From 394b1e3c1f31ac4d16872638cfcd2f4b2d239712 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Thu, 16 Jan 2025 09:34:44 +0530 Subject: [PATCH] Fix for 3GPP issue 1169: Assert in reduce_metadata_further_fx for MASA selection test input Link #1169 --- lib_enc/ivas_masa_enc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 543897b85..42abcf9f4 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 ); -- GitLab