forked from len0rd/rockbox
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
This commit is contained in:
parent
dceec09092
commit
da67f66eed
1 changed files with 8 additions and 3 deletions
|
@ -466,16 +466,21 @@ static void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, /* int dow
|
||||||
int j;
|
int j;
|
||||||
celt_sig * OPUS_RESTRICT x;
|
celt_sig * OPUS_RESTRICT x;
|
||||||
opus_val16 * OPUS_RESTRICT y;
|
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];
|
celt_sig m = mem[c];
|
||||||
x =in[c];
|
x =in[c];
|
||||||
y = pcm+c;
|
y = pcm+c;
|
||||||
for (j=0;j<N;j++)
|
for (j=0;j<N;j++)
|
||||||
{
|
{
|
||||||
celt_sig tmp = *x + m;
|
celt_sig tmp = *x + m;
|
||||||
m = MULT16_32_Q15(coef[0], tmp);
|
m = MULT16_32_Q15(coef0, tmp);
|
||||||
#ifdef CUSTOM_MODES
|
#ifdef CUSTOM_MODES
|
||||||
m -= MULT16_32_Q15(coef[1], *x);
|
m -= MULT16_32_Q15(coef1, *x);
|
||||||
tmp = SHL32(MULT16_32_Q15(coef[3], tmp), 2);
|
tmp = SHL32(MULT16_32_Q15(coef3, tmp), 2);
|
||||||
#endif
|
#endif
|
||||||
x++;
|
x++;
|
||||||
/* Technically the store could be moved outside of the if because
|
/* Technically the store could be moved outside of the if because
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue