From 45854df9a5220bdde400a447f63f61618b89dde2 Mon Sep 17 00:00:00 2001 From: Christophe Gisquet Date: Thu, 6 Feb 2014 00:41:54 +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. Signed-off-by: Michael Niedermayer --- 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 87c9f90b7f..b14c4350ef 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