Loading lib_rend/ivas_dirac_dec_binaural_functions.c +8 −61 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ #include "wmc_auto.h" #if ( BINAURAL_CHANNELS == 2 ) #define FIX1072_SPEEDUP_combinedMatrixCalculations // 2 calls: approx 10.5 mhz //#define FIX1072_SPEEDUP_combinedMatrixCalculations // 2 calls: approx 10.5 mhz - accept regression in failing pipelines #endif Loading Loading @@ -92,6 +92,7 @@ // 0 : 282.704 --> 8 Mhz gain #include <stdio.h> //#define FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_0 // 8Mhz with 1072 issue stream //#define FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_1 // 8Mhz with 1072 issue stream //#define FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_2 //--> leave this inactive (pipeline 374321) Loading Loading @@ -822,7 +823,6 @@ void ivas_dirac_dec_binaural_render_fx( output_length = 0; move16(); push_wmops( "IDR: ivas_dirac_dec_binaural_internal_fx (IDDBI)" ); FOR( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { Word16 n_samples_sf = imult1616( slot_size, hSpatParamRendCom->subframe_nbslots[subframe_idx] ); Loading @@ -838,7 +838,6 @@ void ivas_dirac_dec_binaural_render_fx( /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } pop_wmops(); FOR( ch = 0; ch < nchan_out; ch++ ) { Loading Loading @@ -1031,7 +1030,6 @@ static void ivas_dirac_dec_binaural_internal_fx( } } /* CLDFB Analysis of input */ push_wmops( "IDDBI: CLDFB Analysis of input" ); FOR( slot = 0; slot < hSpatParamRendCom->subframe_nbslots[subframe]; slot++ ) { FOR( ch = 0; ch < numInChannels; ch++ ) Loading Loading @@ -1157,12 +1155,10 @@ static void ivas_dirac_dec_binaural_internal_fx( } } } pop_wmops(); test(); IF( EQ_32( config_data.ivas_format, SBA_FORMAT ) || EQ_32( config_data.ivas_format, SBA_ISM_FORMAT ) ) { push_wmops( "IDDBI: ivas_sba_prototype_renderer_fx" ); hDiracDecBin->hDiffuseDist = &diffuseDistData; ivas_spar_param_to_masa_param_mapping_fx( st_ivas, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_cldfb, subframe ); Loading @@ -1178,7 +1174,6 @@ static void ivas_dirac_dec_binaural_internal_fx( { Scale_sig32( st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[idx], IVAS_MAX_NUM_FB_BANDS, Q22 - Q31 ); /*Q31 to Q22*/ } pop_wmops(); } Word16 q_inp = Q6; Loading Loading @@ -1220,10 +1215,8 @@ static void ivas_dirac_dec_binaural_internal_fx( } test(); push_wmops( "IDDBI: ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices_fx" ); ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, Rmat_fx, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, st_ivas->hMasaIsmData, q_inp ); pop_wmops(); IF( EQ_32( config_data.ivas_format, ISM_FORMAT ) ) { max_band_decorr = 0; Loading Loading @@ -1260,10 +1253,8 @@ static void ivas_dirac_dec_binaural_internal_fx( move16(); } push_wmops( "IDDBI: IDDB_detProcMat_fx" ); ivas_dirac_dec_binaural_determine_processing_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat_fx, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, nchanSeparateChannels, st_ivas->hMasaIsmData ); pop_wmops(); q_inp = Q6; move16(); Loading Loading @@ -1309,9 +1300,7 @@ static void ivas_dirac_dec_binaural_internal_fx( hDiracDecBin->q_processMtxDecPrev = q_mat; move16(); push_wmops( "IDDBI: ivas_dirac_dec_binaural_process_output_fx" ); ivas_dirac_dec_binaural_process_output_fx( hDiracDecBin, hSpatParamRendCom, st_ivas->cldfbSynDec, output_fx, &q_out, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_inp, max_band_decorr, numInChannels, config_data.processReverb, subframe, q_mat ); pop_wmops(); hDiracDecBin->hDiffuseDist = NULL; Loading Loading @@ -2150,7 +2139,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( move16(); } push_wmops( "IDDB_detProcMat_bigLoop1" ); FOR( bin = 0; bin < nBins; bin++ ) { Word32 resultMtxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], resultMtxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], gain_fx; Loading Loading @@ -2311,7 +2299,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( * signal energy to synthesize a signal with the target covariance matrix from the non-decorrelated signals */ IF( LT_16( bin, max_band_decorr ) ) { push_wmops( "IDDB_detProcMat_bigLoop1_bigBranch1" ); Word32 decorrelationReductionFactor_fx; Word16 q_decorrelationReductionFactor; Loading Loading @@ -2414,7 +2401,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( Q31, CrEneL_fx, CrEneR_fx, q_CrEne, CrCrossRe_fx, CrCrossIm_fx, q_CrCross, prototypeMtx_fx, MdecRe_fx, MdecIm_fx, &q_Mdec, 3277 ); // 3277 = 0.2 in Q14 pop_wmops(); /*IDDB_detProcMat_bigLoop1_bigBranch1*/ } ELSE { Loading Loading @@ -2565,7 +2551,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( move16(); UWord8 instantChange = 0; move16(); push_wmops( "IDDB_detProcMat_bigLoop1_bigBranch2" ); exp = sub( 31, hDiracDecBin->q_earlyPartEneCorrection ); tmp1 = Sqrt32( hDiracDecBin->earlyPartEneCorrection_fx[bin], &exp ); Loading Loading @@ -2641,10 +2626,8 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( move16(); } } pop_wmops(); /*IDDB_detProcMat_bigLoop1_bigBranch2*/ } } pop_wmops(); /*IDDB_detProcMat_bigLoop1*/ /* Aligning Q-factors of all bins in the processing matrices to a common Q-factor */ minimum_s( q_processMtx, nBins, &hDiracDecBin->q_processMtx ); Loading Loading @@ -3645,13 +3628,14 @@ static void eig2x2_fx( tmp2 = BASOP_Util_Add_Mant32Exp( crossSquare_fx, sub( 31, q_crossSquare ), tmp2, sub( 31, q_tmp2 ), &q_tmp2 ); q_tmp2 = sub( 31, q_tmp2 ); #if defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT ) && defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_0 ) tmp3 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), epsilon_mant, epsilon_exp, &exp_tmp3 ); #if defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT ) && defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_0 ) exp = exp_tmp3; normVal_fx = ISqrt32( tmp3, &exp ); q_tmp2 = sub( 31, exp ); #else tmp3 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), epsilon_mant, epsilon_exp, &exp_tmp3 ); tmp2 = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, tmp3, &exp ); exp = sub( exp, sub( Q30, sub( 31, exp_tmp3 ) ) ); normVal_fx = Sqrt32( tmp2, &exp ); // q_tmp2 Loading Loading @@ -5026,9 +5010,6 @@ static void formulate2x2MixingMatrix_fx( Word16 q_Pre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], q_Pim[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; Word16 hdrm_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS], hdrm_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; push_wmops( "IDDB_detProcMat_bigLoop1_2x2Matrix" ); push_wmops( "IDDB_2x2Matrix_Part1" ); #ifdef FIX1072_SPEEDUP_formulate2x2MixingMatrix_fx_simple #else set16_fx( hdrm_re[0], 63, i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ); Loading Loading @@ -5139,18 +5120,12 @@ static void formulate2x2MixingMatrix_fx( Cout_im = Mpy_32_32( Cout_im, maxEneDiv_fx ); q_cout = sub( add( q_cout, q_maxEneDiv ), 31 ); pop_wmops(); //( "IDDB_2x2Matrix_Part1" ); push_wmops( "IDDB_2x2Matrix_Part2" ); push_wmops( "IDDB_2x2Matrix_Part2.1" ); push_wmops( "IDDB_2x2Matrix_Part2.1.1" ); /* Cholesky decomposition of target / output covariance matrix */ chol2x2_fx( E_out1, E_out2, q_eout, Cout_re, Cout_im, q_cout, KyRe_fx, KyIm_fx, &q_ky ); /* Eigendecomposition of input covariance matrix */ eig2x2_fx( E_in1, E_in2, q_ein, Cin_re, Cin_im, q_cin, Uxre_fx, Uxim_fx, &q_Ux, Sx_fx, &q_Sx ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.1.1" ); push_wmops( "IDDB_2x2Matrix_Part2.1.2" ); /* Eigendecomposition to Kx -- Ux Sx Ux' -> Kx Kx'*/ exp = sub( 31, q_Sx ); exp1 = sub( 31, q_Sx ); Loading @@ -5164,8 +5139,6 @@ static void formulate2x2MixingMatrix_fx( Sx_fx[1] = L_shr( Sx_fx[1], sub( sub( 31, exp1 ), q_Sx ) ); // q_Sx move32(); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.1.2" ); push_wmops( "IDDB_2x2Matrix_Part2.1.3" ); matrixDiagMul_fx( Uxre_fx, Uxim_fx, q_Ux, Sx_fx, q_Sx, Kxre_fx, Kxim_fx, &q_Kx ); /* Regularize the diagonal Sx for matrix inversion */ Loading @@ -5177,9 +5150,6 @@ static void formulate2x2MixingMatrix_fx( temp = Mpy_32_32( E_in2, 2147484 ); // 2147484 = 0.001f in Q31 temp = L_max( temp, E_in1 ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.1.3" ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.1" ); push_wmops( "IDDB_2x2Matrix_Part2.2" ); #if defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT ) && defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_2 ) /*IF (E_out1 == 0)*/ { Loading Loading @@ -5303,8 +5273,6 @@ static void formulate2x2MixingMatrix_fx( move32(); Ghat_fx[1] = L_shr( Ghat_fx[1], sub( sub( 31, exp1 ), q_Ghat ) ); // q_Ghat move32(); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.2" ); push_wmops( "IDDB_2x2Matrix_Part2.3" ); /* Matrix multiplication, tmp = Ky' * G_hat * Q */ FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) Loading Loading @@ -5335,9 +5303,6 @@ static void formulate2x2MixingMatrix_fx( q_temp = sub( add( q_ky, q_GhatQ ), 31 ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.3" ); push_wmops( "IDDB_2x2Matrix_Part2.4" ); push_wmops( "IDDB_2x2Matrix_Part2.4.1" ); /* A = Ky' * G_hat * Q * Kx (see publication) */ matrixMul_fx( tmpRe_fx, tmpIm_fx, &q_temp, Kxre_fx, Kxim_fx, &q_Kx, Are_fx, Aim_fx, &q_A ); Loading @@ -5351,8 +5316,6 @@ static void formulate2x2MixingMatrix_fx( eig2x2_fx( tmpRe_fx[0][0], tmpRe_fx[1][1], q_temp, tmpRe_fx[1][0], tmpIm_fx[1][0], q_temp, Ure_fx, Uim_fx, &q_U, D_fx, &q_D ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.4.1" ); push_wmops( "IDDB_2x2Matrix_Part2.4.2" ); #if defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT ) && defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_4 ) IF( D_fx[0] == 0 ) { Loading Loading @@ -5426,9 +5389,7 @@ static void formulate2x2MixingMatrix_fx( div_fx[1] = Sqrt32( temp, &exp1 ); // Q = 31 - exp1 move32(); #endif /*FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT*/ pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.4.2" ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.4" ); push_wmops( "IDDB_2x2Matrix_Part2.5" ); q_div = sub( 31, s_max( exp, exp1 ) ); div_fx[0] = L_shr( div_fx[0], sub( sub( 31, exp ), q_div ) ); // q_div Loading Loading @@ -5460,8 +5421,6 @@ static void formulate2x2MixingMatrix_fx( scale_sig32( div_fx, BINAURAL_CHANNELS, exp ); q_div = add( q_div, exp ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.5" ); push_wmops( "IDDB_2x2Matrix_Part2.6" ); FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { FOR( chB = 0; chB < BINAURAL_CHANNELS; chB++ ) Loading Loading @@ -5531,8 +5490,6 @@ static void formulate2x2MixingMatrix_fx( } } } pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.6" ); push_wmops( "IDDB_2x2Matrix_Part2.7" ); minimum_s( hdrm_re[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), &exp ); q_temp = exp; move16(); Loading @@ -5556,10 +5513,7 @@ static void formulate2x2MixingMatrix_fx( 0 /*int Bscale*/, #endif Pre_fx, Pim_fx, &q_P ); /* Nearest orthonormal matrix P to matrix A formulated */ pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.7" ); pop_wmops(); //( "IDDB_2x2Matrix_Part2" ); push_wmops( "IDDB_2x2Matrix_Part3" ); push_wmops( "IDDB_2x2Matrix_Part3.1" ); /* These are the final formulas of the JAES publication M = Ky P Kx^(-1) */ FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { Loading Loading @@ -5617,8 +5571,6 @@ static void formulate2x2MixingMatrix_fx( #endif } } pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part3.1" ); push_wmops( "IDDB_2x2Matrix_Part3.2" ); minimum_s( q_Pre[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), &exp ); q_P = s_min( q_P, exp ); minimum_s( q_Pim[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), &exp ); Loading @@ -5634,8 +5586,6 @@ static void formulate2x2MixingMatrix_fx( move32(); } } pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part3.2" ); push_wmops( "IDDB_2x2Matrix_Part3.3" ); #if defined( FIX1072_SPEEDUP_combinedMatrixCalculations ) combinedMatrixCalculations( KyRe_fx, KyIm_fx, &q_ky, 0 /*scale*/, Pre_fx, Pim_fx, &q_P, 0 /*scale*/, Uxre_fx, Uxim_fx, &q_Ux, 0 /*scale*/, Mre_fx, Mim_fx, q_M ); #else Loading @@ -5648,9 +5598,6 @@ static void formulate2x2MixingMatrix_fx( #endif Mre_fx, Mim_fx, q_M ); #endif /*FIX1072_SPEEDUP_combinedMatrixCalculations*/ pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part3.3" ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part3" ); pop_wmops(); /*IDDB_detProcMat_bigLoop1_2x2Matrix*/ return; } Loading Loading
lib_rend/ivas_dirac_dec_binaural_functions.c +8 −61 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ #include "wmc_auto.h" #if ( BINAURAL_CHANNELS == 2 ) #define FIX1072_SPEEDUP_combinedMatrixCalculations // 2 calls: approx 10.5 mhz //#define FIX1072_SPEEDUP_combinedMatrixCalculations // 2 calls: approx 10.5 mhz - accept regression in failing pipelines #endif Loading Loading @@ -92,6 +92,7 @@ // 0 : 282.704 --> 8 Mhz gain #include <stdio.h> //#define FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_0 // 8Mhz with 1072 issue stream //#define FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_1 // 8Mhz with 1072 issue stream //#define FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_2 //--> leave this inactive (pipeline 374321) Loading Loading @@ -822,7 +823,6 @@ void ivas_dirac_dec_binaural_render_fx( output_length = 0; move16(); push_wmops( "IDR: ivas_dirac_dec_binaural_internal_fx (IDDBI)" ); FOR( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { Word16 n_samples_sf = imult1616( slot_size, hSpatParamRendCom->subframe_nbslots[subframe_idx] ); Loading @@ -838,7 +838,6 @@ void ivas_dirac_dec_binaural_render_fx( /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } pop_wmops(); FOR( ch = 0; ch < nchan_out; ch++ ) { Loading Loading @@ -1031,7 +1030,6 @@ static void ivas_dirac_dec_binaural_internal_fx( } } /* CLDFB Analysis of input */ push_wmops( "IDDBI: CLDFB Analysis of input" ); FOR( slot = 0; slot < hSpatParamRendCom->subframe_nbslots[subframe]; slot++ ) { FOR( ch = 0; ch < numInChannels; ch++ ) Loading Loading @@ -1157,12 +1155,10 @@ static void ivas_dirac_dec_binaural_internal_fx( } } } pop_wmops(); test(); IF( EQ_32( config_data.ivas_format, SBA_FORMAT ) || EQ_32( config_data.ivas_format, SBA_ISM_FORMAT ) ) { push_wmops( "IDDBI: ivas_sba_prototype_renderer_fx" ); hDiracDecBin->hDiffuseDist = &diffuseDistData; ivas_spar_param_to_masa_param_mapping_fx( st_ivas, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_cldfb, subframe ); Loading @@ -1178,7 +1174,6 @@ static void ivas_dirac_dec_binaural_internal_fx( { Scale_sig32( st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[idx], IVAS_MAX_NUM_FB_BANDS, Q22 - Q31 ); /*Q31 to Q22*/ } pop_wmops(); } Word16 q_inp = Q6; Loading Loading @@ -1220,10 +1215,8 @@ static void ivas_dirac_dec_binaural_internal_fx( } test(); push_wmops( "IDDBI: ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices_fx" ); ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, Rmat_fx, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, st_ivas->hMasaIsmData, q_inp ); pop_wmops(); IF( EQ_32( config_data.ivas_format, ISM_FORMAT ) ) { max_band_decorr = 0; Loading Loading @@ -1260,10 +1253,8 @@ static void ivas_dirac_dec_binaural_internal_fx( move16(); } push_wmops( "IDDBI: IDDB_detProcMat_fx" ); ivas_dirac_dec_binaural_determine_processing_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat_fx, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, nchanSeparateChannels, st_ivas->hMasaIsmData ); pop_wmops(); q_inp = Q6; move16(); Loading Loading @@ -1309,9 +1300,7 @@ static void ivas_dirac_dec_binaural_internal_fx( hDiracDecBin->q_processMtxDecPrev = q_mat; move16(); push_wmops( "IDDBI: ivas_dirac_dec_binaural_process_output_fx" ); ivas_dirac_dec_binaural_process_output_fx( hDiracDecBin, hSpatParamRendCom, st_ivas->cldfbSynDec, output_fx, &q_out, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_inp, max_band_decorr, numInChannels, config_data.processReverb, subframe, q_mat ); pop_wmops(); hDiracDecBin->hDiffuseDist = NULL; Loading Loading @@ -2150,7 +2139,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( move16(); } push_wmops( "IDDB_detProcMat_bigLoop1" ); FOR( bin = 0; bin < nBins; bin++ ) { Word32 resultMtxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], resultMtxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], gain_fx; Loading Loading @@ -2311,7 +2299,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( * signal energy to synthesize a signal with the target covariance matrix from the non-decorrelated signals */ IF( LT_16( bin, max_band_decorr ) ) { push_wmops( "IDDB_detProcMat_bigLoop1_bigBranch1" ); Word32 decorrelationReductionFactor_fx; Word16 q_decorrelationReductionFactor; Loading Loading @@ -2414,7 +2401,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( Q31, CrEneL_fx, CrEneR_fx, q_CrEne, CrCrossRe_fx, CrCrossIm_fx, q_CrCross, prototypeMtx_fx, MdecRe_fx, MdecIm_fx, &q_Mdec, 3277 ); // 3277 = 0.2 in Q14 pop_wmops(); /*IDDB_detProcMat_bigLoop1_bigBranch1*/ } ELSE { Loading Loading @@ -2565,7 +2551,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( move16(); UWord8 instantChange = 0; move16(); push_wmops( "IDDB_detProcMat_bigLoop1_bigBranch2" ); exp = sub( 31, hDiracDecBin->q_earlyPartEneCorrection ); tmp1 = Sqrt32( hDiracDecBin->earlyPartEneCorrection_fx[bin], &exp ); Loading Loading @@ -2641,10 +2626,8 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( move16(); } } pop_wmops(); /*IDDB_detProcMat_bigLoop1_bigBranch2*/ } } pop_wmops(); /*IDDB_detProcMat_bigLoop1*/ /* Aligning Q-factors of all bins in the processing matrices to a common Q-factor */ minimum_s( q_processMtx, nBins, &hDiracDecBin->q_processMtx ); Loading Loading @@ -3645,13 +3628,14 @@ static void eig2x2_fx( tmp2 = BASOP_Util_Add_Mant32Exp( crossSquare_fx, sub( 31, q_crossSquare ), tmp2, sub( 31, q_tmp2 ), &q_tmp2 ); q_tmp2 = sub( 31, q_tmp2 ); #if defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT ) && defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_0 ) tmp3 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), epsilon_mant, epsilon_exp, &exp_tmp3 ); #if defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT ) && defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_0 ) exp = exp_tmp3; normVal_fx = ISqrt32( tmp3, &exp ); q_tmp2 = sub( 31, exp ); #else tmp3 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), epsilon_mant, epsilon_exp, &exp_tmp3 ); tmp2 = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, tmp3, &exp ); exp = sub( exp, sub( Q30, sub( 31, exp_tmp3 ) ) ); normVal_fx = Sqrt32( tmp2, &exp ); // q_tmp2 Loading Loading @@ -5026,9 +5010,6 @@ static void formulate2x2MixingMatrix_fx( Word16 q_Pre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], q_Pim[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; Word16 hdrm_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS], hdrm_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; push_wmops( "IDDB_detProcMat_bigLoop1_2x2Matrix" ); push_wmops( "IDDB_2x2Matrix_Part1" ); #ifdef FIX1072_SPEEDUP_formulate2x2MixingMatrix_fx_simple #else set16_fx( hdrm_re[0], 63, i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ); Loading Loading @@ -5139,18 +5120,12 @@ static void formulate2x2MixingMatrix_fx( Cout_im = Mpy_32_32( Cout_im, maxEneDiv_fx ); q_cout = sub( add( q_cout, q_maxEneDiv ), 31 ); pop_wmops(); //( "IDDB_2x2Matrix_Part1" ); push_wmops( "IDDB_2x2Matrix_Part2" ); push_wmops( "IDDB_2x2Matrix_Part2.1" ); push_wmops( "IDDB_2x2Matrix_Part2.1.1" ); /* Cholesky decomposition of target / output covariance matrix */ chol2x2_fx( E_out1, E_out2, q_eout, Cout_re, Cout_im, q_cout, KyRe_fx, KyIm_fx, &q_ky ); /* Eigendecomposition of input covariance matrix */ eig2x2_fx( E_in1, E_in2, q_ein, Cin_re, Cin_im, q_cin, Uxre_fx, Uxim_fx, &q_Ux, Sx_fx, &q_Sx ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.1.1" ); push_wmops( "IDDB_2x2Matrix_Part2.1.2" ); /* Eigendecomposition to Kx -- Ux Sx Ux' -> Kx Kx'*/ exp = sub( 31, q_Sx ); exp1 = sub( 31, q_Sx ); Loading @@ -5164,8 +5139,6 @@ static void formulate2x2MixingMatrix_fx( Sx_fx[1] = L_shr( Sx_fx[1], sub( sub( 31, exp1 ), q_Sx ) ); // q_Sx move32(); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.1.2" ); push_wmops( "IDDB_2x2Matrix_Part2.1.3" ); matrixDiagMul_fx( Uxre_fx, Uxim_fx, q_Ux, Sx_fx, q_Sx, Kxre_fx, Kxim_fx, &q_Kx ); /* Regularize the diagonal Sx for matrix inversion */ Loading @@ -5177,9 +5150,6 @@ static void formulate2x2MixingMatrix_fx( temp = Mpy_32_32( E_in2, 2147484 ); // 2147484 = 0.001f in Q31 temp = L_max( temp, E_in1 ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.1.3" ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.1" ); push_wmops( "IDDB_2x2Matrix_Part2.2" ); #if defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT ) && defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_2 ) /*IF (E_out1 == 0)*/ { Loading Loading @@ -5303,8 +5273,6 @@ static void formulate2x2MixingMatrix_fx( move32(); Ghat_fx[1] = L_shr( Ghat_fx[1], sub( sub( 31, exp1 ), q_Ghat ) ); // q_Ghat move32(); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.2" ); push_wmops( "IDDB_2x2Matrix_Part2.3" ); /* Matrix multiplication, tmp = Ky' * G_hat * Q */ FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) Loading Loading @@ -5335,9 +5303,6 @@ static void formulate2x2MixingMatrix_fx( q_temp = sub( add( q_ky, q_GhatQ ), 31 ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.3" ); push_wmops( "IDDB_2x2Matrix_Part2.4" ); push_wmops( "IDDB_2x2Matrix_Part2.4.1" ); /* A = Ky' * G_hat * Q * Kx (see publication) */ matrixMul_fx( tmpRe_fx, tmpIm_fx, &q_temp, Kxre_fx, Kxim_fx, &q_Kx, Are_fx, Aim_fx, &q_A ); Loading @@ -5351,8 +5316,6 @@ static void formulate2x2MixingMatrix_fx( eig2x2_fx( tmpRe_fx[0][0], tmpRe_fx[1][1], q_temp, tmpRe_fx[1][0], tmpIm_fx[1][0], q_temp, Ure_fx, Uim_fx, &q_U, D_fx, &q_D ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.4.1" ); push_wmops( "IDDB_2x2Matrix_Part2.4.2" ); #if defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT ) && defined( FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT_4 ) IF( D_fx[0] == 0 ) { Loading Loading @@ -5426,9 +5389,7 @@ static void formulate2x2MixingMatrix_fx( div_fx[1] = Sqrt32( temp, &exp1 ); // Q = 31 - exp1 move32(); #endif /*FIX_1072_REPLACE_DIV_SQRT_BY_ISQRT*/ pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.4.2" ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.4" ); push_wmops( "IDDB_2x2Matrix_Part2.5" ); q_div = sub( 31, s_max( exp, exp1 ) ); div_fx[0] = L_shr( div_fx[0], sub( sub( 31, exp ), q_div ) ); // q_div Loading Loading @@ -5460,8 +5421,6 @@ static void formulate2x2MixingMatrix_fx( scale_sig32( div_fx, BINAURAL_CHANNELS, exp ); q_div = add( q_div, exp ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.5" ); push_wmops( "IDDB_2x2Matrix_Part2.6" ); FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { FOR( chB = 0; chB < BINAURAL_CHANNELS; chB++ ) Loading Loading @@ -5531,8 +5490,6 @@ static void formulate2x2MixingMatrix_fx( } } } pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.6" ); push_wmops( "IDDB_2x2Matrix_Part2.7" ); minimum_s( hdrm_re[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), &exp ); q_temp = exp; move16(); Loading @@ -5556,10 +5513,7 @@ static void formulate2x2MixingMatrix_fx( 0 /*int Bscale*/, #endif Pre_fx, Pim_fx, &q_P ); /* Nearest orthonormal matrix P to matrix A formulated */ pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part2.7" ); pop_wmops(); //( "IDDB_2x2Matrix_Part2" ); push_wmops( "IDDB_2x2Matrix_Part3" ); push_wmops( "IDDB_2x2Matrix_Part3.1" ); /* These are the final formulas of the JAES publication M = Ky P Kx^(-1) */ FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { Loading Loading @@ -5617,8 +5571,6 @@ static void formulate2x2MixingMatrix_fx( #endif } } pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part3.1" ); push_wmops( "IDDB_2x2Matrix_Part3.2" ); minimum_s( q_Pre[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), &exp ); q_P = s_min( q_P, exp ); minimum_s( q_Pim[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), &exp ); Loading @@ -5634,8 +5586,6 @@ static void formulate2x2MixingMatrix_fx( move32(); } } pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part3.2" ); push_wmops( "IDDB_2x2Matrix_Part3.3" ); #if defined( FIX1072_SPEEDUP_combinedMatrixCalculations ) combinedMatrixCalculations( KyRe_fx, KyIm_fx, &q_ky, 0 /*scale*/, Pre_fx, Pim_fx, &q_P, 0 /*scale*/, Uxre_fx, Uxim_fx, &q_Ux, 0 /*scale*/, Mre_fx, Mim_fx, q_M ); #else Loading @@ -5648,9 +5598,6 @@ static void formulate2x2MixingMatrix_fx( #endif Mre_fx, Mim_fx, q_M ); #endif /*FIX1072_SPEEDUP_combinedMatrixCalculations*/ pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part3.3" ); pop_wmops(); // push_wmops( "IDDB_2x2Matrix_Part3" ); pop_wmops(); /*IDDB_detProcMat_bigLoop1_2x2Matrix*/ return; } Loading