diff --git a/lib_com/lsf_tools_fx.c b/lib_com/lsf_tools_fx.c index c3a5fc40ed2a614dc0b08d81933dfb149f2577e2..5b6b612cade3ff8493a5cf6741b881dcc23e6a1c 100644 --- a/lib_com/lsf_tools_fx.c +++ b/lib_com/lsf_tools_fx.c @@ -2865,7 +2865,7 @@ void lsf_syn_mem_backup_fx( move16(); *streaklimit = st_fx->streaklimit_fx; move16(); - *pstreaklen = st_fx->pstreaklen_fx; + *pstreaklen = st_fx->pstreaklen; move16(); FOR( i = 0; i < L_FFT; i++ ) @@ -3005,7 +3005,7 @@ void lsf_syn_mem_restore_fx( move16(); st_fx->streaklimit_fx = streaklimit; move16(); - st_fx->pstreaklen_fx = pstreaklen; + st_fx->pstreaklen = pstreaklen; move16(); FOR( i = 0; i < L_FFT; i++ ) diff --git a/lib_enc/acelp_core_enc_fx.c b/lib_enc/acelp_core_enc_fx.c index fb993c10a51e739ace71688e322b774ede7f02e7..def676aa0306efd5e5dc4b6dd12442c542a8be91 100644 --- a/lib_enc/acelp_core_enc_fx.c +++ b/lib_enc/acelp_core_enc_fx.c @@ -527,7 +527,7 @@ ivas_error acelp_core_enc_fx( IF( EQ_16( st_fx->coder_type, TRANSITION ) ) { - tc_classif_enc_fx( Q_new, st_fx->L_frame, &tc_subfr_fx, &position, attack_flag, st_fx->pitch_fx[0], res_fx ); + tc_classif_enc_fx( Q_new, st_fx->L_frame, &tc_subfr_fx, &position, attack_flag, st_fx->pitch[0], res_fx ); config_acelp1( ENC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl, st_fx->extl_brate, st_fx->L_frame, -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, st_fx->coder_type, tc_subfr_fx, 1, NULL, unbits_fx, st_fx->element_mode, &uc_two_stage_flag, diff --git a/lib_enc/acelp_core_switch_enc_fx.c b/lib_enc/acelp_core_switch_enc_fx.c index 994fe70a946b2db8374247d50cd6022d78c3b9c9..f2558851bd7bab39c835fb0dc63302cc6bc07695 100644 --- a/lib_enc/acelp_core_switch_enc_fx.c +++ b/lib_enc/acelp_core_switch_enc_fx.c @@ -62,9 +62,9 @@ void acelp_core_switch_enc_fx( Copy( st_fx->old_Aq_12_8_fx, Aq, M + 1 ); Copy( st_fx->old_Aq_12_8_fx, Aq + ( M + 1 ), M + 1 ); - T_op[0] = st_fx->pitch_fx[0]; + T_op[0] = st_fx->pitch[0]; move16(); - T_op[1] = st_fx->pitch_fx[1]; + T_op[1] = st_fx->pitch[1]; move16(); /*----------------------------------------------------------------* diff --git a/lib_enc/amr_wb_enc_fx.c b/lib_enc/amr_wb_enc_fx.c index b4b011b354ed4bf72c3e811e6a0c5dde5f2658df..8edf03a4c92a54f3714da1387974d124fc1ff160 100644 --- a/lib_enc/amr_wb_enc_fx.c +++ b/lib_enc/amr_wb_enc_fx.c @@ -399,7 +399,7 @@ void amr_wb_enc_fx( /* reset the OL pitch tracker memories during inactive frames */ pitch_ol_init_fx( &st->old_thres_fx, &st->old_pitch, &st->delta_pit, &st->old_corr_fx ); } - old_pitch1 = st->pitch_fx[1]; + old_pitch1 = st->pitch[1]; move16(); analy_lp_AMR_WB_fx( inp, &ener, A, epsP_h, epsP_l, isp_new, st->lsp_old1_fx, isf_new, st->old_pitch_la, st->old_voicing_la, Q_new, Q_r ); @@ -421,8 +421,8 @@ void amr_wb_enc_fx( shift = -1; move16(); } - pitch_ol_fx( st->pitch_fx, st->voicing_fx, &st->old_pitch, &st->old_corr_fx, corr_shift, &st->old_thres_fx, &st->delta_pit, st->old_wsp2_fx, wsp, st->mem_decim2_fx, relE, 0, st->bwidth, st->Opt_SC_VBR ); - st->old_pitch_la = st->pitch_fx[2]; + pitch_ol_fx( st->pitch, st->voicing_fx, &st->old_pitch, &st->old_corr_fx, corr_shift, &st->old_thres_fx, &st->delta_pit, st->old_wsp2_fx, wsp, st->mem_decim2_fx, relE, 0, st->bwidth, st->Opt_SC_VBR ); + st->old_pitch_la = st->pitch[2]; move16(); st->old_voicing_la = st->voicing_fx[2]; move16(); diff --git a/lib_enc/cod_ace_fx.c b/lib_enc/cod_ace_fx.c index f816a7cd86ea0da1f9fbe7c5606a6028d33fc2e8..efa0e0d4c06c5213554cb068d28dd8850da8e43b 100644 --- a/lib_enc/cod_ace_fx.c +++ b/lib_enc/cod_ace_fx.c @@ -239,7 +239,7 @@ Word16 coder_acelp_fx( /* o : SEGSNR for CL decision * { /* Adaptive Codebook (GC and VC) */ - Mode2_pit_encode_fx( acelp_cfg->ltp_mode, i_subfr, &prm, &exc[i_subfr], st->pitch_fx, &T0_min, &T0_min_frac, &T0_max, &T0_max_frac, + Mode2_pit_encode_fx( acelp_cfg->ltp_mode, i_subfr, &prm, &exc[i_subfr], st->pitch, &T0_min, &T0_min_frac, &T0_max, &T0_max_frac, &T0, &T0_frac, &T0_res, h1, xn, st->pit_min, st->pit_fr1, st->pit_fr1b, st->pit_fr2, st->pit_max, st->pit_res_max ); E_ACELP_adaptive_codebook( exc, T0, T0_frac, T0_res, st->pit_res_max, acelp_cfg->ltf_mode, i_subfr, L_SUBFR, L_frame, h1, clip_gain, xn, diff --git a/lib_enc/core_enc_2div_fx.c b/lib_enc/core_enc_2div_fx.c index 42236eaf893ecf838c537af3c431d93befe5fbd9..f0527f0eb5a49823d326c142d286eca27f584cac 100644 --- a/lib_enc/core_enc_2div_fx.c +++ b/lib_enc/core_enc_2div_fx.c @@ -78,7 +78,7 @@ void core_encode_twodiv_fx( FOR( i = 0; i < 3; i++ ) { move16(); - T_op[i] = st->pitch_fx[i]; + T_op[i] = st->pitch[i]; /* check minimum pitch for quantization */ IF( LT_16( T_op[i], PIT_MIN_SHORTER ) ) diff --git a/lib_enc/core_enc_ol_fx.c b/lib_enc/core_enc_ol_fx.c index 781cfe1a5a83498adb7c8f1fe44d2921e2a671ba..4fe990ccb372ba8d2e1540ce188668fdbbc9f26a 100644 --- a/lib_enc/core_enc_ol_fx.c +++ b/lib_enc/core_enc_ol_fx.c @@ -429,7 +429,7 @@ void core_encode_openloop_fx( /* Update ACELP quantizer state */ lsf_update_memory( st->narrowBand, st->lsf_old_fx, st->mem_MA_fx, st->mem_MA_fx, M ); - st->pstreaklen_fx = 0; + st->pstreaklen = 0; st->streaklimit_fx = 32767; /* check resonance for pitch clipping algorithm */ gp_clip_test_lsf_fx( st->element_mode, st->lsf_old_fx, st->clip_var_fx, 0 ); @@ -612,7 +612,7 @@ void core_encode_openloop_fx( IF( NE_16( hRF->rf_frame_type, RF_NO_DATA ) ) { /* coder_acelp_rf_fx does the partial copy encoding based on the rf frame type chosen for the RF encoding */ - coder_acelp_rf_fx( &( hRF->acelp_cfg_rf ), coder_type, Aw, Aq_rf, st->speech_enc_pe, st->voicing_fx, st->pitch_fx, + coder_acelp_rf_fx( &( hRF->acelp_cfg_rf ), coder_type, Aw, Aq_rf, st->speech_enc_pe, st->voicing_fx, st->pitch, stab_fac_rf, st, hRF->rf_target_bits, hRF->rf_frame_type, exc_rf, syn_rf, Q_new, shift ); } } @@ -823,7 +823,7 @@ void core_acelp_tcx20_switching_fx( /* Check minimum pitch for quantization */ FOR( i = 0; i < 3; i++ ) { - tmp16 = st->pitch_fx[i]; + tmp16 = st->pitch[i]; move16(); /* check minimum pitch for quantization */ if ( LT_16( tmp16, PIT_MIN_SHORTER ) ) @@ -838,12 +838,12 @@ void core_acelp_tcx20_switching_fx( /*pitch[i] = (short)(pitch[i] * 1.25f + 0.5f);*/ tmp16 = add( tmp16, s ); } - st->pitch_fx[i] = tmp16; + st->pitch[i] = tmp16; move16(); } IF( st->narrowBand != 0 ) { - pitchDoubling_det_fx( st->wspeech_enc, st->pitch_fx, pitch_fr, voicing_fr ); + pitchDoubling_det_fx( st->wspeech_enc, st->pitch, pitch_fr, voicing_fr ); } E_LPC_f_lsp_a_conversion( lsp_mid, A_q_tcx, M ); @@ -859,7 +859,7 @@ void core_acelp_tcx20_switching_fx( st->speech_enc + st->encoderLookahead_enc, hTcxEnc->speech_ltp + st->encoderLookahead_enc, st->wspeech_enc + st->encoderLookahead_enc, - st->pitch_fx[1], + st->pitch[1], hTcxEnc->tcxltp_param, &hTcxEnc->tcxltp_bits, &hTcxEnc->tcxltp_pitch_int, diff --git a/lib_enc/enc_amr_wb_fx.c b/lib_enc/enc_amr_wb_fx.c index 9e9bbfcc15cc085367e1f50cb711196bdfdebb76..5d5ee6c48af075fa34ded5aadf29b936f275607e 100644 --- a/lib_enc/enc_amr_wb_fx.c +++ b/lib_enc/enc_amr_wb_fx.c @@ -89,7 +89,7 @@ void encod_amr_wb_fx( pt_pitch = pitch_buf; shift_wsp = add( Q_new, shift ); - Copy( st->pitch_fx, T_op, 2 ); + Copy( st->pitch, T_op, 2 ); if ( LE_16( T_op[0], PIT_MIN ) ) { T_op[0] = shl( T_op[0], 1 ); diff --git a/lib_enc/enc_gen_voic_fx.c b/lib_enc/enc_gen_voic_fx.c index a9699855e42ad78da3a1c272841f54e89afe4fbb..8b7d12fba23ed41a6c85162c0459da449bffc0cd 100644 --- a/lib_enc/enc_gen_voic_fx.c +++ b/lib_enc/enc_gen_voic_fx.c @@ -199,7 +199,7 @@ void encod_gen_voic_fx( Scale_sig( xn_fx, L_SUBFR, shift ); *pt_pitch_fx = pit_encode_fx( hBstr, st_fx->acelp_cfg.pitch_bits, st_fx->core_brate, 0, L_frame, st_fx->coder_type, &pitch_limit_flag, i_subfr_fx, exc_fx, - L_SUBFR, st_fx->pitch_fx, &T0_min_fx, &T0_max_fx, &T0_fx, &T0_frac_fx, h1_fx, xn_fx, tdm_Pitch_reuse_flag, tdm_Pri_pitch_buf ); + L_SUBFR, st_fx->pitch, &T0_min_fx, &T0_max_fx, &T0_fx, &T0_frac_fx, h1_fx, xn_fx, tdm_Pitch_reuse_flag, tdm_Pri_pitch_buf ); tbe_celp_exc( L_frame, i_subfr_fx, T0_fx, T0_frac_fx, &error_fx, bwe_exc_fx ); diff --git a/lib_enc/enc_pit_exc_fx.c b/lib_enc/enc_pit_exc_fx.c index ff8fe3c32b366582fff70c2b420ccc2f5b66e981..6385420fe81a161f1a934be3fe2cf9a131ddb0c0 100644 --- a/lib_enc/enc_pit_exc_fx.c +++ b/lib_enc/enc_pit_exc_fx.c @@ -265,7 +265,7 @@ void enc_pit_exc_fx( * Adaptive exc. construction *----------------------------------------------------------------*/ *pt_pitch = pit_encode_fx( hBstr, st_fx->acelp_cfg.pitch_bits, Pitch_BR, 0, st_fx->L_frame, Pitch_CT, &pitch_limit_flag, i_subfr, exc, - L_subfr, st_fx->pitch_fx, &T0_min, &T0_max, T0, T0_frac, h1, xn, tdm_Pitch_reuse_flag, tdm_Pri_pitch_buf ); + L_subfr, st_fx->pitch, &T0_min, &T0_max, T0, T0_frac, h1, xn, tdm_Pitch_reuse_flag, tdm_Pri_pitch_buf ); /*-----------------------------------------------------------------* * Find adaptive exitation *-----------------------------------------------------------------*/ diff --git a/lib_enc/enc_ppp_fx.c b/lib_enc/enc_ppp_fx.c index d76ed191f83f8944c5cfbbfe33b63eb3beca5a2a..1070bcc49fbe43cab4cfecad8f46ef24462e5fd1 100644 --- a/lib_enc/enc_ppp_fx.c +++ b/lib_enc/enc_ppp_fx.c @@ -125,7 +125,7 @@ ivas_error encod_ppp_fx( /* last frame-end lpc and curr frame-end lpc */ IF( ( error = ppp_voiced_encoder_fx( hBstr, hSC_VBR, st_fx->bwidth, st_fx->last_coder_type_raw, st_fx->old_pitch_buf_fx, res_fx, - excQ_ppp_fx, st_fx->pitch_fx[1], LPC_de_old_fx, LPC_de_curr_fx, exc_fx, pitch_fx, Q_new ) ) != IVAS_ERR_OK ) + excQ_ppp_fx, st_fx->pitch[1], LPC_de_old_fx, LPC_de_curr_fx, exc_fx, pitch_fx, Q_new ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/evs_enc_fx.c b/lib_enc/evs_enc_fx.c index f755475999ff6ba59f1d6ee1ef3aa6ce00bd81fb..92cb8700088d3f10d8048d94997441d98625f2e5 100644 --- a/lib_enc/evs_enc_fx.c +++ b/lib_enc/evs_enc_fx.c @@ -300,7 +300,7 @@ ivas_error evs_enc_fx( #ifndef FIX_I4_OL_PITCH IF( EQ_16( st->core, HQ_CORE ) ) { - Copy( pitch_orig, st->pitch_fx, 3 ); /* original open-loop pitch values might be altered in core_acelp_tcx20_switching_fx() */ + Copy( pitch_orig, st->pitch, 3 ); /* original open-loop pitch values might be altered in core_acelp_tcx20_switching_fx() */ } #endif } @@ -327,7 +327,7 @@ ivas_error evs_enc_fx( bwe_exc_extended, voice_factors, pitch_buf, vad_hover_flag, &Q_new, &shift ); #ifndef FIX_I4_OL_PITCH - Copy( pitch_orig, st->pitch_fx, 3 ); /* populate the original OL pitch values back */ + Copy( pitch_orig, st->pitch, 3 ); /* populate the original OL pitch values back */ #endif /*---------------------------------------------------------------------* diff --git a/lib_enc/ext_sig_ana_fx.c b/lib_enc/ext_sig_ana_fx.c index bb830785012dcc2fbb56d6593663502257ee9355..f4c60b16fbd201dc0e5550cab4dda8c2f8b12ca9 100644 --- a/lib_enc/ext_sig_ana_fx.c +++ b/lib_enc/ext_sig_ana_fx.c @@ -174,9 +174,9 @@ void core_signal_analysis_high_bitrate_fx( { lsp[0] = lsp_new; lsp[1] = lsp_mid; - alw_pitch_lag_12k8[0] = st->pitch_fx[0]; + alw_pitch_lag_12k8[0] = st->pitch[0]; move16(); - alw_pitch_lag_12k8[1] = st->pitch_fx[1]; + alw_pitch_lag_12k8[1] = st->pitch[1]; move16(); alw_voicing[0] = st->voicing_fx[0]; move16(); diff --git a/lib_enc/init_enc_fx.c b/lib_enc/init_enc_fx.c index a38e19b718083387bbfc2c0044b46fbcf851d6ff..7d1f5530200f36d03e880168690b8333220fc643 100644 --- a/lib_enc/init_enc_fx.c +++ b/lib_enc/init_enc_fx.c @@ -159,7 +159,7 @@ ivas_error init_encoder_fx( init_lvq_fx( st_fx->offset_scale1_fx, st_fx->offset_scale2_fx, st_fx->offset_scale1_p_fx, st_fx->offset_scale2_p_fx, st_fx->no_scales_fx, st_fx->no_scales_p_fx ); st_fx->next_force_safety_net_fx = 0; - st_fx->pstreaklen_fx = 0; + st_fx->pstreaklen = 0; move16(); st_fx->streaklimit_fx = 32767; move16(); /*1;//Q15 */ @@ -939,7 +939,7 @@ ivas_error init_encoder_fx( st_fx->low_rate_mode = 0; /* low-rate mode flag */ // st_fx->coder_type = GENERIC; /* low-rate mode flag */ - set16_fx( st_fx->pitch_fx, L_SUBFR, 3 ); + set16_fx( st_fx->pitch, L_SUBFR, 3 ); set16_fx( st_fx->voicing_fx, 0, 3 ); diff --git a/lib_enc/ivas_front_vad.c b/lib_enc/ivas_front_vad.c index 87ae69efe66e6194b423ebb0f83b03fec3de916c..6182cd73054fdb3b60914050079efe1c0395aecc 100644 --- a/lib_enc/ivas_front_vad.c +++ b/lib_enc/ivas_front_vad.c @@ -769,7 +769,7 @@ ivas_error front_vad_spar( #if 0 vad_param_updt( st, corr_shift, corr_shift, A, st->pitch[1], &hFrontVad, 1 ); #else - mvr2r_Word16( st->pitch, st->pitch_fx, 3 ); + mvr2r_Word16( st->pitch, st->pitch, 3 ); corr_shift_fx = (Word16) floatToFixed( corr_shift, Q15 ); hFrontVad->hVAD->running_avg_fx = (Word16) floatToFixed( hFrontVad->hVAD->running_avg, Q15 ); hFrontVad->hVAD->ra_deltasum_fx = (Word16) floatToFixed( hFrontVad->hVAD->ra_deltasum, Q15 ); diff --git a/lib_enc/lsf_enc_fx.c b/lib_enc/lsf_enc_fx.c index 3a463279761504ecc043ab936d18686a416c3456..121de20db6518a1b5ad86526bf1e91aa3b28793c 100644 --- a/lib_enc/lsf_enc_fx.c +++ b/lib_enc/lsf_enc_fx.c @@ -1061,7 +1061,7 @@ void lsf_end_enc_fx( st->offset_scale1_fx, st->offset_scale2_fx, st->no_scales_fx, resq, lsfq ); safety_net = 1; move16(); - st->pstreaklen_fx = 0; + st->pstreaklen = 0; move16(); /* predictive LSF quantizer streak is ended with safety-net */ } ELSE IF( EQ_16( predmode, 1 ) ) /* only MA prediction */ @@ -1085,14 +1085,14 @@ void lsf_end_enc_fx( test(); test(); test(); - IF( ( ( GT_16( st->pstreaklen_fx, ( STREAKLEN + 3 ) ) ) && ( EQ_16( coder_type, VOICED ) ) ) || ( ( GT_16( st->pstreaklen_fx, ( STREAKLEN ) ) ) && ( NE_16( coder_type, VOICED ) ) ) ) + IF( ( ( GT_16( st->pstreaklen, ( STREAKLEN + 3 ) ) ) && ( EQ_16( coder_type, VOICED ) ) ) || ( ( GT_16( st->pstreaklen, ( STREAKLEN ) ) ) && ( NE_16( coder_type, VOICED ) ) ) ) { /* update the adaptive scaling factor to become smaller with increasing number of concecutive predictive frames. */ st->streaklimit_fx = mult( st->streaklimit_fx, STREAKMULT_FX ); move16(); } - IF( st->pstreaklen_fx == 0 ) + IF( st->pstreaklen == 0 ) { /* reset the consecutive AR-predictor multiplier */ st->streaklimit_fx = 32767; /*1.0 in Q15 */ @@ -1128,14 +1128,14 @@ void lsf_end_enc_fx( { /* Safety-net - BC-TCQ quantization : SN */ Err[0] = qlsf_ARSN_tcvq_Enc_16k_fx( Tmp, lsfq, TCQIdx0, wghts, sub( nBits, 1 ), safety_net ); - st->pstreaklen_fx = 0; + st->pstreaklen = 0; move16(); } ELSE { /* predictive - BC-TCQ quantization : AR */ Err[1] = qlsf_ARSN_tcvq_Enc_16k_fx( Tmp2, lsfq, TCQIdx0, wghts, sub( nBits, 1 ), safety_net ); - st->pstreaklen_fx = add( st->pstreaklen_fx, 1 ); + st->pstreaklen = add( st->pstreaklen, 1 ); } } /* all other frames (not VOICED@16kHz) */ @@ -1172,14 +1172,14 @@ void lsf_end_enc_fx( { safety_net = 1; move16(); - st->pstreaklen_fx = 0; + st->pstreaklen = 0; move16(); /* Reset the consecutive predictive frame counter */ } ELSE { safety_net = 0; move16(); /* Increase the consecutive predictive frame counter by one */ - st->pstreaklen_fx = add( st->pstreaklen_fx, 1 ); + st->pstreaklen = add( st->pstreaklen, 1 ); } } } @@ -1672,7 +1672,7 @@ void lsf_end_enc_ivas_fx( Err[0] = vq_lvq_lsf_enc_ivas_fx( 0, mode_lvq, Tmp, levels0, stages0, wghts, Idx0, lsf, pred0, resq, lsfq ); safety_net = 1; move16(); - st->pstreaklen_fx = 0; + st->pstreaklen = 0; move16(); /* predictive LSF quantizer streak is ended with safety-net */ } ELSE IF( EQ_16( predmode, 1 ) ) /* only MA prediction */ @@ -1704,14 +1704,14 @@ void lsf_end_enc_ivas_fx( test(); test(); test(); - IF( ( ( GT_16( st->pstreaklen_fx, ( STREAKLEN + 3 ) ) ) && ( EQ_16( coder_type, VOICED ) ) ) || ( ( GT_16( st->pstreaklen_fx, ( STREAKLEN ) ) ) && ( NE_16( coder_type, VOICED ) ) ) ) + IF( ( ( GT_16( st->pstreaklen, ( STREAKLEN + 3 ) ) ) && ( EQ_16( coder_type, VOICED ) ) ) || ( ( GT_16( st->pstreaklen, ( STREAKLEN ) ) ) && ( NE_16( coder_type, VOICED ) ) ) ) { /* update the adaptive scaling factor to become smaller with increasing number of concecutive predictive frames. */ st->streaklimit_fx = mult( st->streaklimit_fx, STREAKMULT_FX ); move16(); } - IF( st->pstreaklen_fx == 0 ) + IF( st->pstreaklen == 0 ) { /* reset the consecutive AR-predictor multiplier */ st->streaklimit_fx = 32767; /*1.0 in Q15 */ @@ -1734,14 +1734,14 @@ void lsf_end_enc_ivas_fx( { /* Safety-net - BC-TCQ quantization : SN */ Err[0] = qlsf_ARSN_tcvq_Enc_16k_fx( Tmp, lsfq, TCQIdx0, wghts, sub( nBits, 1 ), safety_net ); - st->pstreaklen_fx = 0; + st->pstreaklen = 0; move16(); } ELSE { /* predictive - BC-TCQ quantization : AR */ Err[1] = qlsf_ARSN_tcvq_Enc_16k_fx( Tmp2, lsfq, TCQIdx0, wghts, sub( nBits, 1 ), safety_net ); - st->pstreaklen_fx = add( st->pstreaklen_fx, 1 ); + st->pstreaklen = add( st->pstreaklen, 1 ); } } /* all other frames (not VOICED@16kHz) */ @@ -1766,14 +1766,14 @@ void lsf_end_enc_ivas_fx( { safety_net = 1; move16(); - st->pstreaklen_fx = 0; + st->pstreaklen = 0; move16(); /* Reset the consecutive predictive frame counter */ } ELSE { safety_net = 0; move16(); /* Increase the consecutive predictive frame counter by one */ - st->pstreaklen_fx = add( st->pstreaklen_fx, 1 ); + st->pstreaklen = add( st->pstreaklen, 1 ); } } } @@ -1796,14 +1796,14 @@ void lsf_end_enc_ivas_fx( /* Adaptive scaling factor (multiplier) is updated in order to reduce the amount of consecutive predictive frames in case of possible frame erasure. AR-predictive usage for VOICED mode is allowed to be higher than other modes. */ - IF( GT_16( st->pstreaklen_fx, ( STREAKLEN ) ) ) + IF( GT_16( st->pstreaklen, ( STREAKLEN ) ) ) { /* update the adaptive scaling factor to become smaller with increasing number of concecutive predictive frames. */ st->streaklimit_fx = mult( st->streaklimit_fx, STREAKMULT_FX ); move16(); } - IF( EQ_16( st->pstreaklen_fx, 0 ) ) + IF( EQ_16( st->pstreaklen, 0 ) ) { /* reset the adaptive scaling factor */ st->streaklimit_fx = 32767; @@ -1816,8 +1816,8 @@ void lsf_end_enc_ivas_fx( Err[0] = vq_lvq_lsf_enc_ivas_fx( 2, 9, Tmp2, levels0, stages0, wghts, Idx0, lsf, pred3, &resq[M], &lsfq[M] ); IF( force_sf ) { - safety_net = 1; /* intra-frame prediction */ - st->pstreaklen_fx = 0; /* Reset the consecutive predictive frame counter */ + safety_net = 1; /* intra-frame prediction */ + st->pstreaklen = 0; /* Reset the consecutive predictive frame counter */ } ELSE { /* try also the inter frame prediction */ @@ -1828,12 +1828,12 @@ void lsf_end_enc_ivas_fx( IF( LT_32( Mult_32_16( Err[0], ( st->streaklimit_fx ) ), L_add( Err[1], Mult_32_16( Err[1], PREFERSFNET_FX ) ) ) ) { safety_net = 1; - st->pstreaklen_fx = 0; /* Reset the consecutive predictive frame counter */ + st->pstreaklen = 0; /* Reset the consecutive predictive frame counter */ } ELSE { safety_net = 0; - ( st->pstreaklen_fx )++; /* Increase the consecutive predictive frame counter by one */ + ( st->pstreaklen )++; /* Increase the consecutive predictive frame counter by one */ } } } diff --git a/lib_enc/nois_est_fx.c b/lib_enc/nois_est_fx.c index bf463766664cfc1cff8fcddf8ee024d6344cb0df..dbb29cc6c27df3c6cee8a3a85e790040fc03315d 100644 --- a/lib_enc/nois_est_fx.c +++ b/lib_enc/nois_est_fx.c @@ -800,8 +800,8 @@ void noise_est_fx( *-----------------------------------------------------------------*/ /* pc = abs(pit[0] - pitO) + abs(pit[1] - pit[0]) */ /* needed in signal_clas() */ - wtmp = abs_s( sub( st_fx->pitch_fx[0], old_pitch1 ) ); - wtmp1 = abs_s( sub( st_fx->pitch_fx[1], st_fx->pitch_fx[0] ) ); + wtmp = abs_s( sub( st_fx->pitch[0], old_pitch1 ) ); + wtmp1 = abs_s( sub( st_fx->pitch[1], st_fx->pitch[0] ) ); pc = add( wtmp, wtmp1 ); diff --git a/lib_enc/ppp_enc_fx.c b/lib_enc/ppp_enc_fx.c index bfe64e3432c46b8dff399238890096b44176aa27..29c0fefe7d1f2d4390d7084bd3f278515598aa42 100644 --- a/lib_enc/ppp_enc_fx.c +++ b/lib_enc/ppp_enc_fx.c @@ -353,7 +353,7 @@ void set_ppp_mode_fx( test(); test(); if ( ( GT_16( st_fx->old_pitch_buf_fx[( 2 * NB_SUBFR ) - 1], PPP_LAG_THRLD_Q6 ) || - GT_16( st_fx->pitch_fx[1], PPP_LAG_THRLD ) || !st_fx->last_Opt_SC_VBR ) && + GT_16( st_fx->pitch[1], PPP_LAG_THRLD ) || !st_fx->last_Opt_SC_VBR ) && EQ_16( hSC_VBR->ppp_mode, 1 ) ) { hSC_VBR->ppp_mode = 0; diff --git a/lib_enc/pre_proc_fx.c b/lib_enc/pre_proc_fx.c index cfaea31139c644ae37d50a5bbcc311e2dfa7a7b2..42169453225a4cc5ddee8e3e3f2821047ba41aac 100644 --- a/lib_enc/pre_proc_fx.c +++ b/lib_enc/pre_proc_fx.c @@ -441,39 +441,39 @@ void pre_proc_fx( /* reset the OL pitch tracker memories during inactive frames */ pitch_ol_init_fx( &st->old_thres_fx, &st->old_pitch, &st->delta_pit, &st->old_corr_fx ); } - old_pitch1 = st->pitch_fx[1]; + old_pitch1 = st->pitch[1]; - pitch_ol_fx( st->pitch_fx, st->voicing_fx, &st->old_pitch, &st->old_corr_fx, corr_shift, &st->old_thres_fx, + pitch_ol_fx( st->pitch, st->voicing_fx, &st->old_pitch, &st->old_corr_fx, corr_shift, &st->old_thres_fx, &st->delta_pit, st->old_wsp2_fx, wsp, st->mem_decim2_fx, relE, st->clas, st->bwidth, st->Opt_SC_VBR ); /* Updates for adaptive lag window memory */ - st->old_pitch_la = st->pitch_fx[2]; + st->old_pitch_la = st->pitch[2]; move16(); st->old_voicing_la = st->voicing_fx[2]; move16(); - /* Detection of very short stable st->pitch_fx period (MODE1 bit-rates) */ - StableHighPitchDetect_fx( &flag_spitch, st->pitch_fx, st->voicing_fx, wsp, st->localVAD, &st->voicing_sm_fx, &st->voicing0_sm_fx, + /* Detection of very short stable st->pitch period (MODE1 bit-rates) */ + StableHighPitchDetect_fx( &flag_spitch, st->pitch, st->voicing_fx, wsp, st->localVAD, &st->voicing_sm_fx, &st->voicing0_sm_fx, &st->LF_EnergyRatio_sm_fx, &st->predecision_flag, &st->diff_sm_fx, &st->energy_sm_fx, *Q_new, st->lgBin_E_fx ); /* 1/4 pitch precision improvement */ IF( LE_32( st->total_brate, ACELP_24k40 ) ) { /* 1/4 pitch precision improvement */ - pitch_ol2_fx( PIT_MIN_EXTEND, st->pitch_fx[0], &pitch_fr[0], &voicing_fr[0], 0, wsp, 7 ); - pitch_ol2_fx( PIT_MIN_EXTEND, st->pitch_fx[0], &pitch_fr[1], &voicing_fr[1], L_SUBFR, wsp, 7 ); - pitch_ol2_fx( PIT_MIN_EXTEND, st->pitch_fx[1], &pitch_fr[2], &voicing_fr[2], 2 * L_SUBFR, wsp, 7 ); - pitch_ol2_fx( PIT_MIN_EXTEND, st->pitch_fx[1], &pitch_fr[3], &voicing_fr[3], 3 * L_SUBFR, wsp, 7 ); + pitch_ol2_fx( PIT_MIN_EXTEND, st->pitch[0], &pitch_fr[0], &voicing_fr[0], 0, wsp, 7 ); + pitch_ol2_fx( PIT_MIN_EXTEND, st->pitch[0], &pitch_fr[1], &voicing_fr[1], L_SUBFR, wsp, 7 ); + pitch_ol2_fx( PIT_MIN_EXTEND, st->pitch[1], &pitch_fr[2], &voicing_fr[2], 2 * L_SUBFR, wsp, 7 ); + pitch_ol2_fx( PIT_MIN_EXTEND, st->pitch[1], &pitch_fr[3], &voicing_fr[3], 3 * L_SUBFR, wsp, 7 ); } ELSE { - pitch_fr[0] = st->pitch_fx[0]; + pitch_fr[0] = st->pitch[0]; move16(); - pitch_fr[1] = st->pitch_fx[0]; + pitch_fr[1] = st->pitch[0]; move16(); - pitch_fr[2] = st->pitch_fx[1]; + pitch_fr[2] = st->pitch[1]; move16(); - pitch_fr[3] = st->pitch_fx[1]; + pitch_fr[3] = st->pitch[1]; move16(); voicing_fr[0] = st->voicing_fx[0]; @@ -510,7 +510,7 @@ void pre_proc_fx( * UC and VC frame selection *-----------------------------------------------------------------*/ - find_tilt_fx( fr_bands, hNoiseEst->bckr_fx, ee, st->pitch_fx, st->voicing_fx, lf_E, corr_shift, st->input_bwidth, + find_tilt_fx( fr_bands, hNoiseEst->bckr_fx, ee, st->pitch, st->voicing_fx, lf_E, corr_shift, st->input_bwidth, st->max_band, hp_E, st->codec_mode, *Q_new, &( st->bckr_tilt_lt ), st->Opt_SC_VBR ); st->coder_type = find_uv_fx( st, pitch_fr, voicing_fr, inp_12k8, ee, @@ -1136,7 +1136,7 @@ void pre_proc_fx( Copy( st->lsp_old1_fx, st->lspold_enc_fx, M ); } - analy_lp_fx( inp_16k, L_FRAME16k, L_look, ener, A, epsP_h, epsP_l, lsp_new, lsp_mid, st->lspold_enc_fx, st->pitch_fx, st->voicing_fx, 16000, -1 /*IVAS_CODE !! LowRateFlag*/, *Q_new, Q_r ); + analy_lp_fx( inp_16k, L_FRAME16k, L_look, ener, A, epsP_h, epsP_l, lsp_new, lsp_mid, st->lspold_enc_fx, st->pitch, st->voicing_fx, 16000, -1 /*IVAS_CODE !! LowRateFlag*/, *Q_new, Q_r ); /*--------------------------------------------------------------* * Compute Weighted Input @@ -1215,7 +1215,7 @@ void pre_proc_fx( *-----------------------------------------------------------------*/ #ifndef FIX_I4_OL_PITCH - Copy( st->pitch_fx, pitch_orig, 3 ); + Copy( st->pitch, pitch_orig, 3 ); #endif IF( EQ_16( st->codec_mode, MODE2 ) ) { diff --git a/lib_enc/sig_clas_fx.c b/lib_enc/sig_clas_fx.c index a0ef0caf4d110be61c5c21fcc9a3263a6ad5c530..27f0214653294501946f19597a4ab84d672b3834 100644 --- a/lib_enc/sig_clas_fx.c +++ b/lib_enc/sig_clas_fx.c @@ -114,7 +114,7 @@ Word16 signal_clas_fx( /* o : classification for current zc = extract_l( Ltmp ); /* compute pitch stability */ - pc = add( abs_s( sub( st->pitch_fx[1], st->pitch_fx[0] ) ), abs_s( sub( st->pitch_fx[2], st->pitch_fx[1] ) ) ); + pc = add( abs_s( sub( st->pitch[1], st->pitch[0] ) ), abs_s( sub( st->pitch[2], st->pitch[1] ) ) ); st->tdm_pc = pc; /*-----------------------------------------------------------------* diff --git a/lib_enc/speech_music_classif_fx.c b/lib_enc/speech_music_classif_fx.c index 1606ba3d7057cee7766bf17eb58f0765981e57ab..5418a6714ac9c46bfde5cbbd6778434d56d518cc 100644 --- a/lib_enc/speech_music_classif_fx.c +++ b/lib_enc/speech_music_classif_fx.c @@ -336,7 +336,7 @@ void speech_music_classif_fx( { sp_mus_classif_2nd_fx( st, Etot, attack_flag, inp, Q_inp - 1 ); - /* avoid switch to AUDIO/MUSIC class for very short stable high st->pitch_fx + /* avoid switch to AUDIO/MUSIC class for very short stable high st->pitch and/or stable pitch with high correlation at low bitrates*/ test(); test(); @@ -484,14 +484,14 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis /* [0] OL pitch Q0 */ /*(float)(pitch[0] + pitch[1] + pitch[2]) / 3.0f;*/ - L_tmp = L_mult( st_fx->pitch_fx[0], 10923 ); - L_tmp = L_mac( L_tmp, st_fx->pitch_fx[1], 10923 ); - L_tmp = L_mac( L_tmp, st_fx->pitch_fx[2], 10923 ); + L_tmp = L_mult( st_fx->pitch[0], 10923 ); + L_tmp = L_mac( L_tmp, st_fx->pitch[1], 10923 ); + L_tmp = L_mac( L_tmp, st_fx->pitch[2], 10923 ); test(); IF( EQ_16( st_fx->tc_cnt, 1 ) || EQ_16( st_fx->tc_cnt, 2 ) ) { - *pFV++ = st_fx->pitch_fx[2]; + *pFV++ = st_fx->pitch[2]; move16(); } ELSE @@ -1184,7 +1184,7 @@ static void sp_mus_classif_2nd_fx( st->sp_aud_decision2 = 0; move16(); } - ELSE IF( EQ_16( hSpMusClas->high_stable_cor, 1 ) && GE_16( st->pitch_fx[0], 130 ) ) + ELSE IF( EQ_16( hSpMusClas->high_stable_cor, 1 ) && GE_16( st->pitch[0], 130 ) ) { /* prevent GSC in highly correlated signal with low energy variation */ /* this is basically a patch against bassoon-type of music */ @@ -3740,15 +3740,15 @@ static void tonal_context_improv_fx( } /* Pitch difference w.r.t to past 3 frames */ - lt_pitch_diff = abs_s( sub( hSpMusClas->lt_corr_pitch[0], st_fx->pitch_fx[0] ) ); - lt_pitch_diff = add( lt_pitch_diff, abs_s( sub( hSpMusClas->lt_corr_pitch[1], st_fx->pitch_fx[0] ) ) ); - lt_pitch_diff = add( lt_pitch_diff, abs_s( sub( hSpMusClas->lt_corr_pitch[2], st_fx->pitch_fx[0] ) ) ); + lt_pitch_diff = abs_s( sub( hSpMusClas->lt_corr_pitch[0], st_fx->pitch[0] ) ); + lt_pitch_diff = add( lt_pitch_diff, abs_s( sub( hSpMusClas->lt_corr_pitch[1], st_fx->pitch[0] ) ) ); + lt_pitch_diff = add( lt_pitch_diff, abs_s( sub( hSpMusClas->lt_corr_pitch[2], st_fx->pitch[0] ) ) ); hSpMusClas->lt_corr_pitch[0] = hSpMusClas->lt_corr_pitch[1]; move16(); hSpMusClas->lt_corr_pitch[1] = hSpMusClas->lt_corr_pitch[2]; move16(); - hSpMusClas->lt_corr_pitch[2] = st_fx->pitch_fx[0]; + hSpMusClas->lt_corr_pitch[2] = st_fx->pitch[0]; move16(); hSpMusClas->lt_old_mode[0] = hSpMusClas->lt_old_mode[1]; diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index a7ff97e14f45ebfced492388bdfb5713bcb231bf..5c029a808c45910d20ffaad2a3ddecf49f0d9afd 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -92,7 +92,7 @@ typedef struct bitstream_enc_data_structure void *st_ivas; /* IVAS encoder structure */ // Word16 nb_bits_tot_fx; /* total number of bits already written */ - // Indice *ind_list_fx; /* list of indices */ + // Indice *ind_list_fx; /* list of indices */ Word16 next_ind_fx; /* pointer to the next empty slot in the list of indices */ Word16 last_ind_fx; /* last written indice */ @@ -1787,7 +1787,7 @@ typedef struct enc_core_structure int16_t pitch[3]; /* open-loop pitch values @12.8 kHz for three half-frames */ float voicing[3]; /* open-loop normalized correlation values for three half-frames */ - Word16 pitch_fx[3]; + // Word16 pitch_fx[3]; Word16 voicing_fx[3]; LPD_state_HANDLE hLPDmem; /* ACELP LPDmem memories */ @@ -1809,17 +1809,17 @@ typedef struct enc_core_structure int16_t pstreaklen; /* LSF quantizer */ - float streaklimit; /* LSF quantizer */ - float stab_fac; /* LSF stability factor */ - float mem_preemph; /* preemphasis filter memory */ - float old_wsp[L_WSP_MEM]; /* old weighted signal vector */ - float old_wsp2[( L_WSP_MEM - L_INTERPOL ) / OPL_DECIM]; /* old decimated weighted signal vector */ - float mem_wsp; /* weighted signal vector memory */ - float mem_decim2[3]; /* weighted signal decimation filter memory */ - float clip_var[6]; /* pitch gain clipping memory */ - float mem_AR[M]; /* AR memory of LSF quantizer (past quantized LSFs without mean) */ - float mem_MA[M]; /* MA memory of LSF quantizer (past quantized residual) (used also in AMR-WB IO mode) */ - Word16 pstreaklen_fx; /* LSF quantizer */ + float streaklimit; /* LSF quantizer */ + float stab_fac; /* LSF stability factor */ + float mem_preemph; /* preemphasis filter memory */ + float old_wsp[L_WSP_MEM]; /* old weighted signal vector */ + float old_wsp2[( L_WSP_MEM - L_INTERPOL ) / OPL_DECIM]; /* old decimated weighted signal vector */ + float mem_wsp; /* weighted signal vector memory */ + float mem_decim2[3]; /* weighted signal decimation filter memory */ + float clip_var[6]; /* pitch gain clipping memory */ + float mem_AR[M]; /* AR memory of LSF quantizer (past quantized LSFs without mean) */ + float mem_MA[M]; /* MA memory of LSF quantizer (past quantized residual) (used also in AMR-WB IO mode) */ + // Word16 pstreaklen_fx; /* LSF quantizer */ Word16 streaklimit_fx; /* LSF quantizer */ Word32 offset_scale1_fx[MAX_NO_MODES + 1][MAX_NO_SCALES + 1]; /* offsets for LSF LVQ structure 1st 8-dim subvector*/ Word32 offset_scale2_fx[MAX_NO_MODES + 1][MAX_NO_SCALES + 1]; /* offsets for LSF LVQ structure 2nd 8-dim subvector*/ diff --git a/lib_enc/transition_enc_fx.c b/lib_enc/transition_enc_fx.c index 96b672985b08485a7fbd8a01bb3afe3c94eccee3..3a9fabba0a0884684d229fee08b50f2e690f41d6 100644 --- a/lib_enc/transition_enc_fx.c +++ b/lib_enc/transition_enc_fx.c @@ -105,14 +105,14 @@ void transition_enc_fx( IF( EQ_16( st_fx->L_frame, L_FRAME ) /*|| (tdm_Pri_pitch_buf != NULL && tdm_Pri_pitch_buf[0] < 0)*/ ) { - Copy( st_fx->pitch_fx, T_op, 2 ); + Copy( st_fx->pitch, T_op, 2 ); } ELSE /* L_frame == L_FRAME16k */ { /*T_op[0] = (int16_t)(pitch[0] * 1.25f + 0.5f); T_op[1] = (int16_t)(pitch[1] * 1.25f + 0.5f);*/ - T_op[0] = add( st_fx->pitch_fx[0], mult_r( st_fx->pitch_fx[0], 8192 /*0.25f Q15*/ ) ); - T_op[1] = add( st_fx->pitch_fx[1], mult_r( st_fx->pitch_fx[1], 8192 /*0.25f Q15*/ ) ); + T_op[0] = add( st_fx->pitch[0], mult_r( st_fx->pitch[0], 8192 /*0.25f Q15*/ ) ); + T_op[1] = add( st_fx->pitch[1], mult_r( st_fx->pitch[1], 8192 /*0.25f Q15*/ ) ); } shift_wsp = add( Q_new, shift ); diff --git a/lib_enc/vad_param_updt_fx.c b/lib_enc/vad_param_updt_fx.c index f1eb9b031b482e168f85f40abd3f4c91028f8780..e0b607c5a68015d07f0af5774686659f67f828c4 100644 --- a/lib_enc/vad_param_updt_fx.c +++ b/lib_enc/vad_param_updt_fx.c @@ -175,9 +175,9 @@ void vad_param_updt_fx( #endif /* abs(pitch[0] - *pitO) + abs(pitch[1] - pitch[0]) + abs(pitch[2] - pitch[1]) */ - pitch_tmp = abs_s( sub( st_fx->pitch_fx[0], old_pitch1 ) ); /*Q0 */ - pitch_tmp = add( pitch_tmp, abs_s( sub( st_fx->pitch_fx[1], st_fx->pitch_fx[0] ) ) ); /*Q0 */ - pitch_tmp = add( pitch_tmp, abs_s( sub( st_fx->pitch_fx[2], st_fx->pitch_fx[1] ) ) ); /*Q0 */ + pitch_tmp = abs_s( sub( st_fx->pitch[0], old_pitch1 ) ); /*Q0 */ + pitch_tmp = add( pitch_tmp, abs_s( sub( st_fx->pitch[1], st_fx->pitch[0] ) ) ); /*Q0 */ + pitch_tmp = add( pitch_tmp, abs_s( sub( st_fx->pitch[2], st_fx->pitch[1] ) ) ); /*Q0 */ /* if( (voicing[0] + voicing[1] + voicing[2]) / 3 + corr_shift > 0.65 &&