From 1cd92d2d68f6dad2fcdb54b20959bbf45a729914 Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Wed, 18 Mar 2015 15:01:11 -0700 Subject: [PATCH] packages: add AVX/AVX2 support to ffmpeg/opencv Signed-off-by: Steven Noonan Signed-off-by: Thomas Petazzoni --- package/ffmpeg/ffmpeg.mk | 12 ++++++++++++ package/opencv/opencv.mk | 2 ++ 2 files changed, 14 insertions(+) diff --git a/package/ffmpeg/ffmpeg.mk b/package/ffmpeg/ffmpeg.mk index b27fce6ad9..7d7fb19ce1 100644 --- a/package/ffmpeg/ffmpeg.mk +++ b/package/ffmpeg/ffmpeg.mk @@ -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 diff --git a/package/opencv/opencv.mk b/package/opencv/opencv.mk index 61f529eb36..ee84312985 100644 --- a/package/opencv/opencv.mk +++ b/package/opencv/opencv.mk @@ -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 -- 2.30.2