diff --git a/lib_enc/ivas_stereo_ica_enc.c b/lib_enc/ivas_stereo_ica_enc.c index 5ee97f27cf391341cb95a4ca11c51b59ae624d19..9d06a5523c8ce03a109f8aa85c19c67008243b3d 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 */