From e1f21b832615b373ff036fcede9c3306670c222d Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 12 May 2023 11:11:45 +0200 Subject: [PATCH 1/3] use st->total_brate in FD cng configuration for SCEs --- lib_com/options.h | 2 ++ lib_enc/ivas_core_pre_proc_front.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 62717d9ad7..66492a74eb 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -214,6 +214,8 @@ //#define HODIRAC_READ_PARAMS #endif +#define FIX_443_FD_CNG_INIT /* FhG: correct bitrate value for FD-CNG init */ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index cf23ddef53..4b016d44ac 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -563,7 +563,14 @@ ivas_error pre_proc_front_ivas( if ( st->hFdCngEnc != NULL && ( st->ini_frame == 0 || last_element_brate != element_brate || st->last_bwidth != st->bwidth ) ) { +#ifdef FIX_443_FD_CNG_INIT + int16_t total_brate; + + total_brate = ( element_mode == IVAS_SCE ) ? st->total_brate : st->bits_frame_nominal * FRAMES_PER_SEC; + configureFdCngEnc( st->hFdCngEnc, max( st->input_bwidth, WB ), total_brate ); +#else configureFdCngEnc( st->hFdCngEnc, max( st->input_bwidth, WB ), st->bits_frame_nominal * FRAMES_PER_SEC ); +#endif if ( hCPE != NULL ) { st->hFdCngEnc->hFdCngCom->CngBitrate = hCPE->element_brate - 1; -- GitLab From 77b810b4742a6447f8161b65fa4d130427894f46 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 12 May 2023 11:23:34 +0200 Subject: [PATCH 2/3] fix warning on windows --- 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 4b016d44ac..b0f4f45495 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -566,7 +566,7 @@ ivas_error pre_proc_front_ivas( #ifdef FIX_443_FD_CNG_INIT int16_t total_brate; - total_brate = ( element_mode == IVAS_SCE ) ? st->total_brate : st->bits_frame_nominal * FRAMES_PER_SEC; + total_brate = ( element_mode == IVAS_SCE ) ? st->total_brate : (int16_t) ( st->bits_frame_nominal * FRAMES_PER_SEC ); configureFdCngEnc( st->hFdCngEnc, max( st->input_bwidth, WB ), total_brate ); #else configureFdCngEnc( st->hFdCngEnc, max( st->input_bwidth, WB ), st->bits_frame_nominal * FRAMES_PER_SEC ); -- GitLab From 309d0b29e0ef96b22e06f8425a61b2cce3c58e2d Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 12 May 2023 11:30:05 +0200 Subject: [PATCH 3/3] fix data type --- lib_enc/ivas_core_pre_proc_front.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index b0f4f45495..5f775d2403 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -564,9 +564,9 @@ ivas_error pre_proc_front_ivas( if ( st->hFdCngEnc != NULL && ( st->ini_frame == 0 || last_element_brate != element_brate || st->last_bwidth != st->bwidth ) ) { #ifdef FIX_443_FD_CNG_INIT - int16_t total_brate; + int32_t total_brate; - total_brate = ( element_mode == IVAS_SCE ) ? st->total_brate : (int16_t) ( st->bits_frame_nominal * FRAMES_PER_SEC ); + total_brate = ( element_mode == IVAS_SCE ) ? st->total_brate : st->bits_frame_nominal * FRAMES_PER_SEC; configureFdCngEnc( st->hFdCngEnc, max( st->input_bwidth, WB ), total_brate ); #else configureFdCngEnc( st->hFdCngEnc, max( st->input_bwidth, WB ), st->bits_frame_nominal * FRAMES_PER_SEC ); -- GitLab