Some cleaning up of the synthesis code.
diff --git a/celt/celt_decoder.c b/celt/celt_decoder.c
index 61bf1da..eefda85 100644
--- a/celt/celt_decoder.c
+++ b/celt/celt_decoder.c
@@ -421,16 +421,10 @@
}
st->rng = seed;
- denormalise_bands(mode, X, freq, plcLogE, start, effEnd, C, 1<<LM);
+ denormalise_bands(mode, X, freq, plcLogE, start, effEnd, C, 1<<LM,
+ downsample, 0);
c=0; do {
- int bound = eBands[effEnd]<<LM;
- if (downsample!=1)
- bound = IMIN(bound, N/downsample);
- for (i=bound;i<N;i++)
- freq[c*N+i] = 0;
- } while (++c<C);
- c=0; do {
OPUS_MOVE(decode_mem[c], decode_mem[c]+N,
DECODE_BUFFER_SIZE-N+(overlap>>1));
} while (++c<C);
@@ -921,24 +915,17 @@
{
for (i=0;i<C*nbEBands;i++)
oldBandE[i] = -QCONST16(28.f,DB_SHIFT);
- for (i=0;i<C*N;i++)
- freq[i] = 0;
- } else {
- /* Synthesis */
- denormalise_bands(mode, X, freq, oldBandE, start, effEnd, C, M);
}
+
+ /* Synthesis */
+ denormalise_bands(mode, X, freq, oldBandE, start, effEnd, C, M,
+ st->downsample, silence);
+
c=0; do {
OPUS_MOVE(decode_mem[c], decode_mem[c]+N, DECODE_BUFFER_SIZE-N+overlap/2);
} while (++c<CC);
c=0; do {
- int bound = M*eBands[effEnd];
- if (st->downsample!=1)
- bound = IMIN(bound, N/st->downsample);
- OPUS_CLEAR(&freq[c*N+bound], N-bound);
- } while (++c<C);
-
- c=0; do {
out_syn[c] = decode_mem[c]+DECODE_BUFFER_SIZE-N;
} while (++c<CC);