summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2012-10-06 14:51:01 +0200
committerNils Wallménius <nils@rockbox.org>2012-10-06 14:51:01 +0200
commitda67f66eedd38a1576e182f74d354e12949608f9 (patch)
tree115ef178fc2c87397659043a21e042a1005da450
parentdceec0909295b56c140b83cd6f8d019fddb2b689 (diff)
opus: slight speedup of deemphasis
Hoist load of coefficients out of the loop. Speeds up decoding of a 64kbps test file by 0.6MHz on h300 (cf) 0.2MHz on c200 (pp) and 0.1MHz on fuzev1 (amsv1) Signed-off-by: Nils Wallménius <nils@rockbox.org> Change-Id: I4be0059fc2a77748575f5fc9378f7f348d64f1c4
-rw-r--r--lib/rbcodec/codecs/libopus/celt/celt.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/celt.c b/lib/rbcodec/codecs/libopus/celt/celt.c
index a4e5131a04..4a09cc9905 100644
--- a/lib/rbcodec/codecs/libopus/celt/celt.c
+++ b/lib/rbcodec/codecs/libopus/celt/celt.c
@@ -466,16 +466,21 @@ static void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, /* int dow
int j;
celt_sig * OPUS_RESTRICT x;
opus_val16 * OPUS_RESTRICT y;
+ opus_val16 coef0 = coef[0];
+#ifdef CUSTOM_MODES
+ opus_val16 coef1 = coef[1];
+ opus_val16 coef3 = coef[3];
+#endif
celt_sig m = mem[c];
x =in[c];
y = pcm+c;
for (j=0;j<N;j++)
{
celt_sig tmp = *x + m;
- m = MULT16_32_Q15(coef[0], tmp);
+ m = MULT16_32_Q15(coef0, tmp);
#ifdef CUSTOM_MODES
- m -= MULT16_32_Q15(coef[1], *x);
- tmp = SHL32(MULT16_32_Q15(coef[3], tmp), 2);
+ m -= MULT16_32_Q15(coef1, *x);
+ tmp = SHL32(MULT16_32_Q15(coef3, tmp), 2);
#endif
x++;
/* Technically the store could be moved outside of the if because