[FFmpeg-cvslog] x86/af_afir: add ff_fcmul_add_avx()

James Almer git at videolan.org
Thu Jan 3 15:13:15 EET 2019


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Jan  2 21:09:25 2019 -0300| [5402c1886b97a0c46e843b5ae0c08de74d2e6091] | committer: James Almer

x86/af_afir: add ff_fcmul_add_avx()

fcmul_add_c: 1228.8
fcmul_add_sse3: 334.3
fcmul_add_avx: 186.3

Tested on a Core i5 4460 @ 3.2GHz

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5402c1886b97a0c46e843b5ae0c08de74d2e6091
---

 libavfilter/x86/af_afir.asm    | 8 +++++++-
 libavfilter/x86/af_afir_init.c | 5 +++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavfilter/x86/af_afir.asm b/libavfilter/x86/af_afir.asm
index fcc1f426db..8054ac5f10 100644
--- a/libavfilter/x86/af_afir.asm
+++ b/libavfilter/x86/af_afir.asm
@@ -27,7 +27,7 @@ SECTION .text
 ; void ff_fcmul_add(float *sum, const float *t, const float *c, int len)
 ;------------------------------------------------------------------------------
 
-INIT_XMM sse3
+%macro FCMUL_ADD 0
 cglobal fcmul_add, 4,4,6, sum, t, c, len
     shl       lend, 3
     add         tq, lenq
@@ -61,3 +61,9 @@ ALIGN 16
     addss xm0, [sumq + lenq]
     movss [sumq + lenq], xm0
     RET
+%endmacro
+
+INIT_XMM sse3
+FCMUL_ADD
+INIT_YMM avx
+FCMUL_ADD
diff --git a/libavfilter/x86/af_afir_init.c b/libavfilter/x86/af_afir_init.c
index 29e6f976b2..c37212c381 100644
--- a/libavfilter/x86/af_afir_init.c
+++ b/libavfilter/x86/af_afir_init.c
@@ -24,6 +24,8 @@
 
 void ff_fcmul_add_sse3(float *sum, const float *t, const float *c,
                        ptrdiff_t len);
+void ff_fcmul_add_avx(float *sum, const float *t, const float *c,
+                      ptrdiff_t len);
 
 av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
 {
@@ -32,4 +34,7 @@ av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
     if (EXTERNAL_SSE3(cpu_flags)) {
         s->fcmul_add = ff_fcmul_add_sse3;
     }
+    if (EXTERNAL_AVX_FAST(cpu_flags)) {
+        s->fcmul_add = ff_fcmul_add_avx;
+    }
 }



More information about the ffmpeg-cvslog mailing list