Skip to contentSkip to conversation

jpeg-turbo: now checks for pkg-config

PATCH New Peter Korsgaard 2 participants 7 messages Dec 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 jpeg-turbo: now checks for pkg-config

The jpeg-turbo configure script now contains PKG_PROG_PKG_CONFIG, even though it doesn't so far use pkg-config to detect any dependencies (it does install a .pc file now though):

checking pkg-config is at least version 0.9.0... ./configure: line 13540: \
/home/peko/source/buildroot/output/host/usr/bin/pkg-config: No such file or directory

Depend on host-pkgconf for consistency.

---
 package/jpeg-turbo/jpeg-turbo.mk | 1 +
 1 file changed, 1 insertion(+)
package/jpeg-turbo/jpeg-turbo.mk +1 -0
index 91d6b4e..c3de04a 100644
@@ -11,6 +11,7 @@ JPEG_TURBO_LICENSE = jpeg-license (BSD-3c-like)
 JPEG_TURBO_LICENSE_FILES = LICENSE.md
 JPEG_TURBO_INSTALL_STAGING = YES
 JPEG_TURBO_PROVIDES = jpeg
+JPEG_TURBO_DEPENDENCIES = host-pkgconf
 
 JPEG_TURBO_CONF_OPTS = --with-jpeg8
 
Signature · 1 line
2.10.2
#1 lore raw

PATCH 2/4 jpeg: rework jpeg-turbo simd support handling

In preperation for adding more architectures to the jpeg-turbo simd handling, introduce a hidden BR2_PACKAGE_JPEG_SIMDS_SUPPORT symbol and use that to enable simd support and default to jpeg-turbo, instead of open coding it in both places.

While we are at it, reword the help text to be more useful.

---
 package/jpeg-turbo/jpeg-turbo.mk | 2 +-
 package/jpeg/Config.in           | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)
package/jpeg-turbo/jpeg-turbo.mk +1 -1
index c3de04a..e2b7e63 100644
@@ -15,7 +15,7 @@ JPEG_TURBO_DEPENDENCIES = host-pkgconf
 
 JPEG_TURBO_CONF_OPTS = --with-jpeg8
 
-ifeq ($(BR2_X86_CPU_HAS_MMX)$(BR2_ARM_CPU_HAS_NEON),y)
+ifeq ($(BR2_PACKAGE_JPEG_SIMD_SUPPORT),y)
 JPEG_TURBO_CONF_OPTS += --with-simd
 # x86 simd support needs nasm
 JPEG_TURBO_DEPENDENCIES += $(if $(BR2_X86_CPU_HAS_MMX),host-nasm)
package/jpeg/Config.in +7 -2
index f337aeb..170e58c 100644
@@ -3,13 +3,18 @@ config BR2_PACKAGE_JPEG
 	help
 	  Select the desired JPEG library provider.
 
+# jpeg-turbo has simd support for some architectures
+config BR2_PACKAGE_JPEG_SIMD_SUPPORT
+       bool
+       default y if BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON
+
 if BR2_PACKAGE_JPEG
 
 choice
 	prompt "jpeg variant"
-	default BR2_PACKAGE_JPEG_TURBO if (BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON)
+	default BR2_PACKAGE_JPEG_TURBO if BR2_PACKAGE_JPEG_SIMD_SUPPORT
 	help
-	  Select the older stable version, or the newer developer version
+	  Select the normal libjpeg or libjpeg-turbo.
 
 config BR2_PACKAGE_LIBJPEG
 	bool "jpeg"
Signature · 1 line
2.10.2
#2 lore raw

PATCH 3/4 jpeg-turbo: add simd support for powerpc cores with altivec

In reply to Peter Korsgaard

From the 1.5-b1 release notes:

Added full SIMD acceleration for PowerPC platforms using AltiVec VMX (128-bit SIMD) instructions. Although the performance of libjpeg-turbo on PowerPC was already good, due to the increased number of registers available to the compiler vs. x86, it was still possible to speed up compression by about 3-4x and decompression by about 2-2.5x (relative to libjpeg v6b) through the use of AltiVec instructions.

