Makes sure there's a PLC-only region in the mode transition
This commit is contained in:
parent
73870719a2
commit
ca869b2ee4
1 changed files with 9 additions and 7 deletions
|
@ -225,15 +225,17 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
|
|||
|
||||
if (transition)
|
||||
{
|
||||
int tlength;
|
||||
int plc_length, overlap;
|
||||
if (mode == MODE_CELT_ONLY)
|
||||
tlength = IMIN(audiosize, 10+st->Fs/200);
|
||||
plc_length = IMIN(audiosize, 10+st->Fs/200);
|
||||
else
|
||||
tlength = IMIN(audiosize, 10+st->Fs/400);
|
||||
for (i=0;i<audiosize;i++)
|
||||
{
|
||||
pcm[i] = (i*pcm[i] + (audiosize-i)*pcm_transition[i])/audiosize;
|
||||
}
|
||||
plc_length = IMIN(audiosize, 10+st->Fs/400);
|
||||
for (i=0;i<plc_length;i++)
|
||||
pcm[i] = pcm_transition[i];
|
||||
|
||||
overlap = IMIN(480, IMAX(0, audiosize-plc_length));
|
||||
for (i=0;i<overlap;i++)
|
||||
pcm[plc_length+i] = (i*pcm[plc_length+i] + (overlap-i)*pcm_transition[plc_length+i])/overlap;
|
||||
}
|
||||
#if OPUS_TEST_RANGE_CODER_STATE
|
||||
st->rangeFinal = dec.rng;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue