[FFmpeg-cvslog] x86/synth_filter: add synth_filter_fma3
James Almer
git at videolan.org
Wed Mar 5 02:20:35 CET 2014
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat Mar 1 15:26:51 2014 -0300| [7fd64e3e36f79204c0eda7cacce6884c14ddc1fb] | committer: Michael Niedermayer
x86/synth_filter: add synth_filter_fma3
Signed-off-by: James Almer <jamrial at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7fd64e3e36f79204c0eda7cacce6884c14ddc1fb
---
libavcodec/x86/dcadsp.asm | 28 +++++++++++-----------------
libavcodec/x86/dcadsp_init.c | 4 ++++
2 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/libavcodec/x86/dcadsp.asm b/libavcodec/x86/dcadsp.asm
index a6a4582..4746784 100644
--- a/libavcodec/x86/dcadsp.asm
+++ b/libavcodec/x86/dcadsp.asm
@@ -230,16 +230,12 @@ DCA_LFE_FIR 1
SHUF m11, ptr2 + j + (15 - 3) * 4 - mmsize, m12
mova m12, [ptr1 + j + mmsize]
%endif
- mulps m6, m6, [win + %1 + j + 16 * 4]
+ FMULADD_PS m2, m6, [win + %1 + j + 16 * 4], m2, m6
mulps m5, m5, [win + %1 + j]
-%if ARCH_X86_64
- mulps m12, m12, [win + %1 + j + mmsize + 16 * 4]
- mulps m11, m11, [win + %1 + j + mmsize]
-%endif
- addps m2, m2, m6
subps m1, m1, m5
%if ARCH_X86_64
- addps m8, m8, m12
+ FMULADD_PS m8, m12, [win + %1 + j + mmsize + 16 * 4], m8, m12
+ mulps m11, m11, [win + %1 + j + mmsize]
subps m7, m7, m11
%endif
;~ c += window[i + j + 32] * (synth_buf[16 + i + j])
@@ -250,17 +246,11 @@ DCA_LFE_FIR 1
SHUF m12, ptr2 + j + (31 - 3) * 4 - mmsize, m11
mova m11, [ptr1 + j + mmsize + 16 * 4]
%endif
- mulps m5, m5, [win + %1 + j + 32 * 4]
- mulps m6, m6, [win + %1 + j + 48 * 4]
+ FMULADD_PS m3, m5, [win + %1 + j + 32 * 4], m3, m5
+ FMULADD_PS m4, m6, [win + %1 + j + 48 * 4], m4, m6
%if ARCH_X86_64
- mulps m11, m11, [win + %1 + j + mmsize + 32 * 4]
- mulps m12, m12, [win + %1 + j + mmsize + 48 * 4]
-%endif
- addps m3, m3, m5
- addps m4, m4, m6
-%if ARCH_X86_64
- addps m9, m9, m11
- addps m10, m10, m12
+ FMULADD_PS m9, m11, [win + %1 + j + mmsize + 32 * 4], m9, m11
+ FMULADD_PS m10, m12, [win + %1 + j + mmsize + 48 * 4], m10, m12
%endif
sub j, 64 * 4
%endmacro
@@ -391,3 +381,7 @@ SYNTH_FILTER
INIT_YMM avx
SYNTH_FILTER
%endif
+%if HAVE_FMA3_EXTERNAL
+INIT_YMM fma3
+SYNTH_FILTER
+%endif
diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c
index 832b335..19559f3 100644
--- a/libavcodec/x86/dcadsp_init.c
+++ b/libavcodec/x86/dcadsp_init.c
@@ -82,6 +82,7 @@ SYNTH_FILTER_FUNC(sse)
#endif
SYNTH_FILTER_FUNC(sse2)
SYNTH_FILTER_FUNC(avx)
+SYNTH_FILTER_FUNC(fma3)
#endif
av_cold void ff_synth_filter_init_x86(SynthFilterContext *s)
@@ -100,5 +101,8 @@ av_cold void ff_synth_filter_init_x86(SynthFilterContext *s)
if (EXTERNAL_AVX(cpu_flags)) {
s->synth_filter_float = synth_filter_avx;
}
+ if (EXTERNAL_FMA3(cpu_flags)) {
+ s->synth_filter_float = synth_filter_fma3;
+ }
#endif
}
More information about the ffmpeg-cvslog
mailing list