aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86/dcadsp_init.c
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2014-02-14 15:03:09 +0000
committerJanne Grunau <janne-libav@jannau.net>2014-02-28 13:00:48 +0100
commit08e3ea60ff4059341b74be04a428a38f7c3630b0 (patch)
treee9e639f3b99004cdf785a88b17e06b1c28fb1b66 /libavcodec/x86/dcadsp_init.c
parent57b1eb9f75b04571063ddec316e290c216c114ac (diff)
downloadffmpeg-08e3ea60ff4059341b74be04a428a38f7c3630b0.tar.gz
x86: synth filter float: implement SSE2 version
Timings for Arrandale: C SSE win32: 2108 334 win64: 1152 322 Factorizing the inner loop with a call/jmp is a >15 cycles cost, even with the jmp destination being aligned. Unrolling for ARCH_X86_64 is a 20 cycles gain. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
Diffstat (limited to 'libavcodec/x86/dcadsp_init.c')
-rw-r--r--libavcodec/x86/dcadsp_init.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c
index c234bd29f5..5f6e8c5a19 100644
--- a/libavcodec/x86/dcadsp_init.c
+++ b/libavcodec/x86/dcadsp_init.c
@@ -49,3 +49,31 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
s->int8x8_fmul_int32 = ff_int8x8_fmul_int32_sse4;
}
}
+
+void ff_synth_filter_inner_sse2(float *synth_buf_ptr, float synth_buf2[32],
+ const float window[512],
+ float out[32], intptr_t offset, float scale);
+
+static void synth_filter_sse2(FFTContext *imdct,
+ float *synth_buf_ptr, int *synth_buf_offset,
+ float synth_buf2[32], const float window[512],
+ float out[32], const float in[32], float scale)
+{
+ float *synth_buf= synth_buf_ptr + *synth_buf_offset;
+
+ imdct->imdct_half(imdct, synth_buf, in);
+
+ ff_synth_filter_inner_sse2(synth_buf, synth_buf2, window,
+ out, *synth_buf_offset, scale);
+
+ *synth_buf_offset = (*synth_buf_offset - 32) & 511;
+}
+
+av_cold void ff_synth_filter_init_x86(SynthFilterContext *s)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (EXTERNAL_SSE2(cpu_flags)) {
+ s->synth_filter_float = synth_filter_sse2;
+ }
+}