Loading lib_enc/ivas_mc_param_enc_fx.c +25 −25 Original line number Diff line number Diff line Loading @@ -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 ); Loading Loading @@ -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 */ Loading Loading @@ -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(); } Loading @@ -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 ); Loading Loading @@ -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 ); Loading Loading @@ -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 ) ); Loading Loading @@ -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 */ Loading Loading @@ -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(); } } Loading @@ -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(); } } Loading @@ -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(); } Loading Loading
lib_enc/ivas_mc_param_enc_fx.c +25 −25 Original line number Diff line number Diff line Loading @@ -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 ); Loading Loading @@ -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 */ Loading Loading @@ -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(); } Loading @@ -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 ); Loading Loading @@ -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 ); Loading Loading @@ -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 ) ); Loading Loading @@ -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 */ Loading Loading @@ -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(); } } Loading @@ -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(); } } Loading @@ -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(); } Loading