Skip to content
Snippets Groups Projects
Commit a81e6dc2 authored by Koen Vos's avatar Koen Vos Committed by Jean-Marc Valin
Browse files

Minor bugfix

parent e61e6a75
No related branches found
No related tags found
No related merge requests found
......@@ -38,10 +38,6 @@ SKP_int SKP_Silk_init_decoder(
/* Clear the entire encoder state, except anything copied */
SKP_memset( psDec, 0, sizeof( SKP_Silk_decoder_state ) );
/* Set sampling rate to 16 kHz, and init non-zero values */
psDec->nb_subfr = MAX_NB_SUBFR;
SKP_Silk_decoder_set_fs( psDec, 16 );
/* Used to deactivate e.g. LSF interpolation and fluctuation reduction */
psDec->first_frame_after_reset = 1;
psDec->prev_inv_gain_Q16 = 65536;
......
......@@ -33,11 +33,13 @@ void SKP_Silk_decoder_set_fs(
SKP_int fs_kHz /* I Sampling frequency (kHz) */
)
{
psDec->frame_length = SKP_SMULBB( psDec->nb_subfr, psDec->subfr_length );
if( psDec->fs_kHz != fs_kHz ) {
SKP_int frame_length;
psDec->subfr_length = SKP_SMULBB( SUB_FRAME_LENGTH_MS, fs_kHz );
frame_length = SKP_SMULBB( psDec->nb_subfr, psDec->subfr_length );
if( psDec->fs_kHz != fs_kHz || frame_length != psDec->frame_length ) {
psDec->fs_kHz = fs_kHz;
psDec->subfr_length = SKP_SMULBB( SUB_FRAME_LENGTH_MS, fs_kHz );
psDec->frame_length = SKP_SMULBB( psDec->nb_subfr, psDec->subfr_length );
psDec->frame_length = frame_length;
psDec->ltp_mem_length = SKP_SMULBB( LTP_MEM_LENGTH_MS, fs_kHz );
if( psDec->fs_kHz == 8 ) {
psDec->LPC_order = MIN_LPC_ORDER;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment