diff options
Diffstat (limited to 'thirdparty/opus/silk/control_audio_bandwidth.c')
-rw-r--r-- | thirdparty/opus/silk/control_audio_bandwidth.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/thirdparty/opus/silk/control_audio_bandwidth.c b/thirdparty/opus/silk/control_audio_bandwidth.c index f6d22d8395..4f9bc5cbda 100644 --- a/thirdparty/opus/silk/control_audio_bandwidth.c +++ b/thirdparty/opus/silk/control_audio_bandwidth.c @@ -39,15 +39,9 @@ opus_int silk_control_audio_bandwidth( ) { opus_int fs_kHz; - opus_int orig_kHz; opus_int32 fs_Hz; - orig_kHz = psEncC->fs_kHz; - /* Handle a bandwidth-switching reset where we need to be aware what the last sampling rate was. */ - if( orig_kHz == 0 ) { - orig_kHz = psEncC->sLP.saved_fs_kHz; - } - fs_kHz = orig_kHz; + fs_kHz = psEncC->fs_kHz; fs_Hz = silk_SMULBB( fs_kHz, 1000 ); if( fs_Hz == 0 ) { /* Encoder has just been initialized */ @@ -67,7 +61,7 @@ opus_int silk_control_audio_bandwidth( } if( psEncC->allow_bandwidth_switch || encControl->opusCanSwitch ) { /* Check if we should switch down */ - if( silk_SMULBB( orig_kHz, 1000 ) > psEncC->desiredInternal_fs_Hz ) + if( silk_SMULBB( psEncC->fs_kHz, 1000 ) > psEncC->desiredInternal_fs_Hz ) { /* Switch down */ if( psEncC->sLP.mode == 0 ) { @@ -82,7 +76,7 @@ opus_int silk_control_audio_bandwidth( psEncC->sLP.mode = 0; /* Switch to a lower sample frequency */ - fs_kHz = orig_kHz == 16 ? 12 : 8; + fs_kHz = psEncC->fs_kHz == 16 ? 12 : 8; } else { if( psEncC->sLP.transition_frame_no <= 0 ) { encControl->switchReady = 1; @@ -96,12 +90,12 @@ opus_int silk_control_audio_bandwidth( } else /* Check if we should switch up */ - if( silk_SMULBB( orig_kHz, 1000 ) < psEncC->desiredInternal_fs_Hz ) + if( silk_SMULBB( psEncC->fs_kHz, 1000 ) < psEncC->desiredInternal_fs_Hz ) { /* Switch up */ if( encControl->opusCanSwitch ) { /* Switch to a higher sample frequency */ - fs_kHz = orig_kHz == 8 ? 12 : 16; + fs_kHz = psEncC->fs_kHz == 8 ? 12 : 16; /* New transition */ psEncC->sLP.transition_frame_no = 0; |