diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 543897b8542fc9365bc5a48b127ea9427ef03c4d..42abcf9f4448fc2397a1f75da47f1a4d09818fcd 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -2364,7 +2364,16 @@ static void reduce_metadata_further_fx( } } - tmp2 = W_norm( W_tmp ); + IF( W_tmp != 0 ) + { + tmp2 = sub( W_norm( W_tmp ), 1 ); // Usage of guard bits to avoid the large values of onset_detector in multiplication + } + ELSE + { + tmp2 = 0; + move16(); + } + tmp2 = s_min( 32, tmp2 ); totalEnergySum = W_extract_h( W_shl( W_tmp, tmp2 ) ); tmp2 = sub( tmp2, 32 );