diff options
author | Christophe Gisquet <christophe.gisquet@gmail.com> | 2014-02-14 16:00:48 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-28 20:34:40 +0100 |
commit | 2cdbcc004837ce092a14f326f24d97a29512a2c3 (patch) | |
tree | 7fc4341ce3da5c0aae72033134c5daf7745408fd /libavcodec/x86/dcadsp_init.c | |
parent | 5333e0dd66c5695fc708bc9d7af4bf8750674b8f (diff) | |
download | ffmpeg-2cdbcc004837ce092a14f326f24d97a29512a2c3.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: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86/dcadsp_init.c')
-rw-r--r-- | libavcodec/x86/dcadsp_init.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c index 664019d991..06c31a0739 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; + } +} |