Commit 7f30144b authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

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
parent b4c3b18f
Loading
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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