diff --git a/lib_com/options.h b/lib_com/options.h index 8db1debfcd1a819e55d54ffe483e29ad0c935f15..8b9651f135feb9c774cc69244f2540e4e5d7ff35 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -103,6 +103,8 @@ #define FIX_BASOP_2262_OLAP_BUFFER_SYNTH_SWITCHING /* FhG: basop issue 2262: correct buffer update for FD-CNG buffer in case of BR switching */ #define FIX_2440_AGC_PRESCALING /* FhG: basop issue 2440: Fix loop bounds when scaling p_output_fx before ivas_spar_dec_agc_pca_fx() */ #define FIX_2471_REMOVE_POSSIBLE_OVRF /* VA: basop issue 2471: correcting undesired overflow */ +#define FIX_2465_Q_BWE_EXC /* VA: basop issue 2465: fix calculation of Q_bwe_exc in SWB TBE encoder */ + /* ##################### End NON-BE switches ########################### */ /* ################## End MAINTENANCE switches ######################### */ diff --git a/lib_dec/swb_tbe_dec_fx.c b/lib_dec/swb_tbe_dec_fx.c index c761d8ebcdbd3e11aed2f95a0728c5a81eaded8d..827949d68b2006c2b5641b267fca22e1362a0cbe 100644 --- a/lib_dec/swb_tbe_dec_fx.c +++ b/lib_dec/swb_tbe_dec_fx.c @@ -5295,7 +5295,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 03e7adadebed29beebe5d787eadb1df1e313e0e4..fe14e48602689dd415cbe7789c5ca0ffb05afb45 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -3080,8 +3080,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] ) ); }