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>
This commit is contained in:
Jean-Marc Valin 2022-07-13 19:20:06 -04:00
parent e4a74ddeb9
commit c9d5bea13e
No known key found for this signature in database
GPG key ID: 531A52533318F00A

View file

@ -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;