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

Wu Jianhua jianhua.wu at intel.com
Fri Oct 22 11:52:29 EEST 2021


Signed-off-by: Wu Jianhua <jianhua.wu at intel.com>
---
 libavfilter/x86/vf_exposure.asm    | 5 +++++
 libavfilter/x86/vf_exposure_init.c | 6 ++++++
 2 files changed, 11 insertions(+)

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
 }
-- 
2.17.1



More information about the ffmpeg-devel mailing list