More precise CELT/SILK delay compensation to reduce mode switching glitches
This commit is contained in:
parent
641bd4e4cf
commit
073c4e1472
1 changed files with 9 additions and 2 deletions
|
@ -181,8 +181,15 @@ OpusEncoder *opus_encoder_init(OpusEncoder* st, int Fs, int channels, int applic
|
||||||
|
|
||||||
st->encoder_buffer = st->Fs/100;
|
st->encoder_buffer = st->Fs/100;
|
||||||
st->delay_compensation = st->Fs/400;
|
st->delay_compensation = st->Fs/400;
|
||||||
if (st->Fs > 16000)
|
/* This part is meant to compensate for the resampler delay as a function
|
||||||
st->delay_compensation += 10;
|
of the API sampling rate */
|
||||||
|
if (st->Fs == 48000)
|
||||||
|
st->delay_compensation += 23;
|
||||||
|
else if (st->Fs == 24000)
|
||||||
|
st->delay_compensation += 15;
|
||||||
|
else
|
||||||
|
st->delay_compensation += 2;
|
||||||
|
|
||||||
return st;
|
return st;
|
||||||
|
|
||||||
failure:
|
failure:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue