diff mbox series

[FFmpeg-devel,2/4] avfilter/x86/vf_exposure: add ff_exposure_avx2

Message ID 20211022085231.93931-2-jianhua.wu@intel.com
State New
Headers show
Series [FFmpeg-devel,1/4] avfilter/x86/vf_exposure: add x86 SIMD optimization
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Wu Jianhua Oct. 22, 2021, 8:52 a.m. UTC
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
---
 libavfilter/x86/vf_exposure.asm    | 5 +++++
 libavfilter/x86/vf_exposure_init.c | 6 ++++++
 2 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/libavfilter/x86/vf_exposure.asm b/libavfilter/x86/vf_exposure.asm
index 3351c6fb3b..a0d25afbc4 100644
--- a/libavfilter/x86/vf_exposure.asm
+++ b/libavfilter/x86/vf_exposure.asm
@@ -52,4 +52,9 @@  cglobal exposure, 2, 2, 4, ptr, length, black, scale
 %if ARCH_X86_64
 INIT_XMM sse
 EXPOSURE
+
+%if HAVE_AVX2_EXTERNAL
+INIT_YMM avx2
+EXPOSURE
+%endif
 %endif
diff --git a/libavfilter/x86/vf_exposure_init.c b/libavfilter/x86/vf_exposure_init.c
index de1b360f6c..80dae6164e 100644
--- a/libavfilter/x86/vf_exposure_init.c
+++ b/libavfilter/x86/vf_exposure_init.c
@@ -24,6 +24,7 @@ 
 #include "libavfilter/exposure.h"
 
 void ff_exposure_sse(float *ptr, int length, float black, float scale);
+void ff_exposure_avx2(float *ptr, int length, float black, float scale);
 
 av_cold void ff_exposure_init_x86(ExposureContext *s)
 {
@@ -32,5 +33,10 @@  av_cold void ff_exposure_init_x86(ExposureContext *s)
 #if ARCH_X86_64
     if (EXTERNAL_SSE(cpu_flags))
         s->exposure_func = ff_exposure_sse;
+
+#if HAVE_AVX2_EXTERNAL
+    if (EXTERNAL_AVX2_FAST(cpu_flags))
+        s->exposure_func = ff_exposure_avx2;
+#endif
 #endif
 }