Loading lib_com/tools_fx.c +37 −2 Original line number Diff line number Diff line Loading @@ -759,14 +759,26 @@ void Copy_Scale_sig_16_32_DEPREC( move32(); /* saturation can occur here */ } } #define FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST void Copy_Scale_sig_16_32_no_sat( Word16 x[], /* i : signal to scale input Qx */ Word32 y[], /* o : scaled signal output Qx */ Word16 lg, /* i : size of x[] Q0 */ const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ) #else void Copy_Scale_sig_16_32_no_sat( const Word16 x[], /* i : signal to scale input Qx */ Word32 y[], /* o : scaled signal output Qx */ const Word16 lg, /* i : size of x[] Q0 */ const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ) #endif { Word16 i; Word32 L_tmp; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Loading Loading @@ -795,27 +807,50 @@ void Copy_Scale_sig_16_32_no_sat( return; } #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST lg = 1; for (int i_exp = 0; i_exp < 35; i_exp++) { for ( short i_x = 0x8000; i_x < 0x7FFF; i_x ++) { L_tmp = L_shl_o( 1, i_exp - 1, &Overflow ); #else L_tmp = L_shl_o( 1, exp0 - 1, &Overflow ); #endif IF( L_tmp >= 0x7FFF ) { FOR( i = 0; i < lg; i++ ) { #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST x[i] = i_x; #endif // y[i] = L_mult0(x[i], L_tmp); y[i] = W_extract_l( W_mult_32_16( L_tmp, x[i] ) ); move32(); /* saturation can occur here */ } return; } // ELSE ELSE { Word16 tmp = extract_l( L_tmp ); FOR( i = 0; i < lg; i++ ) { #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST x[i] = i_x; #endif y[i] = L_mult( x[i], tmp ); move32(); } } #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST int test = W_extract_l( W_mult_32_16( L_tmp, x[0] ) ); if ( test != y[0] ) assert( 0 ); } //i_x } //i_exp #endif #else L_tmp = L_shl_o( 1, exp0 - 1, &Overflow ); FOR( i = 0; i < lg; i++ ) Loading Loading
lib_com/tools_fx.c +37 −2 Original line number Diff line number Diff line Loading @@ -759,14 +759,26 @@ void Copy_Scale_sig_16_32_DEPREC( move32(); /* saturation can occur here */ } } #define FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST void Copy_Scale_sig_16_32_no_sat( Word16 x[], /* i : signal to scale input Qx */ Word32 y[], /* o : scaled signal output Qx */ Word16 lg, /* i : size of x[] Q0 */ const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ) #else void Copy_Scale_sig_16_32_no_sat( const Word16 x[], /* i : signal to scale input Qx */ Word32 y[], /* o : scaled signal output Qx */ const Word16 lg, /* i : size of x[] Q0 */ const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ) #endif { Word16 i; Word32 L_tmp; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Loading Loading @@ -795,27 +807,50 @@ void Copy_Scale_sig_16_32_no_sat( return; } #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST lg = 1; for (int i_exp = 0; i_exp < 35; i_exp++) { for ( short i_x = 0x8000; i_x < 0x7FFF; i_x ++) { L_tmp = L_shl_o( 1, i_exp - 1, &Overflow ); #else L_tmp = L_shl_o( 1, exp0 - 1, &Overflow ); #endif IF( L_tmp >= 0x7FFF ) { FOR( i = 0; i < lg; i++ ) { #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST x[i] = i_x; #endif // y[i] = L_mult0(x[i], L_tmp); y[i] = W_extract_l( W_mult_32_16( L_tmp, x[i] ) ); move32(); /* saturation can occur here */ } return; } // ELSE ELSE { Word16 tmp = extract_l( L_tmp ); FOR( i = 0; i < lg; i++ ) { #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST x[i] = i_x; #endif y[i] = L_mult( x[i], tmp ); move32(); } } #ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat_TEST int test = W_extract_l( W_mult_32_16( L_tmp, x[0] ) ); if ( test != y[0] ) assert( 0 ); } //i_x } //i_exp #endif #else L_tmp = L_shl_o( 1, exp0 - 1, &Overflow ); FOR( i = 0; i < lg; i++ ) Loading