Loading lib_rend/ivas_masa_merge_fx.c +5 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,11 @@ void diffuse_meta_merge_1x1_fx( tmp = BASOP_Util_Divide3232_Scale( total_diff_nrg_fx, L_add( total_nrg_fx, EPSILON_FX ), &scale ); L_tmp1 = L_deposit_h( tmp ); /* Q( 31 - ( scale + total_nrg_e - total_diff_nrg_e ) ) */ scale = add( scale, sub( total_diff_nrg_e, total_nrg_e ) ); if ( L_tmp1 == 0 ) { scale = 30; move16(); } L_tmp2 = L_sub( L_shl( 1, scale ), L_tmp1 ); L_tmp1 = BASOP_Util_Add_Mant32Exp( dir_ratio_ism_fx, dir_ratio_ism_e, L_tmp2, scale, &tmp ); Loading lib_rend/ivas_mcmasa_ana_fx.c +25 −16 Original line number Diff line number Diff line Loading @@ -952,7 +952,7 @@ void ivas_mcmasa_param_est_ana_fx( temp2 = L_add( temp2, EPSILON_FX ); lsEnergyRelation_fx = BASOP_Util_Divide3232_Scale( temp1, temp2, &lsEnergyRelation_e ); lsEnergyRelation_e = add( lsEnergyRelation_e, sub( temp1_e, temp2_e ) ); lsEnergyRelation_fx = L_shl( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 lsEnergyRelation_fx = L_shl_sat( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 stereoness_fx = Mult_32_32( stereoCoh_fx, lsEnergyRelation_fx ); stereoness_e = stereoCoh_e; move16(); Loading Loading @@ -1105,12 +1105,12 @@ void ivas_mcmasa_param_est_ana_fx( lsEnergySum_fx = L_add_sat( lsEnergySum_fx, EPSILON_FX ); lsEnergyRelation_fx = BASOP_Util_Divide3232_Scale( temp1, lsEnergySum_fx, &lsEnergyRelation_e ); lsEnergyRelation_e = add( lsEnergyRelation_e, sub( temp1_e, lsEnergySum_e ) ); lsEnergyRelation_fx = L_shl( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 lsEnergyRelation_fx = L_shl_sat( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 stereoRatio_fx = L_sub( Mult_32_32( L_shl_sat( stereoCoh_fx, stereoCoh_e ), lsEnergyRelation_fx ), surrCoh_fx ); // Q31 temp2 = L_sub( temp2, EPSILON_FX ); lsEnergyRelation_fx = BASOP_Util_Divide3232_Scale( temp2, lsEnergySum_fx, &lsEnergyRelation_e ); lsEnergyRelation_e = add( lsEnergyRelation_e, sub( temp2_e, lsEnergySum_e ) ); lsEnergyRelation_fx = L_shl( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 lsEnergyRelation_fx = L_shl_sat( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 cohPanRatio_fx = L_sub( Mult_32_32( cohPanCoh_fx, lsEnergyRelation_fx ), surrCoh_fx ); // Q31 IF( GT_32( stereoRatio_fx, cohPanRatio_fx ) ) Loading Loading @@ -1436,6 +1436,8 @@ static void computeVerticalDiffuseness_fx( { Word16 tmp_e1, tmp_e2; tmp = BASOP_Util_Divide3232_Scale( intensity_slow_abs[i], L_add( energy_slow[i], EPSILON_FX_SMALL ), &tmp_e1 ); IF( tmp != 0 ) { tmp_e1 = add( tmp_e1, sub( intensity_slow_e[i], energy_slow_e[i] ) ); tmp = BASOP_Util_Divide3232_Scale( L_sub( tmp, L_shr( VERTICAL_ENERGY_RATIO_OFFSET_FX, tmp_e1 ) ), L_sub( ONE_IN_Q15, VERTICAL_ENERGY_RATIO_OFFSET_FX ), &tmp_e2 ); /* Tuned to avoid effect due to ambience of vertically un-even setups */ tmp_e2 = add( tmp_e2, tmp_e1 ); Loading @@ -1454,6 +1456,13 @@ static void computeVerticalDiffuseness_fx( { tmp = L_shl( tmp, add( 16, tmp_e2 ) ); // Q31 } } ELSE { tmp = ONE_IN_Q31; // Q31 move32(); } diffuseness[i] = tmp; // Q31 move32(); } Loading Loading
lib_rend/ivas_masa_merge_fx.c +5 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,11 @@ void diffuse_meta_merge_1x1_fx( tmp = BASOP_Util_Divide3232_Scale( total_diff_nrg_fx, L_add( total_nrg_fx, EPSILON_FX ), &scale ); L_tmp1 = L_deposit_h( tmp ); /* Q( 31 - ( scale + total_nrg_e - total_diff_nrg_e ) ) */ scale = add( scale, sub( total_diff_nrg_e, total_nrg_e ) ); if ( L_tmp1 == 0 ) { scale = 30; move16(); } L_tmp2 = L_sub( L_shl( 1, scale ), L_tmp1 ); L_tmp1 = BASOP_Util_Add_Mant32Exp( dir_ratio_ism_fx, dir_ratio_ism_e, L_tmp2, scale, &tmp ); Loading
lib_rend/ivas_mcmasa_ana_fx.c +25 −16 Original line number Diff line number Diff line Loading @@ -952,7 +952,7 @@ void ivas_mcmasa_param_est_ana_fx( temp2 = L_add( temp2, EPSILON_FX ); lsEnergyRelation_fx = BASOP_Util_Divide3232_Scale( temp1, temp2, &lsEnergyRelation_e ); lsEnergyRelation_e = add( lsEnergyRelation_e, sub( temp1_e, temp2_e ) ); lsEnergyRelation_fx = L_shl( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 lsEnergyRelation_fx = L_shl_sat( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 stereoness_fx = Mult_32_32( stereoCoh_fx, lsEnergyRelation_fx ); stereoness_e = stereoCoh_e; move16(); Loading Loading @@ -1105,12 +1105,12 @@ void ivas_mcmasa_param_est_ana_fx( lsEnergySum_fx = L_add_sat( lsEnergySum_fx, EPSILON_FX ); lsEnergyRelation_fx = BASOP_Util_Divide3232_Scale( temp1, lsEnergySum_fx, &lsEnergyRelation_e ); lsEnergyRelation_e = add( lsEnergyRelation_e, sub( temp1_e, lsEnergySum_e ) ); lsEnergyRelation_fx = L_shl( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 lsEnergyRelation_fx = L_shl_sat( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 stereoRatio_fx = L_sub( Mult_32_32( L_shl_sat( stereoCoh_fx, stereoCoh_e ), lsEnergyRelation_fx ), surrCoh_fx ); // Q31 temp2 = L_sub( temp2, EPSILON_FX ); lsEnergyRelation_fx = BASOP_Util_Divide3232_Scale( temp2, lsEnergySum_fx, &lsEnergyRelation_e ); lsEnergyRelation_e = add( lsEnergyRelation_e, sub( temp2_e, lsEnergySum_e ) ); lsEnergyRelation_fx = L_shl( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 lsEnergyRelation_fx = L_shl_sat( lsEnergyRelation_fx, add( 16, lsEnergyRelation_e ) ); // Q31 cohPanRatio_fx = L_sub( Mult_32_32( cohPanCoh_fx, lsEnergyRelation_fx ), surrCoh_fx ); // Q31 IF( GT_32( stereoRatio_fx, cohPanRatio_fx ) ) Loading Loading @@ -1436,6 +1436,8 @@ static void computeVerticalDiffuseness_fx( { Word16 tmp_e1, tmp_e2; tmp = BASOP_Util_Divide3232_Scale( intensity_slow_abs[i], L_add( energy_slow[i], EPSILON_FX_SMALL ), &tmp_e1 ); IF( tmp != 0 ) { tmp_e1 = add( tmp_e1, sub( intensity_slow_e[i], energy_slow_e[i] ) ); tmp = BASOP_Util_Divide3232_Scale( L_sub( tmp, L_shr( VERTICAL_ENERGY_RATIO_OFFSET_FX, tmp_e1 ) ), L_sub( ONE_IN_Q15, VERTICAL_ENERGY_RATIO_OFFSET_FX ), &tmp_e2 ); /* Tuned to avoid effect due to ambience of vertically un-even setups */ tmp_e2 = add( tmp_e2, tmp_e1 ); Loading @@ -1454,6 +1456,13 @@ static void computeVerticalDiffuseness_fx( { tmp = L_shl( tmp, add( 16, tmp_e2 ) ); // Q31 } } ELSE { tmp = ONE_IN_Q31; // Q31 move32(); } diffuseness[i] = tmp; // Q31 move32(); } Loading