diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index af3d9000c0a7294f28d75a12b44302a0787de678..5bb0dfe1fc25f15363fe1155dd6fad2425c48697 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -3471,47 +3471,18 @@ void protoSignalComputation2_fx( // 20480 = 10 in Q11 lr_total_bb_ratio_fx = Mpy_32_16_1( temp, 20480 ); // Q21 - temp = Mpy_32_32( a_fx, left_hi_power_fx ); // 2*(q_cldfb+min_q_shift) -31 - IF( LT_16( q_temp, stereo_type_detect->q_left_hi_power ) ) - { - stereo_type_detect->left_hi_power_fx = L_add( temp, L_shr( Mpy_32_32( b_fx, stereo_type_detect->left_hi_power_fx ), sub( stereo_type_detect->q_left_hi_power, q_temp ) ) ); // q_temp - move32(); - stereo_type_detect->q_left_hi_power = q_temp; - move16(); - } - ELSE - { - stereo_type_detect->left_hi_power_fx = L_add( L_shr( temp, sub( q_temp, stereo_type_detect->q_left_hi_power ) ), Mpy_32_32( b_fx, stereo_type_detect->left_hi_power_fx ) ); // stereo_type_detect->q_left_hi_power - move32(); - } - - temp = Mpy_32_32( a_fx, right_hi_power_fx ); // 2*(q_cldfb+min_q_shift) -31 - IF( LT_16( q_temp, stereo_type_detect->q_right_hi_power ) ) - { - stereo_type_detect->right_hi_power_fx = L_add( temp, L_shr( Mpy_32_32( b_fx, stereo_type_detect->right_hi_power_fx ), sub( stereo_type_detect->q_right_hi_power, q_temp ) ) ); // q_temp - move32(); - stereo_type_detect->q_right_hi_power = q_temp; - move16(); - } - ELSE - { - stereo_type_detect->right_hi_power_fx = L_add( L_shr( temp, sub( q_temp, stereo_type_detect->q_right_hi_power ) ), Mpy_32_32( b_fx, stereo_type_detect->right_hi_power_fx ) ); // stereo_type_detect->q_right_hi_power - move32(); - } - - temp = Mpy_32_32( a_fx, total_hi_power_fx ); // 2*(q_cldfb+min_q_shift) -31 - IF( LT_16( q_temp, stereo_type_detect->q_total_hi_power ) ) - { - stereo_type_detect->total_hi_power_fx = L_add( temp, L_shr( Mpy_32_32( b_fx, stereo_type_detect->total_hi_power_fx ), sub( stereo_type_detect->q_total_hi_power, q_temp ) ) ); // q_temp - move32(); - stereo_type_detect->q_total_hi_power = q_temp; - move16(); - } - ELSE - { - stereo_type_detect->total_hi_power_fx = L_add( L_shr( temp, sub( q_temp, stereo_type_detect->q_total_hi_power ) ), Mpy_32_32( b_fx, stereo_type_detect->total_hi_power_fx ) ); // stereo_type_detect->q_total_hi_power - move32(); - } + stereo_type_detect->left_hi_power_fx = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, left_hi_power_fx ), sub( 31, q_temp ), Mpy_32_32( b_fx, stereo_type_detect->left_hi_power_fx ), sub( 31, stereo_type_detect->q_left_hi_power ), &stereo_type_detect->q_left_hi_power ); + move32(); + stereo_type_detect->q_left_hi_power = sub( 31, stereo_type_detect->q_left_hi_power ); + move16(); + stereo_type_detect->right_hi_power_fx = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, right_hi_power_fx ), sub( 31, q_temp ), Mpy_32_32( b_fx, stereo_type_detect->right_hi_power_fx ), sub( 31, stereo_type_detect->q_right_hi_power ), &stereo_type_detect->q_right_hi_power ); + move32(); + stereo_type_detect->q_right_hi_power = sub( 31, stereo_type_detect->q_right_hi_power ); + move16(); + stereo_type_detect->total_hi_power_fx = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, total_hi_power_fx ), sub( 31, q_temp ), Mpy_32_32( b_fx, stereo_type_detect->total_hi_power_fx ), sub( 31, stereo_type_detect->q_total_hi_power ), &stereo_type_detect->q_total_hi_power ); + move32(); + stereo_type_detect->q_total_hi_power = sub( 31, stereo_type_detect->q_total_hi_power ); + move16(); IF( LT_16( stereo_type_detect->q_left_hi_power, stereo_type_detect->q_right_hi_power ) ) {