---
 package/jpeg/Config.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/jpeg/Config.in +2 -1
index 170e58c..926f12e 100644
@@ -6,7 +6,8 @@ config BR2_PACKAGE_JPEG
 # jpeg-turbo has simd support for some architectures
 config BR2_PACKAGE_JPEG_SIMD_SUPPORT
        bool
-       default y if BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON
+       default y if BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON || \
+       	       	 BR2_POWERPC_CPU_HAS_ALTIVEC
 
 if BR2_PACKAGE_JPEG
 
Signature · 1 line
2.10.2
#3 lore raw

PATCH 4/4 jpeg-turbo: add simd support for aarch64

In reply to Peter Korsgaard

From the 1.5-b1 release notes:

Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used compression algorithms (including the slow integer forward DCT and h2v2 & h2v1 downsampling algorithms, which are not accelerated in the 32-bit NEON implementation.) This speeds up the compression of full-color JPEGs by about 75% on average on a Cavium ThunderX processor and by about 2-2.5x on average on Cortex-A53 and Cortex-A57 cores.

Add it unconditionally for all aarch64 cores, as neon support is required for all "standard" ARMv8 implementations. If an ARMv8 implementation w/o NEON ever shows up, then we will need to add a BR2_AARCH64_CPU_HAS_NEON and handle it like ARM.

---
 package/jpeg/Config.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/jpeg/Config.in +3 -1
index 926f12e..9bf9712 100644
@@ -7,7 +7,9 @@ config BR2_PACKAGE_JPEG
 config BR2_PACKAGE_JPEG_SIMD_SUPPORT
        bool
        default y if BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON || \
-       	       	 BR2_POWERPC_CPU_HAS_ALTIVEC
+       	       	 BR2_POWERPC_CPU_HAS_ALTIVEC || \
+		 BR2_aarch64 || BR2_aarch64_be
+
 
 if BR2_PACKAGE_JPEG
 
Signature · 1 line
2.10.2
#4 lore raw

PATCH 1/4 jpeg-turbo: now checks for pkg-config

In reply to Peter Korsgaard

Hello,

Quoted 7 lines · Peter Korsgaard

The jpeg-turbo configure script now contains PKG_PROG_PKG_CONFIG, even though it doesn't so far use pkg-config to detect any dependencies (it does install a .pc file now though):

checking pkg-config is at least version 0.9.0... ./configure: line 13540: \
/home/peko/source/buildroot/output/host/usr/bin/pkg-config: No such file or directory

Quoted 6 lines

Depend on host-pkgconf for consistency.

---
 package/jpeg-turbo/jpeg-turbo.mk | 1 +
 1 file changed, 1 insertion(+)

All four patches applied, thanks. Notice that on PATCH 3/4, you had a mix of tabs and spaces for the indentation of the PowerPC Altivec dependency.

Also, since you are interested about jpeg-turbo, what about adding yourself for this package in DEVELOPERS? We already have another developer, but who isn't really active, so having someone else would be good.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/4 jpeg-turbo: now checks for pkg-config

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Quoted 3 lines

All four patches applied, thanks. Notice that on PATCH 3/4, you had a mix of tabs and spaces for the indentation of the PowerPC Altivec dependency.

Ups, thanks for fixing.

Quoted 4 lines

Also, since you are interested about jpeg-turbo, what about adding yourself for this package in DEVELOPERS? We already have another developer, but who isn't really active, so having someone else would be good.

Sure, I can do that. I'll send a patch.

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

PATCH 1/4 jpeg-turbo: now checks for pkg-config

Hello,

Quoted 5 lines · Peter Korsgaard
Quoted 3 lines

All four patches applied, thanks. Notice that on PATCH 3/4, you had a mix of tabs and spaces for the indentation of the PowerPC Altivec dependency.

Ups, thanks for fixing.

And I somehow screw things up when fixing your typo, so I had to make a follow-up commit :-/

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com