From 119e85bf66c4f8d93c381c18f43bb25b0960d8fb Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 12 Feb 2025 12:37:44 +0530 Subject: [PATCH 1/2] Fix for 3GPP issue 1284: Assert in ic_bwe_enc_specMapping_ivas_fx of BASOP encoder with OMASA LTV input coded at 24.4 kbps Link #1284 --- lib_enc/ivas_stereo_icbwe_enc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib_enc/ivas_stereo_icbwe_enc.c b/lib_enc/ivas_stereo_icbwe_enc.c index 407f66cfe..5da4c239a 100644 --- a/lib_enc/ivas_stereo_icbwe_enc.c +++ b/lib_enc/ivas_stereo_icbwe_enc.c @@ -219,8 +219,11 @@ static Word16 ic_bwe_enc_specMapping_ivas_fx( u_fx = extract_l( *specMapping_fx ); - tmp = mult( b_fx, b_fx ); // b_e + b_e; - tmp1 = mult( a_fx, c_fx ); // a_e + c_e + 2 + + /*only possible saturation is -32768 and -32768 to avoid crash in that case mult_sat is used instead of mult*/ + + tmp = mult_sat( b_fx, b_fx ); // b_e + b_e; + tmp1 = mult_sat( a_fx, c_fx ); // a_e + c_e + 2 exp = BASOP_Util_Add_MantExp( tmp, add( b_e, b_e ), tmp1, add( a_e, add( c_e, 2 ) ), &temp_fx ); /* Q15-exp */ test(); -- GitLab From 7ece91aa0a09b57044bd7dc06052f4403f6fdc0e Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 12 Feb 2025 15:04:01 +0530 Subject: [PATCH 2/2] Comment update --- lib_enc/ivas_stereo_icbwe_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_stereo_icbwe_enc.c b/lib_enc/ivas_stereo_icbwe_enc.c index 5da4c239a..16c12be50 100644 --- a/lib_enc/ivas_stereo_icbwe_enc.c +++ b/lib_enc/ivas_stereo_icbwe_enc.c @@ -220,7 +220,7 @@ static Word16 ic_bwe_enc_specMapping_ivas_fx( u_fx = extract_l( *specMapping_fx ); - /*only possible saturation is -32768 and -32768 to avoid crash in that case mult_sat is used instead of mult*/ + /* while performing (-32768)*(-32768), overflow occurs because the result comes out as 32768 after mult. This is the only case for mult where overflow happens. In order to avoid this scenario mult_sat is used */ tmp = mult_sat( b_fx, b_fx ); // b_e + b_e; tmp1 = mult_sat( a_fx, c_fx ); // a_e + c_e + 2 -- GitLab