From dbacf7282b3dd0d1a2e2dd6101682673c15f9cb5 Mon Sep 17 00:00:00 2001 From: Mohammadreza Naghibzadeh Tahamizarandi Date: Mon, 4 May 2026 17:43:31 +0200 Subject: [PATCH] Exclude zero samples from exp_com calculation in tcaTargetCh_LA_fx. --- lib_com/options.h | 1 + lib_enc/ivas_stereo_ica_enc_fx.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 9ce33d497..32c674559 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -130,6 +130,7 @@ #define FIX_FLOAT_1578_OMASA_REND_SPIKES /* Nokia: Float issue 1578: Fix spikes and collapsed perception in OMASA/MASA rendering to FOA/HOA */ #define FIX_1521_SBA_LOUDNESS_STEREO /* FhG: issue 1521: Fix loudness for SBA to stereo rendering */ #define FIX_1559 /* Eri/FhG: fix for Issue 1559 in FD CNG with bitrate/bw switching */ +#define FIX_BASOP_2519_TCA_LA_ZERO_EXP /* FhG: BASOP #2519: Exclude zero samples from exp_com calculation in tcaTargetCh_LA_fx */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_stereo_ica_enc_fx.c b/lib_enc/ivas_stereo_ica_enc_fx.c index 234652072..0263267f7 100644 --- a/lib_enc/ivas_stereo_ica_enc_fx.c +++ b/lib_enc/ivas_stereo_ica_enc_fx.c @@ -171,7 +171,14 @@ static void tcaTargetCh_LA_fx( move32(); target_exp_temp[i + currentNCShift] = temp; move16(); +#ifdef FIX_BASOP_2519_TCA_LA_ZERO_EXP + IF( NE_32( target[i + currentNCShift], 0 ) ) + { + exp_com = s_max( exp_com, temp ); + } +#else exp_com = s_max( exp_com, temp ); +#endif } FOR( ; i < input_frame; i++ ) @@ -180,7 +187,14 @@ static void tcaTargetCh_LA_fx( move32(); target_exp_temp[i + currentNCShift] = add( gAdj_exp, ref_exp ); move16(); +#ifdef FIX_BASOP_2519_TCA_LA_ZERO_EXP + IF( NE_32( target[i + currentNCShift], 0 ) ) + { + exp_com = s_max( exp_com, target_exp_temp[i + currentNCShift] ); + } +#else exp_com = s_max( exp_com, target_exp_temp[i + currentNCShift] ); +#endif } FOR( i = 0; i < input_frame + currentNCShift; i++ ) -- GitLab