Loading lib_rend/ivas_dirac_dec_binaural_functions.c +30 −102 Original line number Diff line number Diff line Loading @@ -145,33 +145,6 @@ static void matrixTransp2Mul_fx( Word32 outIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS] /*q_out*/, Word16 *q_out ); #if defined( FIX1072_SPEEDUP_combinedMatrixCalculations ) /* ( (a && b) || (!a && !b) ) = ( ( !a || !b ) && ( a || b )) */ static inline Word32 matrixMul_func1( Word32 cond1, Word32 cond2, Word32 prod ) { Word32 tmp = prod; Word32 cond3 = cond1 && cond2; move32(); if ( cond3 ) tmp = ( L_abs( tmp ) ); if ( cond3 ) tmp = L_negate( tmp ); return tmp; /* IF( ( Are_fx_chA_0_GE_0 && Bre_fx_0_chB_GE_0 ) || ( Are_fx_chA_0_LT_0 && Bre_fx_0_chB_LT_0 ) ) tmp = Mpy_32_32( Are_fx[chA][0], Bre_fx[0][chB] ); ELSE tmp = L_negate( Mpy_32_32( L_abs( Are_fx[chA][0] ), L_abs( Bre_fx[0][chB] ) ) ); */ } #endif /*------------------------------------------------------------------------- * ivas_dirac_dec_init_binaural_data() * Loading Loading @@ -607,8 +580,6 @@ static void ivas_dirac_dec_binaural_internal_fx( const Word16 nchan_transport, const Word16 subframe ) { push_wmops( "IDDBinaural" ); Word16 q_input = 11; move16(); IF( st_ivas->hSCE[0] ) Loading Loading @@ -738,8 +709,6 @@ static void ivas_dirac_dec_binaural_internal_fx( set32_fx( Cldfb_ImagBuffer_in_fx[i][j], 0, 60 ); } } push_wmops( "IDDBinaural: CLDFB Analysis of input" ); /* CLDFB Analysis of input */ FOR( slot = 0; slot < hSpatParamRendCom->subframe_nbslots[subframe]; slot++ ) { Loading Loading @@ -891,9 +860,6 @@ static void ivas_dirac_dec_binaural_internal_fx( } } pop_wmops(); /*push_wmops( "IDDBinaural: CLDFB Analysis of input" )*/ push_wmops( "IDDBinaural: renderer" ); test(); IF( EQ_32( config_data.ivas_format, SBA_FORMAT ) || EQ_32( config_data.ivas_format, SBA_ISM_FORMAT ) ) { Loading @@ -913,10 +879,7 @@ 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(); /*push_wmops( "IDDBinaural: renderer" );*/ push_wmops( "IDDBinaural: Part X1" ); push_wmops( "IDDBinaural: Part X1.1" ); Word16 q_inp = Q6; move16(); FOR( Word16 cha = 0; cha < 6; cha++ ) Loading @@ -932,8 +895,6 @@ static void ivas_dirac_dec_binaural_internal_fx( } } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.1" );*/ push_wmops( "IDDBinaural: Part X1.2" ); test(); test(); test(); Loading @@ -942,8 +903,7 @@ static void ivas_dirac_dec_binaural_internal_fx( /* Un-tested function. No test-case is hitting.*/ ivas_omasa_preProcessStereoTransportsForMovedObjects_fx( st_ivas, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, &q_inp, nBins, subframe ); } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.2" );*/ push_wmops( "IDDBinaural: Part X1.3" ); IF( hCombinedOrientationData ) { FOR( i = 0; i < 3; i++ ) Loading @@ -961,12 +921,9 @@ static void ivas_dirac_dec_binaural_internal_fx( ivas_dirac_dec_binaural_check_and_switch_transports_headtracked_fx( hCombinedOrientationData, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, nBins, hSpatParamRendCom->subframe_nbslots[subframe], Rmat_fx ); } } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.3" );*/ push_wmops( "IDDBinaural: Part X1.4" ); test(); 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(); /*push_wmops( "IDDBinaural: Part X1.4" );*/ push_wmops( "IDDBinaural: Part X1.5" ); IF( EQ_32( config_data.ivas_format, ISM_FORMAT ) ) { Loading Loading @@ -1003,11 +960,9 @@ static void ivas_dirac_dec_binaural_internal_fx( nchanSeparateChannels = (UWord8) st_ivas->nchan_ism; move16(); } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.5" );*/ push_wmops( "IDDBinaural: Part X1.6" ); 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(); /*push_wmops( "IDDBinaural: Part X1.6" );*/ push_wmops( "IDDBinaural: Part X1.7" ); q_inp = Q6; move16(); FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) Loading Loading @@ -1051,12 +1006,9 @@ static void ivas_dirac_dec_binaural_internal_fx( move16(); hDiracDecBin->q_processMtxDecPrev = q_mat; move16(); pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.7" );*/ push_wmops( "IDDBinaural: Part X1.8" ); 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(); /*push_wmops( "IDDBinaural: Part X1.8" );*/ push_wmops( "IDDBinaural: Part X1.9" ); hDiracDecBin->hDiffuseDist = NULL; hSpatParamRendCom->slots_rendered = add( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->subframe_nbslots[subframe] ); Loading @@ -1071,9 +1023,7 @@ static void ivas_dirac_dec_binaural_internal_fx( st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; move16(); } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.9" );*/ pop_wmops(); /*push_wmops( "IDDBinaural: Part X1" );*/ pop_wmops(); /*push_wmops( "IDDBinaural" )*/ return; } Loading Loading @@ -1727,7 +1677,6 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Formulate average diffuseness over frame */ frameMeanDiffuseness = BASOP_Util_Divide3232_Scale_cadence( frameMeanDiffuseness, L_max( EPSILLON_FX, frameMeanDiffusenessEneWeight_fx[bin] ), &exp ); // exp = exp + 31 - q_meanEnePerCh - exp1 exp = sub( exp, sub( sub( 31, q_meanEnePerCh ), exp1 ) ); hDiracDecBin->frameMeanDiffuseness_fx[bin] = L_shl( frameMeanDiffuseness, sub( exp, 2 ) ); // Q29 move32(); } Loading Loading @@ -1898,7 +1847,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( FOR( bin = 0; bin < nBins; bin++ ) { Word32 resultMtxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], resultMtxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], gain_fx; Word32 tmpMtxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], tmpMtxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], resultMtxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], resultMtxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], gain_fx; Word32 CxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], CxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; /* Input covariance matrix */ Word32 realizedOutputEne_fx, targetOutputEne_fx, missingOutputEne_fx; Word32 CrEneL_fx, CrEneR_fx; /* Cr = residual decorrelated sound covariance matrix */ Loading @@ -1906,9 +1855,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( Word32 Mre_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], Mim_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], MdecRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], MdecIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; /* M = mixing matrix; Mdec = residual decorrelated signal mixing matrix */ Word32 prototypeMtx_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS] = { { ONE_IN_Q31, 107374182 }, { 107374182, ONE_IN_Q31 } }; move32(); Word16 q_M, q_Cx, q_res, q_CrEne, q_CrCross, q_Mdec = 0; Word32 tmpMtxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], tmpMtxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; Word16 q_tmp; Word16 q_M, q_Cx, q_tmp, q_res, q_CrEne, q_CrCross, q_Mdec = 0; move16(); Word32 tmp1, tmp2, res1, res2; Word16 q_tmp1, q_tmp2, q_realizedOutputEne, q_targetOutputEne, q_missingOutputEne, q_gain; Loading Loading @@ -2035,7 +1982,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( } /* Make matrix multiplication M*Cx*M' to determine resulting covariance matrix of processing input with M */ matrixMul_fx( Mre_fx, Mim_fx, &q_M, CxRe_fx, CxIm_fx, &q_Cx, tmpMtxRe_fx, tmpMtxIm_fx, &q_tmp ); matrixTransp2Mul_fx( tmpMtxRe_fx, tmpMtxIm_fx, &q_tmp, Mre_fx, Mim_fx, &q_M, Loading Loading @@ -2379,7 +2325,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( } } } /* Aligning Q-factors of all bins in the processing matrices to a common Q-factor */ minimum_s( q_processMtx, nBins, &hDiracDecBin->q_processMtx ); minimum_s( q_processMtxPrev, nBins, &hDiracDecBin->q_processMtxPrev ); Loading Loading @@ -2480,15 +2425,13 @@ static void ivas_dirac_dec_binaural_process_output_fx( Word16 q_inp_mix, q_reverb = 31; move16(); push_wmops( "IDDBinaural: Part X1.8 A" ); IF( processReverb ) { /* Process second / room effect part of binaural output when needed */ ivas_binaural_reverb_processSubframe_fx( hDiracDecBin->hReverb, numInChannels, nSlots, inRe_fx, inIm_fx, reverbRe_fx, reverbIm_fx ); } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 A" );*/ push_wmops( "IDDBinaural: Part X1.8 B" ); // scaling input and reverb to same q// // input scaling is to maintain precision in ivas_dirac_dec_decorrelate_slot fn// Word16 shift = s_min( L_norm_arr( cldfbSynDec[0]->cldfb_state_fx, cldfbSynDec[0]->p_filter_length ), L_norm_arr( cldfbSynDec[1]->cldfb_state_fx, cldfbSynDec[1]->p_filter_length ) ); Loading Loading @@ -2536,9 +2479,7 @@ static void ivas_dirac_dec_binaural_process_output_fx( } } } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 B" );*/ push_wmops( "IDDBinaural: Part X1.8 C" ); // scaling cldfb states to q_result-1// scale_sig32( cldfbSynDec[0]->cldfb_state_fx, cldfbSynDec[0]->p_filter_length, cldfb_state_shift ); cldfbSynDec[0]->Q_cldfb_state = add( cldfbSynDec[0]->Q_cldfb_state, cldfb_state_shift ); Loading @@ -2557,7 +2498,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( move16(); move16(); push_wmops( "IDDBinaural: Part X1.8 C Loop" ); FOR( slot = 0; slot < nSlots; slot++ ) { IF( NE_16( slot, sub( nSlots, 1 ) ) ) Loading @@ -2575,7 +2515,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( ivas_dirac_dec_decorrelate_slot_fx( hDiracDecBin, nBins, slot, inRe_fx, inIm_fx, q_inp_mix, decSlotRe_fx, decSlotIm_fx ); } push_wmops( "IDDBinaural: Part X1.8 C InnerLoop 1" ); FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { Word32 *outSlotRePr_fx, *outSlotImPr_fx; /* Pointers needed for function call compatibility */ Loading @@ -2584,7 +2523,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( set_zero_fx( outSlotIm_fx, CLDFB_NO_CHANNELS_MAX ); /* Processing of the first / HRTF part of the binaural output. */ push_wmops( "IDDBinaural: Part X1.8 C InnerLoop 1 HRTF" ); FOR( chB = 0; chB < numInChannels; chB++ ) { IF( LT_16( chB, BINAURAL_CHANNELS ) ) Loading Loading @@ -2651,7 +2589,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( } } } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 C InnerLoop 1 HRTF" );*/ IF( processReverb ) Loading @@ -2669,10 +2606,7 @@ static void ivas_dirac_dec_binaural_process_output_fx( cldfbSynDec[chA]->Q_cldfb_state = sub( q_result, 1 ); move16(); } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 C InnerLoop 1" );*/ } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 C Loop" );*/ pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 C" );*/ *q_out = sub( q_result, 1 ); move16(); return; Loading Loading @@ -3387,6 +3321,7 @@ static void eig2x2_fx( exp = sub( norm_l( s_fx ), 1 ); tmp2 = Mpy_32_32( s_fx, s_fx ); q_tmp2 = sub( add( q_tmp1, q_tmp1 ), 31 ); tmp2 = BASOP_Util_Add_Mant32Exp( crossSquare_fx, sub( 31, q_crossSquare ), tmp2, sub( 31, q_tmp2 ), &q_tmp2 ); q_tmp2 = sub( 31, q_tmp2 ); Loading Loading @@ -3417,6 +3352,7 @@ static void eig2x2_fx( q_tmp1 = q_c; move16(); } Ure_fx[0][ch] = Mpy_32_32( s_fx, normVal_fx ); move32(); Ure_fx[1][ch] = Mpy_32_32( c_re, normVal_fx ); Loading Loading @@ -3465,7 +3401,6 @@ 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 ); tmp3 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), epsilon_mant, epsilon_exp, &exp_tmp3 ); #if 1 Loading Loading @@ -3581,7 +3516,6 @@ static void matrixDiagMul_fx( return; } static void matrixMul_fx( Word32 Are_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_A*/ Word32 Aim_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_A*/ Loading Loading @@ -3629,7 +3563,7 @@ static void matrixMul_fx( outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], W_extract_h( W_mac_32_32( W_mult_32_32( Are_fx[chA][0], Bim_fx[0][chB] ), Are_fx[chA][1], Bim_fx[1][chB] ) ) ); move32(); #else #if defined( FIX_1113_OPT_DIRAC_BIN_REND ) #ifdef FIX_1113_OPT_DIRAC_BIN_REND outRe_fx[chA][chB] = Msub_32_32( Msub_32_32( Madd_32_32( Mpy_32_32( Are_fx[chA][0], Bre_fx[0][chB] ), Are_fx[chA][1], Bre_fx[1][chB] ), Aim_fx[chA][0], Bim_fx[0][chB] ), Loading Loading @@ -3739,7 +3673,7 @@ static void matrixMul_fx( } outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], L_add( tmp1, tmp2 ) ); move32(); #endif /* FIX_1113_OPT_DIRAC_BIN_REND*/ #endif #endif /* #ifdef IVAS_ENH64_CADENCE_CHANGES */ } } Loading Loading @@ -3776,7 +3710,7 @@ static void matrixTransp1Mul_fx( { FOR( chB = 0; chB < BINAURAL_CHANNELS; chB++ ) { #if defined( FIX_1113_OPT_DIRAC_BIN_REND ) #ifdef FIX_1113_OPT_DIRAC_BIN_REND outRe_fx[chA][chB] = Madd_32_32( Madd_32_32( Madd_32_32( Mpy_32_32( Are_fx[0][chA], Bre_fx[0][chB] ), Are_fx[1][chA], Bre_fx[1][chB] ), Aim_fx[0][chA], Bim_fx[0][chB] ), Loading Loading @@ -3854,7 +3788,7 @@ static void matrixTransp1Mul_fx( tmp2 = L_negate( Mpy_32_32( L_abs( Are_fx[1][chA] ), L_abs( Bim_fx[1][chB] ) ) ); outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], L_add( tmp1, tmp2 ) ); move32(); #endif /* FIX_1113_OPT_DIRAC_BIN_REND*/ #endif } } *q_out = sub( add( q_A, q_B ), 31 ); Loading @@ -3865,10 +3799,10 @@ static void matrixTransp1Mul_fx( *q_out = Q31; move16(); } return; } static void matrixTransp2Mul_fx( Word32 Are_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_A*/ Word32 Aim_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_A*/ Loading Loading @@ -3929,7 +3863,7 @@ static void matrixTransp2Mul_fx( outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], W_extract_h( W_mac_32_32( W_mult_32_32( Are_fx[chA][0], L_negate( Bim_fx[chB][0] ) ), Are_fx[chA][1], L_negate( Bim_fx[chB][1] ) ) ) ); move32(); #else #if defined( FIX_1113_OPT_DIRAC_BIN_REND ) #ifdef FIX_1113_OPT_DIRAC_BIN_REND outRe_fx[chA][chB] = Madd_32_32( Madd_32_32( Madd_32_32( Mpy_32_32( Are_fx[chA][0], Bre_fx[chB][0] ), Are_fx[chA][1], Bre_fx[chB][1] ), Aim_fx[chA][0], Bim_fx[chB][0] ), Loading @@ -3941,7 +3875,6 @@ static void matrixTransp2Mul_fx( Are_fx[chA][1], Bim_fx[chB][1] ); move32(); #else test(); test(); test(); Loading Loading @@ -4009,8 +3942,7 @@ static void matrixTransp2Mul_fx( tmp2 = L_negate( Mpy_32_32( L_abs( Are_fx[chA][1] ), L_abs( -Bim_fx[chB][1] ) ) ); outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], L_add( tmp1, tmp2 ) ); move32(); #endif /* FIX_1113_OPT_DIRAC_BIN_REND*/ #endif #endif /* #ifdef IVAS_ENH64_CADENCE_CHANGES */ } } Loading Loading @@ -4085,7 +4017,15 @@ static void chol2x2_fx( } ELSE { #if defined( FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC ) #ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC outRe[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_re, outRe[0][0], &exp ); move32(); q_re2 = add( sub( 31, exp ), sub( q_c, q_re1 ) ); outIm[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_im, outRe[0][0], &exp ); move32(); q_im = add( sub( 31, exp ), sub( q_c, q_re1 ) ); #else Word32 denom; Word16 den_exp; Word32 my_outRe, my_outIm; Loading @@ -4111,14 +4051,6 @@ static void chol2x2_fx( outIm[1][0] = Mpy_32_32( denom, my_outIm ); move32(); q_im = sub( q_im, den_exp ); #else outRe[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_re, outRe[0][0], &exp ); move32(); q_re2 = add( sub( 31, exp ), sub( q_c, q_re1 ) ); outIm[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_im, outRe[0][0], &exp ); move32(); q_im = add( sub( 31, exp ), sub( q_c, q_re1 ) ); #endif } if ( outRe[1][0] == 0 ) Loading Loading @@ -4270,7 +4202,6 @@ static void chol2x2_fx( temp = BASOP_Util_Divide3232_Scale_cadence( temp, e2, &exp ); q_tmp = add( sub( 31, exp ), sub( q_tmp, q_e ) ); } if ( temp == 0 ) { q_tmp = Q31; Loading Loading @@ -4304,9 +4235,9 @@ static void chol2x2_fx( outRe[0][0] = L_shr( outRe[0][0], sub( q_re3, *q_out ) ); move32(); } return; } static void formulate2x2MixingMatrix_fx( Word32 Ein1_fx, /*q_Ein*/ Word32 Ein2_fx, /*q_Ein*/ Loading Loading @@ -4355,7 +4286,6 @@ static void formulate2x2MixingMatrix_fx( Word32 temp; 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]; set16_fx( hdrm_re[0], 63, i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ); set16_fx( hdrm_im[0], 63, i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ); set16_fx( q_Pre[0], Q31, i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ); Loading Loading @@ -4407,7 +4337,6 @@ static void formulate2x2MixingMatrix_fx( move16(); } // 4611686 = Q62 IF( maxEne_fx == 0 ) { Loading @@ -4426,8 +4355,6 @@ static void formulate2x2MixingMatrix_fx( maxEneDiv_fx = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, maxEne_fx, &exp ); q_maxEneDiv = add( sub( 31, exp ), sub( Q30, q_maxEne ) ); } exp = norm_l( maxEneDiv_fx ); maxEneDiv_fx = L_shl( maxEneDiv_fx, exp ); q_maxEneDiv = add( q_maxEneDiv, exp ); Loading Loading @@ -4572,7 +4499,6 @@ static void formulate2x2MixingMatrix_fx( exp = sub( s_min( L_norm_arr( KyRe_fx[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ), L_norm_arr( KyIm_fx[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ) ), 1 ); scale_sig32( KyRe_fx[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), exp ); scale_sig32( KyIm_fx[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), exp ); q_ky = add( q_ky, exp ); FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) Loading Loading @@ -4705,6 +4631,7 @@ static void formulate2x2MixingMatrix_fx( } } } minimum_s( hdrm_re[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), &exp ); q_temp = exp; move16(); Loading Loading @@ -4873,6 +4800,7 @@ static void formulate2x2MixingMatrix_fx( move32(); } } matrixMul_fx( KyRe_fx, KyIm_fx, &q_ky, Pre_fx, Pim_fx, &q_P, tmpRe_fx, tmpIm_fx, &q_temp ); matrixTransp2Mul_fx( tmpRe_fx, tmpIm_fx, &q_temp, Uxre_fx, Uxim_fx, &q_Ux, Loading Loading
lib_rend/ivas_dirac_dec_binaural_functions.c +30 −102 Original line number Diff line number Diff line Loading @@ -145,33 +145,6 @@ static void matrixTransp2Mul_fx( Word32 outIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS] /*q_out*/, Word16 *q_out ); #if defined( FIX1072_SPEEDUP_combinedMatrixCalculations ) /* ( (a && b) || (!a && !b) ) = ( ( !a || !b ) && ( a || b )) */ static inline Word32 matrixMul_func1( Word32 cond1, Word32 cond2, Word32 prod ) { Word32 tmp = prod; Word32 cond3 = cond1 && cond2; move32(); if ( cond3 ) tmp = ( L_abs( tmp ) ); if ( cond3 ) tmp = L_negate( tmp ); return tmp; /* IF( ( Are_fx_chA_0_GE_0 && Bre_fx_0_chB_GE_0 ) || ( Are_fx_chA_0_LT_0 && Bre_fx_0_chB_LT_0 ) ) tmp = Mpy_32_32( Are_fx[chA][0], Bre_fx[0][chB] ); ELSE tmp = L_negate( Mpy_32_32( L_abs( Are_fx[chA][0] ), L_abs( Bre_fx[0][chB] ) ) ); */ } #endif /*------------------------------------------------------------------------- * ivas_dirac_dec_init_binaural_data() * Loading Loading @@ -607,8 +580,6 @@ static void ivas_dirac_dec_binaural_internal_fx( const Word16 nchan_transport, const Word16 subframe ) { push_wmops( "IDDBinaural" ); Word16 q_input = 11; move16(); IF( st_ivas->hSCE[0] ) Loading Loading @@ -738,8 +709,6 @@ static void ivas_dirac_dec_binaural_internal_fx( set32_fx( Cldfb_ImagBuffer_in_fx[i][j], 0, 60 ); } } push_wmops( "IDDBinaural: CLDFB Analysis of input" ); /* CLDFB Analysis of input */ FOR( slot = 0; slot < hSpatParamRendCom->subframe_nbslots[subframe]; slot++ ) { Loading Loading @@ -891,9 +860,6 @@ static void ivas_dirac_dec_binaural_internal_fx( } } pop_wmops(); /*push_wmops( "IDDBinaural: CLDFB Analysis of input" )*/ push_wmops( "IDDBinaural: renderer" ); test(); IF( EQ_32( config_data.ivas_format, SBA_FORMAT ) || EQ_32( config_data.ivas_format, SBA_ISM_FORMAT ) ) { Loading @@ -913,10 +879,7 @@ 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(); /*push_wmops( "IDDBinaural: renderer" );*/ push_wmops( "IDDBinaural: Part X1" ); push_wmops( "IDDBinaural: Part X1.1" ); Word16 q_inp = Q6; move16(); FOR( Word16 cha = 0; cha < 6; cha++ ) Loading @@ -932,8 +895,6 @@ static void ivas_dirac_dec_binaural_internal_fx( } } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.1" );*/ push_wmops( "IDDBinaural: Part X1.2" ); test(); test(); test(); Loading @@ -942,8 +903,7 @@ static void ivas_dirac_dec_binaural_internal_fx( /* Un-tested function. No test-case is hitting.*/ ivas_omasa_preProcessStereoTransportsForMovedObjects_fx( st_ivas, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, &q_inp, nBins, subframe ); } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.2" );*/ push_wmops( "IDDBinaural: Part X1.3" ); IF( hCombinedOrientationData ) { FOR( i = 0; i < 3; i++ ) Loading @@ -961,12 +921,9 @@ static void ivas_dirac_dec_binaural_internal_fx( ivas_dirac_dec_binaural_check_and_switch_transports_headtracked_fx( hCombinedOrientationData, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, nBins, hSpatParamRendCom->subframe_nbslots[subframe], Rmat_fx ); } } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.3" );*/ push_wmops( "IDDBinaural: Part X1.4" ); test(); 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(); /*push_wmops( "IDDBinaural: Part X1.4" );*/ push_wmops( "IDDBinaural: Part X1.5" ); IF( EQ_32( config_data.ivas_format, ISM_FORMAT ) ) { Loading Loading @@ -1003,11 +960,9 @@ static void ivas_dirac_dec_binaural_internal_fx( nchanSeparateChannels = (UWord8) st_ivas->nchan_ism; move16(); } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.5" );*/ push_wmops( "IDDBinaural: Part X1.6" ); 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(); /*push_wmops( "IDDBinaural: Part X1.6" );*/ push_wmops( "IDDBinaural: Part X1.7" ); q_inp = Q6; move16(); FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) Loading Loading @@ -1051,12 +1006,9 @@ static void ivas_dirac_dec_binaural_internal_fx( move16(); hDiracDecBin->q_processMtxDecPrev = q_mat; move16(); pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.7" );*/ push_wmops( "IDDBinaural: Part X1.8" ); 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(); /*push_wmops( "IDDBinaural: Part X1.8" );*/ push_wmops( "IDDBinaural: Part X1.9" ); hDiracDecBin->hDiffuseDist = NULL; hSpatParamRendCom->slots_rendered = add( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->subframe_nbslots[subframe] ); Loading @@ -1071,9 +1023,7 @@ static void ivas_dirac_dec_binaural_internal_fx( st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; move16(); } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.9" );*/ pop_wmops(); /*push_wmops( "IDDBinaural: Part X1" );*/ pop_wmops(); /*push_wmops( "IDDBinaural" )*/ return; } Loading Loading @@ -1727,7 +1677,6 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Formulate average diffuseness over frame */ frameMeanDiffuseness = BASOP_Util_Divide3232_Scale_cadence( frameMeanDiffuseness, L_max( EPSILLON_FX, frameMeanDiffusenessEneWeight_fx[bin] ), &exp ); // exp = exp + 31 - q_meanEnePerCh - exp1 exp = sub( exp, sub( sub( 31, q_meanEnePerCh ), exp1 ) ); hDiracDecBin->frameMeanDiffuseness_fx[bin] = L_shl( frameMeanDiffuseness, sub( exp, 2 ) ); // Q29 move32(); } Loading Loading @@ -1898,7 +1847,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( FOR( bin = 0; bin < nBins; bin++ ) { Word32 resultMtxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], resultMtxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], gain_fx; Word32 tmpMtxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], tmpMtxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], resultMtxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], resultMtxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], gain_fx; Word32 CxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], CxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; /* Input covariance matrix */ Word32 realizedOutputEne_fx, targetOutputEne_fx, missingOutputEne_fx; Word32 CrEneL_fx, CrEneR_fx; /* Cr = residual decorrelated sound covariance matrix */ Loading @@ -1906,9 +1855,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( Word32 Mre_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], Mim_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], MdecRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], MdecIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; /* M = mixing matrix; Mdec = residual decorrelated signal mixing matrix */ Word32 prototypeMtx_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS] = { { ONE_IN_Q31, 107374182 }, { 107374182, ONE_IN_Q31 } }; move32(); Word16 q_M, q_Cx, q_res, q_CrEne, q_CrCross, q_Mdec = 0; Word32 tmpMtxRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], tmpMtxIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; Word16 q_tmp; Word16 q_M, q_Cx, q_tmp, q_res, q_CrEne, q_CrCross, q_Mdec = 0; move16(); Word32 tmp1, tmp2, res1, res2; Word16 q_tmp1, q_tmp2, q_realizedOutputEne, q_targetOutputEne, q_missingOutputEne, q_gain; Loading Loading @@ -2035,7 +1982,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( } /* Make matrix multiplication M*Cx*M' to determine resulting covariance matrix of processing input with M */ matrixMul_fx( Mre_fx, Mim_fx, &q_M, CxRe_fx, CxIm_fx, &q_Cx, tmpMtxRe_fx, tmpMtxIm_fx, &q_tmp ); matrixTransp2Mul_fx( tmpMtxRe_fx, tmpMtxIm_fx, &q_tmp, Mre_fx, Mim_fx, &q_M, Loading Loading @@ -2379,7 +2325,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( } } } /* Aligning Q-factors of all bins in the processing matrices to a common Q-factor */ minimum_s( q_processMtx, nBins, &hDiracDecBin->q_processMtx ); minimum_s( q_processMtxPrev, nBins, &hDiracDecBin->q_processMtxPrev ); Loading Loading @@ -2480,15 +2425,13 @@ static void ivas_dirac_dec_binaural_process_output_fx( Word16 q_inp_mix, q_reverb = 31; move16(); push_wmops( "IDDBinaural: Part X1.8 A" ); IF( processReverb ) { /* Process second / room effect part of binaural output when needed */ ivas_binaural_reverb_processSubframe_fx( hDiracDecBin->hReverb, numInChannels, nSlots, inRe_fx, inIm_fx, reverbRe_fx, reverbIm_fx ); } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 A" );*/ push_wmops( "IDDBinaural: Part X1.8 B" ); // scaling input and reverb to same q// // input scaling is to maintain precision in ivas_dirac_dec_decorrelate_slot fn// Word16 shift = s_min( L_norm_arr( cldfbSynDec[0]->cldfb_state_fx, cldfbSynDec[0]->p_filter_length ), L_norm_arr( cldfbSynDec[1]->cldfb_state_fx, cldfbSynDec[1]->p_filter_length ) ); Loading Loading @@ -2536,9 +2479,7 @@ static void ivas_dirac_dec_binaural_process_output_fx( } } } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 B" );*/ push_wmops( "IDDBinaural: Part X1.8 C" ); // scaling cldfb states to q_result-1// scale_sig32( cldfbSynDec[0]->cldfb_state_fx, cldfbSynDec[0]->p_filter_length, cldfb_state_shift ); cldfbSynDec[0]->Q_cldfb_state = add( cldfbSynDec[0]->Q_cldfb_state, cldfb_state_shift ); Loading @@ -2557,7 +2498,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( move16(); move16(); push_wmops( "IDDBinaural: Part X1.8 C Loop" ); FOR( slot = 0; slot < nSlots; slot++ ) { IF( NE_16( slot, sub( nSlots, 1 ) ) ) Loading @@ -2575,7 +2515,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( ivas_dirac_dec_decorrelate_slot_fx( hDiracDecBin, nBins, slot, inRe_fx, inIm_fx, q_inp_mix, decSlotRe_fx, decSlotIm_fx ); } push_wmops( "IDDBinaural: Part X1.8 C InnerLoop 1" ); FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { Word32 *outSlotRePr_fx, *outSlotImPr_fx; /* Pointers needed for function call compatibility */ Loading @@ -2584,7 +2523,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( set_zero_fx( outSlotIm_fx, CLDFB_NO_CHANNELS_MAX ); /* Processing of the first / HRTF part of the binaural output. */ push_wmops( "IDDBinaural: Part X1.8 C InnerLoop 1 HRTF" ); FOR( chB = 0; chB < numInChannels; chB++ ) { IF( LT_16( chB, BINAURAL_CHANNELS ) ) Loading Loading @@ -2651,7 +2589,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( } } } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 C InnerLoop 1 HRTF" );*/ IF( processReverb ) Loading @@ -2669,10 +2606,7 @@ static void ivas_dirac_dec_binaural_process_output_fx( cldfbSynDec[chA]->Q_cldfb_state = sub( q_result, 1 ); move16(); } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 C InnerLoop 1" );*/ } pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 C Loop" );*/ pop_wmops(); /*push_wmops( "IDDBinaural: Part X1.8 C" );*/ *q_out = sub( q_result, 1 ); move16(); return; Loading Loading @@ -3387,6 +3321,7 @@ static void eig2x2_fx( exp = sub( norm_l( s_fx ), 1 ); tmp2 = Mpy_32_32( s_fx, s_fx ); q_tmp2 = sub( add( q_tmp1, q_tmp1 ), 31 ); tmp2 = BASOP_Util_Add_Mant32Exp( crossSquare_fx, sub( 31, q_crossSquare ), tmp2, sub( 31, q_tmp2 ), &q_tmp2 ); q_tmp2 = sub( 31, q_tmp2 ); Loading Loading @@ -3417,6 +3352,7 @@ static void eig2x2_fx( q_tmp1 = q_c; move16(); } Ure_fx[0][ch] = Mpy_32_32( s_fx, normVal_fx ); move32(); Ure_fx[1][ch] = Mpy_32_32( c_re, normVal_fx ); Loading Loading @@ -3465,7 +3401,6 @@ 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 ); tmp3 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), epsilon_mant, epsilon_exp, &exp_tmp3 ); #if 1 Loading Loading @@ -3581,7 +3516,6 @@ static void matrixDiagMul_fx( return; } static void matrixMul_fx( Word32 Are_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_A*/ Word32 Aim_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_A*/ Loading Loading @@ -3629,7 +3563,7 @@ static void matrixMul_fx( outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], W_extract_h( W_mac_32_32( W_mult_32_32( Are_fx[chA][0], Bim_fx[0][chB] ), Are_fx[chA][1], Bim_fx[1][chB] ) ) ); move32(); #else #if defined( FIX_1113_OPT_DIRAC_BIN_REND ) #ifdef FIX_1113_OPT_DIRAC_BIN_REND outRe_fx[chA][chB] = Msub_32_32( Msub_32_32( Madd_32_32( Mpy_32_32( Are_fx[chA][0], Bre_fx[0][chB] ), Are_fx[chA][1], Bre_fx[1][chB] ), Aim_fx[chA][0], Bim_fx[0][chB] ), Loading Loading @@ -3739,7 +3673,7 @@ static void matrixMul_fx( } outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], L_add( tmp1, tmp2 ) ); move32(); #endif /* FIX_1113_OPT_DIRAC_BIN_REND*/ #endif #endif /* #ifdef IVAS_ENH64_CADENCE_CHANGES */ } } Loading Loading @@ -3776,7 +3710,7 @@ static void matrixTransp1Mul_fx( { FOR( chB = 0; chB < BINAURAL_CHANNELS; chB++ ) { #if defined( FIX_1113_OPT_DIRAC_BIN_REND ) #ifdef FIX_1113_OPT_DIRAC_BIN_REND outRe_fx[chA][chB] = Madd_32_32( Madd_32_32( Madd_32_32( Mpy_32_32( Are_fx[0][chA], Bre_fx[0][chB] ), Are_fx[1][chA], Bre_fx[1][chB] ), Aim_fx[0][chA], Bim_fx[0][chB] ), Loading Loading @@ -3854,7 +3788,7 @@ static void matrixTransp1Mul_fx( tmp2 = L_negate( Mpy_32_32( L_abs( Are_fx[1][chA] ), L_abs( Bim_fx[1][chB] ) ) ); outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], L_add( tmp1, tmp2 ) ); move32(); #endif /* FIX_1113_OPT_DIRAC_BIN_REND*/ #endif } } *q_out = sub( add( q_A, q_B ), 31 ); Loading @@ -3865,10 +3799,10 @@ static void matrixTransp1Mul_fx( *q_out = Q31; move16(); } return; } static void matrixTransp2Mul_fx( Word32 Are_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_A*/ Word32 Aim_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_A*/ Loading Loading @@ -3929,7 +3863,7 @@ static void matrixTransp2Mul_fx( outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], W_extract_h( W_mac_32_32( W_mult_32_32( Are_fx[chA][0], L_negate( Bim_fx[chB][0] ) ), Are_fx[chA][1], L_negate( Bim_fx[chB][1] ) ) ) ); move32(); #else #if defined( FIX_1113_OPT_DIRAC_BIN_REND ) #ifdef FIX_1113_OPT_DIRAC_BIN_REND outRe_fx[chA][chB] = Madd_32_32( Madd_32_32( Madd_32_32( Mpy_32_32( Are_fx[chA][0], Bre_fx[chB][0] ), Are_fx[chA][1], Bre_fx[chB][1] ), Aim_fx[chA][0], Bim_fx[chB][0] ), Loading @@ -3941,7 +3875,6 @@ static void matrixTransp2Mul_fx( Are_fx[chA][1], Bim_fx[chB][1] ); move32(); #else test(); test(); test(); Loading Loading @@ -4009,8 +3942,7 @@ static void matrixTransp2Mul_fx( tmp2 = L_negate( Mpy_32_32( L_abs( Are_fx[chA][1] ), L_abs( -Bim_fx[chB][1] ) ) ); outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], L_add( tmp1, tmp2 ) ); move32(); #endif /* FIX_1113_OPT_DIRAC_BIN_REND*/ #endif #endif /* #ifdef IVAS_ENH64_CADENCE_CHANGES */ } } Loading Loading @@ -4085,7 +4017,15 @@ static void chol2x2_fx( } ELSE { #if defined( FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC ) #ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC outRe[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_re, outRe[0][0], &exp ); move32(); q_re2 = add( sub( 31, exp ), sub( q_c, q_re1 ) ); outIm[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_im, outRe[0][0], &exp ); move32(); q_im = add( sub( 31, exp ), sub( q_c, q_re1 ) ); #else Word32 denom; Word16 den_exp; Word32 my_outRe, my_outIm; Loading @@ -4111,14 +4051,6 @@ static void chol2x2_fx( outIm[1][0] = Mpy_32_32( denom, my_outIm ); move32(); q_im = sub( q_im, den_exp ); #else outRe[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_re, outRe[0][0], &exp ); move32(); q_re2 = add( sub( 31, exp ), sub( q_c, q_re1 ) ); outIm[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_im, outRe[0][0], &exp ); move32(); q_im = add( sub( 31, exp ), sub( q_c, q_re1 ) ); #endif } if ( outRe[1][0] == 0 ) Loading Loading @@ -4270,7 +4202,6 @@ static void chol2x2_fx( temp = BASOP_Util_Divide3232_Scale_cadence( temp, e2, &exp ); q_tmp = add( sub( 31, exp ), sub( q_tmp, q_e ) ); } if ( temp == 0 ) { q_tmp = Q31; Loading Loading @@ -4304,9 +4235,9 @@ static void chol2x2_fx( outRe[0][0] = L_shr( outRe[0][0], sub( q_re3, *q_out ) ); move32(); } return; } static void formulate2x2MixingMatrix_fx( Word32 Ein1_fx, /*q_Ein*/ Word32 Ein2_fx, /*q_Ein*/ Loading Loading @@ -4355,7 +4286,6 @@ static void formulate2x2MixingMatrix_fx( Word32 temp; 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]; set16_fx( hdrm_re[0], 63, i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ); set16_fx( hdrm_im[0], 63, i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ); set16_fx( q_Pre[0], Q31, i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ); Loading Loading @@ -4407,7 +4337,6 @@ static void formulate2x2MixingMatrix_fx( move16(); } // 4611686 = Q62 IF( maxEne_fx == 0 ) { Loading @@ -4426,8 +4355,6 @@ static void formulate2x2MixingMatrix_fx( maxEneDiv_fx = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, maxEne_fx, &exp ); q_maxEneDiv = add( sub( 31, exp ), sub( Q30, q_maxEne ) ); } exp = norm_l( maxEneDiv_fx ); maxEneDiv_fx = L_shl( maxEneDiv_fx, exp ); q_maxEneDiv = add( q_maxEneDiv, exp ); Loading Loading @@ -4572,7 +4499,6 @@ static void formulate2x2MixingMatrix_fx( exp = sub( s_min( L_norm_arr( KyRe_fx[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ), L_norm_arr( KyIm_fx[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ) ) ), 1 ); scale_sig32( KyRe_fx[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), exp ); scale_sig32( KyIm_fx[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), exp ); q_ky = add( q_ky, exp ); FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) Loading Loading @@ -4705,6 +4631,7 @@ static void formulate2x2MixingMatrix_fx( } } } minimum_s( hdrm_re[0], i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ), &exp ); q_temp = exp; move16(); Loading Loading @@ -4873,6 +4800,7 @@ static void formulate2x2MixingMatrix_fx( move32(); } } matrixMul_fx( KyRe_fx, KyIm_fx, &q_ky, Pre_fx, Pim_fx, &q_P, tmpRe_fx, tmpIm_fx, &q_temp ); matrixTransp2Mul_fx( tmpRe_fx, tmpIm_fx, &q_temp, Uxre_fx, Uxim_fx, &q_Ux, Loading