Loading lib_com/oper_32b.c +28 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,12 @@ #define WMC_TOOL_SKIP #ifndef ISSUE_1836_FILEACTIVE_oper_32b_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /***************************************************************************** * * * Function L_Extract() * Loading Loading @@ -124,13 +130,20 @@ Word32 L_Comp( Word16 hi, Word16 lo ) Word32 Mpy_32( Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2 ) { Word32 L_32; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif L_32 = L_mult( hi1, hi2 ); #ifdef ISSUE_1836_replace_overflow_libcom L_32 = L_mac_sat( L_32, mult( hi1, lo2 ), 1 ); //??sat L_32 = L_mac_sat( L_32, mult( lo1, hi2 ), 1 ); //??sat #else L_32 = L_mac_o( L_32, mult( hi1, lo2 ), 1, &Overflow ); L_32 = L_mac_o( L_32, mult( lo1, hi2 ), 1, &Overflow ); #endif return ( L_32 ); } Loading Loading @@ -159,13 +172,21 @@ Word32 Mpy_32( Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2 ) Word32 Mac_32( Word32 L_num, Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2 ) { Word32 L_32; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif #ifdef ISSUE_1836_replace_overflow_libcom L_32 = L_mac_sat( L_num, hi1, hi2 ); //??sat L_32 = L_mac_sat( L_32, mult( hi1, lo2 ), 1 ); //??sat L_32 = L_mac_sat( L_32, mult( lo1, hi2 ), 1 ); //??sat #else L_32 = L_mac_o( L_num, hi1, hi2, &Overflow ); L_32 = L_mac_o( L_32, mult( hi1, lo2 ), 1, &Overflow ); L_32 = L_mac_o( L_32, mult( lo1, hi2 ), 1, &Overflow ); #endif return ( L_32 ); } Loading Loading @@ -193,12 +214,19 @@ Word32 Mac_32( Word32 L_num, Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2 ) Word32 Sqr_32( Word16 hi, Word16 lo ) { Word32 L_32; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif #ifdef ISSUE_1836_replace_overflow_libcom L_32 = L_mult_sat( hi, hi ); //??sat L_32 = L_mac_sat( L_32, mult( hi, lo ), 2 ); //??sat #else L_32 = L_mult_o( hi, hi, &Overflow ); L_32 = L_mac_o( L_32, mult( hi, lo ), 2, &Overflow ); #endif return ( L_32 ); } Loading lib_com/phase_dispersion_fx.c +16 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,12 @@ #include "basop_util.h" #include "rom_com.h" #ifndef ISSUE_1836_FILEACTIVE_phase_dispersion_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*-----------------------------------------------------------------------* * phase_dispersion: * Loading @@ -30,9 +36,11 @@ void phase_dispersion( Word32 x32[2 * L_SUBFR]; Word16 *code_real, *code_imag; const Word16 *h_real, *h_imag; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif move16(); Loading @@ -57,7 +65,11 @@ void phase_dispersion( move16(); prev_gain_pit[0] = gain_pit; #ifdef ISSUE_1836_replace_overflow_libcom IF( GT_32( gain_code, L_add_sat( *prev_gain_code, L_shl_sat( *prev_gain_code, 1 ) ) ) ) //??sat #else IF( GT_32( gain_code, L_add_o( *prev_gain_code, L_shl_o( *prev_gain_code, 1, &Overflow ), &Overflow ) ) ) #endif { IF( LT_16( state, 2 ) ) { Loading Loading @@ -165,7 +177,11 @@ void phase_dispersion( scale2 = getScaleFactor32( x32, L_subfr ); FOR( i = 0; i < L_subfr; i++ ) { #ifdef ISSUE_1836_replace_overflow_libcom code[i] = round_fx_sat( L_shl_sat( x32[i], scale2 ) ); #else code[i] = round_fx_o( L_shl_o( x32[i], scale2, &Overflow ), &Overflow ); #endif move16(); } j = sub( j, scale2 ); Loading lib_com/ppp_fx.c +16 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,12 @@ #include "cnst.h" #include "prot_fx.h" #ifndef ISSUE_1836_FILEACTIVE_ppp_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*===================================================================*/ /* FUNCTION : Interpol_delay_fx () */ /*-------------------------------------------------------------------*/ Loading Loading @@ -97,9 +103,11 @@ void deemph_lpc_fx( Word16 k, temp; Word16 b_fx[M + 2]; /* Q12 */ Word16 a_fx[2] = { -22282, 32767 }; /* Q15 {-PREEMPH_FAC,1.0} */ #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif b_fx[0] = 4096; move16(); /* 1 in Q12 */ Loading @@ -115,7 +123,11 @@ void deemph_lpc_fx( { /* LPC_de_curr[k] = a[0]*b[k] + a[1]*b[k+1]; */ temp = mult( a_fx[0], b_fx[k] ); /* Q12 */ #ifdef ISSUE_1836_replace_overflow_libcom LPC_de_curr_fx[k] = add_sat( temp, b_fx[k + 1] ); //??sat #else LPC_de_curr_fx[k] = add_o( temp, b_fx[k + 1], &Overflow ); #endif move16(); /* Q12 */ } Loading @@ -137,7 +149,11 @@ void deemph_lpc_fx( { /* LPC_de_old[k] = a[0]*b[k] + a[1]*b[k+1]; */ temp = mult( a_fx[0], b_fx[k] ); /* Q12 */ #ifdef ISSUE_1836_replace_overflow_libcom LPC_de_old_fx[k] = add_sat( temp, b_fx[k + 1] ); //??sat #else LPC_de_old_fx[k] = add_o( temp, b_fx[k + 1], &Overflow ); #endif move16(); /* Q12 */ } } Loading lib_com/pred_lt4_fx.c +37 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,11 @@ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #ifndef ISSUE_1836_FILEACTIVE_pred_lt4_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*-------------------------------------------------------------------* * Function pred_lt4: * Loading Loading @@ -35,9 +40,11 @@ void pred_lt4_ivas_fx( Word32 s; const Word16 *x0, *x1, *x2; const Word32 *c1, *c2; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif x0 = &excI[-T0]; Loading Loading @@ -71,7 +78,11 @@ void pred_lt4_ivas_fx( s = W_sat_l( W_shr( s64, 16 ) ); /* Q_exc + Q16 */ } #ifdef ISSUE_1836_replace_overflow_libcom excO[j] = round_fx_sat( s ); /* Q_exc */ //??sat #else excO[j] = round_fx_o( s, &Overflow ); /* Q_exc */ #endif move16(); } return; Loading @@ -91,9 +102,11 @@ void pred_lt4( Word16 i, j; Word32 s; const Word16 *x0, *x1, *x2, *c1, *c2; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif x0 = &excI[-T0]; Loading Loading @@ -127,12 +140,21 @@ void pred_lt4( } s = W_sat_l( s64 ); /* Q_exc + Q14 */ } #ifdef ISSUE_1836_replace_overflow_libcom #if ( INTERP_EXP != -1 ) s = L_shl_sat( s, INTERP_EXP + 1 ); /* Q_exc + Q15 */ //??sat #endif excO[j] = round_fx_sat( s ); /* Q_exc */ //??sat move16(); #else #if ( INTERP_EXP != -1 ) s = L_shl_o( s, INTERP_EXP + 1, &Overflow ); /* Q_exc + Q15 */ #endif excO[j] = round_fx_o( s, &Overflow ); /* Q_exc */ move16(); #endif } return; } Loading Loading @@ -177,9 +199,11 @@ void pred_lt4_tc_fx( Word16 excO[L_SUBFR + 1]; Word32 L_sum; Word16 excI[2 * L_SUBFR]; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif Copy( exc + sub( i_subfr, L_SUBFR ), excI, L_SUBFR * 2 ); /* Q0 */ Loading Loading @@ -212,15 +236,25 @@ void pred_lt4_tc_fx( k += UP_SAMP; L_sum = L_mac( L_sum, x0[i], win[k] ); /* Q15 */ } #ifdef ISSUE_1836_replace_overflow_libcom L_sum = L_shl_sat( L_sum, 1 ); /* Q16 */ //??sat excO[j] = round_fx_sat( L_sum ); /* Q0 */ //??sat #else L_sum = L_shl_o( L_sum, 1, &Overflow ); /* Q16 */ excO[j] = round_fx_o( L_sum, &Overflow ); /* Q0 */ #endif move16(); x0++; } FOR( i = T0; i < L_SUBFR; i++ ) { #ifdef ISSUE_1836_replace_overflow_libcom exc[i + i_subfr] = add_sat( exc[i + i_subfr], mult_r( PIT_SHARP_fx, excO[i] ) ); /* Q0 */ //??sat #else exc[i + i_subfr] = add_o( exc[i + i_subfr], mult_r( PIT_SHARP_fx, excO[i] ), &Overflow ); /* Q0 */ #endif move16(); } } Loading lib_com/preemph_fx.c +44 −0 Original line number Diff line number Diff line Loading @@ -22,12 +22,23 @@ void preemph_copy_fx( ) { Word16 i, temp; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif temp = x[lg - 1]; /* Qx */ move16(); #ifdef ISSUE_1836_replace_overflow_libcom FOR( i = lg - 1; i > 0; i-- ) { y[i] = msu_r_sat( L_deposit_h( x[i] ), x[i - 1], mu ); /* Qx */ move16(); } y[0] = msu_r_sat( L_deposit_h( x[0] ), *mem, mu ); /* Qx */ //??sat move16(); #else FOR( i = lg - 1; i > 0; i-- ) { y[i] = msu_ro( L_deposit_h( x[i] ), x[i - 1], mu, &Overflow ); /* Qx */ Loading @@ -35,6 +46,8 @@ void preemph_copy_fx( } y[0] = msu_ro( L_deposit_h( x[0] ), *mem, mu, &Overflow ); /* Qx */ move16(); #endif *mem = temp; /* Qx */ move16(); Loading @@ -49,12 +62,23 @@ void preemph_copy_32fx( ) { Word16 i, temp; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif temp = x[lg - 1]; /* Qx */ move16(); #ifdef ISSUE_1836_replace_overflow_libcom FOR( i = lg - 1; i > 0; i-- ) { y[i] = L_msu_sat( L_deposit_h( x[i] ), x[i - 1], mu ); /* Qx+16 */ //??sat move16(); } y[0] = L_msu_sat( L_deposit_h( x[0] ), *mem, mu ); /* Qx+16 */ //??sat move16(); #else FOR( i = lg - 1; i > 0; i-- ) { y[i] = L_msu_o( L_deposit_h( x[i] ), x[i - 1], mu, &Overflow ); /* Qx+16 */ Loading @@ -62,6 +86,7 @@ void preemph_copy_32fx( } y[0] = L_msu_o( L_deposit_h( x[0] ), *mem, mu, &Overflow ); /* Qx+16 */ move16(); #endif *mem = temp; /* Qx */ move16(); Loading Loading @@ -125,13 +150,31 @@ void E_UTIL_f_preemph2( { Word16 i, temp; Word32 L_tmp; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif temp = signal[lg - 1]; /* Qx */ move16(); #ifdef ISSUE_1836_replace_overflow_libcom FOR( i = lg - 1; i > 0; i-- ) { L_tmp = L_mult( signal[i], 16384 ); /* Qx + 15 */ L_tmp = L_msu0_sat( L_tmp, signal[i - 1], mu ); /* Qx + 15 */ //??sat L_tmp = L_shl_sat( L_tmp, add( shift, 1 ) ); /* Qx + shift + 16 */ signal[i] = round_fx_sat( L_tmp ); /* Qx + shift */ //??sat move16(); } L_tmp = L_mult( signal[0], 16384 ); /* Qx + 15 */ L_tmp = L_msu0_sat( L_tmp, *mem, mu ); /* Qx + 15 */ //??sat L_tmp = L_shl_sat( L_tmp, add( shift, 1 ) ); /* Qx + shift + 16 */ signal[0] = round_fx_sat( L_tmp ); /* Qx + shift */ //??sat move16(); #else FOR( i = lg - 1; i > 0; i-- ) { L_tmp = L_mult( signal[i], 16384 ); /* Qx + 15 */ Loading @@ -146,6 +189,7 @@ void E_UTIL_f_preemph2( L_tmp = L_shl_o( L_tmp, add( shift, 1 ), &Overflow ); /* Qx + shift + 16 */ signal[0] = round_fx_o( L_tmp, &Overflow ); /* Qx + shift */ move16(); #endif *mem = temp; /* Qx */ move16(); Loading Loading
lib_com/oper_32b.c +28 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,12 @@ #define WMC_TOOL_SKIP #ifndef ISSUE_1836_FILEACTIVE_oper_32b_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /***************************************************************************** * * * Function L_Extract() * Loading Loading @@ -124,13 +130,20 @@ Word32 L_Comp( Word16 hi, Word16 lo ) Word32 Mpy_32( Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2 ) { Word32 L_32; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif L_32 = L_mult( hi1, hi2 ); #ifdef ISSUE_1836_replace_overflow_libcom L_32 = L_mac_sat( L_32, mult( hi1, lo2 ), 1 ); //??sat L_32 = L_mac_sat( L_32, mult( lo1, hi2 ), 1 ); //??sat #else L_32 = L_mac_o( L_32, mult( hi1, lo2 ), 1, &Overflow ); L_32 = L_mac_o( L_32, mult( lo1, hi2 ), 1, &Overflow ); #endif return ( L_32 ); } Loading Loading @@ -159,13 +172,21 @@ Word32 Mpy_32( Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2 ) Word32 Mac_32( Word32 L_num, Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2 ) { Word32 L_32; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif #ifdef ISSUE_1836_replace_overflow_libcom L_32 = L_mac_sat( L_num, hi1, hi2 ); //??sat L_32 = L_mac_sat( L_32, mult( hi1, lo2 ), 1 ); //??sat L_32 = L_mac_sat( L_32, mult( lo1, hi2 ), 1 ); //??sat #else L_32 = L_mac_o( L_num, hi1, hi2, &Overflow ); L_32 = L_mac_o( L_32, mult( hi1, lo2 ), 1, &Overflow ); L_32 = L_mac_o( L_32, mult( lo1, hi2 ), 1, &Overflow ); #endif return ( L_32 ); } Loading Loading @@ -193,12 +214,19 @@ Word32 Mac_32( Word32 L_num, Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2 ) Word32 Sqr_32( Word16 hi, Word16 lo ) { Word32 L_32; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif #ifdef ISSUE_1836_replace_overflow_libcom L_32 = L_mult_sat( hi, hi ); //??sat L_32 = L_mac_sat( L_32, mult( hi, lo ), 2 ); //??sat #else L_32 = L_mult_o( hi, hi, &Overflow ); L_32 = L_mac_o( L_32, mult( hi, lo ), 2, &Overflow ); #endif return ( L_32 ); } Loading
lib_com/phase_dispersion_fx.c +16 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,12 @@ #include "basop_util.h" #include "rom_com.h" #ifndef ISSUE_1836_FILEACTIVE_phase_dispersion_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*-----------------------------------------------------------------------* * phase_dispersion: * Loading @@ -30,9 +36,11 @@ void phase_dispersion( Word32 x32[2 * L_SUBFR]; Word16 *code_real, *code_imag; const Word16 *h_real, *h_imag; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif move16(); Loading @@ -57,7 +65,11 @@ void phase_dispersion( move16(); prev_gain_pit[0] = gain_pit; #ifdef ISSUE_1836_replace_overflow_libcom IF( GT_32( gain_code, L_add_sat( *prev_gain_code, L_shl_sat( *prev_gain_code, 1 ) ) ) ) //??sat #else IF( GT_32( gain_code, L_add_o( *prev_gain_code, L_shl_o( *prev_gain_code, 1, &Overflow ), &Overflow ) ) ) #endif { IF( LT_16( state, 2 ) ) { Loading Loading @@ -165,7 +177,11 @@ void phase_dispersion( scale2 = getScaleFactor32( x32, L_subfr ); FOR( i = 0; i < L_subfr; i++ ) { #ifdef ISSUE_1836_replace_overflow_libcom code[i] = round_fx_sat( L_shl_sat( x32[i], scale2 ) ); #else code[i] = round_fx_o( L_shl_o( x32[i], scale2, &Overflow ), &Overflow ); #endif move16(); } j = sub( j, scale2 ); Loading
lib_com/ppp_fx.c +16 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,12 @@ #include "cnst.h" #include "prot_fx.h" #ifndef ISSUE_1836_FILEACTIVE_ppp_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*===================================================================*/ /* FUNCTION : Interpol_delay_fx () */ /*-------------------------------------------------------------------*/ Loading Loading @@ -97,9 +103,11 @@ void deemph_lpc_fx( Word16 k, temp; Word16 b_fx[M + 2]; /* Q12 */ Word16 a_fx[2] = { -22282, 32767 }; /* Q15 {-PREEMPH_FAC,1.0} */ #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif b_fx[0] = 4096; move16(); /* 1 in Q12 */ Loading @@ -115,7 +123,11 @@ void deemph_lpc_fx( { /* LPC_de_curr[k] = a[0]*b[k] + a[1]*b[k+1]; */ temp = mult( a_fx[0], b_fx[k] ); /* Q12 */ #ifdef ISSUE_1836_replace_overflow_libcom LPC_de_curr_fx[k] = add_sat( temp, b_fx[k + 1] ); //??sat #else LPC_de_curr_fx[k] = add_o( temp, b_fx[k + 1], &Overflow ); #endif move16(); /* Q12 */ } Loading @@ -137,7 +149,11 @@ void deemph_lpc_fx( { /* LPC_de_old[k] = a[0]*b[k] + a[1]*b[k+1]; */ temp = mult( a_fx[0], b_fx[k] ); /* Q12 */ #ifdef ISSUE_1836_replace_overflow_libcom LPC_de_old_fx[k] = add_sat( temp, b_fx[k + 1] ); //??sat #else LPC_de_old_fx[k] = add_o( temp, b_fx[k + 1], &Overflow ); #endif move16(); /* Q12 */ } } Loading
lib_com/pred_lt4_fx.c +37 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,11 @@ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #ifndef ISSUE_1836_FILEACTIVE_pred_lt4_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*-------------------------------------------------------------------* * Function pred_lt4: * Loading Loading @@ -35,9 +40,11 @@ void pred_lt4_ivas_fx( Word32 s; const Word16 *x0, *x1, *x2; const Word32 *c1, *c2; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif x0 = &excI[-T0]; Loading Loading @@ -71,7 +78,11 @@ void pred_lt4_ivas_fx( s = W_sat_l( W_shr( s64, 16 ) ); /* Q_exc + Q16 */ } #ifdef ISSUE_1836_replace_overflow_libcom excO[j] = round_fx_sat( s ); /* Q_exc */ //??sat #else excO[j] = round_fx_o( s, &Overflow ); /* Q_exc */ #endif move16(); } return; Loading @@ -91,9 +102,11 @@ void pred_lt4( Word16 i, j; Word32 s; const Word16 *x0, *x1, *x2, *c1, *c2; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif x0 = &excI[-T0]; Loading Loading @@ -127,12 +140,21 @@ void pred_lt4( } s = W_sat_l( s64 ); /* Q_exc + Q14 */ } #ifdef ISSUE_1836_replace_overflow_libcom #if ( INTERP_EXP != -1 ) s = L_shl_sat( s, INTERP_EXP + 1 ); /* Q_exc + Q15 */ //??sat #endif excO[j] = round_fx_sat( s ); /* Q_exc */ //??sat move16(); #else #if ( INTERP_EXP != -1 ) s = L_shl_o( s, INTERP_EXP + 1, &Overflow ); /* Q_exc + Q15 */ #endif excO[j] = round_fx_o( s, &Overflow ); /* Q_exc */ move16(); #endif } return; } Loading Loading @@ -177,9 +199,11 @@ void pred_lt4_tc_fx( Word16 excO[L_SUBFR + 1]; Word32 L_sum; Word16 excI[2 * L_SUBFR]; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif Copy( exc + sub( i_subfr, L_SUBFR ), excI, L_SUBFR * 2 ); /* Q0 */ Loading Loading @@ -212,15 +236,25 @@ void pred_lt4_tc_fx( k += UP_SAMP; L_sum = L_mac( L_sum, x0[i], win[k] ); /* Q15 */ } #ifdef ISSUE_1836_replace_overflow_libcom L_sum = L_shl_sat( L_sum, 1 ); /* Q16 */ //??sat excO[j] = round_fx_sat( L_sum ); /* Q0 */ //??sat #else L_sum = L_shl_o( L_sum, 1, &Overflow ); /* Q16 */ excO[j] = round_fx_o( L_sum, &Overflow ); /* Q0 */ #endif move16(); x0++; } FOR( i = T0; i < L_SUBFR; i++ ) { #ifdef ISSUE_1836_replace_overflow_libcom exc[i + i_subfr] = add_sat( exc[i + i_subfr], mult_r( PIT_SHARP_fx, excO[i] ) ); /* Q0 */ //??sat #else exc[i + i_subfr] = add_o( exc[i + i_subfr], mult_r( PIT_SHARP_fx, excO[i] ), &Overflow ); /* Q0 */ #endif move16(); } } Loading
lib_com/preemph_fx.c +44 −0 Original line number Diff line number Diff line Loading @@ -22,12 +22,23 @@ void preemph_copy_fx( ) { Word16 i, temp; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif temp = x[lg - 1]; /* Qx */ move16(); #ifdef ISSUE_1836_replace_overflow_libcom FOR( i = lg - 1; i > 0; i-- ) { y[i] = msu_r_sat( L_deposit_h( x[i] ), x[i - 1], mu ); /* Qx */ move16(); } y[0] = msu_r_sat( L_deposit_h( x[0] ), *mem, mu ); /* Qx */ //??sat move16(); #else FOR( i = lg - 1; i > 0; i-- ) { y[i] = msu_ro( L_deposit_h( x[i] ), x[i - 1], mu, &Overflow ); /* Qx */ Loading @@ -35,6 +46,8 @@ void preemph_copy_fx( } y[0] = msu_ro( L_deposit_h( x[0] ), *mem, mu, &Overflow ); /* Qx */ move16(); #endif *mem = temp; /* Qx */ move16(); Loading @@ -49,12 +62,23 @@ void preemph_copy_32fx( ) { Word16 i, temp; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif temp = x[lg - 1]; /* Qx */ move16(); #ifdef ISSUE_1836_replace_overflow_libcom FOR( i = lg - 1; i > 0; i-- ) { y[i] = L_msu_sat( L_deposit_h( x[i] ), x[i - 1], mu ); /* Qx+16 */ //??sat move16(); } y[0] = L_msu_sat( L_deposit_h( x[0] ), *mem, mu ); /* Qx+16 */ //??sat move16(); #else FOR( i = lg - 1; i > 0; i-- ) { y[i] = L_msu_o( L_deposit_h( x[i] ), x[i - 1], mu, &Overflow ); /* Qx+16 */ Loading @@ -62,6 +86,7 @@ void preemph_copy_32fx( } y[0] = L_msu_o( L_deposit_h( x[0] ), *mem, mu, &Overflow ); /* Qx+16 */ move16(); #endif *mem = temp; /* Qx */ move16(); Loading Loading @@ -125,13 +150,31 @@ void E_UTIL_f_preemph2( { Word16 i, temp; Word32 L_tmp; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif temp = signal[lg - 1]; /* Qx */ move16(); #ifdef ISSUE_1836_replace_overflow_libcom FOR( i = lg - 1; i > 0; i-- ) { L_tmp = L_mult( signal[i], 16384 ); /* Qx + 15 */ L_tmp = L_msu0_sat( L_tmp, signal[i - 1], mu ); /* Qx + 15 */ //??sat L_tmp = L_shl_sat( L_tmp, add( shift, 1 ) ); /* Qx + shift + 16 */ signal[i] = round_fx_sat( L_tmp ); /* Qx + shift */ //??sat move16(); } L_tmp = L_mult( signal[0], 16384 ); /* Qx + 15 */ L_tmp = L_msu0_sat( L_tmp, *mem, mu ); /* Qx + 15 */ //??sat L_tmp = L_shl_sat( L_tmp, add( shift, 1 ) ); /* Qx + shift + 16 */ signal[0] = round_fx_sat( L_tmp ); /* Qx + shift */ //??sat move16(); #else FOR( i = lg - 1; i > 0; i-- ) { L_tmp = L_mult( signal[i], 16384 ); /* Qx + 15 */ Loading @@ -146,6 +189,7 @@ void E_UTIL_f_preemph2( L_tmp = L_shl_o( L_tmp, add( shift, 1 ), &Overflow ); /* Qx + shift + 16 */ signal[0] = round_fx_o( L_tmp, &Overflow ); /* Qx + shift */ move16(); #endif *mem = temp; /* Qx */ move16(); Loading