From c592b5659e34e0d25d93818f1ea3af6212bb0de6 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Sat, 2 Mar 2024 22:33:52 +0530 Subject: [PATCH] Fixes stv crash issue due to Assertion issue caused by L_shl in sub function of hq_core_dec_fx() [x] The crash occurs due to assertion issue caused by L_shl for values just above 0.5 in Q27 when left shifted by 5, which was not handled in the EVS implemented hq_generic_decoding_fx(). The order of multiply and left shift was altered with which issue was resolved. If issue occurs again, copy of hq_bwe_fx and hq_generic_decoding_fx for IVAS needs to be created. --- lib_com/swb_bwe_com_fx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_com/swb_bwe_com_fx.c b/lib_com/swb_bwe_com_fx.c index d940637b1..05dcfc8d8 100644 --- a/lib_com/swb_bwe_com_fx.c +++ b/lib_com/swb_bwe_com_fx.c @@ -2938,7 +2938,11 @@ void hq_generic_decoding_fx( tmp4_fx = mult_r(tmp3_fx, 1638); WHILE(tmp3_fx > 1024) { +#ifdef EVS_FUNC_MODIFIED + L_tmp1 = L_shl(Mult_32_16(*pit1_fx , tmp3_fx), 5); /*15 + 5 + 10 -15 */ +#else L_tmp1 = Mult_32_16(L_shl(*pit1_fx, 5), tmp3_fx); /*15 + 5 + 10 -15 */ +#endif *pit1_fx-- = L_tmp1; move32(); tmp3_fx = sub(tmp3_fx, tmp4_fx); -- GitLab