diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 1ae2f48c66cd2a6c0af1b76c4765d7594a3b03f5..4e4ab24369b8d1da2cafa350a819fbbcbf2b45d4 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -785,7 +785,12 @@ ivas_error init_encoder( } initFdCngEnc( st->hFdCngEnc, st->input_Fs, st->cldfbAnaEnc->scale ); - configureFdCngEnc( st->hFdCngEnc, st->bwidth, st->rf_mode && st->total_brate == ACELP_13k20 ? ACELP_9k60 : st->total_brate ); + + /* initialization for IVAS modes happens in first frame pre-processing */ + if ( st->element_mode == EVS_MONO ) + { + configureFdCngEnc( st->hFdCngEnc, st->bwidth, st->rf_mode && st->total_brate == ACELP_13k20 ? ACELP_9k60 : st->total_brate ); + } } else { diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index 51a549505fd2887c4b3b9470d43bc91ee2602bc4..b4336bdf6236cf66c93deb32ff2f1e49e7abbd0b 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -553,7 +553,7 @@ ivas_error pre_proc_front_ivas( * Adjust FD-CNG Noise Estimator *----------------------------------------------------------------*/ - if ( st->hFdCngEnc != NULL && ( last_element_brate != element_brate || st->last_bwidth != st->bwidth ) ) + if ( st->hFdCngEnc != NULL && ( st->ini_frame == 0 || last_element_brate != element_brate || st->last_bwidth != st->bwidth ) ) { configureFdCngEnc( st->hFdCngEnc, max( st->input_bwidth, WB ), st->bits_frame_nominal * FRAMES_PER_SEC ); if ( hCPE != NULL )