Loading lib_com/edct.c +3 −38 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ #include "prot.h" #include "wmc_auto.h" #include <math.h> /* for cosf, sinf */ #include <assert.h> static ivas_error get_edct_table( const float **edct_table, Loading Loading @@ -226,7 +227,6 @@ void edst( return; } #define FAST_EDXT /* optimized FFT-based DCT/DST algorithm */ /*-------------------------------------------------------------------------* * edxt() Loading @@ -243,9 +243,8 @@ void edxt( ) { const float pi_len = EVS_PI / length; int16_t k, m; int16_t k; #ifdef FAST_EDXT if ( kernelType == MDST_II || kernelType == MDCT_II ) { const int16_t Nm1 = length - 1; Loading Loading @@ -351,42 +350,8 @@ void edxt( } } else #endif if ( kernelType & 1 ) /* DST */ { const float offK = ( kernelType == MDST_II && synthesis ? 0.5f : 1.0f - 0.5f * ( kernelType >> 1 ) ); const float offM = ( kernelType == MDST_II && synthesis ? 1.0f : 0.5f ); for ( k = 0; k < length; k++ ) { y[k] = 0.f; for ( m = 0; m < length; m++ ) { y[k] += x[m] * sinf( pi_len * ( m + offM ) * ( k + offK ) ); } } if ( offK == 1.f ) { y[length - 1] *= 0.5f; /* scale Nyquist sample */ } } else /* kernelType 0, 2: DCT */ { const float offK = ( kernelType == MDCT_II && synthesis ? 0.5f : 0.5f - 0.5f * ( kernelType >> 1 ) ); const float offM = ( kernelType == MDCT_II && synthesis ? 0.0f : 0.5f ); for ( k = 0; k < length; k++ ) { y[k] = 0.f; for ( m = 0; m < length; m++ ) { y[k] += x[m] * cosf( pi_len * ( m + offM ) * ( k + offK ) ); } } if ( offK == 0.f ) { y[0] *= 0.5f; /* scale lowest (i.e. DC) sample */ } assert( !"Unsupported Kernel type in edxt()" ); } v_multc( y, ( kernelType == MDCT_II ? -1.f : 1.f ) * sqrtf( 2.f / length ), y, length ); Loading lib_com/prot.h +6 −8 Original line number Diff line number Diff line Loading @@ -2250,8 +2250,6 @@ ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ Encoder_Struct *st_ivas, /* i/o: encoder state structure */ const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ const ISM_MODE ism_mode, /* i : ISM mode */ const int32_t element_brate /* element bitrate */ Loading lib_com/tcx_utils.c +2 −5 Original line number Diff line number Diff line Loading @@ -568,14 +568,11 @@ void lpc2mdct( if ( noInverse ) { for ( i = 0; i < length; i++ ) { mdct_gains[i] = (float) ( sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) ); } assert( !"not supported option in lpc2mdct()" ); } else /* Get amplitude */ { /* Get amplitude */ for ( i = 0; i < length; i++ ) { mdct_gains[i] = (float) ( 1.0f / max( EPSILON, sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) ) ); Loading lib_dec/ivas_init_dec.c +10 −10 Original line number Diff line number Diff line Loading @@ -1520,7 +1520,7 @@ ivas_error ivas_init_decoder( return error; } if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO && !( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA ) ) if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO && !( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA ) ) { if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK ) { Loading @@ -1542,7 +1542,7 @@ ivas_error ivas_init_decoder( st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 ); } st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); Loading Loading @@ -1667,7 +1667,7 @@ ivas_error ivas_init_decoder( return error; } if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO ) { if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK ) { Loading @@ -1689,7 +1689,7 @@ ivas_error ivas_init_decoder( st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 ); } Loading Loading @@ -2126,7 +2126,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, output_Fs ) ) != IVAS_ERR_OK ) { return error; } Loading Loading @@ -2156,8 +2156,8 @@ ivas_error ivas_init_decoder( } } if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) { return error; } Loading Loading @@ -2259,7 +2259,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, output_Fs ) ) != IVAS_ERR_OK ) { return error; } Loading Loading @@ -2322,7 +2322,7 @@ ivas_error ivas_init_decoder( { if ( st_ivas->hBinRenderer->render_lfe ) { if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { /* Account for filterbank delay */ delay_ns += IVAS_FB_DEC_DELAY_NS; Loading Loading @@ -2377,7 +2377,7 @@ ivas_error ivas_init_decoder( if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && hDecoderConfig->Opt_tsm ) { if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( ( error = ivas_jbm_dec_metadata_open( st_ivas ) ) != IVAS_ERR_OK ) { Loading lib_enc/init_enc.c +15 −17 Original line number Diff line number Diff line Loading @@ -57,18 +57,16 @@ ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ Encoder_Struct *st_ivas, /* i/o: encoder state structure */ const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ const ISM_MODE ism_mode, /* i : ISM mode */ const int32_t element_brate /* i : element bitrate */ ) { int16_t i; int16_t i, input_frame; ivas_error error; int32_t igf_brate; error = IVAS_ERR_OK; input_frame = (int16_t) ( st->input_Fs / FRAMES_PER_SEC ); /*-----------------------------------------------------------------* * General parameters Loading Loading @@ -303,11 +301,11 @@ ivas_error init_encoder( st->old_input_signal = st->input_buff; if ( st->element_mode == EVS_MONO ) { st->input = st->input_buff + st->input_Fs / FRAMES_PER_SEC + NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ); st->input = st->input_buff + input_frame + NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ); } else { st->input = st->input_buff + st->input_Fs / FRAMES_PER_SEC; st->input = st->input_buff + input_frame; } } else Loading Loading @@ -438,7 +436,7 @@ ivas_error init_encoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTX variables\n" ) ); } dtx_enc_init( st, var_SID_rate_flag, interval_SID ); dtx_enc_init( st, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID ); } else { Loading Loading @@ -475,7 +473,7 @@ ivas_error init_encoder( st->core = -1; st->rf_mode = 0; return error; return IVAS_ERR_OK; } /*-----------------------------------------------------------------* Loading Loading @@ -862,11 +860,11 @@ ivas_error init_encoder( if ( st->element_mode > EVS_MONO ) { InitTransientDetection( (int16_t) ( st->input_Fs / FRAMES_PER_SEC ), 0, st->hTranDet, 1 ); InitTransientDetection( input_frame, 0, st->hTranDet, 1 ); } else { InitTransientDetection( (int16_t) ( st->input_Fs / FRAMES_PER_SEC ), NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet, 0 ); InitTransientDetection( input_frame, NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet, 0 ); } /*-----------------------------------------------------------------* Loading @@ -878,7 +876,7 @@ ivas_error init_encoder( st->bits_frame_channel = 0; st->side_bits_frame_channel = 0; return error; return IVAS_ERR_OK; } Loading Loading
lib_com/edct.c +3 −38 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ #include "prot.h" #include "wmc_auto.h" #include <math.h> /* for cosf, sinf */ #include <assert.h> static ivas_error get_edct_table( const float **edct_table, Loading Loading @@ -226,7 +227,6 @@ void edst( return; } #define FAST_EDXT /* optimized FFT-based DCT/DST algorithm */ /*-------------------------------------------------------------------------* * edxt() Loading @@ -243,9 +243,8 @@ void edxt( ) { const float pi_len = EVS_PI / length; int16_t k, m; int16_t k; #ifdef FAST_EDXT if ( kernelType == MDST_II || kernelType == MDCT_II ) { const int16_t Nm1 = length - 1; Loading Loading @@ -351,42 +350,8 @@ void edxt( } } else #endif if ( kernelType & 1 ) /* DST */ { const float offK = ( kernelType == MDST_II && synthesis ? 0.5f : 1.0f - 0.5f * ( kernelType >> 1 ) ); const float offM = ( kernelType == MDST_II && synthesis ? 1.0f : 0.5f ); for ( k = 0; k < length; k++ ) { y[k] = 0.f; for ( m = 0; m < length; m++ ) { y[k] += x[m] * sinf( pi_len * ( m + offM ) * ( k + offK ) ); } } if ( offK == 1.f ) { y[length - 1] *= 0.5f; /* scale Nyquist sample */ } } else /* kernelType 0, 2: DCT */ { const float offK = ( kernelType == MDCT_II && synthesis ? 0.5f : 0.5f - 0.5f * ( kernelType >> 1 ) ); const float offM = ( kernelType == MDCT_II && synthesis ? 0.0f : 0.5f ); for ( k = 0; k < length; k++ ) { y[k] = 0.f; for ( m = 0; m < length; m++ ) { y[k] += x[m] * cosf( pi_len * ( m + offM ) * ( k + offK ) ); } } if ( offK == 0.f ) { y[0] *= 0.5f; /* scale lowest (i.e. DC) sample */ } assert( !"Unsupported Kernel type in edxt()" ); } v_multc( y, ( kernelType == MDCT_II ? -1.f : 1.f ) * sqrtf( 2.f / length ), y, length ); Loading
lib_com/prot.h +6 −8 Original line number Diff line number Diff line Loading @@ -2250,8 +2250,6 @@ ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ Encoder_Struct *st_ivas, /* i/o: encoder state structure */ const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ const ISM_MODE ism_mode, /* i : ISM mode */ const int32_t element_brate /* element bitrate */ Loading
lib_com/tcx_utils.c +2 −5 Original line number Diff line number Diff line Loading @@ -568,14 +568,11 @@ void lpc2mdct( if ( noInverse ) { for ( i = 0; i < length; i++ ) { mdct_gains[i] = (float) ( sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) ); } assert( !"not supported option in lpc2mdct()" ); } else /* Get amplitude */ { /* Get amplitude */ for ( i = 0; i < length; i++ ) { mdct_gains[i] = (float) ( 1.0f / max( EPSILON, sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) ) ); Loading
lib_dec/ivas_init_dec.c +10 −10 Original line number Diff line number Diff line Loading @@ -1520,7 +1520,7 @@ ivas_error ivas_init_decoder( return error; } if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO && !( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA ) ) if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO && !( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA ) ) { if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK ) { Loading @@ -1542,7 +1542,7 @@ ivas_error ivas_init_decoder( st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 ); } st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); Loading Loading @@ -1667,7 +1667,7 @@ ivas_error ivas_init_decoder( return error; } if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO ) { if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK ) { Loading @@ -1689,7 +1689,7 @@ ivas_error ivas_init_decoder( st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 ); } Loading Loading @@ -2126,7 +2126,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, output_Fs ) ) != IVAS_ERR_OK ) { return error; } Loading Loading @@ -2156,8 +2156,8 @@ ivas_error ivas_init_decoder( } } if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) { return error; } Loading Loading @@ -2259,7 +2259,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, output_Fs ) ) != IVAS_ERR_OK ) { return error; } Loading Loading @@ -2322,7 +2322,7 @@ ivas_error ivas_init_decoder( { if ( st_ivas->hBinRenderer->render_lfe ) { if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { /* Account for filterbank delay */ delay_ns += IVAS_FB_DEC_DELAY_NS; Loading Loading @@ -2377,7 +2377,7 @@ ivas_error ivas_init_decoder( if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && hDecoderConfig->Opt_tsm ) { if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( ( error = ivas_jbm_dec_metadata_open( st_ivas ) ) != IVAS_ERR_OK ) { Loading
lib_enc/init_enc.c +15 −17 Original line number Diff line number Diff line Loading @@ -57,18 +57,16 @@ ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ Encoder_Struct *st_ivas, /* i/o: encoder state structure */ const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ const ISM_MODE ism_mode, /* i : ISM mode */ const int32_t element_brate /* i : element bitrate */ ) { int16_t i; int16_t i, input_frame; ivas_error error; int32_t igf_brate; error = IVAS_ERR_OK; input_frame = (int16_t) ( st->input_Fs / FRAMES_PER_SEC ); /*-----------------------------------------------------------------* * General parameters Loading Loading @@ -303,11 +301,11 @@ ivas_error init_encoder( st->old_input_signal = st->input_buff; if ( st->element_mode == EVS_MONO ) { st->input = st->input_buff + st->input_Fs / FRAMES_PER_SEC + NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ); st->input = st->input_buff + input_frame + NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ); } else { st->input = st->input_buff + st->input_Fs / FRAMES_PER_SEC; st->input = st->input_buff + input_frame; } } else Loading Loading @@ -438,7 +436,7 @@ ivas_error init_encoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTX variables\n" ) ); } dtx_enc_init( st, var_SID_rate_flag, interval_SID ); dtx_enc_init( st, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID ); } else { Loading Loading @@ -475,7 +473,7 @@ ivas_error init_encoder( st->core = -1; st->rf_mode = 0; return error; return IVAS_ERR_OK; } /*-----------------------------------------------------------------* Loading Loading @@ -862,11 +860,11 @@ ivas_error init_encoder( if ( st->element_mode > EVS_MONO ) { InitTransientDetection( (int16_t) ( st->input_Fs / FRAMES_PER_SEC ), 0, st->hTranDet, 1 ); InitTransientDetection( input_frame, 0, st->hTranDet, 1 ); } else { InitTransientDetection( (int16_t) ( st->input_Fs / FRAMES_PER_SEC ), NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet, 0 ); InitTransientDetection( input_frame, NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet, 0 ); } /*-----------------------------------------------------------------* Loading @@ -878,7 +876,7 @@ ivas_error init_encoder( st->bits_frame_channel = 0; st->side_bits_frame_channel = 0; return error; return IVAS_ERR_OK; } Loading