diff options
author | Christophe Gisquet <christophe.gisquet@gmail.com> | 2012-05-11 11:17:36 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-08 00:55:42 +0100 |
commit | 481a46a462ca762600ee4ad4c3b1e93d21b1fa35 (patch) | |
tree | f81182d2736a1ae14a14b83eb35b70541d344509 /libavcodec/dcadsp.c | |
parent | a7574a36afa1ccf5b170e4e827050710bd280899 (diff) | |
download | ffmpeg-481a46a462ca762600ee4ad4c3b1e93d21b1fa35.tar.gz |
dcadsp: add int8x8_fmul_int32 to DSP context
It is currently declared as a macro who is set to inlinable functions,
among which a Neon and a default C implementations.
Add a DSP parameter to each inline function, unused except by the
default C implementation which calls a function from the DSP context.
On an Arrandale CPU, gain for an inlined SSE2 function vs. a call:
- Win32: 29 to 26 cycles
- Win64: 25 to 23 cycles
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dcadsp.c')
-rw-r--r-- | libavcodec/dcadsp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c index abeba2492b..a82548f83c 100644 --- a/libavcodec/dcadsp.c +++ b/libavcodec/dcadsp.c @@ -24,6 +24,14 @@ #include "libavutil/intreadwrite.h" #include "dcadsp.h" +static void int8x8_fmul_int32_c(float *dst, const int8_t *src, int scale) +{ + float fscale = scale / 16.0; + int i; + for (i = 0; i < 8; i++) + dst[i] = src[i] * fscale; +} + static void dca_lfe_fir_c(float *out, const float *in, const float *coefs, int decifactor, float scale) { @@ -78,5 +86,6 @@ av_cold void ff_dcadsp_init(DCADSPContext *s) { s->lfe_fir = dca_lfe_fir_c; s->qmf_32_subbands = dca_qmf_32_subbands; + s->int8x8_fmul_int32 = int8x8_fmul_int32_c; if (ARCH_ARM) ff_dcadsp_init_arm(s); } |