diff --git a/lib_com/rom_com.h b/lib_com/rom_com.h index 15d568edae676e4045ad72646ec3cc7685692c97..de0c26a5ab56a7a7c1ad13652991ae1d8d21435e 100644 --- a/lib_com/rom_com.h +++ b/lib_com/rom_com.h @@ -395,17 +395,11 @@ extern const Word16 *const Predictors_fx[]; // Q15 extern const Word16 CBsizes[]; // Q0 extern const Word16 CBbits[]; // Q0 -extern const Word16 CBbits_p[]; // Q0 -extern const Word16 vals_fx[NO_LEADERS][MAX_NO_VALS]; // Q1 - -extern const Word16 no_vals[NO_LEADERS]; // Q0 -// extern const Word16 no_vals_fx[NO_LEADERS]; - -extern const Word16 no_vals_ind[NO_LEADERS][MAX_NO_VALS]; // Q0 -// extern const Word16 no_vals_ind_fx[NO_LEADERS][MAX_NO_VALS]; - +extern const Word16 CBbits_p[]; // Q0 +extern const Word16 vals_fx[NO_LEADERS][MAX_NO_VALS]; // Q1 +extern const Word16 no_vals[NO_LEADERS]; // Q0 +extern const Word16 no_vals_ind[NO_LEADERS][MAX_NO_VALS]; // Q0 extern const Word16 C_VQ[LATTICE_DIM + 1][LATTICE_DIM + 1]; // Q0 -// extern const Word16 C_VQ_fx[LATTICE_DIM + 1][LATTICE_DIM + 1]; extern const Word16 BitsVQ[]; // Q0 extern const Word16 BitsVQ_p[]; // Q0 @@ -422,26 +416,21 @@ extern const Word16 scales_fx[][MAX_NO_SCALES * 2]; // Q11 extern const Word16 scales_ivas_fx[][MAX_NO_SCALES * 2]; // Q11 extern const Word16 scales_p_ivas_fx[][MAX_NO_SCALES * 2]; // Q11 extern const Word16 scales_p_fx[][MAX_NO_SCALES * 2]; // Q11 -extern const Word16 predmode_tab_float[][6]; -extern const Word16 predmode_tab[][6]; // Q0 -extern const Word16 pl_HQ_fx[]; // Q1 +extern const Word16 predmode_tab[][6]; // Q0 +extern const Word16 pl_HQ_fx[]; // Q1 extern const Word16 pi0[]; // Q0 -// extern const Word16 pi0_fx[]; extern const UWord32 table_no_cv[]; // Q0 extern const Word32 table_no_cv_fx[]; // Q0 -extern const Word16 pl_par[]; // Q0 -// extern const Word16 pl_par_fx[]; /* 1 if even number of signs */ +extern const Word16 pl_par[]; // Q0 extern const Word16 *const Quantizers_p_fx[]; // Qlog2(2.56) extern const Word16 *const Quantizers_fx[]; // Qlog2(2.56) extern const Word16 cng_sort[]; // Q0 -// extern const Word16 cng_sort_fx[]; extern const Word16 perm_MSLVQ[][4]; // Q0 -// extern const Word16 perm_MSLVQ_fx[][4]; extern const Word16 min_lat_bits_SN[]; extern const Word16 min_lat_bits_SN_fx[]; // Q0 @@ -656,9 +645,7 @@ extern const Word16 fb_bwe_sm_subband[]; // Q0 extern const Word16 swb_inv_bwe_subband_width_fx[]; // Q15 extern const Word16 swb_bwe_sm_subband[]; // Q0 extern const Word16 smooth_factor_fx[]; // Q15 -extern const Word16 fb_bwe_subband_float[]; // Q0 extern const Word16 fb_inv_bwe_subband_width_fx[]; // Q15 -extern const Word16 fb_bwe_sm_subband_float[]; // Q0 extern const Word16 fb_smooth_factor_fx[]; // Q15 extern const Word16 EnvCdbk11_fx[]; /*Q8 */ extern const Word16 EnvCdbk1st_fx[]; /*Q8 */ @@ -673,6 +660,7 @@ extern const Word16 w_NOR_fx[]; // Q15 extern const Word16 Mean_env_fx[]; // Q8 extern const Word16 Mean_env_fb_fx[]; /*Q8 */ extern const Word16 Mean_env_tr_fx[]; /*Q8 */ + /*------------------------------------------------------------------------------* * ACEPL/HQ core switching tables *------------------------------------------------------------------------------*/ @@ -685,8 +673,8 @@ extern const Word16 hp12800_16000_fx[]; // Q15 extern const Word16 cu15_fx[28][3]; // Q13 extern const Word16 cu4_fx[6][3]; // Q13 -extern const Word16 ct2[7][13]; // Q0 extern const Word16 ct2_fx[7][14]; // Q13 + /*------------------------------------------------------------------------------* * HQ core tables *------------------------------------------------------------------------------*/ @@ -703,13 +691,12 @@ extern const Word16 wscw16q15_16_fx[]; /*Q15 */ extern const Word16 wscw16q15_32_fx[]; /*Q15 */ /* Band structure */ -extern const Word16 band_len_HQ[]; // Q0 -extern const Word16 band_start_HQ[]; // Q0 -extern const Word16 band_end_HQ[]; // Q0 -extern const Word16 band_len_wb[]; // Q0 -extern const Word16 band_start_wb[]; // Q0 -extern const Word16 band_end_wb[]; // Q0 -extern const Word16 band_len_harm_float[]; +extern const Word16 band_len_HQ[]; // Q0 +extern const Word16 band_start_HQ[]; // Q0 +extern const Word16 band_end_HQ[]; // Q0 +extern const Word16 band_len_wb[]; // Q0 +extern const Word16 band_start_wb[]; // Q0 +extern const Word16 band_end_wb[]; // Q0 extern const Word16 band_start_harm[]; // Q0 extern const Word16 band_end_harm[]; // Q0 extern const Word16 rat_fx[SFM_N_WB]; // Q14 @@ -731,7 +718,6 @@ extern const Word32 thren_pg_fx[44]; extern const Word32 dicn_fx[40]; /*Q14 */ extern const Word32 thren_HQ_fx[39]; /*Q14 */ -extern const Word16 dicnlg2_float[40]; // Q0 extern const Word16 huffnorm[32]; // Q0 extern const Word16 huffsizn[32]; // Q0 extern const Word16 huffcoef[60]; // Q0 @@ -909,6 +895,7 @@ extern const Word16 att_step_fx[4]; // Q13 extern const Word16 gain_cb_size[]; extern const Word16 stab_trans_fx[]; // Q15 extern const Word16 env_stab_tp_fx[2][2]; // Q15 + /*----------------------------------------------------------------------------------* * SWB BWE for LR MDCT core *----------------------------------------------------------------------------------*/ @@ -1010,6 +997,7 @@ extern const Word16 hvq_cp_huff_tab[52]; // Q0 /*------------------------------------------------------------------------------* * GSC mode *------------------------------------------------------------------------------*/ + extern const Word16 sin_table256_fx[]; // Q15 extern const Word16 gsc_sfm_start[]; // Q0 extern const Word16 gsc_sfm_end[]; // Q0 @@ -1091,6 +1079,7 @@ extern const Word16 Ip_fft4[6]; // Q0 /*----------------------------------------------------------------------------------* * FEC for HQ core *----------------------------------------------------------------------------------*/ + extern const Word16 Asr_LP32_fx[41]; // Q15 extern const Word16 Asr_LP16_fx[21]; // Q15 extern const Word16 Asr_LP48_fx[61]; // Q15 @@ -1132,10 +1121,8 @@ extern const Word16 cldfb_anaScale[]; // Q0 extern const Word16 cldfb_synScale[]; // Q0 extern const Word16 cldfb_synGain[]; // Q0 extern const Word16 *cldfb_protoFilter_2_5ms[]; -// extern const Word16 *cldfb_protoFilter_5_0ms[]; extern const Word16 cldfb_scale_2_5ms[7]; // Q8 - extern const Word32 rot_vec_syn_re_L10_fx[5]; // Q31 extern const Word32 rot_vec_syn_im_L10_fx[5]; // Q31 extern const Word32 rot_vec_syn_re_L16_fx[8]; // Q31 @@ -1169,16 +1156,14 @@ extern const Word16 m_array[SIZE_SCALE_TABLE_CN]; // Q15 extern const Word16 msQeqInvAv_thresh[3]; // Q15 extern const Word16 msNoiseSlopeMax[4]; // Q15 -extern const SCALE_SETUP scaleTableStereo[SIZE_SCALE_TABLE_STEREO]; // Q7 -extern const SCALE_SETUP scaleTableMono[SIZE_SCALE_TABLE_MONO]; // Q7 -extern const SCALE_SETUP scaleTable_cn_only[SIZE_SCALE_TABLE_CN]; // Q14 -extern const SCALE_SETUP scaleTable_cn_dirac[15]; // Q14 -extern const Word16 scaleTable_cn_only_amrwbio[SIZE_SCALE_TABLE_CN_AMRWB][2]; // Q14 -extern const Word32 scaleTable_cn_only_amrwbio_fx_by_10f[SIZE_SCALE_TABLE_CN_AMRWB][2]; // Q29 +extern const SCALE_SETUP scaleTableStereo[SIZE_SCALE_TABLE_STEREO]; // Q7 +extern const SCALE_SETUP scaleTableMono[SIZE_SCALE_TABLE_MONO]; // Q7 +extern const SCALE_SETUP scaleTable_cn_only[SIZE_SCALE_TABLE_CN]; // Q14 +extern const SCALE_SETUP scaleTable_cn_dirac[15]; // Q14 +extern const Word16 scaleTable_cn_only_amrwbio[SIZE_SCALE_TABLE_CN_AMRWB][2]; // Q14 extern const Word16 sidparts_encoder_noise_est[SIZE_SIDPARTS_ENC_NOISE_EST]; // Q0 - extern const FD_CNG_SETUP FdCngSetup_nb; extern const FD_CNG_SETUP FdCngSetup_wb1; extern const FD_CNG_SETUP FdCngSetup_wb2; @@ -1214,7 +1199,6 @@ extern const Word16 *stage1_dct_col_syn_shift[]; // Q0 extern const Word16 cdk1r_tr_midQ_truncQ_fx[]; // Q10 extern const Word32 fdcng_dct_scaleF_fx[]; // Q31 - extern const Word16 unique_idctT2_24coeffsQ16[]; // Q16 extern const Word8 idctT2_24_compressed_idx[]; @@ -1413,12 +1397,10 @@ extern const Word32 LastCoefPred_0bit_fx[18]; // Q31 extern const Word32 LastCoefPred_1bit_fx[36]; // Q31 extern const Word16 config_LSF_BWE[]; // Q0 - // basops extern const Word32 BASOP_util_normReciprocal[CHEAP_NORM_SIZE]; // Q31 extern const Word16 f_atan_expand_range[MAXSFTAB - ( MINSFTAB - 1 )]; // Q15 - extern const Word16 Grid[]; // Q15 extern const Word16 pwAlpha[10]; // Q15 extern const Word8 Ind_Guess[256]; @@ -1464,6 +1446,7 @@ extern const Word16 InvIntTable[65]; // Q15 extern const Word16 TecLowBandTable[]; // Q0 extern const Word16 TecSC_Fx[]; // Q15 extern const Word16 sqrt_table_pitch_search[256 + 1]; // Q11 + /* fft_evs.c */ extern const Word16 RotVector_32[2 * 20]; // Q15 extern const Word16 RotVector_256[2 * ( 256 - 32 )]; // Q15 @@ -1505,7 +1488,6 @@ extern const Word16 phs_tbl_dec[]; // Q15 extern const Word16 Low_H_phasedisp[L_SUBFR]; // Q15 extern const Word16 Mid_H_phasedisp[L_SUBFR]; // Q15 - // ACcontextMapping_dec_fx.c extern const Word16 Tab_esc_nb[4]; // Q0 extern const Word16 pow2tab[15]; // Q0 diff --git a/lib_com/rom_com_fx.c b/lib_com/rom_com_fx.c index 497196ecc3a6966ce592a59711c095cda6ee4604..cec1be1ce1b67f392fbed8b222a50483e30f89e6 100644 --- a/lib_com/rom_com_fx.c +++ b/lib_com/rom_com_fx.c @@ -7016,12 +7016,6 @@ const Word16 scaleTable_cn_only_amrwbio[3][2] = { ACELP_8k85, 16306/*0.9952622652 Q14*/ }, { ACELP_12k65, 9583/*0.5848932266 Q14*/ }, }; -const Word32 scaleTable_cn_only_amrwbio_fx_by_10f[SIZE_SCALE_TABLE_CN_AMRWB][2] =//Q29 -{ - { ACELP_6k60, 858993459 }, - { ACELP_8k85, 644245094 }, - { ACELP_12k65, 429496729 } -}; const Word16 sidparts_encoder_noise_est[SIZE_SIDPARTS_ENC_NOISE_EST] = { 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 58, 68, 80, 92, 108, 126, 148, 176, 212, 255, 259, 264, 269, 279 }; // Q0 @@ -11874,14 +11868,6 @@ const Word16 BitsVQ_p[]= }; // Q0 -const Word16 predmode_tab_float[][6] = -{ - {1,1,2,2,0,2}, - {1,1,2,2,0,2}, - {1,-1,2,1,0,1}, - {1,1,2,1,0,1} /* should check how is the cb for audio mode at 13.2*/ -}; - const Word16 predmode_tab[][6] = { {1,1,2,2,0,2}, @@ -12583,19 +12569,6 @@ const Word16 C_VQ[LATTICE_DIM+1][LATTICE_DIM+1] = {1,8,28,56,70,56,28,8,1} }; -const Word16 C_VQ_fx[LATTICE_DIM + 1][LATTICE_DIM + 1] = -{ - {1,0,0,0,0,0,0,0,0}, - {1,1,0,0,0,0,0,0,0}, - {1,2,1,0,0,0,0,0,0}, - {1,3,3,1,0,0,0,0,0}, - {1,4,6,4,1,0,0,0,0}, - {1,5,10,10,5,1,0,0,0}, - {1,6,15,20,15,6,1,0,0}, - {1,7,21,35,35,21,7,1,0}, - {1,8,28,56,70,56,28,8,1} -}; // Q0 - const UWord32 table_no_cv[] = //Q0 { 0, 112, 240, 1360, 1376, 2400, 4192, 5536, 9120, 9376, 18336, 18448, 25616, 26640, 33808, 40528, 40752, @@ -15557,10 +15530,7 @@ const Word16 fb_bwe_sm_subband[DIM_FB] = { 656, 696, 760 }; // Q0 const Word16 swb_inv_bwe_subband_width_fx[SWB_FENV] = { 2048,1365,2048,1365,2048,1365,2048,1365,1365,1365,1365,1365,1024,1024 };//Q15 const Word16 swb_bwe_sm_subband[SWB_FENV] = {248, 268, 288, 308, 328, 348, 368, 388, 412, 436, 460, 484, 512, 544}; // Q0 const Word16 smooth_factor_fx[SWB_FENV - 1] = { 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1366, 1366, 1366, 1366, 1024, 1024 };//Q15 - -const Word16 fb_bwe_subband_float[DIM_FB+1] = {640, 680, 720, 800}; // Q0 const Word16 fb_inv_bwe_subband_width_fx[DIM_FB] = { 819, 819, 409 };//Q15 -const Word16 fb_bwe_sm_subband_float[DIM_FB] = {656, 696, 760}; // Q0 const Word16 fb_smooth_factor_fx[DIM_FB] = { 1024, 819, 512 };//Q15 @@ -16381,13 +16351,6 @@ const Word16 pgain_huffsizn[32] = 4, 4, 4, 4, 4, 4, 5, 5, 6, 7, 7, 8, 10, 10, 12, 12 }; // Q0 -const Word16 dicnlg2_float[40] = -{ - 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, - 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, - 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, - 4, 3, 2, 1, 0, -1, -2, -3, -4, -5 -}; // Q0 /*** Table for quantization of MLT coefficients ***/ const Word16 norm_order_48[NB_SFM] = @@ -16460,11 +16423,6 @@ const Word16 band_len_wb[26] = 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 32, 32 }; // Q0 -const Word16 band_len_harm_float[SFM_N_HARM_FB] = // Q0 -{ - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 16, 16, 16, 16, 16, 16, 32, 32, 32, 48, 48, 48, 48, 64, 64, 64, 96 -}; const Word16 band_start_harm[SFM_N_HARM_FB] =//Q0 { @@ -19691,20 +19649,6 @@ const Word16 hp16000_48000_fx[49] =//Q15 175, 138, -0, -83, -64, -0, 39, 33, -0 }; -const Word16 ct2[7][13] = -{ - /* accepted configurations */ - /*input 12.8, output :*/ - /*8*/ {30, 22, 30, 16, 25, 30, 19, 30, 30, 0, 8, 4, 15}, - /*16*/ {25, 22, 19, 16, 16, 0, 0, 0, 12, 1, 4, 4, 15}, - /*32*/ {19, 16, 19, 16, 16, 0, 0, 0, 6, 2, 2, 4, 15}, - /*48*/ {17, 14, 15, 16, 16, 0, 0, 0, 4, 3, 4, 4, 15}, - - /*input 16, output :*/ - /*12*/ { 9, 3, 4, 5, 9, 0, 0, 0, 5, 0, 5, 5, 4}, - /*32*/ { 4, 4, 4, 4, 4, 0, 0, 0, 2, 1, 1, 4, 4}, - /*48*/ {18, 18, 18, 18, 18, 0, 0, 0, 5, 2, 1, 4, 15}, -}; // Q0 const Word16 ct2_fx[7][14] = { /* accepted configurations */ diff --git a/lib_dec/rom_dec.h b/lib_dec/rom_dec.h index cfa8455bfa7fbc2301f388811da7c4fe7d13e9ee..f5eed905ba5d6457f3c67389849c090395161dc4 100644 --- a/lib_dec/rom_dec.h +++ b/lib_dec/rom_dec.h @@ -56,7 +56,6 @@ extern const Word16 lsf_tab_fx[LPC_SHB_ORDER]; // Q15 extern const Word16 POW_ATT_TABLE0[]; // Q15 extern const Word16 POW_ATT_TABLE1[]; // Q15 extern const Word16 gw[LGW_MAX]; // Q0 -extern const Word16 gw_fx[LGW_MAX]; // Q0 extern const Word16 gw_len_inv_fx[LGW_MAX - 1]; // Q15 extern const Word16 GR_POW_HEADROOM[]; extern const Word16 ivas_gwlpr[LGW_MAX]; @@ -66,7 +65,6 @@ extern const Word16 w_hamm16k_2_fx[]; // Q15 extern const Word16 swb_hr_inv_frm_len[4]; /* in Q19 */ extern const Word16 inv_tbl_2n_minus1[]; - extern const Word16 w_hamm_sana48k_2_fx[]; // Q15 extern const Word16 w_hamm_sana32k_2_fx[]; // Q15 extern const Word16 w_hamm_sana16k_2_fx[]; // Q15 diff --git a/lib_dec/rom_dec_fx.c b/lib_dec/rom_dec_fx.c index f3539d64095a922968b574519abb8f691db135e1..a8254a6381c5a10c4cfda992dffb70160eefdf9f 100644 --- a/lib_dec/rom_dec_fx.c +++ b/lib_dec/rom_dec_fx.c @@ -149,8 +149,6 @@ const Word16 POW_ATT_TABLE1[OFF_FRAMES_LIMIT + 1] = /* Q15 */ /* 125 375 750 1250 2000 4000 8000 16000 24000 */ const Word16 gw[LGW_MAX] = { 1, 3, 6, 10, 16, 32, 64, 128, 192 }; -const Word16 gw_fx[LGW_MAX] = { 1, 3, 6, 10, 16, 32, 64, 128, 192 }; /* Q0 frequency group start bins for transient analysis */ - const Word16 gw_len_inv_fx[LGW_MAX - 1] = /* Q15 */ { 16384, 10923, 8192, 5461, diff --git a/lib_enc/SNR_calc_fx.c b/lib_enc/SNR_calc_fx.c index ef54f1841f3fa8cfd42d8b3eb485820e396d66da..8e6a555d1e0dbfc241bb467b4da639bc8a2b30a6 100644 --- a/lib_enc/SNR_calc_fx.c +++ b/lib_enc/SNR_calc_fx.c @@ -253,7 +253,7 @@ void snr_calc( set_zero_fx( snr_tmpidx, 12 ); - SNR_sb_num = SNR_SUB_BAND_NUM[bwidth - CLDFBVAD_NB_ID]; /* Q0 */ + SNR_sb_num = ENERGY_BAND_NUM[bwidth - CLDFBVAD_NB_ID]; /* Q0 */ move16(); sb_bg_energy = hVAD_CLDFB->sb_bg_energy; frame_sb_energy = hVAD_CLDFB->frame_sb_energy; diff --git a/lib_enc/energy_fx.c b/lib_enc/energy_fx.c index b81412ead1e24f0ad8fe67ab4cce67bc2183e966..6a0be10a75cead7d3db3cd18e87b212bd75b64cb 100644 --- a/lib_enc/energy_fx.c +++ b/lib_enc/energy_fx.c @@ -43,7 +43,7 @@ void est_energy_fx( Word32 *sb_power = enerBuffer; Word32 Ltmp32 = 0; move32(); - SNR_sb_num = SNR_SUB_BAND_NUM[bandwidth - CLDFBVAD_NB_ID]; + SNR_sb_num = ENERGY_BAND_NUM[bandwidth - CLDFBVAD_NB_ID]; move16(); Nregion_index = REGION_INDEX[bandwidth - CLDFBVAD_NB_ID]; move16(); @@ -237,7 +237,7 @@ void background_update_fx( move16(); CONST32fix.s32Mantissa = 1759218560; move32(); - SNR_sb_num = SNR_SUB_BAND_NUM[bandwith - CLDFBVAD_NB_ID]; + SNR_sb_num = ENERGY_BAND_NUM[bandwith - CLDFBVAD_NB_ID]; move16(); scale_sb_energy = hVAD_CLDFB->sb_bg_energy_scale; move16(); diff --git a/lib_enc/pitch_ol_fx.c b/lib_enc/pitch_ol_fx.c index 324c600a226d1d14d8c1c959c3b6c6fef8634469..2071088de1dfaebdedf6b50ff15f554ee68a194a 100644 --- a/lib_enc/pitch_ol_fx.c +++ b/lib_enc/pitch_ol_fx.c @@ -398,7 +398,7 @@ static void pitch_ol_resolve_fx( /*==================================================================================*/ -/* FUNCTION : pitch_ol_fx() */ +/* FUNCTION : pitch_ol_fx() */ /*----------------------------------------------------------------------------------*/ /* PURPOSE : * Compute the open loop pitch lag. @@ -422,38 +422,6 @@ static void pitch_ol_resolve_fx( * For each section, the length of the vectors to correlate is * greater/equal to the longest pitch delay. */ /*----------------------------------------------------------------------------------*/ -/* INPUT ARGUMENTS : */ -/* _ (Word16[]) old_pitch : OL pitch of the 2nd half-frame of the last frame Q0 */ -/* _ (Word16[]) old_corr_fx : correlation Q15 */ -/* _ (Word16[]) corr_shift_fx : normalized correlation correction Q15 */ -/* _ (Word16[]) old_thres_fx : maximum correlation weighting with respect */ -/* to past frame pitch Q15 */ -/* _ (Word16[]) delta_pit : old pitch extrapolation correction Q0 */ -/* _ (Word16[]) st_old_wsp2_fx: weighted speech memory qwsp */ -/* _ (Word16[]) wsp_fx : weighted speech for current frame & look-ahead qwsp */ -/* _ (Word16[]) mem_decim2_fx : wsp decimation filter memory qwsp */ -/* _ (Word16[]) relE_fx : relative frame energy Q8 */ -/* _ (Word16[]) L_look : look-ahead Q0 */ -/* _ (Word16[]) Opt_SC_VBR : SC-VBR flag Q0 */ -/* _ (Word16*) qwsp : wsp & filter memory Qformat */ -/*----------------------------------------------------------------------------------*/ -/* OUTPUT ARGUMENTS : */ -/* _ (Word16[]) pitch : open loop pitch lag for each half-frame Q0 */ -/* _ (Word16[]) T_op : open loop pitch lag for each half-frm for quant Q0 */ -/* _ (Word16[]) voicing_fx : max normalized correlation for each half-frame QIn */ -/* _ (Word16[]) old_pitch : OL pitch of the 2nd half-frame of the last frame Q0 */ -/* _ (Word16[]) old_corr_fx : correlation Q15 */ -/* _ (Word16[]) old_thres_fx : maximum correlation weighting with respect */ -/* to past frame pitch Q15 */ -/* _ (Word16[]) delta_pit : old pitch extrapolation correction Q0 */ -/* _ (Word16[]) st_old_wsp2_fx: weighted speech memory qwsp */ -/* _ (Word16[]) mem_decim2_fx : wsp decimation filter memory qwsp */ -/*----------------------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------------------*/ -/* RETURN ARGUMENTS : */ -/* _ None */ -/*==================================================================================*/ void pitch_ol_fx( Word16 pitch[3], /* o : open loop pitch lag for each half-frame in range [29,231] Q0 */ @@ -491,13 +459,16 @@ void pitch_ol_fx( Word16 tmp16, tmp16_2; Word16 qCorX, qScaledX; Word16 scaledX[NHFR][2 * NSECT], corX[NHFR][2 * NSECT]; - const Word16 *len, *len1, *sublen, *sublen1, *pit_max, *sec_length, *sec_length1; - + const Word16 *nb_sect, *nb_subsect, *len, *len1, *sublen, *sublen1, *pit_max, *sec_length, *sec_length1; Word16 pit_min_coding; /*--------------------------------------------------------------* * Initialization *--------------------------------------------------------------*/ + + nb_sect = nb_sect_12k8; + nb_subsect = nb_subsect_12k8; + len = len_12k8; len1 = len1_12k8; sublen = sublen_12k8; @@ -643,12 +614,15 @@ void pitch_ol_fx( pt_exp3 = scaled_buf_exp + 2 * ( DELTA_COH - 1 ) + len_x; pt_exp4 = pt_exp3; - IF( LT_16( i, NHFR - 1 ) ) /* First two half-frames (current frame) */ + /*-----------------------------------------------------------------* + * First two half-frames (corresponding to current frame) + *-----------------------------------------------------------------*/ + IF( LT_16( i, NHFR - 1 ) ) { pt3 = pt1; pt5 = pt1; - FOR( j = sect0; j < NSECT; j++ ) /* loop for each section */ + FOR( j = sect0; j < nb_sect[i]; j++ ) /* loop for each section */ { /*-----------------------------------------------------------------* * Find fixed vector energy @@ -729,7 +703,7 @@ void pitch_ol_fx( * For each subsection, find the correlation *----------------------------------------------------------*/ - FOR( j = subsect0; j < NSUBSECT; j++ ) + FOR( j = subsect0; j < nb_subsect[i]; j++ ) { len_temp = sublen[j]; move16(); @@ -786,7 +760,7 @@ void pitch_ol_fx( * For each section in both sets, find fixed vector energy *-----------------------------------------------------------------*/ - FOR( j = sect0; j < NSECT; j++ ) /* loop for each section */ + FOR( j = sect0; j < nb_sect[i]; j++ ) /* loop for each section */ { /* 1st set */ k = (Word16) ( pt3 - pt6 ); @@ -888,7 +862,7 @@ void pitch_ol_fx( * For each subsection, find the correlation (overlapping pitch lag values) *-----------------------------------------------------------------*/ - FOR( j = subsect0; j < NSUBSECT; j++ ) + FOR( j = subsect0; j < nb_subsect[i]; j++ ) { exp_sect[j + 1] = 0; move16(); @@ -1025,7 +999,7 @@ void pitch_ol_fx( offset1 = 0; move16(); - FOR( j = sect0; j < NSECT; j++ ) /* loop for each section */ + FOR( j = sect0; j < nb_sect[i]; j++ ) /* loop for each section */ { /* 1st set */ offset_la = 0; @@ -1158,23 +1132,25 @@ void pitch_ol_ivas_fx( Word16 i, j, k, m, pit_min, pit_min1, sect0, subsect0, old_tmp, old_tmp1, len_x, len_x1; Word16 len_temp; Word16 pitchX[NHFR][2 * NSECT]; - Word16 enr0_exp[NSECT], enr0_1_exp[NSECT], enr1_exp; Word32 enr0[NSECT], enr0_1[NSECT], enr1; Word64 temp, temp1; Word32 Ltmp; Word16 tmp16, tmp16_2; Word16 scaledX[NHFR][2 * NSECT], corX[NHFR][2 * NSECT]; - - const Word16 *len, *len1, *sublen, *sublen1, *pit_max, *sec_length, *sec_length1; - + const Word16 *nb_sect, *nb_subsect, *len, *len1, *sublen, *sublen1, *pit_max, *sec_length, *sec_length1; Word16 pit_min_coding; Word16 new_q; + new_q = sub( 63, shl( qwsp, 1 ) ); /*--------------------------------------------------------------* * Initialization *--------------------------------------------------------------*/ + + nb_sect = nb_sect_12k8; + nb_subsect = nb_subsect_12k8; + len = len_12k8; len1 = len1_12k8; sublen = sublen_12k8; @@ -1319,12 +1295,15 @@ void pitch_ol_ivas_fx( pt_cor3 = pt_cor0 + ( DELTA_COH - 1 ) + len_x; pt_cor3_exp = pt_cor0_exp + ( DELTA_COH - 1 ) + len_x; - IF( LT_16( i, NHFR - 1 ) ) /* First two half-frames (current frame) */ + /*-----------------------------------------------------------------* + * First two half-frames (corresponding to current frame) + *-----------------------------------------------------------------*/ + IF( LT_16( i, NHFR - 1 ) ) { pt3 = pt1; pt5 = pt1; - FOR( j = sect0; j < NSECT; j++ ) /* loop for each section */ + FOR( j = sect0; j < nb_sect[i]; j++ ) /* loop for each section */ { /*-----------------------------------------------------------------* * Find fixed vector energy @@ -1415,7 +1394,7 @@ void pitch_ol_ivas_fx( * For each subsection, find the correlation *----------------------------------------------------------*/ - FOR( j = subsect0; j < NSUBSECT; j++ ) + FOR( j = subsect0; j < nb_subsect[i]; j++ ) { len_temp = sublen[j]; move16(); @@ -1501,7 +1480,7 @@ void pitch_ol_ivas_fx( * For each section in both sets, find fixed vector energy *-----------------------------------------------------------------*/ - FOR( j = sect0; j < NSECT; j++ ) /* loop for each section */ + FOR( j = sect0; j < nb_sect[i]; j++ ) /* loop for each section */ { /* 1st set */ k = (Word16) ( pt3 - pt6 ); @@ -1600,7 +1579,7 @@ void pitch_ol_ivas_fx( * For each subsection, find the correlation (overlapping pitch lag values) *-----------------------------------------------------------------*/ - FOR( j = subsect0; j < NSUBSECT; j++ ) + FOR( j = subsect0; j < nb_subsect[i]; j++ ) { k = sub( pit_max[j + 1], pit_max[j] ); diff --git a/lib_enc/rom_enc.h b/lib_enc/rom_enc.h index 526136e698c0d952e185dbb9bee1d919ac0adff6..4b1a5f42cb07d0cf42a8c342a8740b9f6d6d6c8d 100644 --- a/lib_enc/rom_enc.h +++ b/lib_enc/rom_enc.h @@ -45,8 +45,8 @@ /*----------------------------------------------------------------------------------* * General tables *----------------------------------------------------------------------------------*/ + extern const Word16 sqrt_han_window_fx[]; /* Half of the square root hanning window Q15*/ -extern const Word16 tipos[]; /* Starting points for pulse position search in Algebraic innovation codebook Q0*/ extern const Word16 W_HIST_FX[DTX_HIST_SIZE]; /* CNG & DTX - table for calculation of average excitation energy Q16*/ extern const Word16 W_HIST_S_FX[DTX_HIST_SIZE]; /* CNG & DTX - table for calculation of average excitation energy Q12*/ @@ -171,7 +171,6 @@ extern const Word16 startLineSWB[N_TCX_STARTLINE_NOISE_SWB]; // Q0 // EVS basop extern const Word32 LS_MIN_SILENCE_SNR[4]; // Q25 -extern const Word16 SNR_SUB_BAND_NUM[4]; // Q0 extern const Word16 BAND_MUL[4]; // Q15 extern const UWord8 E_ROM_tipos[]; /* ACELP indexing Q0*/ diff --git a/lib_enc/rom_enc_fx.c b/lib_enc/rom_enc_fx.c index 9c7f3f53e02b6a5358e89469fcc57a30f494fef0..cb211404b411b9cb11781135d63a79f4cec30b30 100644 --- a/lib_enc/rom_enc_fx.c +++ b/lib_enc/rom_enc_fx.c @@ -108,22 +108,6 @@ const Word16 sqrt_han_window_fx[L_FFT / 2 + 1] = 32757, 32765, 32767 }; // Q15 -/*----------------------------------------------------------------------------------* - * Starting points for pulse position search in Algebraic innovation codebook - *----------------------------------------------------------------------------------*/ -const Word16 tipos[40] = -{ - 0, 1, 2, 3, /* starting point &ipos[0], 1st iter */ - 1, 2, 3, 0, /* starting point &ipos[4], 2nd iter */ - 2, 3, 0, 1, /* starting point &ipos[8], 3rd iter */ - 3, 0, 1, 2, /* starting point &ipos[12], 4th iter */ - 0, 1, 2, 3, - 1, 2, 3, 0, - 2, 3, 0, 1, - 3, 0, 1, 2, - 0, 1, 2, 3, - 1, 2, 3, 0 /* end point for 28 pulses &ipos[39], 4th iter */ -}; // Q0 /*----------------------------------------------------------------------------------* * Open-loop pitch tables *----------------------------------------------------------------------------------*/ @@ -1065,7 +1049,6 @@ const Word16 startLineSWB[N_TCX_STARTLINE_NOISE_SWB] = { 8, 44, 96 /* 13.2kbps const Word32 LS_MIN_SILENCE_SNR[4] = { 251658233/* 7.5 Q25 */, 251658233/* 7.5 Q25 */, 228170137/* 6.8 Q25 */,228170137/* 6.8 Q25 */ }; -const Word16 SNR_SUB_BAND_NUM[4] = { 8,10,12,MAX_SUBBAND_NUM }; const Word16 BAND_MUL[4] = { 4096/* 1/8.0 Q15 */,3277/* 1/10.0 Q15 */,2731/* 1/12.0 Q15 */,2731/* 1/12.0 Q15 */ }; /* enc_acelp.c, enc_acelpx.c */