From e529a0e9ceeb99fe54970194829a0c07bb276a46 Mon Sep 17 00:00:00 2001 From: Thomas Dettbarn Date: Thu, 3 Apr 2025 10:07:06 +0200 Subject: [PATCH 1/5] renamed Cy_fx, Cy_e, Cx_fx and Cx_e to Cy_sum_fx, Cy_sum_e, Cx_sum_fx, Cx_sum_e. --- lib_enc/ivas_mc_param_enc_fx.c | 50 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib_enc/ivas_mc_param_enc_fx.c b/lib_enc/ivas_mc_param_enc_fx.c index 92cd33e2f..06b9d9913 100644 --- a/lib_enc/ivas_mc_param_enc_fx.c +++ b/lib_enc/ivas_mc_param_enc_fx.c @@ -59,11 +59,11 @@ static void ivas_param_mc_range_encoder_fx( const Word16 *seq_in, const Word16 n #define ATTACKTHRESHOLD_E 4 -static void ivas_param_mc_quantize_ilds_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 Cy_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word16 Cy_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word32 Cx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], Word16 Cx_fx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const Word16 freq_idx, const Word16 nchan_input, const Word16 nchan_transport, Word16 *ILD_idx_out, Word16 ILD_q[PARAM_MC_SZ_ILD_MAP] ); +static void ivas_param_mc_quantize_ilds_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 Cy_sum_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word16 Cy_sum_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word32 Cx_sum_fx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], Word16 Cx_sum_e[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const Word16 freq_idx, const Word16 nchan_input, const Word16 nchan_transport, Word16 *ILD_idx_out, Word16 ILD_q[PARAM_MC_SZ_ILD_MAP] ); static void ivas_param_mc_parameter_quantizer_fx( const Word32 *x, const Word16 *x_e, const Word16 L, const Word16 sz_quantizer, const Word16 *quantizer_fx, const Word16 Q_quant, Word16 *quant_idx, Word16 *y ); -static void ivas_param_mc_quantize_iccs_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 Cy_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word16 Cy_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], const Word16 freq_idx, const Word16 nchan_input, Word16 *ICC_idx_out ); +static void ivas_param_mc_quantize_iccs_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 Cy_sum_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word16 Cy_sum_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], const Word16 freq_idx, const Word16 nchan_input, Word16 *ICC_idx_out ); static void ivas_param_mc_dmx_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 *data_f_fx[], Word32 data_dmx_fx[][L_FRAME48k], const Word16 input_frame, const Word16 nchan_input, const Word16 nchan_transport ); @@ -1331,10 +1331,10 @@ static void ivas_param_mc_param_est_enc_fx( static void ivas_param_mc_quantize_ilds_fx( PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ - Word32 Cy_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ - Word16 Cy_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ - Word32 Cx_fx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ - Word16 Cx_e[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ + Word32 Cy_sum_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ + Word16 Cy_sum_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ + Word32 Cx_sum_fx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ + Word16 Cx_sum_e[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ const Word16 freq_idx, /* i : frequency index being processed */ const Word16 nchan_input, /* i : number of input channels */ const Word16 nchan_transport, /* i : number of transport channels */ @@ -1392,9 +1392,9 @@ static void ivas_param_mc_quantize_ilds_fx( /* get ICLDs */ FOR( k = 0; k < Ny; ++k ) { - Nrg_fx[k] = Cy_fx[k][k]; + Nrg_fx[k] = Cy_sum_fx[k][k]; move32(); - Nrg_e[k] = Cy_e[k][k]; + Nrg_e[k] = Cy_sum_e[k][k]; move16(); } @@ -1419,7 +1419,7 @@ static void ivas_param_mc_quantize_ilds_fx( FOR( k = 0; k < nchan_transport; k++ ) { - dmx_ener_fx = BASOP_Util_Add_Mant32Exp( dmx_ener_fx, dmx_ener_e, Cx_fx[k][k], Cx_e[k][k], &dmx_ener_e ); + dmx_ener_fx = BASOP_Util_Add_Mant32Exp( dmx_ener_fx, dmx_ener_e, Cx_sum_fx[k][k], Cx_sum_e[k][k], &dmx_ener_e ); } /*ener_fac = 10.0f * log10f( ( tot_ener + EPSILON ) / ( dmx_ener + EPSILON ) )*/ tot_ener_fx = BASOP_Util_Add_Mant32Exp( tot_ener_fx, tot_ener_e, EPSILON_FX, 0, &tot_ener_e ); @@ -1469,7 +1469,7 @@ static void ivas_param_mc_quantize_ilds_fx( FOR( k = 0; k < nchan_transport; k++ ) { - dmx_ener_fx = BASOP_Util_Add_Mant32Exp( dmx_ener_fx, dmx_ener_e, Cx_fx[k][k], Cx_e[k][k], &dmx_ener_e ); + dmx_ener_fx = BASOP_Util_Add_Mant32Exp( dmx_ener_fx, dmx_ener_e, Cx_sum_fx[k][k], Cx_sum_e[k][k], &dmx_ener_e ); } tot_ener_fx = BASOP_Util_Add_Mant32Exp( tot_ener_fx, tot_ener_e, EPSILON_FX, 0, &tot_ener_e ); @@ -1531,7 +1531,7 @@ static void ivas_param_mc_quantize_ilds_fx( { ref_channel_idx = h_ild_mapping->ref_channel_idx[k][ref_channel_cnt]; move16(); - ref_ener_fx = BASOP_Util_Add_Mant32Exp( ref_ener_fx, ref_ener_e, Cx_fx[ref_channel_idx][ref_channel_idx], Cx_e[ref_channel_idx][ref_channel_idx], &ref_ener_e ); + ref_ener_fx = BASOP_Util_Add_Mant32Exp( ref_ener_fx, ref_ener_e, Cx_sum_fx[ref_channel_idx][ref_channel_idx], Cx_sum_e[ref_channel_idx][ref_channel_idx], &ref_ener_e ); } ref_ener_fx = Mpy_32_16_1( ref_ener_fx, hParamMC->hMetadataPMC.ild_factors_fx[k] ); L_tmp = L_deposit_h( BASOP_Util_Divide3232_Scale( Nrg_fx[h_ild_mapping->ild_index[k]], L_add( ref_ener_fx, EPSILLON_FX ), &tmp_e ) ); @@ -1572,8 +1572,8 @@ static void ivas_param_mc_quantize_ilds_fx( static void ivas_param_mc_quantize_iccs_fx( PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ - Word32 Cy_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ - Word16 Cy_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ + Word32 Cy_sum_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ + Word16 Cy_sum_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ const Word16 freq_idx, /* i : frequency index being processed */ const Word16 nchan_input, /* i : number of input channels */ Word16 *ICC_idx_out /* o : quantizer indices */ @@ -1623,25 +1623,25 @@ static void ivas_param_mc_quantize_iccs_fx( /* Get ICC matrix from Cy */ FOR( k = 0; k < Ny; ++k ) { - Nrg_fx[k] = Cy_fx[k][k]; + Nrg_fx[k] = Cy_sum_fx[k][k]; move32(); - Nrg_e = Cy_e[k][k]; + Nrg_e = Cy_sum_e[k][k]; move16(); a_fx = ISqrt32( L_add( Nrg_fx[k], EPSILLON_FX ), &Nrg_e ); FOR( i = k; i < Ny; ++i ) { - Cy_fx[k][i] = Mpy_32_32( Cy_fx[k][i], a_fx ); + Cy_sum_fx[k][i] = Mpy_32_32( Cy_sum_fx[k][i], a_fx ); move32(); - Cy_fx[k][i] = BASOP_Util_Add_Mant32Exp( Cy_fx[k][i], add( Cy_e[k][i], Nrg_e ), 0, 0, &Cy_e[k][i] ); + Cy_sum_fx[k][i] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[k][i], add( Cy_sum_e[k][i], Nrg_e ), 0, 0, &Cy_sum_e[k][i] ); move32(); } FOR( i = 0; i <= k; i++ ) { - Cy_fx[i][k] = Mpy_32_32( Cy_fx[i][k], a_fx ); + Cy_sum_fx[i][k] = Mpy_32_32( Cy_sum_fx[i][k], a_fx ); move32(); - Cy_fx[i][k] = BASOP_Util_Add_Mant32Exp( Cy_fx[i][k], add( Cy_e[i][k], Nrg_e ), 0, 0, &Cy_e[i][k] ); + Cy_sum_fx[i][k] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[i][k], add( Cy_sum_e[i][k], Nrg_e ), 0, 0, &Cy_sum_e[i][k] ); move32(); } } @@ -1653,17 +1653,17 @@ static void ivas_param_mc_quantize_iccs_fx( { FOR( i = k; i < Ny; ++i ) { - Cy_fx[k][i] = ONE_IN_Q31; + Cy_sum_fx[k][i] = ONE_IN_Q31; move32(); - Cy_e[k][i] = 0; + Cy_sum_e[k][i] = 0; move16(); } FOR( i = 0; i <= k; ++i ) { - Cy_fx[i][k] = ONE_IN_Q31; + Cy_sum_fx[i][k] = ONE_IN_Q31; move32(); - Cy_e[i][k] = 0; + Cy_sum_e[i][k] = 0; move16(); } } @@ -1676,9 +1676,9 @@ static void ivas_param_mc_quantize_iccs_fx( move16(); tmp_map[1] = hParamMC->hMetadataPMC.icc_mapping_conf->icc_mapping[k][1]; move16(); - ICC_vect_fx[k] = Cy_fx[tmp_map[0]][tmp_map[1]]; + ICC_vect_fx[k] = Cy_sum_fx[tmp_map[0]][tmp_map[1]]; move32(); - ICC_vect_e[k] = Cy_e[tmp_map[0]][tmp_map[1]]; + ICC_vect_e[k] = Cy_sum_e[tmp_map[0]][tmp_map[1]]; move16(); } -- GitLab From 77854797b59ed32f52f59453703aa141154dc910 Mon Sep 17 00:00:00 2001 From: Thomas Dettbarn Date: Thu, 3 Apr 2025 10:10:38 +0200 Subject: [PATCH 2/5] applied the clang formatting patch. --- lib_enc/ivas_mc_param_enc_fx.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib_enc/ivas_mc_param_enc_fx.c b/lib_enc/ivas_mc_param_enc_fx.c index 06b9d9913..b19220a9b 100644 --- a/lib_enc/ivas_mc_param_enc_fx.c +++ b/lib_enc/ivas_mc_param_enc_fx.c @@ -1330,16 +1330,16 @@ static void ivas_param_mc_param_est_enc_fx( *------------------------------------------------------------------------*/ static void ivas_param_mc_quantize_ilds_fx( - PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ + PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ Word32 Cy_sum_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ Word16 Cy_sum_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ Word32 Cx_sum_fx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ Word16 Cx_sum_e[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ - const Word16 freq_idx, /* i : frequency index being processed */ - const Word16 nchan_input, /* i : number of input channels */ - const Word16 nchan_transport, /* i : number of transport channels */ - Word16 *ILD_idx_out, /* o : ILD indices */ - Word16 ILD_q[PARAM_MC_SZ_ILD_MAP] /* o : Quanzited ILD matrix */ + const Word16 freq_idx, /* i : frequency index being processed */ + const Word16 nchan_input, /* i : number of input channels */ + const Word16 nchan_transport, /* i : number of transport channels */ + Word16 *ILD_idx_out, /* o : ILD indices */ + Word16 ILD_q[PARAM_MC_SZ_ILD_MAP] /* o : Quanzited ILD matrix */ ) { Word16 i, k; @@ -1571,12 +1571,12 @@ static void ivas_param_mc_quantize_ilds_fx( *------------------------------------------------------------------------*/ static void ivas_param_mc_quantize_iccs_fx( - PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ + PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ Word32 Cy_sum_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ Word16 Cy_sum_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ - const Word16 freq_idx, /* i : frequency index being processed */ - const Word16 nchan_input, /* i : number of input channels */ - Word16 *ICC_idx_out /* o : quantizer indices */ + const Word16 freq_idx, /* i : frequency index being processed */ + const Word16 nchan_input, /* i : number of input channels */ + Word16 *ICC_idx_out /* o : quantizer indices */ ) { Word16 i, k; -- GitLab From 79c4450ccfeed515b6428cb406fa1f860010dbb0 Mon Sep 17 00:00:00 2001 From: Thomas Dettbarn Date: Thu, 3 Apr 2025 10:16:21 +0200 Subject: [PATCH 3/5] renamed Cx_sum_fx, Cx_sum_e, Cy_sum_fx, Cy_sum_e to Cx_real_fx, Cx_real_e, Cy_real_fx, Cy_real_e. --- lib_enc/ivas_mc_param_enc_fx.c | 250 ++++++++++++++++----------------- 1 file changed, 125 insertions(+), 125 deletions(-) diff --git a/lib_enc/ivas_mc_param_enc_fx.c b/lib_enc/ivas_mc_param_enc_fx.c index b19220a9b..895990910 100644 --- a/lib_enc/ivas_mc_param_enc_fx.c +++ b/lib_enc/ivas_mc_param_enc_fx.c @@ -59,17 +59,17 @@ static void ivas_param_mc_range_encoder_fx( const Word16 *seq_in, const Word16 n #define ATTACKTHRESHOLD_E 4 -static void ivas_param_mc_quantize_ilds_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 Cy_sum_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word16 Cy_sum_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word32 Cx_sum_fx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], Word16 Cx_sum_e[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const Word16 freq_idx, const Word16 nchan_input, const Word16 nchan_transport, Word16 *ILD_idx_out, Word16 ILD_q[PARAM_MC_SZ_ILD_MAP] ); +static void ivas_param_mc_quantize_ilds_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 Cy_real_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word16 Cy_real_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word32 Cx_real_fx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], Word16 Cx_real_e[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const Word16 freq_idx, const Word16 nchan_input, const Word16 nchan_transport, Word16 *ILD_idx_out, Word16 ILD_q[PARAM_MC_SZ_ILD_MAP] ); static void ivas_param_mc_parameter_quantizer_fx( const Word32 *x, const Word16 *x_e, const Word16 L, const Word16 sz_quantizer, const Word16 *quantizer_fx, const Word16 Q_quant, Word16 *quant_idx, Word16 *y ); -static void ivas_param_mc_quantize_iccs_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 Cy_sum_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word16 Cy_sum_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], const Word16 freq_idx, const Word16 nchan_input, Word16 *ICC_idx_out ); +static void ivas_param_mc_quantize_iccs_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 Cy_real_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word16 Cy_real_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], const Word16 freq_idx, const Word16 nchan_input, Word16 *ICC_idx_out ); static void ivas_param_mc_dmx_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 *data_f_fx[], Word32 data_dmx_fx[][L_FRAME48k], const Word16 input_frame, const Word16 nchan_input, const Word16 nchan_transport ); static void ivas_param_mc_transient_detection_fx( PARAM_MC_ENC_HANDLE hParamMC, TRAN_DET_HANDLE hTranDet, Word16 *bAttackPresent, Word16 *attackIdx ); -static void ivas_param_mc_param_est_enc_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 *data_f[], Word32 Cy_sum_fx[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word16 Cy_sum_e[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word32 Cx_sum_fx[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], Word16 Cx_sum_e[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const Word16 input_frame, const Word16 nchan_input, const Word16 nchan_transport ); +static void ivas_param_mc_param_est_enc_fx( PARAM_MC_ENC_HANDLE hParamMC, Word32 *data_f[], Word32 Cy_real_fx[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word16 Cy_real_e[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], Word32 Cx_real_fx[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], Word16 Cx_real_e[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const Word16 input_frame, const Word16 nchan_input, const Word16 nchan_transport ); /*------------------------------------------------------------------------- @@ -400,10 +400,10 @@ void ivas_param_mc_enc_fx( Word16 data_f_fx16[L_FRAME48k]; Word32 data_dmx_fx[PARAM_MC_MAX_TRANSPORT_CHANS][L_FRAME48k]; Word16 data_dmx_fx16[PARAM_MC_MAX_TRANSPORT_CHANS][L_FRAME48k]; - Word32 Cy_sum_fx[PARAM_MC_MAX_PARAMETER_BANDS][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; - Word16 Cy_sum_e[PARAM_MC_MAX_PARAMETER_BANDS][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; - Word32 Cx_sum_fx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; - Word16 Cx_sum_e[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; + Word32 Cy_real_fx[PARAM_MC_MAX_PARAMETER_BANDS][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; + Word16 Cy_real_e[PARAM_MC_MAX_PARAMETER_BANDS][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; + Word32 Cx_real_fx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; + Word16 Cx_real_e[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; Word16 ILD_q_fx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_SZ_ILD_MAP]; Word16 ch; Word16 band; @@ -425,13 +425,13 @@ void ivas_param_mc_enc_fx( { FOR( ch = 0; ch < MAX_CICP_CHANNELS; ch++ ) { - set32_fx( Cy_sum_fx[band][ch], 0, MAX_CICP_CHANNELS ); - set16_fx( Cy_sum_e[band][ch], 0, MAX_CICP_CHANNELS ); + set32_fx( Cy_real_fx[band][ch], 0, MAX_CICP_CHANNELS ); + set16_fx( Cy_real_e[band][ch], 0, MAX_CICP_CHANNELS ); } FOR( ch = 0; ch < PARAM_MC_MAX_TRANSPORT_CHANS; ch++ ) { - set32_fx( Cx_sum_fx[band][ch], 0, PARAM_MC_MAX_TRANSPORT_CHANS ); - set16_fx( Cx_sum_e[band][ch], 0, PARAM_MC_MAX_TRANSPORT_CHANS ); + set32_fx( Cx_real_fx[band][ch], 0, PARAM_MC_MAX_TRANSPORT_CHANS ); + set16_fx( Cx_real_e[band][ch], 0, PARAM_MC_MAX_TRANSPORT_CHANS ); } } @@ -503,7 +503,7 @@ void ivas_param_mc_enc_fx( /* Encoding */ /* parameter estimation*/ - ivas_param_mc_param_est_enc_fx( hParamMC, data_f_fx, Cy_sum_fx, Cy_sum_e, Cx_sum_fx, Cx_sum_e, input_frame, nchan_inp, st_ivas->nchan_transport ); + ivas_param_mc_param_est_enc_fx( hParamMC, data_f_fx, Cy_real_fx, Cy_real_e, Cx_real_fx, Cx_real_e, input_frame, nchan_inp, st_ivas->nchan_transport ); IF( hParamMC->hMetadataPMC.bAttackPresent ) { @@ -520,13 +520,13 @@ void ivas_param_mc_enc_fx( /* ILD parameter quantization */ FOR( k = 0; k < hParamMC->hMetadataPMC.nbands_coded; k += band_step ) { - ivas_param_mc_quantize_ilds_fx( hParamMC, Cy_sum_fx[k], Cy_sum_e[k], Cx_sum_fx[k], Cx_sum_e[k], k, nchan_inp, st_ivas->nchan_transport, ILD_idx, ILD_q_fx[k] ); + ivas_param_mc_quantize_ilds_fx( hParamMC, Cy_real_fx[k], Cy_real_e[k], Cx_real_fx[k], Cx_real_e[k], k, nchan_inp, st_ivas->nchan_transport, ILD_idx, ILD_q_fx[k] ); } /* ICC parameter quantization */ FOR( k = 0; k < hParamMC->hMetadataPMC.nbands_coded; k += band_step ) { - ivas_param_mc_quantize_iccs_fx( hParamMC, Cy_sum_fx[k], Cy_sum_e[k], k, nchan_inp, ICC_idx ); + ivas_param_mc_quantize_iccs_fx( hParamMC, Cy_real_fx[k], Cy_real_e[k], k, nchan_inp, ICC_idx ); } /* time domain DMX generation*/ @@ -621,15 +621,15 @@ static void ivas_param_mc_dmx_fx( *------------------------------------------------------------------------*/ static void ivas_param_mc_param_est_enc_fx( - PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ - Word32 *data_f_fx[], /* i : Input frame in the time domain Q11 */ - Word32 Cy_sum_fx[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* o : Covariance matrix for the original frame Cy_sum_e*/ - Word16 Cy_sum_e[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* o : Covariance matrix for the original frame */ - Word32 Cx_sum_fx[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* o : Covariance matrix for the downmixed frame Cx_sum_e*/ - Word16 Cx_sum_e[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* o : Covariance matrix for the downmixed frame */ - const Word16 input_frame, /* i : Input frame length */ - const Word16 nchan_input, /* i : number of input channels */ - const Word16 nchan_transport /* i : number of transport channels */ + PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ + Word32 *data_f_fx[], /* i : Input frame in the time domain Q11 */ + Word32 Cy_real_fx[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* o : Covariance matrix for the original frame Cy_real_e*/ + Word16 Cy_real_e[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* o : Covariance matrix for the original frame */ + Word32 Cx_real_fx[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* o : Covariance matrix for the downmixed frame Cx_real_e*/ + Word16 Cx_real_e[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* o : Covariance matrix for the downmixed frame */ + const Word16 input_frame, /* i : Input frame length */ + const Word16 nchan_input, /* i : number of input channels */ + const Word16 nchan_transport /* i : number of transport channels */ ) { Word16 i, cur_cldfb_band, cur_param_band, ch_idx1, ch_idx2, inp_ch; @@ -655,10 +655,10 @@ static void ivas_param_mc_param_est_enc_fx( Word16 dmx_imag_e[PARAM_MC_MAX_TRANSPORT_CHANS]; /* Downmix channel - Imag Part */ Word32 a_fx, b_fx, c_fx, d_fx; /* Tmp complex values */ Word16 a_e, b_e, c_e, d_e; /* Tmp complex values */ - Word32 Cy_sum_imag_fx[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; - Word16 Cy_sum_imag_e[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; - Word32 Cx_sum_imag_fx[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; - Word16 Cx_sum_imag_e[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; + Word32 Cy_imag_fx[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; + Word16 Cy_imag_e[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; + Word32 Cx_imag_fx[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; + Word16 Cx_imag_e[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; Word32 real_part_fx, imag_part_fx; Word16 real_part_e, imag_part_e; const Word32 *p_dmx_fac_fx; @@ -690,14 +690,14 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx1 = 0; ch_idx1 < MAX_CICP_CHANNELS; ch_idx1++ ) { - set32_fx( Cy_sum_imag_fx[cur_param_band][ch_idx1], 0, MAX_CICP_CHANNELS ); - set16_fx( Cy_sum_imag_e[cur_param_band][ch_idx1], 0, MAX_CICP_CHANNELS ); + set32_fx( Cy_imag_fx[cur_param_band][ch_idx1], 0, MAX_CICP_CHANNELS ); + set16_fx( Cy_imag_e[cur_param_band][ch_idx1], 0, MAX_CICP_CHANNELS ); } FOR( ch_idx1 = 0; ch_idx1 < PARAM_MC_MAX_TRANSPORT_CHANS; ch_idx1++ ) { - set32_fx( Cx_sum_imag_fx[cur_param_band][ch_idx1], 0, PARAM_MC_MAX_TRANSPORT_CHANS ); - set16_fx( Cx_sum_imag_e[cur_param_band][ch_idx1], 0, PARAM_MC_MAX_TRANSPORT_CHANS ); + set32_fx( Cx_imag_fx[cur_param_band][ch_idx1], 0, PARAM_MC_MAX_TRANSPORT_CHANS ); + set16_fx( Cx_imag_e[cur_param_band][ch_idx1], 0, PARAM_MC_MAX_TRANSPORT_CHANS ); } } @@ -823,12 +823,12 @@ static void ivas_param_mc_param_est_enc_fx( /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e ); - Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cx_sum_e[cur_param_band][ch_idx1][ch_idx2], - L_tmp, tmp_e, &Cx_sum_e[cur_param_band][ch_idx1][ch_idx2] ); + Cx_real_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], + L_tmp, tmp_e, &Cx_real_e[cur_param_band][ch_idx1][ch_idx2] ); move32(); L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, d_fx ), add( a_e, d_e ), L_negate( Mpy_32_32( b_fx, c_fx ) ), add( b_e, c_e ), &tmp_e ); - Cx_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cx_sum_imag_e[cur_param_band][ch_idx1][ch_idx2], - L_tmp, tmp_e, &Cx_sum_imag_e[cur_param_band][ch_idx1][ch_idx2] ); + Cx_imag_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cx_imag_e[cur_param_band][ch_idx1][ch_idx2], + L_tmp, tmp_e, &Cx_imag_e[cur_param_band][ch_idx1][ch_idx2] ); move32(); } } @@ -881,12 +881,12 @@ static void ivas_param_mc_param_est_enc_fx( #endif /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e ); - Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band][ch_idx1][ch_idx2], - L_tmp, tmp_e, &Cy_sum_e[cur_param_band][ch_idx1][ch_idx2] ); + Cy_real_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_real_fx[cur_param_band][ch_idx1][ch_idx2], Cy_real_e[cur_param_band][ch_idx1][ch_idx2], + L_tmp, tmp_e, &Cy_real_e[cur_param_band][ch_idx1][ch_idx2] ); move32(); L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, d_fx ), add( a_e, d_e ), L_negate( Mpy_32_32( b_fx, c_fx ) ), add( b_e, c_e ), &tmp_e ); - Cy_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_imag_e[cur_param_band][ch_idx1][ch_idx2], - L_tmp, tmp_e, &Cy_sum_imag_e[cur_param_band][ch_idx1][ch_idx2] ); + Cy_imag_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cy_imag_e[cur_param_band][ch_idx1][ch_idx2], + L_tmp, tmp_e, &Cy_imag_e[cur_param_band][ch_idx1][ch_idx2] ); move32(); } } @@ -990,13 +990,13 @@ static void ivas_param_mc_param_est_enc_fx( /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e ); - Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cx_sum_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, - &Cx_sum_e[cur_param_band][ch_idx1][ch_idx2] ); + Cx_real_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, + &Cx_real_e[cur_param_band][ch_idx1][ch_idx2] ); #else /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, dmx_real_fx[ch_idx2] ), add( a_e, dmx_real_e[ch_idx2] ), Mpy_32_32( b_fx, dmx_imag_fx[ch_idx2] ), add( b_e, dmx_imag_e[ch_idx2] ), &tmp_e ); - Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cx_sum_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, - &Cx_sum_e[cur_param_band][ch_idx1][ch_idx2] ); + Cx_real_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, + &Cx_real_e[cur_param_band][ch_idx1][ch_idx2] ); #endif move32(); } @@ -1050,8 +1050,8 @@ static void ivas_param_mc_param_est_enc_fx( #endif /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e ); - Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, - &Cy_sum_e[cur_param_band][ch_idx1][ch_idx2] ); + Cy_real_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_real_fx[cur_param_band][ch_idx1][ch_idx2], Cy_real_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, + &Cy_real_e[cur_param_band][ch_idx1][ch_idx2] ); move32(); } } @@ -1067,21 +1067,21 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 ) { - Cy_sum_fx[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; + Cy_real_fx[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; move32(); - Cy_sum_e[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; + Cy_real_e[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; move16(); - Cy_sum_fx[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; + Cy_real_fx[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; move32(); - Cy_sum_e[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; + Cy_real_e[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; move16(); - Cy_sum_imag_fx[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; + Cy_imag_fx[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; move32(); - Cy_sum_imag_e[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; + Cy_imag_e[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; move16(); - Cy_sum_imag_fx[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; + Cy_imag_fx[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; move32(); - Cy_sum_imag_e[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; + Cy_imag_e[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; move16(); } } @@ -1090,13 +1090,13 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 ) { - Cy_sum_fx[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; + Cy_real_fx[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; move32(); - Cy_sum_e[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; + Cy_real_e[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; move16(); - Cy_sum_fx[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; + Cy_real_fx[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; move32(); - Cy_sum_e[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; + Cy_real_e[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; move16(); } } @@ -1134,9 +1134,9 @@ static void ivas_param_mc_param_est_enc_fx( /* get ICLDs */ FOR( k = 0; k < nchan_input; ++k ) { - Nrg_fx[k] = Cy_sum_fx[cur_param_band][k][k]; + Nrg_fx[k] = Cy_real_fx[cur_param_band][k][k]; move32(); - Nrg_e[k] = Cy_sum_e[cur_param_band][k][k]; + Nrg_e[k] = Cy_real_e[cur_param_band][k][k]; move16(); } FOR( k = 0; k < num_ilds_to_code; ++k ) @@ -1152,8 +1152,8 @@ static void ivas_param_mc_param_est_enc_fx( { ref_channel_idx = h_ild_mapping->ref_channel_idx[k][ref_channel_cnt]; move16(); - ref_ener_fx = BASOP_Util_Add_Mant32Exp( ref_ener_fx, ref_ener_e, Cx_sum_fx[cur_param_band][ref_channel_idx][ref_channel_idx], // ref_ener_e - Cx_sum_e[cur_param_band][ref_channel_idx][ref_channel_idx], &ref_ener_e ); + ref_ener_fx = BASOP_Util_Add_Mant32Exp( ref_ener_fx, ref_ener_e, Cx_real_fx[cur_param_band][ref_channel_idx][ref_channel_idx], // ref_ener_e + Cx_real_e[cur_param_band][ref_channel_idx][ref_channel_idx], &ref_ener_e ); } L_tmp = Mpy_32_16_1( ref_ener_fx, hParamMC->hMetadataPMC.ild_factors_fx[k] ); L_tmp = L_deposit_h( BASOP_Util_Divide3232_Scale( Nrg_fx[h_ild_mapping->ild_index[k]], L_add( L_tmp, EPSILLON_FX ), &tmp_e ) ); @@ -1189,13 +1189,13 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx2 = 0; ch_idx2 < nchan_transport; ++ch_idx2 ) { - Cx_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cx_sum_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cx_sum_e[cur_param_band][ch_idx1][ch_idx2], - &Cx_sum_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cx_real_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_real_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cx_real_e[cur_param_band - 1][ch_idx1][ch_idx2], + Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], + &Cx_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); - Cx_sum_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_sum_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cx_sum_imag_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cx_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cx_sum_imag_e[cur_param_band][ch_idx1][ch_idx2], - &Cx_sum_imag_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cx_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cx_imag_e[cur_param_band - 1][ch_idx1][ch_idx2], + Cx_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cx_imag_e[cur_param_band][ch_idx1][ch_idx2], + &Cx_imag_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); } } @@ -1204,13 +1204,13 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 ) { - Cy_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band][ch_idx1][ch_idx2], - &Cy_sum_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cy_real_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_real_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_real_e[cur_param_band - 1][ch_idx1][ch_idx2], + Cy_real_fx[cur_param_band][ch_idx1][ch_idx2], Cy_real_e[cur_param_band][ch_idx1][ch_idx2], + &Cy_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); - Cy_sum_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_sum_imag_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cy_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_imag_e[cur_param_band][ch_idx1][ch_idx2], - &Cy_sum_imag_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cy_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_imag_e[cur_param_band - 1][ch_idx1][ch_idx2], + Cy_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cy_imag_e[cur_param_band][ch_idx1][ch_idx2], + &Cy_imag_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); } } @@ -1224,9 +1224,9 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx2 = 0; ch_idx2 < nchan_transport; ++ch_idx2 ) { - Cx_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cx_sum_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cx_sum_e[cur_param_band][ch_idx1][ch_idx2], - &Cx_sum_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cx_real_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_real_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cx_real_e[cur_param_band - 1][ch_idx1][ch_idx2], + Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], + &Cx_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); } } @@ -1235,9 +1235,9 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 ) { - Cy_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band][ch_idx1][ch_idx2], - &Cy_sum_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cy_real_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_real_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_real_e[cur_param_band - 1][ch_idx1][ch_idx2], + Cy_real_fx[cur_param_band][ch_idx1][ch_idx2], Cy_real_e[cur_param_band][ch_idx1][ch_idx2], + &Cy_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); } } @@ -1257,13 +1257,13 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx2 = 0; ch_idx2 < nchan_transport; ch_idx2++ ) { - real_part_fx = Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2]; + real_part_fx = Cx_real_fx[cur_param_band][ch_idx1][ch_idx2]; move32(); - real_part_e = Cx_sum_e[cur_param_band][ch_idx1][ch_idx2]; + real_part_e = Cx_real_e[cur_param_band][ch_idx1][ch_idx2]; move16(); - imag_part_fx = Cx_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2]; + imag_part_fx = Cx_imag_fx[cur_param_band][ch_idx1][ch_idx2]; move32(); - imag_part_e = Cx_sum_imag_e[cur_param_band][ch_idx1][ch_idx2]; + imag_part_e = Cx_imag_e[cur_param_band][ch_idx1][ch_idx2]; move16(); real_part_fx = Mpy_32_32( real_part_fx, real_part_fx ); @@ -1272,9 +1272,9 @@ static void ivas_param_mc_param_est_enc_fx( /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = Sqrt32( L_tmp, &tmp_e ); - Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2] = L_tmp; + Cx_real_fx[cur_param_band][ch_idx1][ch_idx2] = L_tmp; move32(); - Cx_sum_e[cur_param_band][ch_idx1][ch_idx2] = tmp_e; + Cx_real_e[cur_param_band][ch_idx1][ch_idx2] = tmp_e; move16(); } } @@ -1284,13 +1284,13 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ch_idx2++ ) { - real_part_fx = Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2]; + real_part_fx = Cy_real_fx[cur_param_band][ch_idx1][ch_idx2]; move32(); - real_part_e = Cy_sum_e[cur_param_band][ch_idx1][ch_idx2]; + real_part_e = Cy_real_e[cur_param_band][ch_idx1][ch_idx2]; move16(); - imag_part_fx = Cy_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2]; + imag_part_fx = Cy_imag_fx[cur_param_band][ch_idx1][ch_idx2]; move32(); - imag_part_e = Cy_sum_imag_e[cur_param_band][ch_idx1][ch_idx2]; + imag_part_e = Cy_imag_e[cur_param_band][ch_idx1][ch_idx2]; move16(); real_part_fx = Mpy_32_32( real_part_fx, real_part_fx ); @@ -1299,15 +1299,15 @@ static void ivas_param_mc_param_est_enc_fx( L_tmp = BASOP_Util_Add_Mant32Exp( real_part_fx, shl( real_part_e, 1 ), imag_part_fx, shl( imag_part_e, 1 ), &tmp_e ); L_tmp = Sqrt32( L_tmp, &tmp_e ); - Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2] = L_tmp; + Cy_real_fx[cur_param_band][ch_idx1][ch_idx2] = L_tmp; move32(); - Cy_sum_e[cur_param_band][ch_idx1][ch_idx2] = tmp_e; + Cy_real_e[cur_param_band][ch_idx1][ch_idx2] = tmp_e; move16(); } } } - IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( Cy_sum_fx[0][LFE_CHANNEL][LFE_CHANNEL], Cy_sum_e[0][LFE_CHANNEL][LFE_CHANNEL], PARAM_MC_LFE_ON_THRESH_FX, 31 ), -1 ) ) + IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( Cy_real_fx[0][LFE_CHANNEL][LFE_CHANNEL], Cy_real_e[0][LFE_CHANNEL][LFE_CHANNEL], PARAM_MC_LFE_ON_THRESH_FX, 31 ), -1 ) ) { hParamMC->hMetadataPMC.lfe_on = 0; move16(); @@ -1330,16 +1330,16 @@ static void ivas_param_mc_param_est_enc_fx( *------------------------------------------------------------------------*/ static void ivas_param_mc_quantize_ilds_fx( - PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ - Word32 Cy_sum_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ - Word16 Cy_sum_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ - Word32 Cx_sum_fx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ - Word16 Cx_sum_e[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ - const Word16 freq_idx, /* i : frequency index being processed */ - const Word16 nchan_input, /* i : number of input channels */ - const Word16 nchan_transport, /* i : number of transport channels */ - Word16 *ILD_idx_out, /* o : ILD indices */ - Word16 ILD_q[PARAM_MC_SZ_ILD_MAP] /* o : Quanzited ILD matrix */ + PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ + Word32 Cy_real_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ + Word16 Cy_real_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ + Word32 Cx_real_fx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ + Word16 Cx_real_e[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ + const Word16 freq_idx, /* i : frequency index being processed */ + const Word16 nchan_input, /* i : number of input channels */ + const Word16 nchan_transport , /* i : number of transport channels */ + Word16 *ILD_idx_out, /* o : ILD indices */ + Word16 ILD_q[PARAM_MC_SZ_ILD_M AP] /* o : Quanzited ILD matrix */ ) { Word16 i, k; @@ -1392,9 +1392,9 @@ static void ivas_param_mc_quantize_ilds_fx( /* get ICLDs */ FOR( k = 0; k < Ny; ++k ) { - Nrg_fx[k] = Cy_sum_fx[k][k]; + Nrg_fx[k] = Cy_real_fx[k][k]; move32(); - Nrg_e[k] = Cy_sum_e[k][k]; + Nrg_e[k] = Cy_real_e[k][k]; move16(); } @@ -1419,7 +1419,7 @@ static void ivas_param_mc_quantize_ilds_fx( FOR( k = 0; k < nchan_transport; k++ ) { - dmx_ener_fx = BASOP_Util_Add_Mant32Exp( dmx_ener_fx, dmx_ener_e, Cx_sum_fx[k][k], Cx_sum_e[k][k], &dmx_ener_e ); + dmx_ener_fx = BASOP_Util_Add_Mant32Exp( dmx_ener_fx, dmx_ener_e, Cx_real_fx[k][k], Cx_real_e[k][k], &dmx_ener_e ); } /*ener_fac = 10.0f * log10f( ( tot_ener + EPSILON ) / ( dmx_ener + EPSILON ) )*/ tot_ener_fx = BASOP_Util_Add_Mant32Exp( tot_ener_fx, tot_ener_e, EPSILON_FX, 0, &tot_ener_e ); @@ -1469,7 +1469,7 @@ static void ivas_param_mc_quantize_ilds_fx( FOR( k = 0; k < nchan_transport; k++ ) { - dmx_ener_fx = BASOP_Util_Add_Mant32Exp( dmx_ener_fx, dmx_ener_e, Cx_sum_fx[k][k], Cx_sum_e[k][k], &dmx_ener_e ); + dmx_ener_fx = BASOP_Util_Add_Mant32Exp( dmx_ener_fx, dmx_ener_e, Cx_real_fx[k][k], Cx_real_e[k][k], &dmx_ener_e ); } tot_ener_fx = BASOP_Util_Add_Mant32Exp( tot_ener_fx, tot_ener_e, EPSILON_FX, 0, &tot_ener_e ); @@ -1531,7 +1531,7 @@ static void ivas_param_mc_quantize_ilds_fx( { ref_channel_idx = h_ild_mapping->ref_channel_idx[k][ref_channel_cnt]; move16(); - ref_ener_fx = BASOP_Util_Add_Mant32Exp( ref_ener_fx, ref_ener_e, Cx_sum_fx[ref_channel_idx][ref_channel_idx], Cx_sum_e[ref_channel_idx][ref_channel_idx], &ref_ener_e ); + ref_ener_fx = BASOP_Util_Add_Mant32Exp( ref_ener_fx, ref_ener_e, Cx_real_fx[ref_channel_idx][ref_channel_idx], Cx_real_e[ref_channel_idx][ref_channel_idx], &ref_ener_e ); } ref_ener_fx = Mpy_32_16_1( ref_ener_fx, hParamMC->hMetadataPMC.ild_factors_fx[k] ); L_tmp = L_deposit_h( BASOP_Util_Divide3232_Scale( Nrg_fx[h_ild_mapping->ild_index[k]], L_add( ref_ener_fx, EPSILLON_FX ), &tmp_e ) ); @@ -1571,12 +1571,12 @@ static void ivas_param_mc_quantize_ilds_fx( *------------------------------------------------------------------------*/ static void ivas_param_mc_quantize_iccs_fx( - PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ - Word32 Cy_sum_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ - Word16 Cy_sum_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ - const Word16 freq_idx, /* i : frequency index being processed */ - const Word16 nchan_input, /* i : number of input channels */ - Word16 *ICC_idx_out /* o : quantizer indices */ + PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ + Word32 Cy_real_fx[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ + Word16 Cy_real_e[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ + const Word16 freq_idx, /* i : frequency index being processed */ + const Word16 nchan_input, /* i : number of input channels */ + Word16 *ICC_idx_out /* o : quantizer indices */ ) { Word16 i, k; @@ -1623,25 +1623,25 @@ static void ivas_param_mc_quantize_iccs_fx( /* Get ICC matrix from Cy */ FOR( k = 0; k < Ny; ++k ) { - Nrg_fx[k] = Cy_sum_fx[k][k]; + Nrg_fx[k] = Cy_real_fx[k][k]; move32(); - Nrg_e = Cy_sum_e[k][k]; + Nrg_e = Cy_real_e[k][k]; move16(); a_fx = ISqrt32( L_add( Nrg_fx[k], EPSILLON_FX ), &Nrg_e ); FOR( i = k; i < Ny; ++i ) { - Cy_sum_fx[k][i] = Mpy_32_32( Cy_sum_fx[k][i], a_fx ); + Cy_real_fx[k][i] = Mpy_32_32( Cy_real_fx[k][i], a_fx ); move32(); - Cy_sum_fx[k][i] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[k][i], add( Cy_sum_e[k][i], Nrg_e ), 0, 0, &Cy_sum_e[k][i] ); + Cy_real_fx[k][i] = BASOP_Util_Add_Mant32Exp( Cy_real_fx[k][i], add( Cy_real_e[k][i], Nrg_e ), 0, 0, &Cy_real_e[k][i] ); move32(); } FOR( i = 0; i <= k; i++ ) { - Cy_sum_fx[i][k] = Mpy_32_32( Cy_sum_fx[i][k], a_fx ); + Cy_real_fx[i][k] = Mpy_32_32( Cy_real_fx[i][k], a_fx ); move32(); - Cy_sum_fx[i][k] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[i][k], add( Cy_sum_e[i][k], Nrg_e ), 0, 0, &Cy_sum_e[i][k] ); + Cy_real_fx[i][k] = BASOP_Util_Add_Mant32Exp( Cy_real_fx[i][k], add( Cy_real_e[i][k], Nrg_e ), 0, 0, &Cy_real_e[i][k] ); move32(); } } @@ -1653,17 +1653,17 @@ static void ivas_param_mc_quantize_iccs_fx( { FOR( i = k; i < Ny; ++i ) { - Cy_sum_fx[k][i] = ONE_IN_Q31; + Cy_real_fx[k][i] = ONE_IN_Q31; move32(); - Cy_sum_e[k][i] = 0; + Cy_real_e[k][i] = 0; move16(); } FOR( i = 0; i <= k; ++i ) { - Cy_sum_fx[i][k] = ONE_IN_Q31; + Cy_real_fx[i][k] = ONE_IN_Q31; move32(); - Cy_sum_e[i][k] = 0; + Cy_real_e[i][k] = 0; move16(); } } @@ -1676,9 +1676,9 @@ static void ivas_param_mc_quantize_iccs_fx( move16(); tmp_map[1] = hParamMC->hMetadataPMC.icc_mapping_conf->icc_mapping[k][1]; move16(); - ICC_vect_fx[k] = Cy_sum_fx[tmp_map[0]][tmp_map[1]]; + ICC_vect_fx[k] = Cy_real_fx[tmp_map[0]][tmp_map[1]]; move32(); - ICC_vect_e[k] = Cy_sum_e[tmp_map[0]][tmp_map[1]]; + ICC_vect_e[k] = Cy_real_e[tmp_map[0]][tmp_map[1]]; move16(); } -- GitLab From e675faf957209d42dc4d8ece0c6cfa1323631b21 Mon Sep 17 00:00:00 2001 From: Thomas Dettbarn Date: Thu, 3 Apr 2025 10:20:07 +0200 Subject: [PATCH 4/5] applied the clang formatting patch. --- lib_enc/ivas_mc_param_enc_fx.c | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib_enc/ivas_mc_param_enc_fx.c b/lib_enc/ivas_mc_param_enc_fx.c index 895990910..1bfc1b2c7 100644 --- a/lib_enc/ivas_mc_param_enc_fx.c +++ b/lib_enc/ivas_mc_param_enc_fx.c @@ -824,11 +824,11 @@ static void ivas_param_mc_param_est_enc_fx( /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e ); Cx_real_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], - L_tmp, tmp_e, &Cx_real_e[cur_param_band][ch_idx1][ch_idx2] ); + L_tmp, tmp_e, &Cx_real_e[cur_param_band][ch_idx1][ch_idx2] ); move32(); L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, d_fx ), add( a_e, d_e ), L_negate( Mpy_32_32( b_fx, c_fx ) ), add( b_e, c_e ), &tmp_e ); Cx_imag_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cx_imag_e[cur_param_band][ch_idx1][ch_idx2], - L_tmp, tmp_e, &Cx_imag_e[cur_param_band][ch_idx1][ch_idx2] ); + L_tmp, tmp_e, &Cx_imag_e[cur_param_band][ch_idx1][ch_idx2] ); move32(); } } @@ -882,11 +882,11 @@ static void ivas_param_mc_param_est_enc_fx( /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e ); Cy_real_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_real_fx[cur_param_band][ch_idx1][ch_idx2], Cy_real_e[cur_param_band][ch_idx1][ch_idx2], - L_tmp, tmp_e, &Cy_real_e[cur_param_band][ch_idx1][ch_idx2] ); + L_tmp, tmp_e, &Cy_real_e[cur_param_band][ch_idx1][ch_idx2] ); move32(); L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, d_fx ), add( a_e, d_e ), L_negate( Mpy_32_32( b_fx, c_fx ) ), add( b_e, c_e ), &tmp_e ); Cy_imag_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cy_imag_e[cur_param_band][ch_idx1][ch_idx2], - L_tmp, tmp_e, &Cy_imag_e[cur_param_band][ch_idx1][ch_idx2] ); + L_tmp, tmp_e, &Cy_imag_e[cur_param_band][ch_idx1][ch_idx2] ); move32(); } } @@ -991,12 +991,12 @@ static void ivas_param_mc_param_est_enc_fx( /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e ); Cx_real_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, - &Cx_real_e[cur_param_band][ch_idx1][ch_idx2] ); + &Cx_real_e[cur_param_band][ch_idx1][ch_idx2] ); #else /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, dmx_real_fx[ch_idx2] ), add( a_e, dmx_real_e[ch_idx2] ), Mpy_32_32( b_fx, dmx_imag_fx[ch_idx2] ), add( b_e, dmx_imag_e[ch_idx2] ), &tmp_e ); Cx_real_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, - &Cx_real_e[cur_param_band][ch_idx1][ch_idx2] ); + &Cx_real_e[cur_param_band][ch_idx1][ch_idx2] ); #endif move32(); } @@ -1051,7 +1051,7 @@ static void ivas_param_mc_param_est_enc_fx( /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e ); Cy_real_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_real_fx[cur_param_band][ch_idx1][ch_idx2], Cy_real_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, - &Cy_real_e[cur_param_band][ch_idx1][ch_idx2] ); + &Cy_real_e[cur_param_band][ch_idx1][ch_idx2] ); move32(); } } @@ -1190,12 +1190,12 @@ static void ivas_param_mc_param_est_enc_fx( FOR( ch_idx2 = 0; ch_idx2 < nchan_transport; ++ch_idx2 ) { Cx_real_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_real_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cx_real_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], - &Cx_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], + &Cx_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); Cx_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cx_imag_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cx_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cx_imag_e[cur_param_band][ch_idx1][ch_idx2], - &Cx_imag_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cx_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cx_imag_e[cur_param_band][ch_idx1][ch_idx2], + &Cx_imag_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); } } @@ -1205,12 +1205,12 @@ static void ivas_param_mc_param_est_enc_fx( FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 ) { Cy_real_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_real_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_real_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cy_real_fx[cur_param_band][ch_idx1][ch_idx2], Cy_real_e[cur_param_band][ch_idx1][ch_idx2], - &Cy_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cy_real_fx[cur_param_band][ch_idx1][ch_idx2], Cy_real_e[cur_param_band][ch_idx1][ch_idx2], + &Cy_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); Cy_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_imag_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cy_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cy_imag_e[cur_param_band][ch_idx1][ch_idx2], - &Cy_imag_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cy_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cy_imag_e[cur_param_band][ch_idx1][ch_idx2], + &Cy_imag_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); } } @@ -1225,8 +1225,8 @@ static void ivas_param_mc_param_est_enc_fx( FOR( ch_idx2 = 0; ch_idx2 < nchan_transport; ++ch_idx2 ) { Cx_real_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_real_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cx_real_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], - &Cx_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cx_real_fx[cur_param_band][ch_idx1][ch_idx2], Cx_real_e[cur_param_band][ch_idx1][ch_idx2], + &Cx_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); } } @@ -1236,8 +1236,8 @@ static void ivas_param_mc_param_est_enc_fx( FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 ) { Cy_real_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_real_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_real_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cy_real_fx[cur_param_band][ch_idx1][ch_idx2], Cy_real_e[cur_param_band][ch_idx1][ch_idx2], - &Cy_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); + Cy_real_fx[cur_param_band][ch_idx1][ch_idx2], Cy_real_e[cur_param_band][ch_idx1][ch_idx2], + &Cy_real_e[cur_param_band - 1][ch_idx1][ch_idx2] ); move32(); } } @@ -1337,7 +1337,7 @@ static void ivas_param_mc_quantize_ilds_fx( Word16 Cx_real_e[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ const Word16 freq_idx, /* i : frequency index being processed */ const Word16 nchan_input, /* i : number of input channels */ - const Word16 nchan_transport , /* i : number of transport channels */ + const Word16 nchan_transport, /* i : number of transport channels */ Word16 *ILD_idx_out, /* o : ILD indices */ Word16 ILD_q[PARAM_MC_SZ_ILD_M AP] /* o : Quanzited ILD matrix */ ) -- GitLab From 4787c9deaa3aa37ee638c567f00de30693a949ff Mon Sep 17 00:00:00 2001 From: Thomas Dettbarn Date: Thu, 3 Apr 2025 10:25:41 +0200 Subject: [PATCH 5/5] patched the patch. --- lib_enc/ivas_mc_param_enc_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_mc_param_enc_fx.c b/lib_enc/ivas_mc_param_enc_fx.c index 1bfc1b2c7..7e1fe7ed0 100644 --- a/lib_enc/ivas_mc_param_enc_fx.c +++ b/lib_enc/ivas_mc_param_enc_fx.c @@ -1339,7 +1339,7 @@ static void ivas_param_mc_quantize_ilds_fx( const Word16 nchan_input, /* i : number of input channels */ const Word16 nchan_transport, /* i : number of transport channels */ Word16 *ILD_idx_out, /* o : ILD indices */ - Word16 ILD_q[PARAM_MC_SZ_ILD_M AP] /* o : Quanzited ILD matrix */ + Word16 ILD_q[PARAM_MC_SZ_ILD_MAP] /* o : Quanzited ILD matrix */ ) { Word16 i, k; -- GitLab