Loading lib_com/ivas_masa_com_fx.c +7 −4 Original line number Diff line number Diff line Loading @@ -978,7 +978,7 @@ static Word16 quantize_phi_masa_fx( Word32 tmp32; Word16 tmp_e, delta_phi_e; delta_phi_fx = L_deposit_h( BASOP_Util_Divide1616_Scale( 360, n, &delta_phi_e ) ); delta_phi_fx = BASOP_Util_Divide3232_Scale_newton( 360, n, &delta_phi_e ); delta_phi_fx = L_shr( delta_phi_fx, sub( sub( 31, delta_phi_e ), 22 ) ); // Q22 IF( EQ_16( n, 1 ) ) Loading @@ -1000,8 +1000,8 @@ static Word16 quantize_phi_masa_fx( } tmp32 = L_add( L_sub( phi_fx, dd_fx ), L_shr( delta_phi_fx, 1 ) ); id_phi = BASOP_Util_Divide3232_Scale( tmp32, delta_phi_fx, &tmp_e ); id_phi = shr( id_phi, sub( 15, tmp_e ) ); // Q0 tmp32 = BASOP_Util_Divide3232_Scale_newton( tmp32, delta_phi_fx, &tmp_e ); id_phi = extract_l( L_shr( tmp32, sub( 31, tmp_e ) ) ); // Q0 if ( EQ_16( id_phi, n ) ) { Loading @@ -1014,7 +1014,10 @@ static Word16 quantize_phi_masa_fx( id_phi = sub( n, 1 ); } *phi_hat_fx = L_add( L_shl( Mpy_32_16_1( delta_phi_fx, id_phi ), 15 ), dd_fx ); // q22 + q0 - 15 = q7 -> q7 + 15 = q22 delta_phi_fx = BASOP_Util_Divide3232_Scale_newton( L_mult0( 360, id_phi ), n, &delta_phi_e ); delta_phi_fx = L_shr( delta_phi_fx, sub( sub( 31, delta_phi_e ), 22 ) ); // Q22 *phi_hat_fx = L_add( delta_phi_fx, dd_fx ); // Q22 move32(); return id_phi; // Q0 Loading lib_com/ivas_rom_com_fx.c +8 −8 Original line number Diff line number Diff line Loading @@ -485,14 +485,14 @@ const Word32 dft_res_gains_q_fx[][2] = { // Q13 const Word16 McMASA_LFEGain_vectors_fx_q13[64] = { 3112, 2703, 1556, 1638, -1310, -1802, -2867, -2785, 4096, 4096, 4096, 4096, -6553, -3276, 8355, 819, -4096, -4096, -4096, -4096, -4587, -983, -6389, 11141, -8355, 9666, -4669, 2703, 5898, -9256, 7946, -5079, -7454, 7618, 8192, -9011, 14172, -1884, -6389, -6881, 7782, -13107, -2785, 7618, 7127, 3850, -15564, 4259, 5488, 11632, -7946, -10158, 6799, 4751, 4997, -16711, -6553, -12943, 6717, 11632, -17530, 2129, 6881, 8355 3113, 2703, 1556, 1638, -1311, -1802, -2867, -2785, 4096, 4096, 4096, 4096, -6554, -3277, 8356, 819, -4096, -4096, -4096, -4096, -4588, -983, -6390, 11141, -8356, 9667, -4669, 2703, 5898, -9257, 7946, -5079, -7455, 7619, 8192, -9011, 14172, -1884, -6390, -6881, 7782, -13107, -2785, 7619, 7127, 3850, -15565, 4260, 5489, 11633, -7946, -10158, 6799, 4751, 4997, -16712, -6554, -12943, 6717, 11633, -17531, 2130, 6881, 8356 }; // Q25 Loading lib_com/rom_com.c +27 −0 Original line number Diff line number Diff line Loading @@ -15654,6 +15654,33 @@ const Word16 wac_swb_l[LPC_SHB_ORDER] = 30328 }; const Word16 wac_swb_ivas_h[LPC_SHB_ORDER] = {//Q15 32749, 32731, 32686, 32622, 32541, 32442, 32325, 32191, 32039, 31870 }; const Word16 wac_swb_ivas_l[LPC_SHB_ORDER] = {//Q15 2624, 20874, 7850, 25873, 12831, 5927, 10541, 239, 15037, 30328 }; const Word16 lbr_wb_bwe_lsfvq_cbook_2bit_fx[4 * 4] = { lib_com/rom_com.h +4 −2 Original line number Diff line number Diff line Loading @@ -618,6 +618,8 @@ extern const Word16 Hilbert_coeffs_fx[4 * NUM_HILBERTS][HILBERT_ORDER1 + 1]; // extern const Word16 wac_swb_h[]; // Q15 extern const Word16 wac_swb_l[]; // Q15 extern const Word16 wac_swb_ivas_h[]; // Q15 extern const Word16 wac_swb_ivas_l[]; // Q15 extern const Word16 wb_bwe_lsfvq_cbook_8bit_fx[]; // Q15 extern const Word16 lbr_wb_bwe_lsfvq_cbook_2bit_fx[]; // Q15 Loading lib_enc/ivas_core_pre_proc_front_fx.c +4 −21 Original line number Diff line number Diff line Loading @@ -1228,16 +1228,7 @@ ivas_error pre_proc_front_ivas_fx( /*------------------------------------------------------------------* * Update estimated noise energy and voicing cut-off frequency *-----------------------------------------------------------------*/ Word16 scale = s_min( Q31, s_min( add( q_tmpN, L_norm_arr( tmpN_fx, NB_BANDS ) ), add( st->hNoiseEst->q_bckr, L_norm_arr( st->hNoiseEst->bckr_fx, NB_BANDS ) ) ) ); scale = sub( scale, 1 ); // guard bits scale_sig32( st->hNoiseEst->bckr_fx, NB_BANDS, sub( scale, st->hNoiseEst->q_bckr ) ); scale_sig32( tmpN_fx, NB_BANDS, sub( scale, q_tmpN ) ); st->hNoiseEst->q_bckr = q_tmpN = scale; move16(); move16(); scale = s_min( Q31, add( st->hNoiseEst->ave_enr_q, s_min( L_norm_arr( st->hNoiseEst->ave_enr_fx, NB_BANDS ), L_norm_arr( st->hNoiseEst->ave_enr2_fx, NB_BANDS ) ) ) ); Word16 scale = s_min( Q31, add( st->hNoiseEst->ave_enr_q, s_min( L_norm_arr( st->hNoiseEst->ave_enr_fx, NB_BANDS ), L_norm_arr( st->hNoiseEst->ave_enr2_fx, NB_BANDS ) ) ) ); scale = s_min( scale, add( q_tmpE, L_norm_arr( tmpE_fx, NB_BANDS ) ) ); scale = sub( scale, 1 ); // guard bits scale_sig32( tmpE_fx, NB_BANDS, sub( scale, q_tmpE ) ); Loading @@ -1256,7 +1247,7 @@ ivas_error pre_proc_front_ivas_fx( move16(); move16(); noise_est_ivas_fx( st, old_pitch1, tmpN_fx, epsP_fx, extract_h( Etot_fx ), *relE_fx, corr_shift_fx, tmpE_fx, q_tmpE, fr_bands_fx, fr_bands_fx_q, cor_map_sum_fx, noise_est_ivas_fx( st, old_pitch1, tmpN_fx, q_tmpN, epsP_fx, extract_h( Etot_fx ), *relE_fx, corr_shift_fx, tmpE_fx, q_tmpE, fr_bands_fx, fr_bands_fx_q, cor_map_sum_fx, &ncharX_fx, &sp_div_fx, &q_sp_div, &non_staX_fx, loc_harm, lf_E_fx, q_lf_E_fx, &st->hNoiseEst->harm_cor_cnt, extract_h( st->hNoiseEst->Etot_l_lp_32fx ), st->hNoiseEst->Etot_v_h2_32fx, &st->hNoiseEst->bg_cnt, st->lgBin_E_fx, &dummy_fx, S_map_fx, hStereoClassif, NULL, st->ini_frame ); Loading @@ -1265,14 +1256,6 @@ ivas_error pre_proc_front_ivas_fx( { FOR( Word16 j = 0; j < 2; j++ ) { scale = s_min( add( q_tmpN_LR[j], L_norm_arr( tmpN_LR_fx[j], NB_BANDS ) ), add( hCPE->hFrontVad[j]->hNoiseEst->q_bckr, L_norm_arr( hCPE->hFrontVad[j]->hNoiseEst->bckr_fx, NB_BANDS ) ) ); scale = sub( s_min( Q31, scale ), 1 ); scale_sig32( hCPE->hFrontVad[j]->hNoiseEst->bckr_fx, NB_BANDS, sub( scale, hCPE->hFrontVad[j]->hNoiseEst->q_bckr ) ); scale_sig32( tmpN_LR_fx[j], NB_BANDS, sub( scale, q_tmpN_LR[j] ) ); hCPE->hFrontVad[j]->hNoiseEst->q_bckr = q_tmpN_LR[j] = scale; move16(); move16(); scale = add( hCPE->hFrontVad[j]->hNoiseEst->ave_enr_q, s_min( L_norm_arr( hCPE->hFrontVad[j]->hNoiseEst->ave_enr_fx, NB_BANDS ), L_norm_arr( hCPE->hFrontVad[j]->hNoiseEst->ave_enr2_fx, NB_BANDS ) ) ); scale = s_min( scale, add( q_tmpE_LR[j], L_norm_arr( tmpE_LR_fx[j], NB_BANDS ) ) ); scale = sub( s_min( Q31, scale ), 1 ); Loading @@ -1297,14 +1280,14 @@ ivas_error pre_proc_front_ivas_fx( move16(); /* Run noise_est for Left and Right channel */ noise_est_ivas_fx( st, old_pitch1, tmpN_LR_fx[0], epsP_fx, Etot_LR_fx[0], sub( Etot_LR_fx[0], hCPE->hFrontVad[0]->lp_speech_fx ), corr_shiftL_fx, noise_est_ivas_fx( st, old_pitch1, tmpN_LR_fx[0], q_tmpN_LR[0], epsP_fx, Etot_LR_fx[0], sub( Etot_LR_fx[0], hCPE->hFrontVad[0]->lp_speech_fx ), corr_shiftL_fx, tmpE_LR_fx[0], q_tmpE_LR[0], fr_bands_LR_fx[0], fr_bands_LR_fx_q[0], &cor_map_sum_LR_fx[0], &ncharX_LR_fx, &sp_div_LR_fx, &q_sp_div_LR, &non_staX_LR_fx, loc_harmLR_fx, lf_E_LR_fx[0], lf_E_LR_fx_q, &hCPE->hFrontVad[0]->hNoiseEst->harm_cor_cnt, extract_h( hCPE->hFrontVad[0]->hNoiseEst->Etot_l_lp_32fx ), hCPE->hFrontVad[0]->hNoiseEst->Etot_v_h2_32fx, &hCPE->hFrontVad[0]->hNoiseEst->bg_cnt, st->lgBin_E_fx, &dummy_fx, S_map_LR_fx, NULL, hCPE->hFrontVad[0], hCPE->hFrontVad[0]->ini_frame ); /* Note: the index [0] in the last argument is intended, the ini_frame counter is only maintained in the zero-th channel's VAD handle */ noise_est_ivas_fx( st, old_pitch1, tmpN_LR_fx[1], epsP_fx, Etot_LR_fx[1], sub( Etot_LR_fx[1], hCPE->hFrontVad[1]->lp_speech_fx ), corr_shiftR_fx, noise_est_ivas_fx( st, old_pitch1, tmpN_LR_fx[1], q_tmpN_LR[1], epsP_fx, Etot_LR_fx[1], sub( Etot_LR_fx[1], hCPE->hFrontVad[1]->lp_speech_fx ), corr_shiftR_fx, tmpE_LR_fx[1], q_tmpE_LR[1], fr_bands_LR_fx[1], fr_bands_LR_fx_q[1], &cor_map_sum_LR_fx[1], &ncharX_LR_fx, &sp_div_LR_fx, &q_sp_div_LR, &non_staX_LR_fx, loc_harmLR_fx, lf_E_LR_fx[1], lf_E_LR_fx_q, &hCPE->hFrontVad[1]->hNoiseEst->harm_cor_cnt, extract_h( hCPE->hFrontVad[1]->hNoiseEst->Etot_l_lp_32fx ), hCPE->hFrontVad[1]->hNoiseEst->Etot_v_h2_32fx, &hCPE->hFrontVad[1]->hNoiseEst->bg_cnt, Loading Loading
lib_com/ivas_masa_com_fx.c +7 −4 Original line number Diff line number Diff line Loading @@ -978,7 +978,7 @@ static Word16 quantize_phi_masa_fx( Word32 tmp32; Word16 tmp_e, delta_phi_e; delta_phi_fx = L_deposit_h( BASOP_Util_Divide1616_Scale( 360, n, &delta_phi_e ) ); delta_phi_fx = BASOP_Util_Divide3232_Scale_newton( 360, n, &delta_phi_e ); delta_phi_fx = L_shr( delta_phi_fx, sub( sub( 31, delta_phi_e ), 22 ) ); // Q22 IF( EQ_16( n, 1 ) ) Loading @@ -1000,8 +1000,8 @@ static Word16 quantize_phi_masa_fx( } tmp32 = L_add( L_sub( phi_fx, dd_fx ), L_shr( delta_phi_fx, 1 ) ); id_phi = BASOP_Util_Divide3232_Scale( tmp32, delta_phi_fx, &tmp_e ); id_phi = shr( id_phi, sub( 15, tmp_e ) ); // Q0 tmp32 = BASOP_Util_Divide3232_Scale_newton( tmp32, delta_phi_fx, &tmp_e ); id_phi = extract_l( L_shr( tmp32, sub( 31, tmp_e ) ) ); // Q0 if ( EQ_16( id_phi, n ) ) { Loading @@ -1014,7 +1014,10 @@ static Word16 quantize_phi_masa_fx( id_phi = sub( n, 1 ); } *phi_hat_fx = L_add( L_shl( Mpy_32_16_1( delta_phi_fx, id_phi ), 15 ), dd_fx ); // q22 + q0 - 15 = q7 -> q7 + 15 = q22 delta_phi_fx = BASOP_Util_Divide3232_Scale_newton( L_mult0( 360, id_phi ), n, &delta_phi_e ); delta_phi_fx = L_shr( delta_phi_fx, sub( sub( 31, delta_phi_e ), 22 ) ); // Q22 *phi_hat_fx = L_add( delta_phi_fx, dd_fx ); // Q22 move32(); return id_phi; // Q0 Loading
lib_com/ivas_rom_com_fx.c +8 −8 Original line number Diff line number Diff line Loading @@ -485,14 +485,14 @@ const Word32 dft_res_gains_q_fx[][2] = { // Q13 const Word16 McMASA_LFEGain_vectors_fx_q13[64] = { 3112, 2703, 1556, 1638, -1310, -1802, -2867, -2785, 4096, 4096, 4096, 4096, -6553, -3276, 8355, 819, -4096, -4096, -4096, -4096, -4587, -983, -6389, 11141, -8355, 9666, -4669, 2703, 5898, -9256, 7946, -5079, -7454, 7618, 8192, -9011, 14172, -1884, -6389, -6881, 7782, -13107, -2785, 7618, 7127, 3850, -15564, 4259, 5488, 11632, -7946, -10158, 6799, 4751, 4997, -16711, -6553, -12943, 6717, 11632, -17530, 2129, 6881, 8355 3113, 2703, 1556, 1638, -1311, -1802, -2867, -2785, 4096, 4096, 4096, 4096, -6554, -3277, 8356, 819, -4096, -4096, -4096, -4096, -4588, -983, -6390, 11141, -8356, 9667, -4669, 2703, 5898, -9257, 7946, -5079, -7455, 7619, 8192, -9011, 14172, -1884, -6390, -6881, 7782, -13107, -2785, 7619, 7127, 3850, -15565, 4260, 5489, 11633, -7946, -10158, 6799, 4751, 4997, -16712, -6554, -12943, 6717, 11633, -17531, 2130, 6881, 8356 }; // Q25 Loading
lib_com/rom_com.c +27 −0 Original line number Diff line number Diff line Loading @@ -15654,6 +15654,33 @@ const Word16 wac_swb_l[LPC_SHB_ORDER] = 30328 }; const Word16 wac_swb_ivas_h[LPC_SHB_ORDER] = {//Q15 32749, 32731, 32686, 32622, 32541, 32442, 32325, 32191, 32039, 31870 }; const Word16 wac_swb_ivas_l[LPC_SHB_ORDER] = {//Q15 2624, 20874, 7850, 25873, 12831, 5927, 10541, 239, 15037, 30328 }; const Word16 lbr_wb_bwe_lsfvq_cbook_2bit_fx[4 * 4] = {
lib_com/rom_com.h +4 −2 Original line number Diff line number Diff line Loading @@ -618,6 +618,8 @@ extern const Word16 Hilbert_coeffs_fx[4 * NUM_HILBERTS][HILBERT_ORDER1 + 1]; // extern const Word16 wac_swb_h[]; // Q15 extern const Word16 wac_swb_l[]; // Q15 extern const Word16 wac_swb_ivas_h[]; // Q15 extern const Word16 wac_swb_ivas_l[]; // Q15 extern const Word16 wb_bwe_lsfvq_cbook_8bit_fx[]; // Q15 extern const Word16 lbr_wb_bwe_lsfvq_cbook_2bit_fx[]; // Q15 Loading
lib_enc/ivas_core_pre_proc_front_fx.c +4 −21 Original line number Diff line number Diff line Loading @@ -1228,16 +1228,7 @@ ivas_error pre_proc_front_ivas_fx( /*------------------------------------------------------------------* * Update estimated noise energy and voicing cut-off frequency *-----------------------------------------------------------------*/ Word16 scale = s_min( Q31, s_min( add( q_tmpN, L_norm_arr( tmpN_fx, NB_BANDS ) ), add( st->hNoiseEst->q_bckr, L_norm_arr( st->hNoiseEst->bckr_fx, NB_BANDS ) ) ) ); scale = sub( scale, 1 ); // guard bits scale_sig32( st->hNoiseEst->bckr_fx, NB_BANDS, sub( scale, st->hNoiseEst->q_bckr ) ); scale_sig32( tmpN_fx, NB_BANDS, sub( scale, q_tmpN ) ); st->hNoiseEst->q_bckr = q_tmpN = scale; move16(); move16(); scale = s_min( Q31, add( st->hNoiseEst->ave_enr_q, s_min( L_norm_arr( st->hNoiseEst->ave_enr_fx, NB_BANDS ), L_norm_arr( st->hNoiseEst->ave_enr2_fx, NB_BANDS ) ) ) ); Word16 scale = s_min( Q31, add( st->hNoiseEst->ave_enr_q, s_min( L_norm_arr( st->hNoiseEst->ave_enr_fx, NB_BANDS ), L_norm_arr( st->hNoiseEst->ave_enr2_fx, NB_BANDS ) ) ) ); scale = s_min( scale, add( q_tmpE, L_norm_arr( tmpE_fx, NB_BANDS ) ) ); scale = sub( scale, 1 ); // guard bits scale_sig32( tmpE_fx, NB_BANDS, sub( scale, q_tmpE ) ); Loading @@ -1256,7 +1247,7 @@ ivas_error pre_proc_front_ivas_fx( move16(); move16(); noise_est_ivas_fx( st, old_pitch1, tmpN_fx, epsP_fx, extract_h( Etot_fx ), *relE_fx, corr_shift_fx, tmpE_fx, q_tmpE, fr_bands_fx, fr_bands_fx_q, cor_map_sum_fx, noise_est_ivas_fx( st, old_pitch1, tmpN_fx, q_tmpN, epsP_fx, extract_h( Etot_fx ), *relE_fx, corr_shift_fx, tmpE_fx, q_tmpE, fr_bands_fx, fr_bands_fx_q, cor_map_sum_fx, &ncharX_fx, &sp_div_fx, &q_sp_div, &non_staX_fx, loc_harm, lf_E_fx, q_lf_E_fx, &st->hNoiseEst->harm_cor_cnt, extract_h( st->hNoiseEst->Etot_l_lp_32fx ), st->hNoiseEst->Etot_v_h2_32fx, &st->hNoiseEst->bg_cnt, st->lgBin_E_fx, &dummy_fx, S_map_fx, hStereoClassif, NULL, st->ini_frame ); Loading @@ -1265,14 +1256,6 @@ ivas_error pre_proc_front_ivas_fx( { FOR( Word16 j = 0; j < 2; j++ ) { scale = s_min( add( q_tmpN_LR[j], L_norm_arr( tmpN_LR_fx[j], NB_BANDS ) ), add( hCPE->hFrontVad[j]->hNoiseEst->q_bckr, L_norm_arr( hCPE->hFrontVad[j]->hNoiseEst->bckr_fx, NB_BANDS ) ) ); scale = sub( s_min( Q31, scale ), 1 ); scale_sig32( hCPE->hFrontVad[j]->hNoiseEst->bckr_fx, NB_BANDS, sub( scale, hCPE->hFrontVad[j]->hNoiseEst->q_bckr ) ); scale_sig32( tmpN_LR_fx[j], NB_BANDS, sub( scale, q_tmpN_LR[j] ) ); hCPE->hFrontVad[j]->hNoiseEst->q_bckr = q_tmpN_LR[j] = scale; move16(); move16(); scale = add( hCPE->hFrontVad[j]->hNoiseEst->ave_enr_q, s_min( L_norm_arr( hCPE->hFrontVad[j]->hNoiseEst->ave_enr_fx, NB_BANDS ), L_norm_arr( hCPE->hFrontVad[j]->hNoiseEst->ave_enr2_fx, NB_BANDS ) ) ); scale = s_min( scale, add( q_tmpE_LR[j], L_norm_arr( tmpE_LR_fx[j], NB_BANDS ) ) ); scale = sub( s_min( Q31, scale ), 1 ); Loading @@ -1297,14 +1280,14 @@ ivas_error pre_proc_front_ivas_fx( move16(); /* Run noise_est for Left and Right channel */ noise_est_ivas_fx( st, old_pitch1, tmpN_LR_fx[0], epsP_fx, Etot_LR_fx[0], sub( Etot_LR_fx[0], hCPE->hFrontVad[0]->lp_speech_fx ), corr_shiftL_fx, noise_est_ivas_fx( st, old_pitch1, tmpN_LR_fx[0], q_tmpN_LR[0], epsP_fx, Etot_LR_fx[0], sub( Etot_LR_fx[0], hCPE->hFrontVad[0]->lp_speech_fx ), corr_shiftL_fx, tmpE_LR_fx[0], q_tmpE_LR[0], fr_bands_LR_fx[0], fr_bands_LR_fx_q[0], &cor_map_sum_LR_fx[0], &ncharX_LR_fx, &sp_div_LR_fx, &q_sp_div_LR, &non_staX_LR_fx, loc_harmLR_fx, lf_E_LR_fx[0], lf_E_LR_fx_q, &hCPE->hFrontVad[0]->hNoiseEst->harm_cor_cnt, extract_h( hCPE->hFrontVad[0]->hNoiseEst->Etot_l_lp_32fx ), hCPE->hFrontVad[0]->hNoiseEst->Etot_v_h2_32fx, &hCPE->hFrontVad[0]->hNoiseEst->bg_cnt, st->lgBin_E_fx, &dummy_fx, S_map_LR_fx, NULL, hCPE->hFrontVad[0], hCPE->hFrontVad[0]->ini_frame ); /* Note: the index [0] in the last argument is intended, the ini_frame counter is only maintained in the zero-th channel's VAD handle */ noise_est_ivas_fx( st, old_pitch1, tmpN_LR_fx[1], epsP_fx, Etot_LR_fx[1], sub( Etot_LR_fx[1], hCPE->hFrontVad[1]->lp_speech_fx ), corr_shiftR_fx, noise_est_ivas_fx( st, old_pitch1, tmpN_LR_fx[1], q_tmpN_LR[1], epsP_fx, Etot_LR_fx[1], sub( Etot_LR_fx[1], hCPE->hFrontVad[1]->lp_speech_fx ), corr_shiftR_fx, tmpE_LR_fx[1], q_tmpE_LR[1], fr_bands_LR_fx[1], fr_bands_LR_fx_q[1], &cor_map_sum_LR_fx[1], &ncharX_LR_fx, &sp_div_LR_fx, &q_sp_div_LR, &non_staX_LR_fx, loc_harmLR_fx, lf_E_LR_fx[1], lf_E_LR_fx_q, &hCPE->hFrontVad[1]->hNoiseEst->harm_cor_cnt, extract_h( hCPE->hFrontVad[1]->hNoiseEst->Etot_l_lp_32fx ), hCPE->hFrontVad[1]->hNoiseEst->Etot_v_h2_32fx, &hCPE->hFrontVad[1]->hNoiseEst->bg_cnt, Loading