summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2016-08-12 23:49:35 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-08-12 23:49:35 -0400
commit9f7e502e0683bfbf8bfe9ba48220df27c258bf9e (patch)
tree19e41683077660afdeedd76470d8a5a0200d2d19
parent7f3fb20185e4f23392b6a9674c274738a58e7283 (diff)
downloadopus-9f7e502e0683bfbf8bfe9ba48220df27c258bf9e.tar.gz
Reducing dependencies in deemphasis()
Reordering the add with VERY_SMALL changes the dependencies cycle from 2 add + 1 mul (11 cycles on haswell) to 1 add + 1 mul (8 cycles). This makes the entire decoder about 1.5% faster.
-rw-r--r--celt/celt_decoder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/celt/celt_decoder.c b/celt/celt_decoder.c
index 4ab89339..43b876b8 100644
--- a/celt/celt_decoder.c
+++ b/celt/celt_decoder.c
@@ -225,7 +225,7 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c
/* Shortcut for the standard (non-custom modes) case */
for (j=0;j<N;j++)
{
- celt_sig tmp = x[j] + m + VERY_SMALL;
+ celt_sig tmp = x[j] + VERY_SMALL + m;
m = MULT16_32_Q15(coef0, tmp);
scratch[j] = tmp;
}
@@ -246,7 +246,7 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c
{
for (j=0;j<N;j++)
{
- celt_sig tmp = x[j] + m + VERY_SMALL;
+ celt_sig tmp = x[j] + VERY_SMALL + m;
m = MULT16_32_Q15(coef0, tmp);
y[j*C] = SCALEOUT(SIG2WORD16(tmp));
}