Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2012-01-12 13:08:46 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2012-07-13 22:50:36 +0400
commit19ce448bf81acd003845e2855ec4e6bef45b1c50 (patch)
tree58a3100da9f1fab20374683749f309c6e4f0c568
parent0892c169c6b868c4a49d679f5379e517311d229e (diff)
Fixes issues when downmixing to mono or when encoding below fullband
-rw-r--r--celt/celt.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/celt/celt.c b/celt/celt.c
index a079702d..3995c933 100644
--- a/celt/celt.c
+++ b/celt/celt.c
@@ -1336,6 +1336,7 @@ int celt_encode_with_ec(CELTEncoder * restrict st, const opus_val16 * pcm, int f
{
for (i=0;i<N;i++)
freq[i] = ADD32(HALF32(freq[i]), HALF32(freq[N+i]));
+ tf_chan = 0;
}
if (st->upsample != 1)
{
@@ -1359,7 +1360,7 @@ int celt_encode_with_ec(CELTEncoder * restrict st, const opus_val16 * pcm, int f
if (shortBlocks)
{
VARDECL(celt_sig, freq2);
- ALLOC(freq2, C*N, celt_sig);
+ ALLOC(freq2, CC*N, celt_sig);
compute_mdcts(st->mode, 0, in, freq2, CC, LM);
if (CC==2&&C==1)
{
@@ -1445,11 +1446,11 @@ int celt_encode_with_ec(CELTEncoder * restrict st, const opus_val16 * pcm, int f
c=0;do
{
follower[c*st->mode->nbEBands] = bandLogE2[c*st->mode->nbEBands];
- for (i=1;i<st->mode->nbEBands;i++)
+ for (i=1;i<st->end;i++)
follower[c*st->mode->nbEBands+i] = MIN16(follower[c*st->mode->nbEBands+i-1]+QCONST16(1.5f,DB_SHIFT), bandLogE2[c*st->mode->nbEBands+i]);
- for (i=st->end-2;i>=0;i--)
+ for (i=effEnd-2;i>=0;i--)
follower[c*st->mode->nbEBands+i] = MIN16(follower[c*st->mode->nbEBands+i], MIN16(follower[c*st->mode->nbEBands+i+1]+QCONST16(2.f,DB_SHIFT), bandLogE2[c*st->mode->nbEBands+i]));
- } while (++c<2);
+ } while (++c<C);
if (C==2)
{
for (i=st->start;i<st->end;i++)