summaryrefslogtreecommitdiff
path: root/celt/celt_encoder.c
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2013-12-16 01:08:21 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-12-16 01:08:21 -0500
commit306d7f5a308e30ce10ba1a1dcdbeeb81de3b2872 (patch)
tree9db4ef75957c9c797f3defe76a28af467a8c96fe /celt/celt_encoder.c
parente0f26246b08122cef31c1ac85f7ed228e2daca61 (diff)
downloadopus-306d7f5a308e30ce10ba1a1dcdbeeb81de3b2872.tar.gz
fixed-point: slight (but free) accuracy improvement in compute_band_energies()
Also moves the VSHR32() condition outside the loop just in case some compilers don't optimize that properly.
Diffstat (limited to 'celt/celt_encoder.c')
-rw-r--r--celt/celt_encoder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c
index 1ac00581..8a1c7483 100644
--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -1519,7 +1519,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
if (secondMdct)
{
compute_mdcts(mode, 0, in, freq, C, CC, LM, st->upsample);
- compute_band_energies(mode, freq, bandE, effEnd, C, M);
+ compute_band_energies(mode, freq, bandE, effEnd, C, LM);
amp2Log2(mode, effEnd, end, bandE, bandLogE2, C);
for (i=0;i<C*nbEBands;i++)
bandLogE2[i] += HALF16(SHL16(LM, DB_SHIFT));
@@ -1528,7 +1528,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
compute_mdcts(mode, shortBlocks, in, freq, C, CC, LM, st->upsample);
if (CC==2&&C==1)
tf_chan = 0;
- compute_band_energies(mode, freq, bandE, effEnd, C, M);
+ compute_band_energies(mode, freq, bandE, effEnd, C, LM);
if (st->lfe)
{
@@ -1651,7 +1651,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
isTransient = 1;
shortBlocks = M;
compute_mdcts(mode, shortBlocks, in, freq, C, CC, LM, st->upsample);
- compute_band_energies(mode, freq, bandE, effEnd, C, M);
+ compute_band_energies(mode, freq, bandE, effEnd, C, LM);
amp2Log2(mode, effEnd, end, bandE, bandLogE, C);
/* Compensate for the scaling of short vs long mdcts */
for (i=0;i<C*nbEBands;i++)