Loading lib_rend/ivas_dirac_dec_binaural_functions_fx.c +11 −17 Original line number Diff line number Diff line Loading @@ -1432,7 +1432,6 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric diffuseness_fx = 0; move32(); } IF( isIsmDirection ) { /* Objects cause lesser decorrelation reduction, to avoid removing all decorrelation when only objects are present */ Loading @@ -1442,6 +1441,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric { diffusenessValForDecorrelationReduction_fx = L_sub( diffusenessValForDecorrelationReduction_fx, ratio_fx ); /*Q30*/ } IF( separateCenterChannelRendering ) { /* In masa + mono rendering mode, the center directions originate from phantom sources, so the Loading Loading @@ -1527,7 +1527,6 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric L_add( Mpy_32_32( lImagpTmp_fx, lImagpTmp_fx ), // Q25 L_add( Mpy_32_32( rRealpTmp_fx, rRealpTmp_fx ), // Q25 Mpy_32_32( rImagpTmp_fx, rImagpTmp_fx ) ) ) ); // Q25 lRealp_fx = L_add( lRealp_fx, Mpy_32_32( sidesMul_fx, lRealpTmp_fx ) ); // Q25 lImagp_fx = L_add( lImagp_fx, Mpy_32_32( sidesMul_fx, lImagpTmp_fx ) ); // Q25 rRealp_fx = L_add( rRealp_fx, Mpy_32_32( sidesMul_fx, rRealpTmp_fx ) ); // Q25 Loading Loading @@ -2162,7 +2161,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( exp = sub( get_min_scalefactor( resultMtxRe_fx[0][0], resultMtxRe_fx[1][1] ), 2 ); tmp2 = L_add( L_shl( resultMtxRe_fx[0][0], exp ), L_shl( resultMtxRe_fx[1][1], exp ) ); q_tmp2 = add( q_res, exp ); IF( LT_16( q_CrEne, q_tmp2 ) ) { realizedOutputEne_fx = L_add( tmp1, L_shr( tmp2, sub( q_tmp2, q_CrEne ) ) ); Loading Loading @@ -2198,6 +2196,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( q_missingOutputEne = q_targetOutputEne; move16(); } tmp1 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), missingOutputEne_fx, sub( 31, q_missingOutputEne ), &exp1 ); #ifdef FIX_1326_SPEEDUP_13 Loading Loading @@ -2258,7 +2257,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( q_processMtxDec_bin = q_processMtxDec[bin]; move16(); move16(); /* Store processing matrices */ FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { Loading Loading @@ -3216,6 +3214,7 @@ static void eig2x2_fx( a_fx = (e1 + e2) * (e1 + e2) - 4.0f * ((e1 * e2) - crossSquare_fx) = (e1 - e2)^2 + 4 * crossSquare_fx pm_fx = 0.5f * sqrtf(max(0.0f, a_fx)) add_fx = 0.5f * (e1 + e2)*/ IF( L_and( c_re == 0, c_im == 0 ) ) { /* if c_re = 0 and c_im = 0, then crossSquare_fx = (c_re * c_re) + (c_im * c_im) = 0 Loading Loading @@ -3345,7 +3344,6 @@ static void eig2x2_fx( #endif /* Numeric case, when input is near an identity matrix with a gain */ tmp1 = Mpy_32_32( 2147484, add_fx ); // 2147484 = 1e-3f in Q31 IF( LT_16( q_tmp1, q_tmp2 ) ) Loading Loading @@ -3425,6 +3423,7 @@ static void eig2x2_fx( #else tmp2 = BASOP_Util_Add_Mant32Exp( crossSquare_fx, sub( 31, q_crossSquare ), tmp2, sub( 31, q_tmp2 ), &q_tmp2 ); q_tmp2 = sub( 31, q_tmp2 ); tmp3 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), epsilon_mant, epsilon_exp, &exp_tmp3 ); #endif Loading Loading @@ -3513,6 +3512,7 @@ static void eig2x2_fx( #else tmp2 = BASOP_Util_Add_Mant32Exp( crossSquare_fx, sub( 31, q_crossSquare ), tmp2, sub( 31, q_tmp2 ), &q_tmp2 ); q_tmp2 = sub( 31, q_tmp2 ); tmp3 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), epsilon_mant, epsilon_exp, &exp_tmp3 ); #endif Loading Loading @@ -4563,13 +4563,13 @@ static void formulate2x2MixingMatrix_fx( ELSE { temp = BASOP_Util_Add_Mant32Exp( temp, sub( 31, q_ein ), EPSILON_MANT, EPSILON_EXP, &exp_temp ); temp = BASOP_Util_Divide3232_Scale_cadence( E_out1, temp, &exp ); exp = sub( exp, sub( q_eout, sub( 31, exp_temp ) ) ); #ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Ghat_fx[0] = Sqrt32( temp, &exp ); // Q = 31 - exp #endif } #ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Ghat_fx[0] = Sqrt32( temp, &exp ); // Q = 31 - exp #endif Loading Loading @@ -4599,19 +4599,14 @@ static void formulate2x2MixingMatrix_fx( } ELSE { if ( E_out2 == 0 ) { static int a = 0; a++; } temp = BASOP_Util_Add_Mant32Exp( temp, sub( 31, q_ein ), EPSILON_MANT, EPSILON_EXP, &exp_temp ); temp = BASOP_Util_Divide3232_Scale_cadence( E_out2, temp, &exp1 ); 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 } #ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Ghat_fx[1] = Sqrt32( temp, &exp1 ); // Q = 31 - exp1 #endif Loading Loading @@ -4796,7 +4791,6 @@ static void formulate2x2MixingMatrix_fx( div_fx[1] = L_shr( div_fx[1], sub( sub( 31, exp1 ), q_div ) ); // q_div move32(); // 1310720000 = 10,000.0f in Q17 IF( LT_16( q_div, Q17 ) ) { Loading Loading
lib_rend/ivas_dirac_dec_binaural_functions_fx.c +11 −17 Original line number Diff line number Diff line Loading @@ -1432,7 +1432,6 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric diffuseness_fx = 0; move32(); } IF( isIsmDirection ) { /* Objects cause lesser decorrelation reduction, to avoid removing all decorrelation when only objects are present */ Loading @@ -1442,6 +1441,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric { diffusenessValForDecorrelationReduction_fx = L_sub( diffusenessValForDecorrelationReduction_fx, ratio_fx ); /*Q30*/ } IF( separateCenterChannelRendering ) { /* In masa + mono rendering mode, the center directions originate from phantom sources, so the Loading Loading @@ -1527,7 +1527,6 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric L_add( Mpy_32_32( lImagpTmp_fx, lImagpTmp_fx ), // Q25 L_add( Mpy_32_32( rRealpTmp_fx, rRealpTmp_fx ), // Q25 Mpy_32_32( rImagpTmp_fx, rImagpTmp_fx ) ) ) ); // Q25 lRealp_fx = L_add( lRealp_fx, Mpy_32_32( sidesMul_fx, lRealpTmp_fx ) ); // Q25 lImagp_fx = L_add( lImagp_fx, Mpy_32_32( sidesMul_fx, lImagpTmp_fx ) ); // Q25 rRealp_fx = L_add( rRealp_fx, Mpy_32_32( sidesMul_fx, rRealpTmp_fx ) ); // Q25 Loading Loading @@ -2162,7 +2161,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( exp = sub( get_min_scalefactor( resultMtxRe_fx[0][0], resultMtxRe_fx[1][1] ), 2 ); tmp2 = L_add( L_shl( resultMtxRe_fx[0][0], exp ), L_shl( resultMtxRe_fx[1][1], exp ) ); q_tmp2 = add( q_res, exp ); IF( LT_16( q_CrEne, q_tmp2 ) ) { realizedOutputEne_fx = L_add( tmp1, L_shr( tmp2, sub( q_tmp2, q_CrEne ) ) ); Loading Loading @@ -2198,6 +2196,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( q_missingOutputEne = q_targetOutputEne; move16(); } tmp1 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), missingOutputEne_fx, sub( 31, q_missingOutputEne ), &exp1 ); #ifdef FIX_1326_SPEEDUP_13 Loading Loading @@ -2258,7 +2257,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( q_processMtxDec_bin = q_processMtxDec[bin]; move16(); move16(); /* Store processing matrices */ FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { Loading Loading @@ -3216,6 +3214,7 @@ static void eig2x2_fx( a_fx = (e1 + e2) * (e1 + e2) - 4.0f * ((e1 * e2) - crossSquare_fx) = (e1 - e2)^2 + 4 * crossSquare_fx pm_fx = 0.5f * sqrtf(max(0.0f, a_fx)) add_fx = 0.5f * (e1 + e2)*/ IF( L_and( c_re == 0, c_im == 0 ) ) { /* if c_re = 0 and c_im = 0, then crossSquare_fx = (c_re * c_re) + (c_im * c_im) = 0 Loading Loading @@ -3345,7 +3344,6 @@ static void eig2x2_fx( #endif /* Numeric case, when input is near an identity matrix with a gain */ tmp1 = Mpy_32_32( 2147484, add_fx ); // 2147484 = 1e-3f in Q31 IF( LT_16( q_tmp1, q_tmp2 ) ) Loading Loading @@ -3425,6 +3423,7 @@ static void eig2x2_fx( #else tmp2 = BASOP_Util_Add_Mant32Exp( crossSquare_fx, sub( 31, q_crossSquare ), tmp2, sub( 31, q_tmp2 ), &q_tmp2 ); q_tmp2 = sub( 31, q_tmp2 ); tmp3 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), epsilon_mant, epsilon_exp, &exp_tmp3 ); #endif Loading Loading @@ -3513,6 +3512,7 @@ static void eig2x2_fx( #else tmp2 = BASOP_Util_Add_Mant32Exp( crossSquare_fx, sub( 31, q_crossSquare ), tmp2, sub( 31, q_tmp2 ), &q_tmp2 ); q_tmp2 = sub( 31, q_tmp2 ); tmp3 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), epsilon_mant, epsilon_exp, &exp_tmp3 ); #endif Loading Loading @@ -4563,13 +4563,13 @@ static void formulate2x2MixingMatrix_fx( ELSE { temp = BASOP_Util_Add_Mant32Exp( temp, sub( 31, q_ein ), EPSILON_MANT, EPSILON_EXP, &exp_temp ); temp = BASOP_Util_Divide3232_Scale_cadence( E_out1, temp, &exp ); exp = sub( exp, sub( q_eout, sub( 31, exp_temp ) ) ); #ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Ghat_fx[0] = Sqrt32( temp, &exp ); // Q = 31 - exp #endif } #ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Ghat_fx[0] = Sqrt32( temp, &exp ); // Q = 31 - exp #endif Loading Loading @@ -4599,19 +4599,14 @@ static void formulate2x2MixingMatrix_fx( } ELSE { if ( E_out2 == 0 ) { static int a = 0; a++; } temp = BASOP_Util_Add_Mant32Exp( temp, sub( 31, q_ein ), EPSILON_MANT, EPSILON_EXP, &exp_temp ); temp = BASOP_Util_Divide3232_Scale_cadence( E_out2, temp, &exp1 ); 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 } #ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Ghat_fx[1] = Sqrt32( temp, &exp1 ); // Q = 31 - exp1 #endif Loading Loading @@ -4796,7 +4791,6 @@ static void formulate2x2MixingMatrix_fx( div_fx[1] = L_shr( div_fx[1], sub( sub( 31, exp1 ), q_div ) ); // q_div move32(); // 1310720000 = 10,000.0f in Q17 IF( LT_16( q_div, Q17 ) ) { Loading