From ef9217717cde63a57828cfac990dea51fb17dddf Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 15 Dec 2025 16:17:27 +0100 Subject: [PATCH 1/2] introduce FIX_1381_BWD --- lib_com/options.h | 1 + lib_enc/bw_detect.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 59daf40a86..e447ee8e93 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,6 +172,7 @@ #define FIX_1454_FIX_STEREO_TO_FOA_JBM /* VA: issue 1454: fix buggy stereo to FOA in JBM */ #define FIX_1461_CNG_BW_SWITCHING /* Eri: issue 1461: Stereo parameters are not updated when SID/NODATA forces BW to stay the same */ #define FIX_2252_LP_CNG_STARTS_SID /* VA: issues 2251 and 2252: fix LP CNG uninitialized value in bitstream that starts with an SID */ +#define FIX_1381_BWD /* VA: issue 1381: apply no hysteresis in BWD at higher bitrates also in mono MASA and OMASA */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index 6a08b04d21..e1ef3ff972 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -53,6 +53,9 @@ *-------------------------------------------------------------------*/ #define BWD_MIN_BRATE_WIDER_BW_MDCT IVAS_48k +#ifdef FIX_1381_BWD +#define BWD_MIN_BRATE_WIDER_BW_MASA IVAS_48k +#endif #define BWD_MIN_BRATE_WIDER_BW_ISM IVAS_32k #define BWD_MAX_BRATE_WIDER_BW_MDCT IVAS_80k #define BWD_MAX_BRATE_WIDER_BW_ISM IVAS_64k @@ -92,7 +95,12 @@ void bw_detect( bwd_count_wider_bw = BWD_COUNT_WIDER_BW; if ( st->ini_frame > 0 && ( ( st->element_mode == IVAS_CPE_MDCT && ( st->element_brate >= BWD_MIN_BRATE_WIDER_BW_MDCT || mct_on ) ) || - ( ivas_format == ISM_FORMAT && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_ISM ) ) ) +#ifdef FIX_1381_BWD + ( st->is_ism_format == ISM_FORMAT && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_ISM ) || + ( ivas_format == MASA_FORMAT && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_MASA ) ) ) +#else + ( ivas_format == ISM_FORMAT && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_ISM ) ) ) +#endif { bwd_count_wider_bw = BWD_COUNT_WIDER_BW_MDCT; } -- GitLab From 335ab820f7ba4e8673edafade9a4b2e65a31553e Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 15 Dec 2025 16:24:21 +0100 Subject: [PATCH 2/2] clang-format --- lib_enc/bw_detect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index e1ef3ff972..f5a404a920 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -96,10 +96,10 @@ void bw_detect( bwd_count_wider_bw = BWD_COUNT_WIDER_BW; if ( st->ini_frame > 0 && ( ( st->element_mode == IVAS_CPE_MDCT && ( st->element_brate >= BWD_MIN_BRATE_WIDER_BW_MDCT || mct_on ) ) || #ifdef FIX_1381_BWD - ( st->is_ism_format == ISM_FORMAT && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_ISM ) || - ( ivas_format == MASA_FORMAT && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_MASA ) ) ) + ( st->is_ism_format && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_ISM ) || + ( ivas_format == MASA_FORMAT && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_MASA ) ) ) #else - ( ivas_format == ISM_FORMAT && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_ISM ) ) ) + ( ivas_format == ISM_FORMAT && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_ISM ) ) ) #endif { bwd_count_wider_bw = BWD_COUNT_WIDER_BW_MDCT; -- GitLab