diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2022-07-14 02:20:06 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2022-07-15 22:01:38 +0300 |
commit | c9d5bea13e3cb7381bfa897a45d8bab4e7b767a7 (patch) | |
tree | 4170aa6bae5e097f3f066049f36c9175045feefc /celt | |
parent | e4a74ddeb9788eab84d10660e958fe706619892f (diff) |
Fix NORM_ALIASING_HACK
We need to move the history out of the way before we write to the
shape array X, or else we get corruption of the audio.
Signed-off-by: Jean-Marc Valin <jmvalin@amazon.com>
Diffstat (limited to 'celt')
-rw-r--r-- | celt/celt_decoder.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/celt/celt_decoder.c b/celt/celt_decoder.c index 77eb44f4..35a2073a 100644 --- a/celt/celt_decoder.c +++ b/celt/celt_decoder.c @@ -557,6 +557,10 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) #else ALLOC(X, C*N, celt_norm); /**< Interleaved normalised MDCTs */ #endif + c=0; do { + OPUS_MOVE(decode_mem[c], decode_mem[c]+N, + DECODE_BUFFER_SIZE-N+(overlap>>1)); + } while (++c<C); /* Energy decay */ decay = loss_duration==0 ? QCONST16(1.5f, DB_SHIFT) : QCONST16(.5f, DB_SHIFT); @@ -585,11 +589,6 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) } st->rng = seed; - c=0; do { - OPUS_MOVE(decode_mem[c], decode_mem[c]+N, - DECODE_BUFFER_SIZE-N+(overlap>>1)); - } while (++c<C); - celt_synthesis(mode, X, out_syn, oldBandE, start, effEnd, C, C, 0, LM, st->downsample, 0, st->arch); } else { int exc_length; |