From 5fdbfcb5b793f5849c496214668094a8ec99fa07 Mon Sep 17 00:00:00 2001 From: Christophe Gisquet Date: Wed, 5 Feb 2014 23:40:52 +0000 Subject: dcadsp: split lfe_dir cases The x86 runs short on registers because numerous elements are not static. In addition, splitting them allows more optimized code, at least for x86. Arm asm changes by Janne Grunau. Signed-off-by: Janne Grunau --- libavcodec/dcadsp.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'libavcodec/dcadsp.c') diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c index 148f6dd607..8d242c5959 100644 --- a/libavcodec/dcadsp.c +++ b/libavcodec/dcadsp.c @@ -32,8 +32,9 @@ static void int8x8_fmul_int32_c(float *dst, const int8_t *src, int scale) dst[i] = src[i] * fscale; } -static void dca_lfe_fir_c(float *out, const float *in, const float *coefs, - int decifactor, float scale) +static inline void +dca_lfe_fir(float *out, const float *in, const float *coefs, + int decifactor, float scale) { float *out2 = out + decifactor; const float *cf0 = coefs; @@ -82,9 +83,22 @@ static void dca_qmf_32_subbands(float samples_in[32][8], int sb_act, } } +static void dca_lfe_fir0_c(float *out, const float *in, const float *coefs, + float scale) +{ + dca_lfe_fir(out, in, coefs, 32, scale); +} + +static void dca_lfe_fir1_c(float *out, const float *in, const float *coefs, + float scale) +{ + dca_lfe_fir(out, in, coefs, 64, scale); +} + av_cold void ff_dcadsp_init(DCADSPContext *s) { - s->lfe_fir = dca_lfe_fir_c; + s->lfe_fir[0] = dca_lfe_fir0_c; + s->lfe_fir[1] = dca_lfe_fir1_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); -- cgit v1.2.3