Loading lib_com/env_stab_fx.c +6 −0 Original line number Diff line number Diff line Loading @@ -187,9 +187,11 @@ Word16 env_stab_smo_fx( /* Q0 */ Word16 maxval, pp[NUM_ENV_STAB_PLC_STATES], pa[NUM_ENV_STAB_PLC_STATES]; Word16 i; Word16 tmp, sum, exp; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /* get previous state */ prev_state = maximum_fx( env_stab_state_p, NUM_ENV_STAB_PLC_STATES, &maxval ); Loading Loading @@ -226,7 +228,11 @@ Word16 env_stab_smo_fx( /* Q0 */ /*tmp = shl(tmp, add(exp, 1));*/ /* Q15 */ FOR( i = 0; i < NUM_ENV_STAB_PLC_STATES; i++ ) { #ifdef ISSUE_1836_replace_overflow_libcom env_stab_state_p[i] = round_fx_sat( L_shl_sat( L_mult_sat( env_stab_state_p[i], tmp ), add( exp, 1 ) ) ); /* Q15 */ #else env_stab_state_p[i] = round_fx_o( L_shl_o( L_mult_o( env_stab_state_p[i], tmp, &Overflow ), add( exp, 1 ), &Overflow ), &Overflow ); /* Q15 */ #endif move16(); } Loading lib_com/fd_cng_com_fx.c +31 −3 Original line number Diff line number Diff line Loading @@ -647,11 +647,12 @@ void minimum_statistics( Word16 msAlphaCorAlpha2; Word16 msPeriodogSum16; Word16 msNoiseFloor16; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif len2 = i_mult( MSNUMSUBFR, len ); Loading Loading @@ -750,7 +751,11 @@ void minimum_statistics( /* use absolute value to avoid -1.0 x -1.0 multiplications */ s2 = norm_l( scalar2 ); } #ifdef ISSUE_1836_replace_overflow_libcom scalar216 = round_fx_sat( L_shl( scalar2, s2 ) ); #else scalar216 = round_fx_o( L_shl_o( scalar2, s2, &Overflow ), &Overflow ); #endif scalar2 = L_mult( scalar216, scalar216 ); /* find common exponent */ Loading Loading @@ -900,7 +905,11 @@ void minimum_statistics( s2 = s_min( s2, WORD32_BITS - 1 ); /* beta: scaled by s2 */ #ifdef ISSUE_1836_replace_overflow_libcom tmp16 = round_fx_sat( L_shl( tmp, s1 ) ); #else tmp16 = round_fx_o( L_shl_o( tmp, s1, &Overflow ), &Overflow ); #endif beta = mult_r( tmp16, tmp16 ); /* scalar3: scaled by s3 */ Loading Loading @@ -988,8 +997,13 @@ void minimum_statistics( move32(); /* exponent msCurrentMinSubWindow[j]: CNG_S */ BASOP_SATURATE_WARNING_OFF_EVS; #ifdef ISSUE_1836_replace_overflow_libcom msCurrentMinSubWindow[j] = L_shl_sat( Mpy_32_32( scalar, msBminSubWin[j] ), 5 ); move32(); #else msCurrentMinSubWindow[j] = L_shl_o( Mpy_32_32( scalar, msBminSubWin[j] ), 5, &Overflow ); move32(); #endif BASOP_SATURATE_WARNING_ON_EVS; } } Loading Loading @@ -1246,10 +1260,12 @@ void minimum_statistics_fx( Word16 msAlphaCorAlpha2; Word16 msPeriodogSum16; Word16 msNoiseFloor16; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif len2 = i_mult( MSNUMSUBFR, len ); Loading Loading @@ -1349,7 +1365,11 @@ void minimum_statistics_fx( /* use absolute value to avoid -1.0 x -1.0 multiplications */ s2 = norm_l( scalar2 ); } #ifdef ISSUE_1836_replace_overflow_libcom scalar216 = round_fx_sat( L_shl( scalar2, s2 ) ); #else scalar216 = round_fx_o( L_shl_o( scalar2, s2, &Overflow ), &Overflow ); #endif scalar2 = L_mult( scalar216, scalar216 ); /* find common exponent */ Loading Loading @@ -1506,7 +1526,11 @@ void minimum_statistics_fx( s2 = s_min( s2, WORD32_BITS - 1 ); /* beta: scaled by s2 */ #ifdef ISSUE_1836_replace_overflow_libcom tmp16 = round_fx_sat( L_shl( tmp, s1 ) ); #else tmp16 = round_fx_o( L_shl_o( tmp, s1, &Overflow ), &Overflow ); #endif beta = mult_r( tmp16, tmp16 ); /* scalar3: scaled by s3 */ Loading Loading @@ -1594,7 +1618,11 @@ void minimum_statistics_fx( move32(); /* exponent msCurrentMinSubWindow[j]: CNG_S */ BASOP_SATURATE_WARNING_OFF_EVS; #ifdef ISSUE_1836_replace_overflow_libcom msCurrentMinSubWindow[j] = L_shl_sat( Mpy_32_32( scalar, msBminSubWin[j] ), 5 ); #else msCurrentMinSubWindow[j] = L_shl_o( Mpy_32_32( scalar, msBminSubWin[j] ), 5, &Overflow ); #endif move32(); BASOP_SATURATE_WARNING_ON_EVS; } Loading Loading @@ -2279,7 +2307,7 @@ static void getmidbands( ) { Word16 j, max_psize, shift; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -2318,7 +2346,7 @@ static void getmidbands( move16(); FOR( j = 0; j < npart; j++ ) { #ifdef ISSUE_1796_replace_shl_o #ifdef ISSUE_1836_replace_overflow_libcom psize_norm[j] = shl_sat( psize[j], shift ); // Q(15 - psize_norm_exp) #else psize_norm[j] = shl_o( psize[j], shift, &Overflow ); // Q(15 - psize_norm_exp) Loading Loading
lib_com/env_stab_fx.c +6 −0 Original line number Diff line number Diff line Loading @@ -187,9 +187,11 @@ Word16 env_stab_smo_fx( /* Q0 */ Word16 maxval, pp[NUM_ENV_STAB_PLC_STATES], pa[NUM_ENV_STAB_PLC_STATES]; Word16 i; Word16 tmp, sum, exp; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /* get previous state */ prev_state = maximum_fx( env_stab_state_p, NUM_ENV_STAB_PLC_STATES, &maxval ); Loading Loading @@ -226,7 +228,11 @@ Word16 env_stab_smo_fx( /* Q0 */ /*tmp = shl(tmp, add(exp, 1));*/ /* Q15 */ FOR( i = 0; i < NUM_ENV_STAB_PLC_STATES; i++ ) { #ifdef ISSUE_1836_replace_overflow_libcom env_stab_state_p[i] = round_fx_sat( L_shl_sat( L_mult_sat( env_stab_state_p[i], tmp ), add( exp, 1 ) ) ); /* Q15 */ #else env_stab_state_p[i] = round_fx_o( L_shl_o( L_mult_o( env_stab_state_p[i], tmp, &Overflow ), add( exp, 1 ), &Overflow ), &Overflow ); /* Q15 */ #endif move16(); } Loading
lib_com/fd_cng_com_fx.c +31 −3 Original line number Diff line number Diff line Loading @@ -647,11 +647,12 @@ void minimum_statistics( Word16 msAlphaCorAlpha2; Word16 msPeriodogSum16; Word16 msNoiseFloor16; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif len2 = i_mult( MSNUMSUBFR, len ); Loading Loading @@ -750,7 +751,11 @@ void minimum_statistics( /* use absolute value to avoid -1.0 x -1.0 multiplications */ s2 = norm_l( scalar2 ); } #ifdef ISSUE_1836_replace_overflow_libcom scalar216 = round_fx_sat( L_shl( scalar2, s2 ) ); #else scalar216 = round_fx_o( L_shl_o( scalar2, s2, &Overflow ), &Overflow ); #endif scalar2 = L_mult( scalar216, scalar216 ); /* find common exponent */ Loading Loading @@ -900,7 +905,11 @@ void minimum_statistics( s2 = s_min( s2, WORD32_BITS - 1 ); /* beta: scaled by s2 */ #ifdef ISSUE_1836_replace_overflow_libcom tmp16 = round_fx_sat( L_shl( tmp, s1 ) ); #else tmp16 = round_fx_o( L_shl_o( tmp, s1, &Overflow ), &Overflow ); #endif beta = mult_r( tmp16, tmp16 ); /* scalar3: scaled by s3 */ Loading Loading @@ -988,8 +997,13 @@ void minimum_statistics( move32(); /* exponent msCurrentMinSubWindow[j]: CNG_S */ BASOP_SATURATE_WARNING_OFF_EVS; #ifdef ISSUE_1836_replace_overflow_libcom msCurrentMinSubWindow[j] = L_shl_sat( Mpy_32_32( scalar, msBminSubWin[j] ), 5 ); move32(); #else msCurrentMinSubWindow[j] = L_shl_o( Mpy_32_32( scalar, msBminSubWin[j] ), 5, &Overflow ); move32(); #endif BASOP_SATURATE_WARNING_ON_EVS; } } Loading Loading @@ -1246,10 +1260,12 @@ void minimum_statistics_fx( Word16 msAlphaCorAlpha2; Word16 msPeriodogSum16; Word16 msNoiseFloor16; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif len2 = i_mult( MSNUMSUBFR, len ); Loading Loading @@ -1349,7 +1365,11 @@ void minimum_statistics_fx( /* use absolute value to avoid -1.0 x -1.0 multiplications */ s2 = norm_l( scalar2 ); } #ifdef ISSUE_1836_replace_overflow_libcom scalar216 = round_fx_sat( L_shl( scalar2, s2 ) ); #else scalar216 = round_fx_o( L_shl_o( scalar2, s2, &Overflow ), &Overflow ); #endif scalar2 = L_mult( scalar216, scalar216 ); /* find common exponent */ Loading Loading @@ -1506,7 +1526,11 @@ void minimum_statistics_fx( s2 = s_min( s2, WORD32_BITS - 1 ); /* beta: scaled by s2 */ #ifdef ISSUE_1836_replace_overflow_libcom tmp16 = round_fx_sat( L_shl( tmp, s1 ) ); #else tmp16 = round_fx_o( L_shl_o( tmp, s1, &Overflow ), &Overflow ); #endif beta = mult_r( tmp16, tmp16 ); /* scalar3: scaled by s3 */ Loading Loading @@ -1594,7 +1618,11 @@ void minimum_statistics_fx( move32(); /* exponent msCurrentMinSubWindow[j]: CNG_S */ BASOP_SATURATE_WARNING_OFF_EVS; #ifdef ISSUE_1836_replace_overflow_libcom msCurrentMinSubWindow[j] = L_shl_sat( Mpy_32_32( scalar, msBminSubWin[j] ), 5 ); #else msCurrentMinSubWindow[j] = L_shl_o( Mpy_32_32( scalar, msBminSubWin[j] ), 5, &Overflow ); #endif move32(); BASOP_SATURATE_WARNING_ON_EVS; } Loading Loading @@ -2279,7 +2307,7 @@ static void getmidbands( ) { Word16 j, max_psize, shift; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -2318,7 +2346,7 @@ static void getmidbands( move16(); FOR( j = 0; j < npart; j++ ) { #ifdef ISSUE_1796_replace_shl_o #ifdef ISSUE_1836_replace_overflow_libcom psize_norm[j] = shl_sat( psize[j], shift ); // Q(15 - psize_norm_exp) #else psize_norm[j] = shl_o( psize[j], shift, &Overflow ); // Q(15 - psize_norm_exp) Loading