packages: add AVX/AVX2 support to ffmpeg/opencv
authorSteven Noonan <steven@uplinklabs.net>
Wed, 18 Mar 2015 22:01:11 +0000 (15:01 -0700)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 9 Apr 2015 21:34:20 +0000 (23:34 +0200)
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/ffmpeg/ffmpeg.mk
package/opencv/opencv.mk

index b27fce6ad91237c5e716460fe5acc79153edf578..7d7fb19ce1976a2777ad9e423e52b065cbc64e41 100644 (file)
@@ -301,6 +301,18 @@ else
 FFMPEG_CONF_OPTS += --disable-sse42
 endif
 
+ifeq ($(BR2_X86_CPU_HAS_AVX),y)
+FFMPEG_CONF_OPTS += --enable-avx
+else
+FFMPEG_CONF_OPTS += --disable-avx
+endif
+
+ifeq ($(BR2_X86_CPU_HAS_AVX2),y)
+FFMPEG_CONF_OPTS += --enable-avx2
+else
+FFMPEG_CONF_OPTS += --disable-avx2
+endif
+
 # Explicitly disable everything that doesn't match for ARM
 # FFMPEG "autodetects" by compiling an extended instruction via AS
 # This works on compilers that aren't built for generic by default
index 61f529eb367bedd0e02d4b13e62861a2a60b9b13..ee843129858a4500e74f9e2909f96ee8303555ea 100644 (file)
@@ -77,6 +77,8 @@ OPENCV_CONF_OPTS += \
        -DENABLE_SSE3=$(if $(BR2_X86_CPU_HAS_SSE3),ON,OFF)   \
        -DENABLE_SSE41=$(if $(BR2_X86_CPU_HAS_SSE4),ON,OFF)  \
        -DENABLE_SSE42=$(if $(BR2_X86_CPU_HAS_SSE42),ON,OFF) \
+       -DENABLE_AVX=$(if $(BR2_X86_CPU_HAS_AVX),ON,OFF) \
+       -DENABLE_AVX2=$(if $(BR2_X86_CPU_HAS_AVX2),ON,OFF) \
        -DENABLE_SSSE3=$(if $(BR2_X86_CPU_HAS_SSSE3),ON,OFF)
 
 # Cuda stuff