From f233f1a279f8621c36e52ec89f25df25faaa1ab4 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 19 Oct 2022 17:36:05 +0200 Subject: [PATCH 1/2] run configureFdCngEnc() at first frame in pre processing --- lib_enc/ivas_core_pre_proc_front.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index 51a549505f..b4336bdf62 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 ) -- GitLab From e9603a626f3415deb7a9f4c50dcbcabc5cf677b1 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 2 Nov 2022 13:51:09 +0100 Subject: [PATCH 2/2] skip configureFdCngEnc in init_encoder for IVAS modes --- lib_enc/init_enc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 1ae2f48c66..4e4ab24369 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 { -- GitLab