summaryrefslogtreecommitdiff
path: root/lib/rbcodec
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 /lib/rbcodec
parentdceec0909295b56c140b83cd6f8d019fddb2b689 (diff)
downloadrockbox-da67f66eedd38a1576e182f74d354e12949608f9.tar.gz
rockbox-da67f66eedd38a1576e182f74d354e12949608f9.zip
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
Diffstat (limited to 'lib/rbcodec')
-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
466 int j; 466 int j;
467 celt_sig * OPUS_RESTRICT x; 467 celt_sig * OPUS_RESTRICT x;
468 opus_val16 * OPUS_RESTRICT y; 468 opus_val16 * OPUS_RESTRICT y;
469 opus_val16 coef0 = coef[0];
470#ifdef CUSTOM_MODES
471 opus_val16 coef1 = coef[1];
472 opus_val16 coef3 = coef[3];
473#endif
469 celt_sig m = mem[c]; 474 celt_sig m = mem[c];
470 x =in[c]; 475 x =in[c];
471 y = pcm+c; 476 y = pcm+c;
472 for (j=0;j<N;j++) 477 for (j=0;j<N;j++)
473 { 478 {
474 celt_sig tmp = *x + m; 479 celt_sig tmp = *x + m;
475 m = MULT16_32_Q15(coef[0], tmp); 480 m = MULT16_32_Q15(coef0, tmp);
476#ifdef CUSTOM_MODES 481#ifdef CUSTOM_MODES
477 m -= MULT16_32_Q15(coef[1], *x); 482 m -= MULT16_32_Q15(coef1, *x);
478 tmp = SHL32(MULT16_32_Q15(coef[3], tmp), 2); 483 tmp = SHL32(MULT16_32_Q15(coef3, tmp), 2);
479#endif 484#endif
480 x++; 485 x++;
481 /* Technically the store could be moved outside of the if because 486 /* Technically the store could be moved outside of the if because