Loading lib_rend/ivas_dirac_dec_binaural_functions_fx.c +32 −12 Original line number Diff line number Diff line Loading @@ -46,14 +46,14 @@ #include "wmc_auto.h" //#define FIX_1326_SPEEDUP_00 //make sqrt(1) a const - catch bitstreams //no occurence in current bitstream //#define FIX_1326_SPEEDUP_01 // optimize matrixTransp1Mul_fx -> eig2x2_fx : .4 WMOPS //#define FIX_1326_SPEEDUP_02 // speedup eig2x2_fx // .3 WMOPS //#define FIX_1326_SPEEDUP_03 // speedup eig2x2_fx // .1 WMOPS //#define FIX_1326_SPEEDUP_04 // speedup eig2x2_fx // .2 WMOPS //#define FIX_1326_SPEEDUP_05 // div->sqrt =>isqrt // 3.5 WMOPS //Quite bad diffs //#define FIX_1326_SPEEDUP_06 // div->sqrt =>isqrt // 3.0 WMOPS //Quite bad diffs #define FIX_1326_SPEEDUP_07 // div->sqrt =>isqrt // 2.8 WMOPS //Big DIffs , no replacement of divSqrt #define FIX_1326_SPEEDUP_08 // "-" // 3.0 WMOPS //small diffs, PIPELINE GREEN! #define FIX_1326_SPEEDUP_01 // optimize matrixTransp1Mul_fx -> eig2x2_fx : .4 WMOPS #define FIX_1326_SPEEDUP_02 // speedup eig2x2_fx // .3 WMOPS #define FIX_1326_SPEEDUP_03 // speedup eig2x2_fx // .1 WMOPS #define FIX_1326_SPEEDUP_04 // speedup eig2x2_fx // .2 WMOPS //#define FIX_1326_SPEEDUP_05 // div->sqrt =>isqrt // 3.5 WMOPS //Quite bad diffs --> DONT USE //#define FIX_1326_SPEEDUP_06 // div->sqrt =>isqrt // 3.0 WMOPS //Quite bad diffs -- > DONT USE #define FIX_1326_SPEEDUP_07 // div->sqrt =>isqrt // ? WMOPS //Big DIffs , no replacement of divSqrt , PIPELINE GREEN, --> USE #define FIX_1326_SPEEDUP_08 // "-" // 3.0 WMOPS //small diffs, PIPELINE GREEN! -- > USE Word16 slot_fx[4] = { 32767, 16384, 10922, 8192 }; /*------------------------------------------------------------------------- Loading Loading @@ -4521,8 +4521,12 @@ static void formulate2x2MixingMatrix_fx( #ifdef FIX_1326_SPEEDUP_05 { Word16 shift = norm_l( temp ); #if 1 // oldcode temp = BASOP_Util_Add_Mant32Exp( temp, sub( 31, q_ein ), EPSILON_MANT, EPSILON_EXP, &exp_temp ); #else temp = L_add( L_shl( temp, sub( shift, 1 ) ), L_shl_sat( EPSILON_MANT, sub( sub( EPSILON_EXP, shift ), 1 ) ) ); exp_temp = sub( 31, q_ein ); exp_temp = sub( 30, q_ein ); if ( temp == 0 ) { exp_temp = EPSILON_EXP; Loading @@ -4533,6 +4537,7 @@ static void formulate2x2MixingMatrix_fx( temp = EPSILON_MANT; move32(); } #endif temp = ISqrt32( temp, &exp_temp ); shift = sub( 31, q_eout ); Ghat_fx[0] = Mpy_32_32( Sqrt32( E_out1, &shift ), temp ); Loading Loading @@ -4582,8 +4587,11 @@ static void formulate2x2MixingMatrix_fx( #ifdef FIX_1326_SPEEDUP_06 { Word16 shift = norm_l( temp ); #if 0 //oldcode temp = BASOP_Util_Add_Mant32Exp( temp, sub( 31, q_ein ), EPSILON_MANT, EPSILON_EXP, &exp_temp ); #else temp = L_add( L_shl( temp, sub( shift, 1 ) ), L_shl_sat( EPSILON_MANT, sub( sub( EPSILON_EXP, shift ), 1 ) ) ); exp_temp = sub( 31, q_ein ); exp_temp = sub( 31 - 1, q_ein ); if ( temp == 0 ) { exp_temp = add( 0, EPSILON_EXP ); Loading @@ -4592,10 +4600,22 @@ static void formulate2x2MixingMatrix_fx( { temp = L_add( 0, EPSILON_MANT ); } #endif #if 1 //oldcode - new code introduces too much noise push_wmops( "formulate2x2MixingMatrix Division" ); temp = BASOP_Util_Divide3232_Scale_cadence( E_out2, temp, &exp1 ); pop_wmops(); /*push_wmops( "formulate2x2MixingMatrix Division" )*/ exp1 = sub( exp1, sub( q_eout, sub( 31, exp_temp ) ) ); #ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Ghat_fx[1] = Sqrt32( temp, &exp1 ); // Q = 31 - exp1 #endif #else temp = ISqrt32( temp, &exp_temp ); shift = sub( 31, q_eout ); Ghat_fx[1] = Mpy_32_32( temp, ISqrt32( E_out2, &shift ) ); exp_temp = add( shift, exp_temp ); Ghat_fx[1] = Mpy_32_32( temp, Sqrt32( E_out2, &shift ) ); exp1 = add( shift, exp_temp ); #endif } #else { Loading Loading
lib_rend/ivas_dirac_dec_binaural_functions_fx.c +32 −12 Original line number Diff line number Diff line Loading @@ -46,14 +46,14 @@ #include "wmc_auto.h" //#define FIX_1326_SPEEDUP_00 //make sqrt(1) a const - catch bitstreams //no occurence in current bitstream //#define FIX_1326_SPEEDUP_01 // optimize matrixTransp1Mul_fx -> eig2x2_fx : .4 WMOPS //#define FIX_1326_SPEEDUP_02 // speedup eig2x2_fx // .3 WMOPS //#define FIX_1326_SPEEDUP_03 // speedup eig2x2_fx // .1 WMOPS //#define FIX_1326_SPEEDUP_04 // speedup eig2x2_fx // .2 WMOPS //#define FIX_1326_SPEEDUP_05 // div->sqrt =>isqrt // 3.5 WMOPS //Quite bad diffs //#define FIX_1326_SPEEDUP_06 // div->sqrt =>isqrt // 3.0 WMOPS //Quite bad diffs #define FIX_1326_SPEEDUP_07 // div->sqrt =>isqrt // 2.8 WMOPS //Big DIffs , no replacement of divSqrt #define FIX_1326_SPEEDUP_08 // "-" // 3.0 WMOPS //small diffs, PIPELINE GREEN! #define FIX_1326_SPEEDUP_01 // optimize matrixTransp1Mul_fx -> eig2x2_fx : .4 WMOPS #define FIX_1326_SPEEDUP_02 // speedup eig2x2_fx // .3 WMOPS #define FIX_1326_SPEEDUP_03 // speedup eig2x2_fx // .1 WMOPS #define FIX_1326_SPEEDUP_04 // speedup eig2x2_fx // .2 WMOPS //#define FIX_1326_SPEEDUP_05 // div->sqrt =>isqrt // 3.5 WMOPS //Quite bad diffs --> DONT USE //#define FIX_1326_SPEEDUP_06 // div->sqrt =>isqrt // 3.0 WMOPS //Quite bad diffs -- > DONT USE #define FIX_1326_SPEEDUP_07 // div->sqrt =>isqrt // ? WMOPS //Big DIffs , no replacement of divSqrt , PIPELINE GREEN, --> USE #define FIX_1326_SPEEDUP_08 // "-" // 3.0 WMOPS //small diffs, PIPELINE GREEN! -- > USE Word16 slot_fx[4] = { 32767, 16384, 10922, 8192 }; /*------------------------------------------------------------------------- Loading Loading @@ -4521,8 +4521,12 @@ static void formulate2x2MixingMatrix_fx( #ifdef FIX_1326_SPEEDUP_05 { Word16 shift = norm_l( temp ); #if 1 // oldcode temp = BASOP_Util_Add_Mant32Exp( temp, sub( 31, q_ein ), EPSILON_MANT, EPSILON_EXP, &exp_temp ); #else temp = L_add( L_shl( temp, sub( shift, 1 ) ), L_shl_sat( EPSILON_MANT, sub( sub( EPSILON_EXP, shift ), 1 ) ) ); exp_temp = sub( 31, q_ein ); exp_temp = sub( 30, q_ein ); if ( temp == 0 ) { exp_temp = EPSILON_EXP; Loading @@ -4533,6 +4537,7 @@ static void formulate2x2MixingMatrix_fx( temp = EPSILON_MANT; move32(); } #endif temp = ISqrt32( temp, &exp_temp ); shift = sub( 31, q_eout ); Ghat_fx[0] = Mpy_32_32( Sqrt32( E_out1, &shift ), temp ); Loading Loading @@ -4582,8 +4587,11 @@ static void formulate2x2MixingMatrix_fx( #ifdef FIX_1326_SPEEDUP_06 { Word16 shift = norm_l( temp ); #if 0 //oldcode temp = BASOP_Util_Add_Mant32Exp( temp, sub( 31, q_ein ), EPSILON_MANT, EPSILON_EXP, &exp_temp ); #else temp = L_add( L_shl( temp, sub( shift, 1 ) ), L_shl_sat( EPSILON_MANT, sub( sub( EPSILON_EXP, shift ), 1 ) ) ); exp_temp = sub( 31, q_ein ); exp_temp = sub( 31 - 1, q_ein ); if ( temp == 0 ) { exp_temp = add( 0, EPSILON_EXP ); Loading @@ -4592,10 +4600,22 @@ static void formulate2x2MixingMatrix_fx( { temp = L_add( 0, EPSILON_MANT ); } #endif #if 1 //oldcode - new code introduces too much noise push_wmops( "formulate2x2MixingMatrix Division" ); temp = BASOP_Util_Divide3232_Scale_cadence( E_out2, temp, &exp1 ); pop_wmops(); /*push_wmops( "formulate2x2MixingMatrix Division" )*/ exp1 = sub( exp1, sub( q_eout, sub( 31, exp_temp ) ) ); #ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Ghat_fx[1] = Sqrt32( temp, &exp1 ); // Q = 31 - exp1 #endif #else temp = ISqrt32( temp, &exp_temp ); shift = sub( 31, q_eout ); Ghat_fx[1] = Mpy_32_32( temp, ISqrt32( E_out2, &shift ) ); exp_temp = add( shift, exp_temp ); Ghat_fx[1] = Mpy_32_32( temp, Sqrt32( E_out2, &shift ) ); exp1 = add( shift, exp_temp ); #endif } #else { Loading