From 1ec3aa3543895063d3cbe36e95b8d2eb2b61bd80 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 3 Mar 2026 17:22:31 +0100 Subject: [PATCH] FIX_2465_Q_BWE_EXC --- lib_com/options.h | 1 + lib_dec/swb_tbe_dec_fx.c | 4 ++++ lib_enc/swb_tbe_enc_fx.c | 13 +++++++++++++ 3 files changed, 18 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 7fa610801..06774e5db 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -118,6 +118,7 @@ #define FIX_1530_Codec_Level_Harmonization_Non_diegetic_panning /* FhG: Adjust non-diegetic panning law to harmonize codec levels with 3GPP reference software */ #define FIX_FLOAT_1518 /* FhG: fix issue 1518: loudness differences in OSBA decoding to mono or stereo output */ #define FIX_FLOAT_1533_BLEND_SUBFR2 /* FhG: float issue 1533: correct blending in blend_subfr2() */ +#define FIX_2465_Q_BWE_EXC /* VA: basop issue 2465: fix calculation of Q_bwe_exc in SWB TBE encoder */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/swb_tbe_dec_fx.c b/lib_dec/swb_tbe_dec_fx.c index cb0a565d0..915760330 100644 --- a/lib_dec/swb_tbe_dec_fx.c +++ b/lib_dec/swb_tbe_dec_fx.c @@ -5312,7 +5312,11 @@ void swb_tbe_dec_ivas_fx( Lmax = 0; move32(); +#ifdef FIX_2465_Q_BWE_EXC + FOR( cnt = 0; cnt < sig_len; cnt++ ) +#else FOR( cnt = 0; cnt < sig_len; cnt++ ) // note: this differs from the encoder where the length is always L_FRAME32k +#endif #else Lmax = 0; move32(); diff --git a/lib_enc/swb_tbe_enc_fx.c b/lib_enc/swb_tbe_enc_fx.c index 2a1a5fad9..9feae2f15 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -3097,8 +3097,21 @@ void swb_tbe_enc_ivas_fx( /* -------- start of memory rescaling -------- */ /* ----- calculate optimum Q_bwe_exc and rescale memories accordingly ----- */ +#ifdef FIX_2465_Q_BWE_EXC + Word16 sig_len = L_FRAME32k + NL_BUFF_OFFSET; + move16(); + IF( st_fx->element_mode == EVS_MONO ) + { + sig_len = L_FRAME32k; + move16(); + } + + Lmax = L_deposit_l( 0 ); + FOR( cnt = 0; cnt < sig_len; cnt++ ) +#else Lmax = L_deposit_l( 0 ); FOR( cnt = 0; cnt < L_FRAME32k; cnt++ ) +#endif { Lmax = L_max( Lmax, L_abs( bwe_exc_extended[cnt] ) ); } -- GitLab