diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index 37619f4c1ff2a467c26414eea3a13394a1f4c11b..44182659d1d28799c6fac90d285f65f049b7dc03 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -2581,12 +2581,25 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ account all shift operations. */ + shift = norm_l( a_m ); + a_m = L_shl( a_m, shift ); + if ( a_m ) + { + a_e = sub( a_e, shift ); + } + + shift = norm_l( b_m ); + b_m = L_shl( b_m, shift ); + if ( b_m ) + { + b_e = sub( b_e, shift ); + } + if ( !a_m ) { a_e = b_e; move16(); } - if ( !b_m ) { b_e = a_e; diff --git a/lib_enc/ivas_mct_enc_mct_fx.c b/lib_enc/ivas_mct_enc_mct_fx.c index d402d834f9fa1b5dcbd409f5902e09c25ee907da..d684f714885f58c5ed0a123c09d53e8b8b5823d7 100644 --- a/lib_enc/ivas_mct_enc_mct_fx.c +++ b/lib_enc/ivas_mct_enc_mct_fx.c @@ -92,6 +92,7 @@ void getChannelEnergies_fx( sum2_e = st->hTcxEnc->spectrum_e[0]; move16(); nrg[ch] = 0; + nrg_e[ch] = 0; move32(); FOR( n = 0; n < nSubframes; n++ ) {