summaryrefslogtreecommitdiff
path: root/libavcodec/dcadsp.c
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2014-02-05 23:40:52 +0000
committerJanne Grunau <janne-libav@jannau.net>2014-02-07 22:54:18 +0100
commit5fdbfcb5b793f5849c496214668094a8ec99fa07 (patch)
tree8f705b537443ec12285e367aa0747fd1fec1671b /libavcodec/dcadsp.c
parent5b59a9fc6152169599561f04b4f66370edda5c9c (diff)
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 <janne-libav@jannau.net>
Diffstat (limited to 'libavcodec/dcadsp.c')
-rw-r--r--libavcodec/dcadsp.c20
1 files changed, 17 insertions, 3 deletions
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);