diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-08-13 06:49:35 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-08-13 06:49:35 +0300 |
commit | 9f7e502e0683bfbf8bfe9ba48220df27c258bf9e (patch) | |
tree | 19e41683077660afdeedd76470d8a5a0200d2d19 | |
parent | 7f3fb20185e4f23392b6a9674c274738a58e7283 (diff) |
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.c | 4 |
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)); } |