From 5c1535eb867eed69d26a6b30a7e93bf06eb8b380 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Mon, 10 Feb 2025 15:11:03 +0530 Subject: [PATCH] Fix for 3GPP issue 1251: Basop Encoder: Spectral holes between 2-4 kHz and spectral differences for Unified Stereo @24kbps - 2 Link #1251 --- lib_enc/ivas_stereo_ica_enc.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib_enc/ivas_stereo_ica_enc.c b/lib_enc/ivas_stereo_ica_enc.c index 5ee97f27c..9d06a5523 100644 --- a/lib_enc/ivas_stereo_ica_enc.c +++ b/lib_enc/ivas_stereo_ica_enc.c @@ -1337,17 +1337,10 @@ static void estDownmixGain_fx( } ELSE IF( GT_16( hStereoTCA->LRTD_G_ATT_cnt, 1 ) ) /* lrtd_mode == 1 but tdm_LRTD_flag still 0 */ { - currentGain = BASOP_Util_Divide1616_Scale( currentGain, hStereoTCA->LRTD_G_ATT_cnt, ¤tGain_e ); // Q = 15 + 0 - (15 - exp) - /* Division result Q has to be got back to the Q of initial currentGain hence the shift operation below */ - IF( currentGain_e != 0 ) - { - currentGain = shr( currentGain, sub( Q15, currentGain_e ) ); /* Q15 */ - currentGain_e = 0; - move16(); - } + currentGain = BASOP_Util_Divide1616_Scale( currentGain, hStereoTCA->LRTD_G_ATT_cnt, &exp ); + currentGain_e = add( exp, sub( currentGain_e, 15 ) ); } - IF( GE_16( norm_s( currentGain ), sub( currentGain_e, 1 ) ) ) { /* convert currentGain into Q14 */ -- GitLab