From 7f30144ba1767174ab29777070380b4df55cf488 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 4 Jun 2025 10:49:42 +0530 Subject: [PATCH 1/2] Fix for 3GPP issue 1722: Assert in BASOP renderer when rendering ISM to certain custom LS setup Link #1722 Increased precision in in_tri function fixes the issue --- lib_rend/ivas_efap_fx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib_rend/ivas_efap_fx.c b/lib_rend/ivas_efap_fx.c index 4fb88643b..3a4ddde1e 100644 --- a/lib_rend/ivas_efap_fx.c +++ b/lib_rend/ivas_efap_fx.c @@ -2490,7 +2490,8 @@ static Word16 in_tri_fx( Word32 tmpDot1[2], tmpDot2[2]; Word32 matInv[2][2]; Word32 invFactor; - Word16 tmp16, tmp_e; + Word16 tmp_e; + Word32 tmp32; Word64 S[2]; /* Threshold adjusted */ Word64 thresh_int = 35184640; // 1e-6f in Q45 @@ -2520,8 +2521,8 @@ static Word16 in_tri_fx( } /* invFactor = 1.f / invFactor; */ - tmp16 = BASOP_Util_Divide3232_Scale( ONE_IN_Q13, invFactor, &tmp_e ); /*15-tmp_e*/ - invFactor = L_shl_sat( tmp16, add( Q16, tmp_e ) ); /* Q31 */ + tmp32 = BASOP_Util_Divide3232_Scale_newton( ONE_IN_Q13, invFactor, &tmp_e ); /*31-tmp_e*/ + invFactor = L_shl_sat( tmp32, tmp_e ); /* Q31 */ Word16 invFactor_exp = norm_l( invFactor ); invFactor = L_shl( invFactor, invFactor_exp ); // 31+invFactor_exp -- GitLab From 9281becbefa13ab56fce58ddcd9ecfee17dbc0a2 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 4 Jun 2025 10:54:36 +0530 Subject: [PATCH 2/2] Clang formatting changes --- lib_rend/ivas_efap_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_efap_fx.c b/lib_rend/ivas_efap_fx.c index 3a4ddde1e..fbcfdfe77 100644 --- a/lib_rend/ivas_efap_fx.c +++ b/lib_rend/ivas_efap_fx.c @@ -2522,7 +2522,7 @@ static Word16 in_tri_fx( /* invFactor = 1.f / invFactor; */ tmp32 = BASOP_Util_Divide3232_Scale_newton( ONE_IN_Q13, invFactor, &tmp_e ); /*31-tmp_e*/ - invFactor = L_shl_sat( tmp32, tmp_e ); /* Q31 */ + invFactor = L_shl_sat( tmp32, tmp_e ); /* Q31 */ Word16 invFactor_exp = norm_l( invFactor ); invFactor = L_shl( invFactor, invFactor_exp ); // 31+invFactor_exp -- GitLab