mirror of
https://github.com/xiph/opus.git
synced 2025-06-01 16:17:42 +00:00
Moves log2Amp inside denormalise_bands() and get rid of bandE[]
Also get rid of the MSE measurement code which is outdated and no longer useful
This commit is contained in:
parent
3afc6ffff0
commit
ee2506b2c7
6 changed files with 17 additions and 92 deletions
|
@ -375,8 +375,8 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, opus_val16 * OPUS_R
|
|||
/* Noise-based PLC/CNG */
|
||||
celt_sig *freq;
|
||||
VARDECL(celt_norm, X);
|
||||
VARDECL(celt_ener, bandE);
|
||||
opus_uint32 seed;
|
||||
opus_val16 *plcLogE;
|
||||
int end;
|
||||
int effEnd;
|
||||
|
||||
|
@ -387,10 +387,9 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, opus_val16 * OPUS_R
|
|||
deemphasis scratch buffer. */
|
||||
freq = scratch;
|
||||
ALLOC(X, C*N, celt_norm); /**< Interleaved normalised MDCTs */
|
||||
ALLOC(bandE, nbEBands*C, celt_ener);
|
||||
|
||||
if (loss_count >= 5)
|
||||
log2Amp(mode, start, end, bandE, backgroundLogE, C);
|
||||
plcLogE = backgroundLogE;
|
||||
else {
|
||||
/* Energy decay */
|
||||
opus_val16 decay = loss_count==0 ?
|
||||
|
@ -400,7 +399,7 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, opus_val16 * OPUS_R
|
|||
for (i=start;i<end;i++)
|
||||
oldBandE[c*nbEBands+i] -= decay;
|
||||
} while (++c<C);
|
||||
log2Amp(mode, start, end, bandE, oldBandE, C);
|
||||
plcLogE = oldBandE;
|
||||
}
|
||||
seed = st->rng;
|
||||
for (c=0;c<C;c++)
|
||||
|
@ -422,7 +421,7 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, opus_val16 * OPUS_R
|
|||
}
|
||||
st->rng = seed;
|
||||
|
||||
denormalise_bands(mode, X, freq, bandE, start, effEnd, C, 1<<LM);
|
||||
denormalise_bands(mode, X, freq, plcLogE, start, effEnd, C, 1<<LM);
|
||||
|
||||
c=0; do {
|
||||
int bound = eBands[effEnd]<<LM;
|
||||
|
@ -659,7 +658,6 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat
|
|||
ec_dec _dec;
|
||||
VARDECL(celt_sig, freq);
|
||||
VARDECL(celt_norm, X);
|
||||
VARDECL(celt_ener, bandE);
|
||||
VARDECL(int, fine_quant);
|
||||
VARDECL(int, pulses);
|
||||
VARDECL(int, cap);
|
||||
|
@ -913,9 +911,6 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat
|
|||
anti_collapse(mode, X, collapse_masks, LM, C, N,
|
||||
st->start, st->end, oldBandE, oldLogE, oldLogE2, pulses, st->rng);
|
||||
|
||||
ALLOC(bandE, nbEBands*C, celt_ener);
|
||||
|
||||
log2Amp(mode, st->start, st->end, bandE, oldBandE, C);
|
||||
ALLOC(freq, IMAX(CC,C)*N, celt_sig); /**< Interleaved signal MDCTs */
|
||||
|
||||
if (silence)
|
||||
|
@ -926,7 +921,7 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat
|
|||
freq[i] = 0;
|
||||
} else {
|
||||
/* Synthesis */
|
||||
denormalise_bands(mode, X, freq, bandE, st->start, effEnd, C, M);
|
||||
denormalise_bands(mode, X, freq, oldBandE, st->start, effEnd, C, M);
|
||||
}
|
||||
c=0; do {
|
||||
OPUS_MOVE(decode_mem[c], decode_mem[c]+N, DECODE_BUFFER_SIZE-N+overlap/2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue