From da9e603319c686969d5186d617c804ec80882239 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 25 Mar 2025 13:55:52 -0400 Subject: [PATCH 01/14] replace EVS push_indice_fx with push_indice (from IVAS) --- lib_com/bitstream_fx.c | 6 +-- lib_com/gs_gains_fx.c | 28 ++++++------- lib_com/hq_tools_fx.c | 4 +- lib_com/pvq_com_fx.c | 2 +- lib_enc/FEC_enc_fx.c | 6 +-- lib_enc/acelp_core_enc_fx.c | 4 +- lib_enc/acelp_core_switch_enc_fx.c | 8 ++-- lib_enc/amr_wb_enc_fx.c | 2 +- lib_enc/avq_cod_fx.c | 20 +++++----- lib_enc/cng_enc_fx.c | 24 +++++------ lib_enc/cod2t32_fx.c | 6 +-- lib_enc/cod4t64_fx.c | 30 +++++++------- lib_enc/decision_matrix_enc_fx.c | 64 +++++++++++++++--------------- lib_enc/enc_amr_wb_fx.c | 4 +- lib_enc/enc_gen_voic_fx.c | 6 +-- lib_enc/enc_higher_acelp_fx.c | 4 +- lib_enc/enc_pit_exc_fx.c | 6 +-- lib_enc/enc_tran_fx.c | 62 ++++++++++++++--------------- lib_enc/enc_uv_fx.c | 2 +- lib_enc/eval_pit_contr_fx.c | 6 +-- lib_enc/fd_cng_enc_fx.c | 12 +++--- lib_enc/gain_enc_fx.c | 20 +++++----- lib_enc/gaus_enc_fx.c | 6 +-- lib_enc/gs_enc_fx.c | 20 +++++----- lib_enc/hq_classifier_enc_fx.c | 8 ++-- lib_enc/hq_core_enc_fx.c | 8 ++-- lib_enc/hq_env_enc_fx.c | 24 +++++------ lib_enc/hq_hr_enc_fx.c | 4 +- lib_enc/hq_lr_enc_fx.c | 62 ++++++++++++++--------------- lib_enc/hvq_enc_fx.c | 2 +- lib_enc/isf_enc_amr_wb_fx.c | 34 ++++++++-------- lib_enc/lsf_enc_fx.c | 18 ++++----- lib_enc/nelp_enc_fx.c | 8 ++-- lib_enc/peak_vq_enc_fx.c | 36 ++++++++--------- lib_enc/pit_enc_fx.c | 8 ++-- lib_enc/ppp_enc_fx.c | 8 ++-- lib_enc/range_enc_fx.c | 8 ++-- lib_enc/stat_noise_uv_enc_fx.c | 2 +- lib_enc/swb_bwe_enc_fx.c | 46 ++++++++++----------- lib_enc/swb_bwe_enc_hr_fx.c | 22 +++++----- lib_enc/swb_bwe_enc_lr_fx.c | 6 +-- lib_enc/swb_tbe_enc_fx.c | 28 ++++++------- lib_enc/tcq_core_enc_fx.c | 4 +- lib_enc/transition_enc_fx.c | 36 ++++++++--------- lib_enc/voiced_enc_fx.c | 2 +- 45 files changed, 363 insertions(+), 363 deletions(-) diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index e144c2cc9..667958264 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -240,11 +240,11 @@ Word16 rate2EVSmode( } /*-------------------------------------------------------------------* - * push_indice_fx( ) + * push_indice( ) * * Push a new indice into the buffer *-------------------------------------------------------------------*/ - +#if 0 void push_indice_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */ Word16 id, /* i : ID of the indice */ @@ -288,7 +288,7 @@ void push_indice_fx( return; } - +#endif /*-------------------------------------------------------------------* * push_next_indice_fx() * * Push a new indice into the buffer at the next position diff --git a/lib_com/gs_gains_fx.c b/lib_com/gs_gains_fx.c index 35236b603..ecfe9aae0 100644 --- a/lib_com/gs_gains_fx.c +++ b/lib_com/gs_gains_fx.c @@ -1028,7 +1028,7 @@ Word16 gsc_gainQ_fx( /*Q12*/ mean_4g[0] = round_fx( L_tmp ); move16(); idx_g = vquant_fx( mean_4g, Gain_meanNB_fx, mean_4g, Gain_mean_dicNB_fx, 1, 64 ); - push_indice_fx( hBstr, IND_MEAN_GAIN2, idx_g, 6 ); + push_indice( hBstr, IND_MEAN_GAIN2, idx_g, 6 ); FOR( i = 0; i < Mbands_gn; i++ ) { @@ -1040,21 +1040,21 @@ Word16 gsc_gainQ_fx( /*Q12*/ move16(); set16_fx( y_gain_tmp + 10, 0, MBANDS_GN - 10 ); idx_g = vquant_fx( y_gain_tmp, Mean_dic_NB_fx, y_gain_tmp, Gain_dic1_NB_fx, 3, 64 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 6 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 6 ); IF( LT_32( core_brate, ACELP_9k60 ) ) { idx_g = vquant_fx( y_gain_tmp + 3, Mean_dic_NB_fx + 3, y_gain_tmp + 3, Gain_dic2_NB_fx, 3, 32 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); idx_g = vquant_fx( y_gain_tmp + 6, Mean_dic_NB_fx + 6, y_gain_tmp + 6, Gain_dic3_NB_fx, 4, 16 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 4 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 4 ); } ELSE { idx_g = vquant_fx( y_gain_tmp + 3, Mean_dic_NB_fx + 3, y_gain_tmp + 3, Gain_dic2_NBHR_fx, 3, 64 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 6 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 6 ); idx_g = vquant_fx( y_gain_tmp + 6, Mean_dic_NB_fx + 6, y_gain_tmp + 6, Gain_dic3_NBHR_fx, 4, 128 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 7 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 7 ); } /*add end */ test(); @@ -1122,7 +1122,7 @@ Word16 gsc_gainQ_fx( /*Q12*/ move16(); idx_g = vquant_fx( mean_4g, mean_m_fx, mean_4g, mean_gain_dic_fx, 1, 64 ); - push_indice_fx( hBstr, IND_MEAN_GAIN2, idx_g, 6 ); + push_indice( hBstr, IND_MEAN_GAIN2, idx_g, 6 ); FOR( i = 0; i < Mbands_gn; i++ ) { @@ -1148,11 +1148,11 @@ Word16 gsc_gainQ_fx( /*Q12*/ move16(); idx_g = vquant_fx( y_gain_tmp2, YGain_mean_LR_fx, y_gain_tmp2, YGain_dic1_LR_fx, 3, 32 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); idx_g = vquant_fx( y_gain_tmp2 + 3, YGain_mean_LR_fx + 3, y_gain_tmp2 + 3, YGain_dic2_LR_fx, 4, 32 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); idx_g = vquant_fx( y_gain_tmp2 + 7, YGain_mean_LR_fx + 7, y_gain_tmp2 + 7, YGain_dic3_LR_fx, 5, 32 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); set16_fx( y_gain_tmp2 + 12, 0, MBANDS_GN - 12 ); /* Update to quantized vector */ @@ -1185,13 +1185,13 @@ Word16 gsc_gainQ_fx( /*Q12*/ ELSE { idx_g = vquant_fx( y_gain_tmp, YG_mean16_fx, y_gain_tmp, YG_dicMR_1_fx, 4, 64 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 6 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 6 ); idx_g = vquant_fx( y_gain_tmp + 4, YG_mean16_fx + 4, y_gain_tmp + 4, YG_dicMR_2_fx, 4, 32 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); idx_g = vquant_fx( y_gain_tmp + 8, YG_mean16_fx + 8, y_gain_tmp + 8, YG_dicMR_3_fx, 4, 32 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); idx_g = vquant_fx( y_gain_tmp + 12, YG_mean16_fx + 12, y_gain_tmp + 12, YG_dicMR_4_fx, 4, 16 ); - push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 4 ); + push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 4 ); } } diff --git a/lib_com/hq_tools_fx.c b/lib_com/hq_tools_fx.c index cf3ce202e..0e00b9428 100644 --- a/lib_com/hq_tools_fx.c +++ b/lib_com/hq_tools_fx.c @@ -2036,7 +2036,7 @@ Word16 calc_nor_delta_hf_fx( /* updating norm & storing delta norm */ add_bits_denv = 2; move16(); - push_indice_fx( hBstr, IND_DELTA_ENV_HQ, sub( bitsforDelta, 2 ), 2 ); + push_indice( hBstr, IND_DELTA_ENV_HQ, sub( bitsforDelta, 2 ), 2 ); FOR( i = num_env_bands; i < nb_sfm; ++i ) { IF( Rsubband[i] != 0 ) @@ -2052,7 +2052,7 @@ Word16 calc_nor_delta_hf_fx( delta = min_delta; /*Q0*/ move16(); } - push_indice_fx( hBstr, IND_DELTA_ENV_HQ, delta - min_delta, bitsforDelta ); + push_indice( hBstr, IND_DELTA_ENV_HQ, delta - min_delta, bitsforDelta ); ynrm[i] = add( ynrm[i], delta ); /*Q0*/ move16(); add_bits_denv = add( add_bits_denv, bitsforDelta ); diff --git a/lib_com/pvq_com_fx.c b/lib_com/pvq_com_fx.c index 479bc04d9..9cf1226d8 100644 --- a/lib_com/pvq_com_fx.c +++ b/lib_com/pvq_com_fx.c @@ -622,7 +622,7 @@ void fine_gain_quant_fx( gain_db = round_fx_sat( L_shl_o( L_tmp, 17, &Overflow ) ); idx = squant_fx( gain_db, &gain_dbq, finegain_fx[gbits - 1], gain_cb_size[gbits - 1] ); - push_indice_fx( hBstr, IND_PVQ_FINE_GAIN, idx, gbits ); + push_indice( hBstr, IND_PVQ_FINE_GAIN, idx, gbits ); L_tmp = L_mult0( gain_dbq, 21771 ); /* 21771=0.05*log2(10) */ /* 14+17=31 */ L_tmp = L_shr( L_tmp, 15 ); /* Q16 */ diff --git a/lib_enc/FEC_enc_fx.c b/lib_enc/FEC_enc_fx.c index 87243e8d2..69b14eb9b 100644 --- a/lib_enc/FEC_enc_fx.c +++ b/lib_enc/FEC_enc_fx.c @@ -94,7 +94,7 @@ void FEC_encode_fx( index = 3; move16(); } - push_indice_fx( hBstr, IND_FEC_CLAS, index, FEC_BITS_CLS ); + push_indice( hBstr, IND_FEC_CLAS, index, FEC_BITS_CLS ); } /*-----------------------------------------------------------------* @@ -117,7 +117,7 @@ void FEC_encode_fx( tmpS = s_min( tmpS, 31 ); tmpS = s_max( tmpS, 0 ); - push_indice_fx( hBstr, IND_FEC_ENR, tmpS, FEC_BITS_ENR ); + push_indice( hBstr, IND_FEC_ENR, tmpS, FEC_BITS_ENR ); } /*-----------------------------------------------------------------* * Encode last glottal pulse position (8 bits) @@ -157,7 +157,7 @@ void FEC_encode_fx( maxi = add( maxi, 128 ); /* use 8 bits (MSB represent the sign of the pulse) Q0*/ } - push_indice_fx( hBstr, IND_FEC_POS, maxi, FEC_BITS_POS ); + push_indice( hBstr, IND_FEC_POS, maxi, FEC_BITS_POS ); } maxi = 0; move16(); diff --git a/lib_enc/acelp_core_enc_fx.c b/lib_enc/acelp_core_enc_fx.c index f9f941dbd..795f03403 100644 --- a/lib_enc/acelp_core_enc_fx.c +++ b/lib_enc/acelp_core_enc_fx.c @@ -472,7 +472,7 @@ ivas_error acelp_core_enc_fx( IF( nb_bits > 0 ) { Es_pred_enc_fx( &Es_pred_fx, &indice, st_fx->L_frame, res_fx, st_fx->voicing_fx, nb_bits, 0, Q_new ); - push_indice_fx( st_fx->hBstr, IND_ES_PRED, indice, nb_bits ); + push_indice( st_fx->hBstr, IND_ES_PRED, indice, nb_bits ); } @@ -619,7 +619,7 @@ ivas_error acelp_core_enc_fx( WHILE( nBits > 0 ) { i = s_min( nBits, 16 ); // Q0 - push_indice_fx( st_fx->hBstr, IND_UNUSED, 0, i ); + push_indice( st_fx->hBstr, IND_UNUSED, 0, i ); nBits = sub( nBits, i ); // Q0 } } diff --git a/lib_enc/acelp_core_switch_enc_fx.c b/lib_enc/acelp_core_switch_enc_fx.c index f9058b9b9..9b0ed8b58 100644 --- a/lib_enc/acelp_core_switch_enc_fx.c +++ b/lib_enc/acelp_core_switch_enc_fx.c @@ -441,7 +441,7 @@ static void encod_gen_voic_core_switch_fx( IF( EQ_16( lp_flag, NORMAL_OPERATION ) ) { - push_indice_fx( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); + push_indice( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); } /*-----------------------------------------------------------------* @@ -489,7 +489,7 @@ static void encod_gen_voic_core_switch_fx( /* write reserved bits */ IF( unbits ) { - push_indice_fx( hBstr, IND_UNUSED, 0, unbits ); + push_indice( hBstr, IND_UNUSED, 0, unbits ); } /*-----------------------------------------------------------------* @@ -838,7 +838,7 @@ static void bwe_switch_enc_fx( } } - push_indice_fx( hBstr, IND_CORE_SWITCHING_AUDIO_DELAY, d1m_fx, AUDIODELAYBITS ); + push_indice( hBstr, IND_CORE_SWITCHING_AUDIO_DELAY, d1m_fx, AUDIODELAYBITS ); tmp = add( i_mult2( d1m_fx, delta_fx ), fdelay_fx ); /* Q0 */ ptmp = &hb_synth_tmp_fx[tmp]; /* Q0 */ @@ -867,7 +867,7 @@ static void bwe_switch_enc_fx( L_tmp1 = L_shl( L_tmp1, sub( q_tmp2, 24 ) ); gain_fx = round_fx_o( Isqrt( L_tmp1 ), &Overflow ); /*Q12 */ ind1_fx = usquant_fx( gain_fx, &gain_fx, shr( MINVALUEOFFIRSTGAIN_FX, 1 ), shr( DELTAOFFIRSTGAIN_FX, 4 ), ( 1 << NOOFGAINBITS1 ) ); /* Q0 */ - push_indice_fx( hBstr, IND_CORE_SWITCHING_AUDIO_GAIN, ind1_fx, NOOFGAINBITS1 ); + push_indice( hBstr, IND_CORE_SWITCHING_AUDIO_GAIN, ind1_fx, NOOFGAINBITS1 ); return; } diff --git a/lib_enc/amr_wb_enc_fx.c b/lib_enc/amr_wb_enc_fx.c index b1b2257e2..6f46e5c12 100644 --- a/lib_enc/amr_wb_enc_fx.c +++ b/lib_enc/amr_wb_enc_fx.c @@ -548,7 +548,7 @@ void amr_wb_enc_fx( * Write VAD information into the bitstream in AMR-WB IO mode *--------------------------------------------------------------------------------------*/ - push_indice_fx( st->hBstr, IND_VAD_FLAG, st->vad_flag, 1 ); + push_indice( st->hBstr, IND_VAD_FLAG, st->vad_flag, 1 ); } /*-----------------------------------------------------------------* diff --git a/lib_enc/avq_cod_fx.c b/lib_enc/avq_cod_fx.c index 962b715cd..b3a49c59e 100644 --- a/lib_enc/avq_cod_fx.c +++ b/lib_enc/avq_cod_fx.c @@ -384,20 +384,20 @@ void AVQ_encmux_fx( /* write the unary code */ FOR( ; j > 16; j -= 16 ) { - push_indice_fx( hBstr, nq_ind, 65535, 16 ); + push_indice( hBstr, nq_ind, 65535, 16 ); bits = sub( bits, 16 ); } IF( j > 0 ) { - push_indice_fx( hBstr, nq_ind, extract_l( L_sub( L_shl( 1L, j ), 1L ) ), j ); + push_indice( hBstr, nq_ind, extract_l( L_sub( L_shl( 1L, j ), 1L ) ), j ); bits = sub( bits, j ); } } IF( !overflow ) { /* write the stop bit */ - push_indice_fx( hBstr, nq_ind, 0, 1 ); + push_indice( hBstr, nq_ind, 0, 1 ); bits = sub( bits, 1 ); } @@ -506,13 +506,13 @@ void AVQ_encmux_fx( IF( j > 0 ) { /* write the unary code */ - push_indice_fx( hBstr, nq_ind, sub( shl( 1, j ), 1 ), j ); + push_indice( hBstr, nq_ind, sub( shl( 1, j ), 1 ), j ); } IF( nq[i] != 0 ) { /* write the stop bit */ - push_indice_fx( hBstr, nq_ind, 0, 1 ); + push_indice( hBstr, nq_ind, 0, 1 ); } /*Compute AVQ code book number from unused Bits */ @@ -1099,32 +1099,32 @@ static void wrte_cv( ELSE IF( LT_16( nq, 5 ) ) /* Q2, Q3, Q4 */ { nq4 = shl( nq, 2 ); - push_indice_fx( hBstr, i_ind, I, nq4 ); + push_indice( hBstr, i_ind, I, nq4 ); bits = sub( bits, nq4 ); } ELSE IF( EQ_16( s_and( nq, 1 ), 0 ) ) /* Q4 + Voronoi extensions r=1,2,3,... */ { - push_indice_fx( hBstr, i_ind, I, 4 * 4 ); + push_indice( hBstr, i_ind, I, 4 * 4 ); bits = sub( bits, 4 * 4 ); /*pos = (int16_t)(nq / 2 - 2);*/ /* Voronoi order determination */ pos = sub( shr( nq, 1 ), 2 ); FOR( j = 0; j < 8; j++ ) { - push_indice_fx( hBstr, kv_ind, kv[j], pos ); + push_indice( hBstr, kv_ind, kv[j], pos ); } bits = sub( bits, shl( pos, 3 ) ); } ELSE /* Q3 + Voronoi extensions r=1,2,3,... */ { - push_indice_fx( hBstr, i_ind, I, 4 * 3 ); + push_indice( hBstr, i_ind, I, 4 * 3 ); bits = sub( bits, 4 * 3 ); /*pos = (int16_t)(nq / 2 - 1);*/ /* Voronoi order determination */ pos = sub( shr( nq, 1 ), 1 ); FOR( j = 0; j < 8; j++ ) { - push_indice_fx( hBstr, kv_ind, kv[j], pos ); + push_indice( hBstr, kv_ind, kv[j], pos ); } bits = sub( bits, shl( pos, 3 ) ); diff --git a/lib_enc/cng_enc_fx.c b/lib_enc/cng_enc_fx.c index e2b29ba59..221454970 100644 --- a/lib_enc/cng_enc_fx.c +++ b/lib_enc/cng_enc_fx.c @@ -975,7 +975,7 @@ void CNG_enc_fx( hTdCngEnc->old_enr_index = enr_index; move16(); - push_indice_fx( hBstr, IND_ENERGY, enr_index, num_bits ); + push_indice( hBstr, IND_ENERGY, enr_index, num_bits ); if ( enr_index == 0 ) { enr_index = -5; @@ -1063,7 +1063,7 @@ void CNG_enc_fx( move16(); } } - push_indice_fx( hBstr, IND_CNG_ENV1, min1_idx, 6 ); + push_indice( hBstr, IND_CNG_ENV1, min1_idx, 6 ); /* get quantized res_env_details */ FOR( i = 0; i < NUM_ENV_CNG; i++ ) { @@ -1122,28 +1122,28 @@ void CNG_enc_fx( /* dithering bit for AMR-WB IO mode is always set to 0 */ IF( EQ_32( st_fx->core_brate, SID_1k75 ) ) { - push_indice_fx( hBstr, IND_DITHERING, 0, 1 ); + push_indice( hBstr, IND_DITHERING, 0, 1 ); } IF( EQ_32( st_fx->core_brate, SID_2k40 ) ) { IF( EQ_16( st_fx->L_frame, L_FRAME16k ) ) { - push_indice_fx( hBstr, IND_ACELP_16KHZ, 1, 1 ); + push_indice( hBstr, IND_ACELP_16KHZ, 1, 1 ); } ELSE { - push_indice_fx( hBstr, IND_ACELP_16KHZ, 0, 1 ); + push_indice( hBstr, IND_ACELP_16KHZ, 0, 1 ); } - push_indice_fx( hBstr, IND_CNG_HO, s_min( hTdCngEnc->burst_ho_cnt, 7 ), 3 ); + push_indice( hBstr, IND_CNG_HO, s_min( hTdCngEnc->burst_ho_cnt, 7 ), 3 ); hTdCngEnc->num_ho = m; move16(); - push_indice_fx( hBstr, IND_SID_TYPE, 0, 1 ); + push_indice( hBstr, IND_SID_TYPE, 0, 1 ); test(); IF( LT_32( st_fx->input_Fs, 32000 ) && NE_16( st_fx->element_mode, IVAS_CPE_DFT ) ) { - push_indice_fx( hBstr, IND_SID_BW, 0, 1 ); + push_indice( hBstr, IND_SID_BW, 0, 1 ); *sid_bw = 0; move16(); } @@ -2458,8 +2458,8 @@ static void shb_CNG_encod_fx( idx_ener_fx = s_max( idx_ener_fx, 0 ); } - push_indice_fx( hBstr, IND_SHB_CNG_GAIN, idx_ener_fx, 4 ); - push_indice_fx( hBstr, IND_SID_BW, 1, 1 ); + push_indice( hBstr, IND_SHB_CNG_GAIN, idx_ener_fx, 4 ); + push_indice( hBstr, IND_SID_BW, 1, 1 ); hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, hBstr->ind_list[IND_CNG_ENV1].nb_bits ); hBstr->ind_list[IND_CNG_ENV1].nb_bits = -1; move16(); @@ -2470,7 +2470,7 @@ static void shb_CNG_encod_fx( } else { - push_indice_fx( hBstr, IND_UNUSED, 0, 2 ); + push_indice( hBstr, IND_UNUSED, 0, 2 ); } hTdCngEnc->ho_sid_bw = L_shl( L_and( hTdCngEnc->ho_sid_bw, (Word32) 0x3fffffffL ), 1 ); hTdCngEnc->ho_sid_bw = L_or( hTdCngEnc->ho_sid_bw, 0x1L ); @@ -2482,7 +2482,7 @@ static void shb_CNG_encod_fx( IF( EQ_32( st_fx->core_brate, SID_2k40 ) ) { hTdCngEnc->ho_sid_bw = L_shl( L_and( hTdCngEnc->ho_sid_bw, (Word32) 0x3fffffffL ), 1 ); - push_indice_fx( hBstr, IND_SID_BW, 0, 1 ); + push_indice( hBstr, IND_SID_BW, 0, 1 ); } } diff --git a/lib_enc/cod2t32_fx.c b/lib_enc/cod2t32_fx.c index a948a4656..dc967e656 100644 --- a/lib_enc/cod2t32_fx.c +++ b/lib_enc/cod2t32_fx.c @@ -292,7 +292,7 @@ void acelp_2t32_fx( } { /* write index to array of indices */ - push_indice_fx( hBstr, IND_ALG_CDBK_2T32, index, 12 ); + push_indice( hBstr, IND_ALG_CDBK_2T32, index, 12 ); } return; } @@ -636,11 +636,11 @@ void acelp_1t64_fx( } IF( EQ_16( L_subfr, L_SUBFR ) ) { - push_indice_fx( hBstr, IND_ALG_CDBK_1T64, index, 7 ); + push_indice( hBstr, IND_ALG_CDBK_1T64, index, 7 ); } ELSE /* L_subfr == 2*L_SUBFR */ { - push_indice_fx( hBstr, IND_ALG_CDBK_1T64, index, 8 ); + push_indice( hBstr, IND_ALG_CDBK_1T64, index, 8 ); } return; diff --git a/lib_enc/cod4t64_fx.c b/lib_enc/cod4t64_fx.c index 99b794b42..457a129b8 100644 --- a/lib_enc/cod4t64_fx.c +++ b/lib_enc/cod4t64_fx.c @@ -330,11 +330,11 @@ Word16 acelp_4t64_fx( bitcnt = s_and( nbbits, 15 ); FOR( i = 0; i < wordcnt; i++ ) { - push_indice_fx( hBstr, IND_ALG_CDBK_4T64, indexing_indices[i], 16 ); + push_indice( hBstr, IND_ALG_CDBK_4T64, indexing_indices[i], 16 ); } IF( bitcnt ) { - push_indice_fx( hBstr, IND_ALG_CDBK_4T64, indexing_indices[i], bitcnt ); + push_indice( hBstr, IND_ALG_CDBK_4T64, indexing_indices[i], bitcnt ); } } ELSE @@ -347,7 +347,7 @@ Word16 acelp_4t64_fx( { k = i_mult2( track, NPMAXPT ); index = quant_1p_N1_fx( ind[k], 4 ); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64, index, 5 ); + push_indice( hBstr, IND_ALG_CDBK_4T64, index, 5 ); } } ELSE IF( EQ_16( nbbits, 36 ) ) @@ -357,7 +357,7 @@ Word16 acelp_4t64_fx( k = i_mult2( track, NPMAXPT ); /* k = track * NPMAXPT;*/ index = quant_2p_2N1_fx( ind[k], ind[k + 1], 4 ); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64, index, 9 ); + push_indice( hBstr, IND_ALG_CDBK_4T64, index, 9 ); } } ELSE IF( EQ_16( nbbits, 44 ) ) /* AMR-WB pulse indexing */ @@ -366,14 +366,14 @@ Word16 acelp_4t64_fx( { k = i_mult2( track, NPMAXPT ); index = quant_3p_3N1_fx( ind[k], ind[k + 1], ind[k + 2], 4 ); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64, index, 13 ); + push_indice( hBstr, IND_ALG_CDBK_4T64, index, 13 ); } FOR( track = 2; track < NB_TRACK_FCB_4T; track++ ) { k = i_mult2( track, NPMAXPT ); index = quant_2p_2N1_fx( ind[k], ind[k + 1], 4 ); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64, index, 9 ); + push_indice( hBstr, IND_ALG_CDBK_4T64, index, 9 ); } } ELSE IF( EQ_16( nbbits, 52 ) ) /* AMR-WB pulse indexing */ @@ -382,7 +382,7 @@ Word16 acelp_4t64_fx( { k = i_mult2( track, NPMAXPT ); index = quant_3p_3N1_fx( ind[k], ind[k + 1], ind[k + 2], 4 ); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64, index, 13 ); + push_indice( hBstr, IND_ALG_CDBK_4T64, index, 13 ); } } ELSE IF( EQ_16( nbbits, 64 ) ) /* AMR-WB pulse indexing */ @@ -393,7 +393,7 @@ Word16 acelp_4t64_fx( L_index = quant_4p_4N_fx( &ind[k], 4 ); index = extract_l( L_shr( L_index, 14 ) & 3 ); logic16(); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64_1, index, 2 ); + push_indice( hBstr, IND_ALG_CDBK_4T64_1, index, 2 ); } FOR( track = 0; track < NB_TRACK_FCB_4T; track++ ) @@ -402,7 +402,7 @@ Word16 acelp_4t64_fx( L_index = quant_4p_4N_fx( &ind[k], 4 ); index = extract_l( L_index & 0x3FFF ); logic16(); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64_2, index, 14 ); + push_indice( hBstr, IND_ALG_CDBK_4T64_2, index, 14 ); } } ELSE IF( EQ_16( nbbits, 72 ) ) @@ -413,7 +413,7 @@ Word16 acelp_4t64_fx( L_index = quant_5p_5N_fx( &ind[k], 4 ); index = extract_l( L_shr( L_index, 10 ) & 0x03FF ); logic16(); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64_1, index, 10 ); + push_indice( hBstr, IND_ALG_CDBK_4T64_1, index, 10 ); } FOR( track = 2; track < NB_TRACK_FCB_4T; track++ ) @@ -422,7 +422,7 @@ Word16 acelp_4t64_fx( L_index = quant_4p_4N_fx( &ind[k], 4 ); index = extract_l( L_shr( L_index, 14 ) & 3 ); logic16(); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64_1, index, 2 ); + push_indice( hBstr, IND_ALG_CDBK_4T64_1, index, 2 ); } FOR( track = 0; track < ( NB_TRACK_FCB_4T - 2 ); track++ ) @@ -431,7 +431,7 @@ Word16 acelp_4t64_fx( L_index = quant_5p_5N_fx( &ind[k], 4 ); index = extract_l( L_index & 0x03FF ); logic16(); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64_2, index, 10 ); + push_indice( hBstr, IND_ALG_CDBK_4T64_2, index, 10 ); } FOR( track = 2; track < NB_TRACK_FCB_4T; track++ ) @@ -440,7 +440,7 @@ Word16 acelp_4t64_fx( L_index = quant_4p_4N_fx( &ind[k], 4 ); index = extract_l( L_index & 0x3FFF ); logic16(); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64_2, index, 14 ); + push_indice( hBstr, IND_ALG_CDBK_4T64_2, index, 14 ); } } ELSE IF( EQ_16( nbbits, 88 ) ) @@ -451,7 +451,7 @@ Word16 acelp_4t64_fx( L_index = quant_6p_6N_2_fx( &ind[k], 4 ); index = extract_l( L_shr( L_index, 11 ) & 0x07FF ); logic16(); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64_1, index, 11 ); + push_indice( hBstr, IND_ALG_CDBK_4T64_1, index, 11 ); } FOR( track = 0; track < NB_TRACK_FCB_4T; track++ ) @@ -460,7 +460,7 @@ Word16 acelp_4t64_fx( L_index = quant_6p_6N_2_fx( &ind[k], 4 ); index = extract_l( L_index & 0x07FF ); logic16(); - push_indice_fx( hBstr, IND_ALG_CDBK_4T64_2, index, 11 ); + push_indice( hBstr, IND_ALG_CDBK_4T64_2, index, 11 ); } } } diff --git a/lib_enc/decision_matrix_enc_fx.c b/lib_enc/decision_matrix_enc_fx.c index c95bc9d5b..63a13aa1a 100644 --- a/lib_enc/decision_matrix_enc_fx.c +++ b/lib_enc/decision_matrix_enc_fx.c @@ -449,14 +449,14 @@ Word16 signalling_mode1_tcx20_enc_fx( num_bits = add( num_bits, nBits ); IF( push != 0 ) { - push_indice_fx( hBstr, IND_ACELP_SIGNALLING, sub( idx, start_idx ), nBits ); + push_indice( hBstr, IND_ACELP_SIGNALLING, sub( idx, start_idx ), nBits ); } /* HQ/TCX core switching flag */ num_bits = add( num_bits, 1 ); IF( push != 0 ) { - push_indice_fx( hBstr, IND_MDCT_CORE, 1, 1 ); + push_indice( hBstr, IND_MDCT_CORE, 1, 1 ); } } ELSE @@ -467,7 +467,7 @@ Word16 signalling_mode1_tcx20_enc_fx( num_bits = add( num_bits, 1 ); IF( push != 0 ) { - push_indice_fx( hBstr, IND_CORE, 1, 1 ); + push_indice( hBstr, IND_CORE, 1, 1 ); } } @@ -475,7 +475,7 @@ Word16 signalling_mode1_tcx20_enc_fx( num_bits = add( num_bits, 1 ); IF( push != 0 ) { - push_indice_fx( hBstr, IND_MDCT_CORE, 1, 1 ); + push_indice( hBstr, IND_MDCT_CORE, 1, 1 ); } num_bits = add( num_bits, 2 ); @@ -484,19 +484,19 @@ Word16 signalling_mode1_tcx20_enc_fx( /* write band-width (needed for different I/O sampling rate support) */ IF( EQ_16( st->bwidth, NB ) ) { - push_indice_fx( hBstr, IND_HQ_BWIDTH, 0, 2 ); + push_indice( hBstr, IND_HQ_BWIDTH, 0, 2 ); } ELSE IF( EQ_16( st->bwidth, WB ) ) { - push_indice_fx( hBstr, IND_HQ_BWIDTH, 1, 2 ); + push_indice( hBstr, IND_HQ_BWIDTH, 1, 2 ); } ELSE IF( EQ_16( st->bwidth, SWB ) ) { - push_indice_fx( hBstr, IND_HQ_BWIDTH, 2, 2 ); + push_indice( hBstr, IND_HQ_BWIDTH, 2, 2 ); } ELSE /* st->bwidth == FB */ { - push_indice_fx( hBstr, IND_HQ_BWIDTH, 3, 2 ); + push_indice( hBstr, IND_HQ_BWIDTH, 3, 2 ); } } } @@ -534,21 +534,21 @@ void signalling_enc_fx( test(); IF( ( st_fx->last_core == ACELP_CORE ) || EQ_16( st_fx->last_core, AMR_WB_CORE ) ) { - push_indice_fx( hBstr, IND_HQ_SWITCHING_FLG, 1, 1 ); + push_indice( hBstr, IND_HQ_SWITCHING_FLG, 1, 1 ); /* write ACELP L_frame info */ IF( EQ_16( st_fx->last_L_frame, L_FRAME ) ) { - push_indice_fx( hBstr, IND_LAST_L_FRAME, 0, 1 ); + push_indice( hBstr, IND_LAST_L_FRAME, 0, 1 ); } ELSE { - push_indice_fx( hBstr, IND_LAST_L_FRAME, 1, 1 ); + push_indice( hBstr, IND_LAST_L_FRAME, 1, 1 ); } } ELSE { - push_indice_fx( hBstr, IND_HQ_SWITCHING_FLG, 0, 1 ); + push_indice( hBstr, IND_HQ_SWITCHING_FLG, 0, 1 ); } return; @@ -574,7 +574,7 @@ void signalling_enc_fx( IF( EQ_16( ppp_mode, 1 ) || EQ_16( nelp_mode, 1 ) ) { /* 1 bit to distinguish between 2.8kbps PPP/NELP frame and SID frame */ - push_indice_fx( hBstr, IND_CORE, 0, 1 ); + push_indice( hBstr, IND_CORE, 0, 1 ); /* SC-VBR: 0 - PPP_NB, 1 - PPP_WB, 2 - NELP_NB, 3 - NELP_WB */ test(); test(); @@ -586,19 +586,19 @@ void signalling_enc_fx( test(); IF( EQ_16( st_fx->coder_type, VOICED ) && EQ_16( st_fx->bwidth, NB ) && EQ_16( ppp_mode, 1 ) ) { - push_indice_fx( hBstr, IND_PPP_NELP_MODE, 0, 2 ); + push_indice( hBstr, IND_PPP_NELP_MODE, 0, 2 ); } ELSE IF( EQ_16( st_fx->coder_type, VOICED ) && NE_16( st_fx->bwidth, NB ) && EQ_16( ppp_mode, 1 ) ) { - push_indice_fx( hBstr, IND_PPP_NELP_MODE, 1, 2 ); + push_indice( hBstr, IND_PPP_NELP_MODE, 1, 2 ); } ELSE IF( EQ_16( st_fx->coder_type, UNVOICED ) && EQ_16( st_fx->bwidth, NB ) && EQ_16( nelp_mode, 1 ) ) { - push_indice_fx( hBstr, IND_PPP_NELP_MODE, 2, 2 ); + push_indice( hBstr, IND_PPP_NELP_MODE, 2, 2 ); } ELSE IF( EQ_16( st_fx->coder_type, UNVOICED ) && NE_16( st_fx->bwidth, NB ) && EQ_16( nelp_mode, 1 ) ) { - push_indice_fx( hBstr, IND_PPP_NELP_MODE, 3, 2 ); + push_indice( hBstr, IND_PPP_NELP_MODE, 3, 2 ); } } ELSE IF( NE_32( st_fx->core_brate, SID_2k40 ) && ( st_fx->core_brate != FRAME_NO_DATA ) ) @@ -606,7 +606,7 @@ void signalling_enc_fx( /* write the ACELP/HQ core selection bit */ IF( GE_32( st_fx->total_brate, ACELP_24k40 ) ) { - push_indice_fx( hBstr, IND_CORE, 0, 1 ); + push_indice( hBstr, IND_CORE, 0, 1 ); } /* find the section in the ACELP signalling table corresponding to bitrate */ @@ -652,7 +652,7 @@ void signalling_enc_fx( idx++; } - push_indice_fx( hBstr, IND_ACELP_SIGNALLING, idx - start_idx, nBits ); + push_indice( hBstr, IND_ACELP_SIGNALLING, idx - start_idx, nBits ); } /* write extension layer flag to distinguish between TBE (0) and BWE (1) */ @@ -664,11 +664,11 @@ void signalling_enc_fx( test(); IF( EQ_16( st_fx->extl, WB_TBE ) || EQ_16( st_fx->extl, SWB_TBE ) || EQ_16( st_fx->extl, FB_TBE ) ) { - push_indice_fx( hBstr, IND_BWE_FLAG, 0, 1 ); + push_indice( hBstr, IND_BWE_FLAG, 0, 1 ); } ELSE IF( EQ_16( st_fx->extl, WB_BWE ) || EQ_16( st_fx->extl, SWB_BWE ) || EQ_16( st_fx->extl, FB_BWE ) ) { - push_indice_fx( hBstr, IND_BWE_FLAG, 1, 1 ); + push_indice( hBstr, IND_BWE_FLAG, 1, 1 ); } } } @@ -678,24 +678,24 @@ void signalling_enc_fx( test(); IF( ( st_fx->last_core == ACELP_CORE ) || EQ_16( st_fx->last_core, AMR_WB_CORE ) ) { - push_indice_fx( hBstr, IND_HQ_SWITCHING_FLG, 1, 1 ); + push_indice( hBstr, IND_HQ_SWITCHING_FLG, 1, 1 ); /* write ACELP L_frame info */ IF( EQ_16( st_fx->last_L_frame, L_FRAME ) ) { - push_indice_fx( hBstr, IND_LAST_L_FRAME, 0, 1 ); + push_indice( hBstr, IND_LAST_L_FRAME, 0, 1 ); } ELSE { - push_indice_fx( hBstr, IND_LAST_L_FRAME, 1, 1 ); + push_indice( hBstr, IND_LAST_L_FRAME, 1, 1 ); } } ELSE { - push_indice_fx( hBstr, IND_HQ_SWITCHING_FLG, 0, 1 ); + push_indice( hBstr, IND_HQ_SWITCHING_FLG, 0, 1 ); } /* HQ/TCX core switching flag */ - push_indice_fx( hBstr, IND_MDCT_CORE, 0, 1 ); + push_indice( hBstr, IND_MDCT_CORE, 0, 1 ); /* Use ACELP signaling for LR MDCT */ IF( LE_32( st_fx->total_brate, ACELP_16k40 ) ) @@ -719,7 +719,7 @@ void signalling_enc_fx( idx++; } - push_indice_fx( hBstr, IND_ACELP_SIGNALLING, idx - start_idx, nBits ); + push_indice( hBstr, IND_ACELP_SIGNALLING, idx - start_idx, nBits ); } ELSE { @@ -727,25 +727,25 @@ void signalling_enc_fx( IF( LE_32( st_fx->core_brate, ACELP_64k ) ) { /* write ACELP/HQ core indication flag */ - push_indice_fx( hBstr, IND_CORE, 1, 1 ); + push_indice( hBstr, IND_CORE, 1, 1 ); } /* write band-width (needed for different I/O sampling rate support) */ IF( EQ_16( st_fx->bwidth, NB ) ) { - push_indice_fx( hBstr, IND_HQ_BWIDTH, 0, 2 ); + push_indice( hBstr, IND_HQ_BWIDTH, 0, 2 ); } ELSE IF( EQ_16( st_fx->bwidth, WB ) ) { - push_indice_fx( hBstr, IND_HQ_BWIDTH, 1, 2 ); + push_indice( hBstr, IND_HQ_BWIDTH, 1, 2 ); } ELSE IF( EQ_16( st_fx->bwidth, SWB ) ) { - push_indice_fx( hBstr, IND_HQ_BWIDTH, 2, 2 ); + push_indice( hBstr, IND_HQ_BWIDTH, 2, 2 ); } ELSE /* st_fx->bwidth == FB */ { - push_indice_fx( hBstr, IND_HQ_BWIDTH, 3, 2 ); + push_indice( hBstr, IND_HQ_BWIDTH, 3, 2 ); } } } diff --git a/lib_enc/enc_amr_wb_fx.c b/lib_enc/enc_amr_wb_fx.c index 08a20bbb9..4c5268017 100644 --- a/lib_enc/enc_amr_wb_fx.c +++ b/lib_enc/enc_amr_wb_fx.c @@ -170,7 +170,7 @@ void encod_amr_wb_fx( IF( EQ_16( lp_flag, NORMAL_OPERATION ) ) { - push_indice_fx( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); + push_indice( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); } /*-----------------------------------------------------------------* @@ -243,7 +243,7 @@ void encod_amr_wb_fx( hVAD->hangover_cnt, &hAmrwb_IO->gain_alpha_fx, &hf_gain_fx[i_subfr / L_SUBFR], add( Q_new, 1 ), st->Q_syn ); } - push_indice_fx( hBstr, IND_HF_GAIN_MODIFICATION, hf_gain_fx[i_subfr / L_SUBFR], 4 ); + push_indice( hBstr, IND_HF_GAIN_MODIFICATION, hf_gain_fx[i_subfr / L_SUBFR], 4 ); } p_Aw += ( M + 1 ); diff --git a/lib_enc/enc_gen_voic_fx.c b/lib_enc/enc_gen_voic_fx.c index 62f740fb2..00c7d28d7 100644 --- a/lib_enc/enc_gen_voic_fx.c +++ b/lib_enc/enc_gen_voic_fx.c @@ -179,7 +179,7 @@ void encod_gen_voic_fx( move16(); } - push_indice_fx( hBstr, IND_HARM_FLAG_ACELP, harm_flag_acelp, 1 ); + push_indice( hBstr, IND_HARM_FLAG_ACELP, harm_flag_acelp, 1 ); } /*------------------------------------------------------------------* @@ -239,7 +239,7 @@ void encod_gen_voic_fx( IF( EQ_16( lp_flag, NORMAL_OPERATION ) ) { - push_indice_fx( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); + push_indice( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); } /*st_fx->lowrate_pitchGain = 0.9f * st_fx->lowrate_pitchGain + 0.1f * gain_pit_fx;*/ @@ -387,7 +387,7 @@ void encod_gen_voic_fx( WHILE( unbits_PI_fx > 0 ) { i = s_min( unbits_PI_fx, 16 ); - push_indice_fx( hBstr, IND_UNUSED, 0, i ); + push_indice( hBstr, IND_UNUSED, 0, i ); unbits_PI_fx -= i; } IF( st_fx->Opt_SC_VBR ) diff --git a/lib_enc/enc_higher_acelp_fx.c b/lib_enc/enc_higher_acelp_fx.c index 64a11be5b..bf248bb5a 100644 --- a/lib_enc/enc_higher_acelp_fx.c +++ b/lib_enc/enc_higher_acelp_fx.c @@ -242,7 +242,7 @@ void transf_cdbk_enc_fx( Ltmp = L_shl( Ltmp, add( e_den, 9 ) ); /* Q18*/ *gain_preQ = round_fx( Ltmp ); /* Q2*/ } - push_indice_fx( st_fx->hBstr, IND_AVQ_GAIN, index, G_AVQ_BITS ); + push_indice( st_fx->hBstr, IND_AVQ_GAIN, index, G_AVQ_BITS ); /*--------------------------------------------------------------* * Encode and multiplex subvectors into bit-stream @@ -276,7 +276,7 @@ void transf_cdbk_enc_fx( WHILE( *unbits > 0 ) { i = s_min( *unbits, 16 ); - push_indice_fx( st_fx->hBstr, IND_UNUSED, 0, i ); + push_indice( st_fx->hBstr, IND_UNUSED, 0, i ); *unbits -= i; } } diff --git a/lib_enc/enc_pit_exc_fx.c b/lib_enc/enc_pit_exc_fx.c index 957e41516..3cb2cc066 100644 --- a/lib_enc/enc_pit_exc_fx.c +++ b/lib_enc/enc_pit_exc_fx.c @@ -291,7 +291,7 @@ void enc_pit_exc_fx( IF( EQ_16( lp_flag, NORMAL_OPERATION ) ) { - push_indice_fx( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); + push_indice( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); } /*st_fx->lowrate_pitchGain = 0.9f * st_fx->lowrate_pitchGain + 0.1f * gain_pit;*/ @@ -312,12 +312,12 @@ void enc_pit_exc_fx( IF( GE_32( st_fx->core_brate, MIN_RATE_FCB ) ) { pit_idx = vquant_fx( &gain_pit, mean_gp_fx, &gain_pit, dic_gp_fx, 1, 32 ); /* Q0 */ - push_indice_fx( hBstr, IND_PIT_IDX, pit_idx, 5 ); + push_indice( hBstr, IND_PIT_IDX, pit_idx, 5 ); } ELSE { pit_idx = vquant_fx( &gain_pit, mean_gp_fx, &gain_pit, dic_gp_fx, 1, 16 ); /* Q0 */ - push_indice_fx( hBstr, IND_PIT_IDX, pit_idx, 4 ); + push_indice( hBstr, IND_PIT_IDX, pit_idx, 4 ); } } else if ( use_fcb == 2 ) diff --git a/lib_enc/enc_tran_fx.c b/lib_enc/enc_tran_fx.c index 4cda393d5..d6935dd0c 100644 --- a/lib_enc/enc_tran_fx.c +++ b/lib_enc/enc_tran_fx.c @@ -327,7 +327,7 @@ Word16 encod_tran_fx( WHILE( unbits_PI > 0 ) { i = s_min( unbits_PI, 16 ); - push_indice_fx( hBstr, IND_UNUSED, 0, i ); + push_indice( hBstr, IND_UNUSED, 0, i ); unbits_PI -= i; } @@ -336,72 +336,72 @@ Word16 encod_tran_fx( { IF( EQ_16( tc_subfr, TC_0_0 ) ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 1, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 1, 1 ); } ELSE IF( EQ_16( tc_subfr, TC_0_64 ) ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 1, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 1, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 1, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 1, 1 ); } ELSE IF( EQ_16( tc_subfr, TC_0_128 ) ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 1, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 1, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); } ELSE IF( EQ_16( tc_subfr, TC_0_192 ) ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 1, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 1, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 1, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 1, 1 ); } ELSE IF( EQ_16( tc_subfr, L_SUBFR ) ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 1, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 1, 1 ); } ELSE IF( EQ_16( tc_subfr, 2 * L_SUBFR ) ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 1, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 1, 1 ); } ELSE IF( EQ_16( tc_subfr, 3 * L_SUBFR ) ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); } } ELSE /* L_frame == L_FRAME16k */ { IF( tc_subfr == 0 ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 2 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 2 ); } ELSE IF( EQ_16( tc_subfr, L_SUBFR ) ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 1, 2 ); + push_indice( hBstr, IND_TC_SUBFR, 1, 2 ); } ELSE IF( EQ_16( tc_subfr, 2 * L_SUBFR ) ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 2, 2 ); + push_indice( hBstr, IND_TC_SUBFR, 2, 2 ); } ELSE IF( EQ_16( tc_subfr, 3 * L_SUBFR ) ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 3, 2 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 0, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 3, 2 ); + push_indice( hBstr, IND_TC_SUBFR, 0, 1 ); } ELSE IF( EQ_16( tc_subfr, 4 * L_SUBFR ) ) { - push_indice_fx( hBstr, IND_TC_SUBFR, 3, 2 ); - push_indice_fx( hBstr, IND_TC_SUBFR, 1, 1 ); + push_indice( hBstr, IND_TC_SUBFR, 3, 2 ); + push_indice( hBstr, IND_TC_SUBFR, 1, 1 ); } } diff --git a/lib_enc/enc_uv_fx.c b/lib_enc/enc_uv_fx.c index 8a77b9e2b..a8612725b 100644 --- a/lib_enc/enc_uv_fx.c +++ b/lib_enc/enc_uv_fx.c @@ -153,7 +153,7 @@ void encod_unvoiced_fx( #ifdef DEBUGGING assert( st_fx->acelp_cfg.gains_mode[i_subfr_idx] == 7 && "Error: UC two-stage, only 5+2 gain Q is supported" ); #endif - push_indice_fx( st_fx->hBstr, IND_GAIN, index, st_fx->acelp_cfg.gains_mode[i_subfr_idx] ); + push_indice( st_fx->hBstr, IND_GAIN, index, st_fx->acelp_cfg.gains_mode[i_subfr_idx] ); gp_clip_test_gain_pit_fx( st_fx->element_mode, st_fx->core_brate, gain_pit_fx, st_fx->clip_var_fx ); diff --git a/lib_enc/eval_pit_contr_fx.c b/lib_enc/eval_pit_contr_fx.c index aef5fd637..df629f295 100644 --- a/lib_enc/eval_pit_contr_fx.c +++ b/lib_enc/eval_pit_contr_fx.c @@ -409,17 +409,17 @@ Word16 Pit_exc_contribution_len_fx( /* o : bin where pit IF( EQ_16( st_fx->coder_type, INACTIVE ) ) { - push_indice_fx( hBstr, IND_PIT_CONTR_IDX, pit_contr_idx, 1 ); + push_indice( hBstr, IND_PIT_CONTR_IDX, pit_contr_idx, 1 ); } } ELSE { - push_indice_fx( hBstr, IND_PIT_CONTR_IDX, pit_contr_idx, 3 ); + push_indice( hBstr, IND_PIT_CONTR_IDX, pit_contr_idx, 3 ); } } ELSE { - push_indice_fx( hBstr, IND_PIT_CONTR_IDX, pit_contr_idx, 4 ); + push_indice( hBstr, IND_PIT_CONTR_IDX, pit_contr_idx, 4 ); } return last_pit_bin; diff --git a/lib_enc/fd_cng_enc_fx.c b/lib_enc/fd_cng_enc_fx.c index e51e2b682..2eb13646c 100644 --- a/lib_enc/fd_cng_enc_fx.c +++ b/lib_enc/fd_cng_enc_fx.c @@ -1217,21 +1217,21 @@ void FdCng_encodeSID_fx( HANDLE_FD_CNG_ENC stenc, /* i/o: pointer to FD_CNG stru } ELSE { - push_indice_fx( hBstr, IND_SID_TYPE, 1, 1 ); - push_indice_fx( hBstr, IND_ACELP_16KHZ, corest->bwidth, 2 ); + push_indice( hBstr, IND_SID_TYPE, 1, 1 ); + push_indice( hBstr, IND_ACELP_16KHZ, corest->bwidth, 2 ); IF( EQ_16( corest->L_frame, L_FRAME16k ) ) { - push_indice_fx( hBstr, IND_ACELP_16KHZ, 1, 1 ); + push_indice( hBstr, IND_ACELP_16KHZ, 1, 1 ); } ELSE { - push_indice_fx( hBstr, IND_ACELP_16KHZ, 0, 1 ); + push_indice( hBstr, IND_ACELP_16KHZ, 0, 1 ); } FOR( i = 0; i < stages_37bits; i++ ) { - push_indice_fx( hBstr, IND_LSF, indices[i], bits_37bits[i] ); + push_indice( hBstr, IND_LSF, indices[i], bits_37bits[i] ); } - push_indice_fx( hBstr, IND_ENERGY, index, 7 ); + push_indice( hBstr, IND_ENERGY, index, 7 ); } /* Interpolate the bin/band-wise levels from the partition levels */ diff --git a/lib_enc/gain_enc_fx.c b/lib_enc/gain_enc_fx.c index 0321cd763..0ccb31ccf 100644 --- a/lib_enc/gain_enc_fx.c +++ b/lib_enc/gain_enc_fx.c @@ -428,7 +428,7 @@ void gain_enc_mless_fx( tmp1 = mult_r( G_PITCH_MAX_MINUS_MIN_TC192_Q13, div_s( 1, sub( shl( 1, nBits ), 1 ) ) ); /*Q13*/ /* set quantization step */ index = usquant_fx( *gain_pit, gain_pit, G_PITCH_MIN_TC192_Q14, tmp1, shl( 1, nBits ) ); move16(); - push_indice_fx( hBstr, IND_GAIN_PIT, index, nBits ); + push_indice( hBstr, IND_GAIN_PIT, index, nBits ); /* gain_code Q */ /**gain_code /= gcode0;*/ @@ -441,7 +441,7 @@ void gain_enc_mless_fx( } index = gain_quant_fx( gain_code, &gain_code16, LG10_G_CODE_MIN_TC192_Q14, LG10_G_CODE_MAX_TC192_Q13, nBits2, &expg ); - push_indice_fx( hBstr, IND_GAIN_CODE, index, nBits2 ); + push_indice( hBstr, IND_GAIN_CODE, index, nBits2 ); L_tmp = L_mult( gain_code16, gcode0 ); /*Q0*Q0 -> Q1*/ *gain_code = L_shl_o( L_tmp, add( add( expg, exp_gcode0 ), 15 ), &Overflow ); /*Q16*/ } @@ -508,7 +508,7 @@ void gain_enc_mless_fx( * search for the best quantizer *-----------------------------------------------------------------*/ index = Find_Opt_gainQ_fx( coeff, exp_coeff, gain_pit, gain_code, gcode0, exp_gcode0, qua_table, size ); // Q0 - push_indice_fx( hBstr, IND_GAIN, index, nBits ); + push_indice( hBstr, IND_GAIN, index, nBits ); } /* *norm_gain_code = *gain_code / *gain_inov; */ @@ -1108,7 +1108,7 @@ void gain_enc_SQ_fx( tmp1 = mult_r( G_PITCH_MAX_Q13, div_s( 1, sub( shl( 1, nBits_pitch ), 1 ) ) ); /*Q13*/ /* set quantization step */ index = usquant_fx( *gain_pit, gain_pit, G_PITCH_MIN_Q14, tmp1, shl( 1, nBits_pitch ) ); // Q0 - push_indice_fx( hBstr, IND_GAIN_PIT, index, nBits_pitch ); + push_indice( hBstr, IND_GAIN_PIT, index, nBits_pitch ); /* gain_code Q */ /* *gain_code /= gcode0; */ @@ -1121,7 +1121,7 @@ void gain_enc_SQ_fx( } index = gain_quant_fx( gain_code, &gain_code16, LG10_G_CODE_MIN_Q14, LG10_G_CODE_MAX_Q13, nBits_code, &expg ); - push_indice_fx( hBstr, IND_GAIN_CODE, index, nBits_code ); + push_indice( hBstr, IND_GAIN_CODE, index, nBits_code ); L_tmp = L_mult( gain_code16, gcode0 ); /*Q0*Q0 -> Q1*/ *gain_code = L_shl_sat( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); move32(); /*Q16*/ @@ -1601,7 +1601,7 @@ void gain_enc_tc_fx( *gain_code_fx = L_shl( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); /*Q16*/ move32(); - push_indice_fx( hBstr, IND_GAIN_CODE, index, nBits ); + push_indice( hBstr, IND_GAIN_CODE, index, nBits ); } ELSE { @@ -1632,7 +1632,7 @@ void gain_enc_tc_fx( L_tmp = L_mult( wgain_code, gcode0_fx ); /* Q13*Q0 -> Q14 */ *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 2 ) ); move32(); /* Q14 -> Q16 */ - push_indice_fx( hBstr, IND_GAIN_CODE, index, nBits ); + push_indice( hBstr, IND_GAIN_CODE, index, nBits ); } ELSE /* nBits == 3 */ { @@ -1642,7 +1642,7 @@ void gain_enc_tc_fx( L_tmp = L_mult( wgain_code, gcode0_fx ); /* Q13*Q0 -> Q14 */ *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 2 ) ); move32(); /* Q14 -> Q16 */ - push_indice_fx( hBstr, IND_GAIN_CODE, index, nBits ); + push_indice( hBstr, IND_GAIN_CODE, index, nBits ); } } @@ -2438,7 +2438,7 @@ void gain_enc_lbr_fx( *norm_gain_code = L_shr( Mult_32_16( *gain_code, tmp ), sub( 1, exp ) ); // Q16 move32(); { - push_indice_fx( hBstr, IND_GAIN, index, nBits ); + push_indice( hBstr, IND_GAIN, index, nBits ); } return; } @@ -3223,7 +3223,7 @@ void gain_enc_amr_wb_fx( *norm_gain_code = L_shr( Mult_32_16( *gain_code, tmp ), sub( 1, exp ) ); // Q16 move32(); - push_indice_fx( hBstr, IND_GAIN, index, nBits ); + push_indice( hBstr, IND_GAIN, index, nBits ); return; } diff --git a/lib_enc/gaus_enc_fx.c b/lib_enc/gaus_enc_fx.c index edddc6a88..081cf7ef0 100644 --- a/lib_enc/gaus_enc_fx.c +++ b/lib_enc/gaus_enc_fx.c @@ -96,7 +96,7 @@ Word16 gaus_encode_fx( move16(); /* low bound = -30; stepSize = 1.71875; inv_stepSize = 0.5818181 */ idx = gain_enc_gaus_fx( gain_code, nb_bits, -7680, 28160, 19065 ); /* Q0 */ - push_indice_fx( st_fx->hBstr, IND_GAIN, idx, nb_bits ); + push_indice( st_fx->hBstr, IND_GAIN, idx, nb_bits ); /*----------------------------------------------------------------* * Total excitation for Unvoiced coders @@ -638,8 +638,8 @@ void gauss2v_fx( idx = cod_2pos_fx( i, j, sign1, sign2, nvec ); /* Q0 */ move16(); - push_indice_fx( hBstr, IND_GAUS_CDBK_INDEX, idx, 2 * nb_bits + 1 ); - push_indice_fx( hBstr, IND_TILT_FACTOR, index_delta, 3 ); + push_indice( hBstr, IND_GAUS_CDBK_INDEX, idx, 2 * nb_bits + 1 ); + push_indice( hBstr, IND_TILT_FACTOR, index_delta, 3 ); /*----------------------------------------------------------------* * Find quantized gain diff --git a/lib_enc/gs_enc_fx.c b/lib_enc/gs_enc_fx.c index 1642d1253..1a3d2cb56 100644 --- a/lib_enc/gs_enc_fx.c +++ b/lib_enc/gs_enc_fx.c @@ -82,16 +82,16 @@ void encod_audio_fx( test(); IF( ( st_fx->element_mode > EVS_MONO ) && st_fx->idchan == 0 ) { - push_indice_fx( hBstr, IND_GSC_IVAS_SP, st_fx->GSC_IVAS_mode, 2 ); + push_indice( hBstr, IND_GSC_IVAS_SP, st_fx->GSC_IVAS_mode, 2 ); } #endif IF( attack_flag > 0 ) { - push_indice_fx( hBstr, IND_GSC_ATTACK, 1, 1 ); + push_indice( hBstr, IND_GSC_ATTACK, 1, 1 ); } ELSE { - push_indice_fx( hBstr, IND_GSC_ATTACK, 0, 1 ); + push_indice( hBstr, IND_GSC_ATTACK, 0, 1 ); } @@ -105,7 +105,7 @@ void encod_audio_fx( IF( GE_16( st_fx->GSC_IVAS_mode, 1 ) || ( NE_16( st_fx->coder_type, INACTIVE ) && ( ( EQ_16( st_fx->element_mode, EVS_MONO ) && GE_32( st_fx->total_brate, ACELP_13k20 ) ) || ( GT_16( st_fx->element_mode, EVS_MONO ) && GT_32( st_fx->total_brate, MIN_BRATE_GSC_NOISY_FLAG ) && GE_16( st_fx->bwidth, SWB ) && !st_fx->flag_ACELP16k ) ) ) ) { - push_indice_fx( hBstr, IND_GSC_SWB_SPEECH, st_fx->GSC_noisy_speech, 1 ); + push_indice( hBstr, IND_GSC_SWB_SPEECH, st_fx->GSC_noisy_speech, 1 ); } /*---------------------------------------------------------------* * Find and encode the number of subframes @@ -185,12 +185,12 @@ void encod_audio_fx( IF( EQ_16( st_fx->L_frame, L_FRAME16k ) && GE_32( st_fx->core_brate, MIN_RATE_4SBFR ) ) { - push_indice_fx( hBstr, IND_HF_NOISE, nb_subfr_flag, 2 ); + push_indice( hBstr, IND_HF_NOISE, nb_subfr_flag, 2 ); } ELSE IF( GE_32( st_fx->core_brate, ACELP_9k60 ) ) { /* nb_subfr_flag can only have the value 0 or 1 */ - push_indice_fx( hBstr, IND_HF_NOISE, nb_subfr_flag, 1 ); + push_indice( hBstr, IND_HF_NOISE, nb_subfr_flag, 1 ); } } test(); @@ -227,7 +227,7 @@ void encod_audio_fx( move16(); } Es_pred_enc_fx( &Es_pred, &indice, st_fx->L_frame, res, st_fx->voicing_fx, nb_bits, 0, Q_new ); - push_indice_fx( hBstr, IND_ES_PRED, indice, nb_bits ); + push_indice( hBstr, IND_ES_PRED, indice, nb_bits ); } enc_pit_exc_fx( st_fx, speech, Aw, Aq, Es_pred, res, synth, exc, &T0_tmp, @@ -290,7 +290,7 @@ void encod_audio_fx( { hGSCEnc->noise_lev = s_max( hGSCEnc->noise_lev, NOISE_LEVEL_SP2 ); move16(); - push_indice_fx( hBstr, IND_NOISE_LEVEL, sub( hGSCEnc->noise_lev, NOISE_LEVEL_SP2 ), 2 ); + push_indice( hBstr, IND_NOISE_LEVEL, sub( hGSCEnc->noise_lev, NOISE_LEVEL_SP2 ), 2 ); } ELSE IF( st_fx->GSC_noisy_speech ) { @@ -300,7 +300,7 @@ void encod_audio_fx( } ELSE { - push_indice_fx( hBstr, IND_NOISE_LEVEL, sub( hGSCEnc->noise_lev, NOISE_LEVEL_SP0 ), 3 ); + push_indice( hBstr, IND_NOISE_LEVEL, sub( hGSCEnc->noise_lev, NOISE_LEVEL_SP0 ), 3 ); } /*---------------------------------------------------------------* @@ -931,7 +931,7 @@ void gsc_enc_fx( WHILE( bit > 0 ) { i = s_min( bit, 16 ); - push_indice_fx( hBstr, IND_UNUSED, 0, i ); + push_indice( hBstr, IND_UNUSED, 0, i ); bit = sub( bit, i ); } /* Reorder Q bands */ diff --git a/lib_enc/hq_classifier_enc_fx.c b/lib_enc/hq_classifier_enc_fx.c index 2b53082f7..300e31e8e 100644 --- a/lib_enc/hq_classifier_enc_fx.c +++ b/lib_enc/hq_classifier_enc_fx.c @@ -258,16 +258,16 @@ Word16 hq_classifier_enc_fx( /* o : Consumed bits { IF( GE_16( *hqswb_clas, HQ_GEN_SWB ) ) { - push_indice_fx( st_fx->hBstr, IND_HQ_SWB_CLAS, *hqswb_clas - 5, bits ); + push_indice( st_fx->hBstr, IND_HQ_SWB_CLAS, *hqswb_clas - 5, bits ); } ELSE { - push_indice_fx( st_fx->hBstr, IND_HQ_SWB_CLAS, *hqswb_clas, bits ); + push_indice( st_fx->hBstr, IND_HQ_SWB_CLAS, *hqswb_clas, bits ); } } ELSE { - push_indice_fx( st_fx->hBstr, IND_HQ_SWB_CLAS, *hqswb_clas, bits ); + push_indice( st_fx->hBstr, IND_HQ_SWB_CLAS, *hqswb_clas, bits ); } test(); @@ -343,7 +343,7 @@ Word16 hq_classifier_enc_fx( /* o : Consumed bits move16(); } /* write signalling info to the bitstream */ - push_indice_fx( st_fx->hBstr, IND_HQ_SWB_CLAS, *hqswb_clas, bits ); + push_indice( st_fx->hBstr, IND_HQ_SWB_CLAS, *hqswb_clas, bits ); IF( LE_32( st_fx->core_brate, HQ_32k ) && EQ_16( *hqswb_clas, HQ_NORMAL ) ) { diff --git a/lib_enc/hq_core_enc_fx.c b/lib_enc/hq_core_enc_fx.c index ff19cfebc..66430cb8e 100644 --- a/lib_enc/hq_core_enc_fx.c +++ b/lib_enc/hq_core_enc_fx.c @@ -229,12 +229,12 @@ void hq_core_enc_fx( { IF( Voicing_flag > 0 ) { - push_indice_fx( hBstr, IND_HQ_VOICING_FLAG, 1, 1 ); + push_indice( hBstr, IND_HQ_VOICING_FLAG, 1, 1 ); num_bits = sub( num_bits, 1 ); } ELSE { - push_indice_fx( hBstr, IND_HQ_VOICING_FLAG, 0, 1 ); + push_indice( hBstr, IND_HQ_VOICING_FLAG, 0, 1 ); num_bits = sub( num_bits, 1 ); } } @@ -278,13 +278,13 @@ void hq_core_enc_fx( WHILE( num_bits >= 16 ) { - push_indice_fx( hBstr, IND_UNUSED, 0, 16 ); + push_indice( hBstr, IND_UNUSED, 0, 16 ); num_bits = sub( num_bits, 16 ); } IF( num_bits != 0 ) { - push_indice_fx( hBstr, IND_UNUSED, 0, num_bits ); + push_indice( hBstr, IND_UNUSED, 0, num_bits ); } #ifdef ADD_IVAS_HQ_CODE if ( st->element_mode > EVS_MONO && ( st->last_core == ACELP_CORE || st->last_core == AMR_WB_CORE ) ) diff --git a/lib_enc/hq_env_enc_fx.c b/lib_enc/hq_env_enc_fx.c index 5d47710ed..f033bd685 100644 --- a/lib_enc/hq_env_enc_fx.c +++ b/lib_enc/hq_env_enc_fx.c @@ -295,13 +295,13 @@ Word16 encode_envelope_indices_fx( /* o : Number of b test(); IF( EQ_16( flag_HQ2, LOW_RATE_HQ_CORE_TRAN ) || EQ_16( flag_HQ2, LOW_RATE_HQ_CORE ) ) { - push_indice_fx( hBstr, IND_HQ2_DENG_HMODE, *LCmode, BITS_DE_HMODE ); - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, difidx[0], BITS_DE_FCOMP ); + push_indice( hBstr, IND_HQ2_DENG_HMODE, *LCmode, BITS_DE_HMODE ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, difidx[0], BITS_DE_FCOMP ); } ELSE { - push_indice_fx( hBstr, IND_LC_MODE, *LCmode, 2 ); - push_indice_fx( hBstr, IND_YNRM, difidx[0], NORM0_BITS ); + push_indice( hBstr, IND_LC_MODE, *LCmode, 2 ); + push_indice( hBstr, IND_YNRM, difidx[0], NORM0_BITS ); } test(); @@ -331,7 +331,7 @@ Word16 encode_envelope_indices_fx( /* o : Number of b m = lshr( m, 1 ); /* Q0 */ } - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, v, r ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, v, r ); } } ELSE @@ -370,7 +370,7 @@ Word16 encode_envelope_indices_fx( /* o : Number of b move16(); } } - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, m, r ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, m, r ); prevj = j; move16(); } @@ -419,11 +419,11 @@ Word16 encode_envelope_indices_fx( /* o : Number of b IF( EQ_16( flag_HQ2, LOW_RATE_HQ_CORE ) ) { - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, m, r ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, m, r ); } ELSE { - push_indice_fx( hBstr, IND_YNRM, m, r ); + push_indice( hBstr, IND_YNRM, m, r ); } prevj = j; @@ -515,11 +515,11 @@ Word16 encode_envelope_indices_fx( /* o : Number of b IF( flag_HQ2 == 0 ) { - push_indice_fx( hBstr, IND_YNRM, v, r ); + push_indice( hBstr, IND_YNRM, v, r ); } ELSE { - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, v, r ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, v, r ); } } } @@ -536,14 +536,14 @@ Word16 encode_envelope_indices_fx( /* o : Number of b r = huffsizn[j]; /* Q0 */ move16(); - push_indice_fx( hBstr, IND_YNRM, m, r ); + push_indice( hBstr, IND_YNRM, m, r ); } } ELSE { FOR( i = 1; i < num_sfm; i++ ) { - push_indice_fx( hBstr, IND_YNRM, difidx[i], NORMI_BITS ); + push_indice( hBstr, IND_YNRM, difidx[i], NORMI_BITS ); } } } diff --git a/lib_enc/hq_hr_enc_fx.c b/lib_enc/hq_hr_enc_fx.c index 1cd516b43..705db9ecd 100644 --- a/lib_enc/hq_hr_enc_fx.c +++ b/lib_enc/hq_hr_enc_fx.c @@ -236,12 +236,12 @@ void hq_hr_enc_fx( IF( EQ_16( hqswb_clas, HQ_GEN_SWB ) || EQ_16( hqswb_clas, HQ_GEN_FB ) ) { nf_idx = noise_adjust_fx( t_audio_norm, 12, R, sfm_start, sfm_end, s_max( core_sfm, sub( num_env_bands, 1 ) ) ); /* Q0 */ - push_indice_fx( st_fx->hBstr, IND_NF_IDX, nf_idx, 2 ); + push_indice( st_fx->hBstr, IND_NF_IDX, nf_idx, 2 ); } ELSE { nf_idx = noise_adjust_fx( t_audio_norm, 12, R, sfm_start, sfm_end, core_sfm ); /* Q0 */ - push_indice_fx( st_fx->hBstr, IND_NF_IDX, nf_idx, 2 ); + push_indice( st_fx->hBstr, IND_NF_IDX, nf_idx, 2 ); } } /* updates */ diff --git a/lib_enc/hq_lr_enc_fx.c b/lib_enc/hq_lr_enc_fx.c index 9aca0f646..af2780682 100644 --- a/lib_enc/hq_lr_enc_fx.c +++ b/lib_enc/hq_lr_enc_fx.c @@ -115,7 +115,7 @@ static void spt_shorten_domain_set_fx( move16(); } } - push_indice_fx( st_fx->hBstr, IND_HQ2_SPT_SHORTEN, spt_shorten_flag[j], 1 ); + push_indice( st_fx->hBstr, IND_HQ2_SPT_SHORTEN, spt_shorten_flag[j], 1 ); *bit_budget = sub( *bit_budget, 1 ); /* Q0 */ move16(); } @@ -313,7 +313,7 @@ void hq_lr_enc_fx( } /* write the classification information into the bitstream */ - push_indice_fx( hBstr, IND_HQ2_SWB_CLAS, hqswb_clas_fx, 2 ); + push_indice( hBstr, IND_HQ2_SWB_CLAS, hqswb_clas_fx, 2 ); ( *num_bits_fx ) = sub( *num_bits_fx, 2 ); move16(); IF( EQ_16( hqswb_clas_fx, HQ_NORMAL ) ) @@ -325,7 +325,7 @@ void hq_lr_enc_fx( ELSE { /* write the transient bit into the bitstream */ - push_indice_fx( st_fx->hBstr, IND_HQ2_SWB_CLAS, is_transient_fx, 1 ); + push_indice( st_fx->hBstr, IND_HQ2_SWB_CLAS, is_transient_fx, 1 ); /* subtract one bit for the transient flag */ ( *num_bits_fx ) = sub( ( *num_bits_fx ), 1 ); @@ -741,7 +741,7 @@ void hq_lr_enc_fx( /* encode the last p2a_bands-1 subbands bit-allocation index of the previous frame */ FOR( i = 0; i < 2; i++ ) { - push_indice_fx( st_fx->hBstr, IND_HQ2_LAST_BA_MAX_BAND, hHQ_core->last_bitalloc_max_band[i], 1 ); + push_indice( st_fx->hBstr, IND_HQ2_LAST_BA_MAX_BAND, hHQ_core->last_bitalloc_max_band[i], 1 ); } } ELSE IF( is_transient_fx == 0 && EQ_16( inner_frame_fx, L_FRAME16k ) ) @@ -970,7 +970,7 @@ void hq_lr_enc_fx( /* encode the last p2a_bands-1 subbands bit-allocation index of the previous frame */ FOR( i = 0; i < 2; i++ ) { - push_indice_fx( st_fx->hBstr, IND_HQ2_LAST_BA_MAX_BAND, hHQ_core->last_bitalloc_max_band[i], 1 ); + push_indice( st_fx->hBstr, IND_HQ2_LAST_BA_MAX_BAND, hHQ_core->last_bitalloc_max_band[i], 1 ); } } ELSE IF( EQ_16( st_fx->bwidth, SWB ) && EQ_16( hqswb_clas_fx, HQ_HARMONIC ) && ( EQ_32( L_bwe_br, HQ_16k40 ) || EQ_32( L_bwe_br, HQ_13k20 ) ) ) @@ -2213,7 +2213,7 @@ static Word16 small_symbol_enc_fx( /* o : bits /* Encoding LSB bit packing */ FOR( i = 0; i < BANDS; ++i ) { - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, LSB[i], BITS_DE_LSB ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, LSB[i], BITS_DE_LSB ); } } @@ -2526,74 +2526,74 @@ static Word16 large_symbol_enc_fx( /* o : bits /* Encoding MSB bits */ IF( *hLCmode0 == 0 ) { - push_indice_fx( hBstr, IND_HQ2_DENG_8SMODE, 0, BITS_DE_8SMODE ); + push_indice( hBstr, IND_HQ2_DENG_8SMODE, 0, BITS_DE_8SMODE ); bits = BITS_DE_8SMODE; move16(); IF( cnt_outlyer0 == 0 ) { - push_indice_fx( hBstr, IND_HQ2_DENG_8SMODE_N0, 0, BITS_DE_8SMODE_N0 ); + push_indice( hBstr, IND_HQ2_DENG_8SMODE_N0, 0, BITS_DE_8SMODE_N0 ); bits = add( bits, BITS_DE_8SMODE_N0 ); IF( EQ_16( cnt_outlyer, 1 ) ) { /* 01 */ - push_indice_fx( hBstr, IND_HQ2_DENG_8SMODE_N1, 1, BITS_DE_8SMODE_N1 ); + push_indice( hBstr, IND_HQ2_DENG_8SMODE_N1, 1, BITS_DE_8SMODE_N1 ); bits = add( bits, BITS_DE_8SMODE_N1 ); /* Q0 */ - push_indice_fx( hBstr, IND_HQ2_DENG_8SPOS, pos_outlyer, BITS_DE_8SPOS ); + push_indice( hBstr, IND_HQ2_DENG_8SPOS, pos_outlyer, BITS_DE_8SPOS ); bits = add( bits, BITS_DE_8SPOS ); - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, qbidx[pos_outlyer] + ABS_ENG_OFFSET, BITS_ABS_ENG ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, qbidx[pos_outlyer] + ABS_ENG_OFFSET, BITS_ABS_ENG ); bits = add( bits, BITS_ABS_ENG ); } ELSE { /* 00 */ - push_indice_fx( hBstr, IND_HQ2_DENG_8SMODE_N1, 0, BITS_DE_8SMODE_N1 ); + push_indice( hBstr, IND_HQ2_DENG_8SMODE_N1, 0, BITS_DE_8SMODE_N1 ); bits = add( bits, BITS_DE_8SMODE_N1 ); /* Q0 */ } FOR( i = 0; i < pos_outlyer; ++i ) { - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, hescode[tdifidx0[i] + 4], hessize[tdifidx0[i] + 4] ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, hescode[tdifidx0[i] + 4], hessize[tdifidx0[i] + 4] ); bitsmode0 = add( bitsmode0, hessize[tdifidx0[i] + 4] ); /* Q0 */ } FOR( i = ( pos_outlyer + 1 ); i < BANDS; ++i ) { - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, hescode[tdifidx0[i] + 4], hessize[tdifidx0[i] + 4] ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, hescode[tdifidx0[i] + 4], hessize[tdifidx0[i] + 4] ); bitsmode0 = add( bitsmode0, hessize[tdifidx0[i] + 4] ); /* Q0 */ } } ELSE IF( EQ_16( cnt_outlyer0, 1 ) ) { - push_indice_fx( hBstr, IND_HQ2_DENG_8SMODE_N0, 1, BITS_DE_8SMODE_N0 ); + push_indice( hBstr, IND_HQ2_DENG_8SMODE_N0, 1, BITS_DE_8SMODE_N0 ); bits = add( bits, BITS_DE_8SMODE_N0 ); IF( EQ_16( cnt_outlyer, 1 ) ) { - push_indice_fx( hBstr, IND_HQ2_DENG_8SMODE_N1, 1, BITS_DE_8SMODE_N1 ); + push_indice( hBstr, IND_HQ2_DENG_8SMODE_N1, 1, BITS_DE_8SMODE_N1 ); bits = add( bits, BITS_DE_8SMODE_N1 ); /* Q0 */ - push_indice_fx( hBstr, IND_HQ2_DENG_8SPOS, pos_outlyer, BITS_DE_8SPOS ); + push_indice( hBstr, IND_HQ2_DENG_8SPOS, pos_outlyer, BITS_DE_8SPOS ); bits = add( bits, BITS_DE_8SPOS ); - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, qbidx[0] + ABS_ENG_OFFSET, BITS_ABS_ENG ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, qbidx[0] + ABS_ENG_OFFSET, BITS_ABS_ENG ); bits = add( bits, BITS_ABS_ENG ); - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, qbidx[pos_outlyer] + ABS_ENG_OFFSET, BITS_ABS_ENG ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, qbidx[pos_outlyer] + ABS_ENG_OFFSET, BITS_ABS_ENG ); bits = add( bits, BITS_ABS_ENG ); } ELSE { - push_indice_fx( hBstr, IND_HQ2_DENG_8SMODE_N1, 0, BITS_DE_8SMODE_N1 ); + push_indice( hBstr, IND_HQ2_DENG_8SMODE_N1, 0, BITS_DE_8SMODE_N1 ); bits = add( bits, BITS_DE_8SMODE_N1 ); /* Q0 */ - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, qbidx[0] + ABS_ENG_OFFSET, BITS_ABS_ENG ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, qbidx[0] + ABS_ENG_OFFSET, BITS_ABS_ENG ); bits = add( bits, BITS_ABS_ENG ); /* Q0 */ } FOR( i = 1; i < pos_outlyer; ++i ) { - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, hescode[tdifidx0[i] + 4], hessize[tdifidx0[i] + 4] ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, hescode[tdifidx0[i] + 4], hessize[tdifidx0[i] + 4] ); bits = add( bits, hessize[tdifidx0[i] + 4] ); /* Q0 */ } FOR( i = pos_outlyer + 1; i < BANDS; ++i ) { - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, hescode[tdifidx0[i] + 4], hessize[tdifidx0[i] + 4] ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, hescode[tdifidx0[i] + 4], hessize[tdifidx0[i] + 4] ); bits = add( bits, hessize[tdifidx0[i] + 4] ); /* Q0 */ } } @@ -2601,12 +2601,12 @@ static Word16 large_symbol_enc_fx( /* o : bits ELSE { bits = add( BITS_DE_8SMODE, BITS_MAX_DEPTH ); /* Q0 */ - push_indice_fx( hBstr, IND_HQ2_DENG_8SMODE, 1, BITS_DE_8SMODE ); - push_indice_fx( hBstr, IND_HQ2_DENG_8SDEPTH, lsbdepth1, BITS_MAX_DEPTH ); + push_indice( hBstr, IND_HQ2_DENG_8SMODE, 1, BITS_DE_8SMODE ); + push_indice( hBstr, IND_HQ2_DENG_8SDEPTH, lsbdepth1, BITS_MAX_DEPTH ); FOR( i = 0; i < BANDS; ++i ) { - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, hescode[tdifidx1[i] + 4], hessize[tdifidx1[i] + 4] ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, hescode[tdifidx1[i] + 4], hessize[tdifidx1[i] + 4] ); bits = add( bits, hessize[tdifidx1[i] + 4] ); /* Q0 */ } @@ -2614,7 +2614,7 @@ static Word16 large_symbol_enc_fx( /* o : bits { FOR( i = 0; i < BANDS; ++i ) { - push_indice_fx( hBstr, IND_HQ2_DIFF_ENERGY, LSB1[i], lsbdepth1 ); + push_indice( hBstr, IND_HQ2_DIFF_ENERGY, LSB1[i], lsbdepth1 ); } /*bits += BANDS * lsbdepth1; */ bits = add( bits, extract_h( L_shl( L_mult( BANDS, lsbdepth1 ), 15 ) ) ); /* Q0 */ @@ -3115,7 +3115,7 @@ static Word16 band_energy_quant_fx( { deng_cmode = 0; move16(); - push_indice_fx( hBstr, IND_HQ2_DENG_MODE, deng_cmode, BITS_DE_CMODE ); + push_indice( hBstr, IND_HQ2_DENG_MODE, deng_cmode, BITS_DE_CMODE ); large_symbol_enc_fx( hBstr, bq2_fx, bands_fx, &hLCmode0, 1 ); deng_bits = add( ebits, BITS_DE_CMODE ); /* Q0 */ } @@ -3124,7 +3124,7 @@ static Word16 band_energy_quant_fx( /* setting energy difference coding mode and storing it */ deng_cmode = 1; move16(); - push_indice_fx( hBstr, IND_HQ2_DENG_MODE, deng_cmode, BITS_DE_CMODE ); + push_indice( hBstr, IND_HQ2_DENG_MODE, deng_cmode, BITS_DE_CMODE ); deng_bits = add( hbits, BITS_DE_CMODE ); /* Q0 */ @@ -3479,7 +3479,7 @@ static Word16 p2a_threshold_quant_fx( move16(); } - push_indice_fx( hBstr, IND_HQ2_P2A_FLAGS, p2a_flags_fx[k], 1 ); + push_indice( hBstr, IND_HQ2_P2A_FLAGS, p2a_flags_fx[k], 1 ); j = add( j, 1 ); } @@ -3768,7 +3768,7 @@ static void mdct_spectrum_fine_gain_enc_fx( move16(); } - push_indice_fx( st_fx->hBstr, IND_HQ2_SUBBAND_GAIN, imin_fx, gqbits ); + push_indice( st_fx->hBstr, IND_HQ2_SUBBAND_GAIN, imin_fx, gqbits ); } return; diff --git a/lib_enc/hvq_enc_fx.c b/lib_enc/hvq_enc_fx.c index b06a1734d..a0acd0bfd 100644 --- a/lib_enc/hvq_enc_fx.c +++ b/lib_enc/hvq_enc_fx.c @@ -335,7 +335,7 @@ Word16 hvq_enc_fx( /*o : Consumed bits q_noise_level[i] = 0; move16(); } - push_indice_fx( st_fx->hBstr, IND_HVQ_BWE_NL, q_noise_level_idx[i], 2 ); + push_indice( st_fx->hBstr, IND_HVQ_BWE_NL, q_noise_level_idx[i], 2 ); bits_used = add( bits_used, 2 ); noise_level[i] = q_noise_level[i]; /* in Q15 */ diff --git a/lib_enc/isf_enc_amr_wb_fx.c b/lib_enc/isf_enc_amr_wb_fx.c index 4851ed155..d58998565 100644 --- a/lib_enc/isf_enc_amr_wb_fx.c +++ b/lib_enc/isf_enc_amr_wb_fx.c @@ -173,11 +173,11 @@ static void qisf_ns_28b_fx( indice[4] = add( sub_VQ_fx( &isf[12], dico5_ns_28b_fx + 4, 4, DICO5_NS_28b - 1, &tmp ), 1 ); /* First vector has a problem -> do not allow */ move16(); /* write indices to array */ - push_indice_fx( hBstr, IND_ISF_0_0, indice[0], 6 ); - push_indice_fx( hBstr, IND_ISF_0_1, indice[1], 6 ); - push_indice_fx( hBstr, IND_ISF_0_2, indice[2], 6 ); - push_indice_fx( hBstr, IND_ISF_0_3, indice[3], 5 ); - push_indice_fx( hBstr, IND_ISF_0_4, indice[4], 5 ); + push_indice( hBstr, IND_ISF_0_0, indice[0], 6 ); + push_indice( hBstr, IND_ISF_0_1, indice[1], 6 ); + push_indice( hBstr, IND_ISF_0_2, indice[2], 6 ); + push_indice( hBstr, IND_ISF_0_3, indice[3], 5 ); + push_indice( hBstr, IND_ISF_0_4, indice[4], 5 ); /* decoding the ISFs */ disf_ns_28b_fx( indice, isf ); @@ -305,11 +305,11 @@ static void qisf_2s_36b_fx( indice[0] = Indirect_dico1[indice[0]]; move16(); /* Make interoperable with G722.2 */ - push_indice_fx( hBstr, IND_ISF_0_0, indice[0], 8 ); - push_indice_fx( hBstr, IND_ISF_0_1, indice[1], 8 ); - push_indice_fx( hBstr, IND_ISF_1_0, indice[2], 7 ); - push_indice_fx( hBstr, IND_ISF_1_1, indice[3], 7 ); - push_indice_fx( hBstr, IND_ISF_1_2, indice[4], 6 ); + push_indice( hBstr, IND_ISF_0_0, indice[0], 8 ); + push_indice( hBstr, IND_ISF_0_1, indice[1], 8 ); + push_indice( hBstr, IND_ISF_1_0, indice[2], 7 ); + push_indice( hBstr, IND_ISF_1_1, indice[3], 7 ); + push_indice( hBstr, IND_ISF_1_2, indice[4], 6 ); return; } @@ -442,13 +442,13 @@ static void qisf_2s_46b_fx( indice[0] = Indirect_dico1[indice[0]]; move16(); /* Make interoperable with G722.2 */ - push_indice_fx( hBstr, IND_ISF_0_0, indice[0], 8 ); - push_indice_fx( hBstr, IND_ISF_0_1, indice[1], 8 ); - push_indice_fx( hBstr, IND_ISF_1_0, indice[2], 6 ); - push_indice_fx( hBstr, IND_ISF_1_1, indice[3], 7 ); - push_indice_fx( hBstr, IND_ISF_1_2, indice[4], 7 ); - push_indice_fx( hBstr, IND_ISF_1_3, indice[5], 5 ); - push_indice_fx( hBstr, IND_ISF_1_4, indice[6], 5 ); + push_indice( hBstr, IND_ISF_0_0, indice[0], 8 ); + push_indice( hBstr, IND_ISF_0_1, indice[1], 8 ); + push_indice( hBstr, IND_ISF_1_0, indice[2], 6 ); + push_indice( hBstr, IND_ISF_1_1, indice[3], 7 ); + push_indice( hBstr, IND_ISF_1_2, indice[4], 7 ); + push_indice( hBstr, IND_ISF_1_3, indice[5], 5 ); + push_indice( hBstr, IND_ISF_1_4, indice[6], 5 ); return; } diff --git a/lib_enc/lsf_enc_fx.c b/lib_enc/lsf_enc_fx.c index e6d08c49d..8fe425d74 100644 --- a/lib_enc/lsf_enc_fx.c +++ b/lib_enc/lsf_enc_fx.c @@ -647,11 +647,11 @@ static void lsfq_CNG_fx( Vr_add( qlsf, &CNG_SN1_fx[idx_cv * M], qlsf, M ); /* write the VQ index to the bitstream */ - push_indice_fx( hBstr, IND_ISF_0_0, idx_cv, 4 ); + push_indice( hBstr, IND_ISF_0_0, idx_cv, 4 ); /* write the LVQ index to the bitstream */ - push_indice_fx( hBstr, IND_ISF_0_1, idx_lvq[0], LEN_INDICE ); - push_indice_fx( hBstr, IND_ISF_0_1, idx_lvq[1], LSF_BITS_CNG - 4 - LEN_INDICE ); + push_indice( hBstr, IND_ISF_0_1, idx_lvq[0], LEN_INDICE ); + push_indice( hBstr, IND_ISF_0_1, idx_lvq[1], LSF_BITS_CNG - 4 - LEN_INDICE ); return; } @@ -1117,13 +1117,13 @@ void lsf_end_enc_fx( IF( EQ_16( coder_type_org, GENERIC ) && EQ_32( st->sr_core, INT_FS_16k ) ) { /* VOICED =2 and GENERIC=3, so "coder_type-2" means VOICED =0 and GENERIC=1*/ - push_indice_fx( hBstr, IND_LSF_PREDICTOR_SELECT_BIT, sub( coder_type, 2 ), 1 ); + push_indice( hBstr, IND_LSF_PREDICTOR_SELECT_BIT, sub( coder_type, 2 ), 1 ); } /* write predictor selection bit */ IF( EQ_16( predmode, 2 ) ) { - push_indice_fx( st->hBstr, IND_LSF_PREDICTOR_SELECT_BIT, safety_net, 1 ); + push_indice( st->hBstr, IND_LSF_PREDICTOR_SELECT_BIT, safety_net, 1 ); } test(); @@ -1134,7 +1134,7 @@ void lsf_end_enc_fx( Bit_alloc1 = &BC_TCVQ_BIT_ALLOC_40B[1]; FOR( i = 0; i < ( M / 2 ) + 3; i++ ) { - push_indice_fx( hBstr, IND_LSF, TCQIdx[i], Bit_alloc1[i] ); + push_indice( hBstr, IND_LSF, TCQIdx[i], Bit_alloc1[i] ); } } ELSE @@ -1175,7 +1175,7 @@ void lsf_end_enc_fx( move16(); cumleft -= num_bits; move16(); - push_indice_fx( hBstr, IND_LSF, indice[i], num_bits ); + push_indice( hBstr, IND_LSF, indice[i], num_bits ); } WHILE( cumleft > 0 ) @@ -1195,7 +1195,7 @@ void lsf_end_enc_fx( } cumleft = sub( cumleft, num_bits ); - push_indice_fx( hBstr, IND_LSF, indice[i], num_bits ); + push_indice( hBstr, IND_LSF, indice[i], num_bits ); i = add( i, 1 ); } } @@ -3636,7 +3636,7 @@ static void lsf_mid_enc_fx( /* convert LSFs back to LSPs */ lsf2lsp_fx( qlsf, lsp, M, int_fs ); - push_indice_fx( hBstr, IND_MID_FRAME_LSF_INDEX, idx, nb_bits ); + push_indice( hBstr, IND_MID_FRAME_LSF_INDEX, idx, nb_bits ); return; } diff --git a/lib_enc/nelp_enc_fx.c b/lib_enc/nelp_enc_fx.c index a7588283a..391191175 100644 --- a/lib_enc/nelp_enc_fx.c +++ b/lib_enc/nelp_enc_fx.c @@ -698,9 +698,9 @@ void nelp_encoder_fx( } ELSE { - push_indice_fx( hBstr, IND_IG1, iG1_fx, 5 ); - push_indice_fx( hBstr, IND_IG2A, iG2_fx[0], 6 ); - push_indice_fx( hBstr, IND_IG2B, iG2_fx[1], 6 ); + push_indice( hBstr, IND_IG1, iG1_fx, 5 ); + push_indice( hBstr, IND_IG2A, iG2_fx[0], 6 ); + push_indice( hBstr, IND_IG2B, iG2_fx[1], 6 ); } test(); @@ -1019,7 +1019,7 @@ void nelp_encoder_fx( } ELSE { - push_indice_fx( hBstr, IND_NELP_FID, fid, 2 ); + push_indice( hBstr, IND_NELP_FID, fid, 2 ); } } diff --git a/lib_enc/peak_vq_enc_fx.c b/lib_enc/peak_vq_enc_fx.c index aa4763aa6..dffab4900 100644 --- a/lib_enc/peak_vq_enc_fx.c +++ b/lib_enc/peak_vq_enc_fx.c @@ -559,13 +559,13 @@ Word16 peak_vq_enc_fx( move32(); nf_gains[i] = L_shr( acc, 1 + 2 ); /* nf_gains in Q12. dicn_fx is in Q14. Need extra shift +2. */ move32(); - push_indice_fx( hBstr, IND_HVQ_NF_GAIN, indx, 5 ); + push_indice( hBstr, IND_HVQ_NF_GAIN, indx, 5 ); bits = add( bits, 5 ); } /* Signal number of peaks */ i = sub( max_peaks, vq_peaks ); - push_indice_fx( hBstr, IND_NUM_PEAKS, i, 5 ); + push_indice( hBstr, IND_NUM_PEAKS, i, 5 ); bits = add( bits, 5 ); /* Identify position of first peak and arrange peak gains by position */ @@ -677,8 +677,8 @@ Word16 peak_vq_enc_fx( move16(); } - push_indice_fx( hBstr, IND_FLAGN, FlagN, 1 ); - push_indice_fx( hBstr, IND_PG_IDX, pgain_difidx[0], GAIN0_BITS ); + push_indice( hBstr, IND_FLAGN, FlagN, 1 ); + push_indice( hBstr, IND_PG_IDX, pgain_difidx[0], GAIN0_BITS ); IF( FlagN ) { @@ -692,7 +692,7 @@ Word16 peak_vq_enc_fx( r = pgain_huffsizn[j]; move16(); - push_indice_fx( hBstr, IND_PG_IDX, m, r ); + push_indice( hBstr, IND_PG_IDX, m, r ); } } ELSE @@ -700,7 +700,7 @@ Word16 peak_vq_enc_fx( pPgainDifIdx = &pgain_difidx[1]; FOR( i = 0; i < vqPeaksMinus1; i++ ) { - push_indice_fx( hBstr, IND_PG_IDX, ( *pPgainDifIdx++ ), GAINI_BITS ); + push_indice( hBstr, IND_PG_IDX, ( *pPgainDifIdx++ ), GAINI_BITS ); } } @@ -727,13 +727,13 @@ Word16 peak_vq_enc_fx( num_overlap_bins = sub( 5, sub( vq_peak_idx[i + 1], vq_peak_idx[i] ) ); indx = sub( vq_peak_idx[i], 2 ); quant_peaks_fx( hBstr, &coefs[indx], &coefs_out[indx], &peak_gains[i], &vq_cb_idx, num_overlap_bins, core_brate, vq_peaks ); - push_indice_fx( hBstr, IND_HVQ_PEAKS, vq_cb_idx, 8 ); + push_indice( hBstr, IND_HVQ_PEAKS, vq_cb_idx, 8 ); bits = add( bits, 9 ); } indx = sub( vq_peak_idx[i], 2 ); quant_peaks_fx( hBstr, &coefs[indx], &coefs_out[indx], &peak_gains[i], &vq_cb_idx, 0, core_brate, vq_peaks ); - push_indice_fx( hBstr, IND_HVQ_PEAKS, vq_cb_idx, 8 ); + push_indice( hBstr, IND_HVQ_PEAKS, vq_cb_idx, 8 ); bits = add( bits, 9 ); /* Quantize peak positions and sign with HVQ */ @@ -826,7 +826,7 @@ Word16 peak_vq_enc_fx( move16(); } - push_indice_fx( hBstr, IND_HVQ_PVQ_GAIN, pvq_norm[k], HVQ_PVQ_GAIN_BITS ); + push_indice( hBstr, IND_HVQ_PVQ_GAIN, pvq_norm[k], HVQ_PVQ_GAIN_BITS ); pvq_bits = add( pvq_bits, HVQ_PVQ_GAIN_BITS ); pvq_norm[k] = add( pvq_norm[k], 8 ); @@ -1148,7 +1148,7 @@ static void quant_peaks_fx( { *vq_idx = w_vquant_fx( x, Qx, weights, xq, hvq_peak_cb_fx, cbSize, 0 ); move16(); - push_indice_fx( hBstr, IND_HVQ_PEAKS, 0, 1 ); + push_indice( hBstr, IND_HVQ_PEAKS, 0, 1 ); } ELSE IF( EQ_16( cb_class, 1 ) ) { @@ -1157,7 +1157,7 @@ static void quant_peaks_fx( move16(); *vq_idx = add( *vq_idx, sub( HVQ_CB_SIZE / 2, search_overlap ) ); move16(); - push_indice_fx( hBstr, IND_HVQ_PEAKS, 0, 1 ); + push_indice( hBstr, IND_HVQ_PEAKS, 0, 1 ); } ELSE IF( EQ_16( cb_class, 2 ) ) { @@ -1166,13 +1166,13 @@ static void quant_peaks_fx( move16(); *vq_idx = add( *vq_idx, sub( HVQ_CB_SIZE / 2, search_overlap ) ); move16(); - push_indice_fx( hBstr, IND_HVQ_PEAKS, 1, 1 ); + push_indice( hBstr, IND_HVQ_PEAKS, 1, 1 ); } ELSE { *vq_idx = w_vquant_fx( x, Qx, weights, xq, hvq_peak_cb_fx, cbSize, 1 ); move16(); - push_indice_fx( hBstr, IND_HVQ_PEAKS, 1, 1 ); + push_indice( hBstr, IND_HVQ_PEAKS, 1, 1 ); } FOR( i = 0; i < 4; i++ ) @@ -1458,23 +1458,23 @@ static Word16 hvq_code_pos_fx( test(); IF( GT_16( delta_bits, sparse_bits ) || delta_bits < 0 ) { - push_indice_fx( hBstr, IND_POS_IDX, HVQ_CP_SPARSE, 1 ); + push_indice( hBstr, IND_POS_IDX, HVQ_CP_SPARSE, 1 ); FOR( i = 0; i < sparse_bits; i++ ) { - push_indice_fx( hBstr, IND_POS_IDX, sparse_result[i], 1 ); + push_indice( hBstr, IND_POS_IDX, sparse_result[i], 1 ); } bits = add( add( bits, sparse_bits ), 1 ); } ELSE { - push_indice_fx( hBstr, IND_POS_IDX, HVQ_CP_DELTA, 1 ); + push_indice( hBstr, IND_POS_IDX, HVQ_CP_DELTA, 1 ); FOR( i = 0; i < num_peaks; i++ ) { j = delta[i]; move16(); - push_indice_fx( hBstr, IND_POS_IDX, hvq_cp_huff_val[j], hvq_cp_huff_len[j] ); + push_indice( hBstr, IND_POS_IDX, hvq_cp_huff_val[j], hvq_cp_huff_len[j] ); } bits = add( add( bits, delta_bits ), 1 ); } @@ -1489,7 +1489,7 @@ static Word16 hvq_code_pos_fx( tmp = 0; move16(); } - push_indice_fx( hBstr, IND_POS_IDX, tmp, 1 ); + push_indice( hBstr, IND_POS_IDX, tmp, 1 ); } bits = add( bits, num_peaks ); diff --git a/lib_enc/pit_enc_fx.c b/lib_enc/pit_enc_fx.c index b19fb7e56..8eea1b3d5 100644 --- a/lib_enc/pit_enc_fx.c +++ b/lib_enc/pit_enc_fx.c @@ -1787,7 +1787,7 @@ void pit_Q_enc_fx( } { - push_indice_fx( hBstr, IND_PITCH, pitch_index, nBits ); + push_indice( hBstr, IND_PITCH, pitch_index, nBits ); } return; @@ -1919,7 +1919,7 @@ void pit16k_Q_enc_fx( } } - push_indice_fx( hBstr, IND_PITCH, pitch_index, nBits ); + push_indice( hBstr, IND_PITCH, pitch_index, nBits ); } ELSE IF( EQ_16( nBits, 9 ) ) /* absolute encoding with 9 bits */ { @@ -1949,14 +1949,14 @@ void pit16k_Q_enc_fx( } } - push_indice_fx( hBstr, IND_PITCH, pitch_index, 9 ); + push_indice( hBstr, IND_PITCH, pitch_index, 9 ); } ELSE /* nBits == 6 */ /* relative encoding with 6 bits */ { /*pitch_index = (T0 - *T0_min) * 4 + T0_frac;*/ pitch_index = add( shl( sub( T0, *T0_min ), 2 ), T0_frac ); - push_indice_fx( hBstr, IND_PITCH, pitch_index, nBits ); + push_indice( hBstr, IND_PITCH, pitch_index, nBits ); } limit_T0_fx( L_FRAME16k, 8, L_SUBFR, limit_flag, T0, T0_frac, T0_min, T0_max ); diff --git a/lib_enc/ppp_enc_fx.c b/lib_enc/ppp_enc_fx.c index 9afb27065..ac3d5836a 100644 --- a/lib_enc/ppp_enc_fx.c +++ b/lib_enc/ppp_enc_fx.c @@ -171,9 +171,9 @@ ivas_error ppp_quarter_encoder_fx( CURRCW_Q_FX->upper_cut_off_freq_of_interest_fx = (Word16) find_remd( Ltempn, 20971, &Ltempd ); move16(); - push_indice_fx( hBstr, IND_AMP0, AMP_IDX_fx[0], 6 ); - push_indice_fx( hBstr, IND_AMP1, AMP_IDX_fx[1], 6 ); - push_indice_fx( hBstr, IND_POWER, POWER_IDX_FX, 6 ); + push_indice( hBstr, IND_AMP0, AMP_IDX_fx[0], 6 ); + push_indice( hBstr, IND_AMP1, AMP_IDX_fx[1], 6 ); + push_indice( hBstr, IND_POWER, POWER_IDX_FX, 6 ); /*Phase copying is done through copy_phase instead of car2pol and pol2car */ copy_phase_fx( TARGETCW_FX, *CURRCW_Q_FX, TARGETCW_FX ); @@ -199,7 +199,7 @@ ivas_error ppp_quarter_encoder_fx( /*DTFS_phaseShift( CURRCW_Q,(float)(PI2*tmp/CURRCW_Q->lag) ); */ Q2phaseShift_fx( CURRCW_Q_FX, tmp_fx, CURRCW_Q_FX->lag_fx, S_fx, C_fx ); - push_indice_fx( hBstr, IND_GLOBAL_ALIGNMENT, shr( add( tmp_fx, 12 ), 2 ), 3 ); + push_indice( hBstr, IND_GLOBAL_ALIGNMENT, shr( add( tmp_fx, 12 ), 2 ), 3 ); free( PREVDTFS_FX ); return error; diff --git a/lib_enc/range_enc_fx.c b/lib_enc/range_enc_fx.c index 689b313d8..767b2ecb5 100644 --- a/lib_enc/range_enc_fx.c +++ b/lib_enc/range_enc_fx.c @@ -423,14 +423,14 @@ void rc_enc_bits_fx( IF( GT_16( bits, 16 ) ) { - push_indice_fx( hBstr, sub( IND_RC_END, hPVQ->rc_offset ), u_extract_l( UL_lshr( value, 16 ) ), sub( bits, 16 ) ); + push_indice( hBstr, sub( IND_RC_END, hPVQ->rc_offset ), u_extract_l( UL_lshr( value, 16 ) ), sub( bits, 16 ) ); hPVQ->rc_offset = add( hPVQ->rc_offset, 1 ); // Q0 - push_indice_fx( hBstr, sub( IND_RC_END, hPVQ->rc_offset ), u_extract_l( UL_and( value, 0x0000ffff ) ), 16 ); + push_indice( hBstr, sub( IND_RC_END, hPVQ->rc_offset ), u_extract_l( UL_and( value, 0x0000ffff ) ), 16 ); hPVQ->rc_offset = add( hPVQ->rc_offset, 1 ); // Q0 } ELSE { - push_indice_fx( hBstr, sub( IND_RC_END, hPVQ->rc_offset ), u_extract_l( value ), bits ); + push_indice( hBstr, sub( IND_RC_END, hPVQ->rc_offset ), u_extract_l( value ), bits ); hPVQ->rc_offset = add( hPVQ->rc_offset, 1 ); // Q0 } } @@ -516,7 +516,7 @@ static void rc_enc_write_fx( Word16 bits /* i : Number of bits Q0*/ ) { - push_indice_fx( hBstr, IND_RC_START, byte, bits ); + push_indice( hBstr, IND_RC_START, byte, bits ); return; } diff --git a/lib_enc/stat_noise_uv_enc_fx.c b/lib_enc/stat_noise_uv_enc_fx.c index 0a20db8ed..1445559a1 100644 --- a/lib_enc/stat_noise_uv_enc_fx.c +++ b/lib_enc/stat_noise_uv_enc_fx.c @@ -94,7 +94,7 @@ void stat_noise_uv_enc_fx( noisiness = s_max( noisiness, 0 ); noisiness = s_min( noisiness, 31 ); - push_indice_fx( st_fx->hBstr, IND_NOISINESS, noisiness, 5 ); + push_indice( st_fx->hBstr, IND_NOISINESS, noisiness, 5 ); } /*-----------------------------------------------------------------* diff --git a/lib_enc/swb_bwe_enc_fx.c b/lib_enc/swb_bwe_enc_fx.c index 26c8382ca..1ebef7404 100644 --- a/lib_enc/swb_bwe_enc_fx.c +++ b/lib_enc/swb_bwe_enc_fx.c @@ -186,7 +186,7 @@ void wb_bwe_enc_fx( Q_synth = sub( add( sub( new_input_fx_exp, 16 ), scl ), 1 ); mode = WB_BWE_encoding_fx( coder_type, yorig_fx, WB_fenv_fx, st_fx, Q_synth, Q_synth ); - push_indice_fx( st_fx->hBstr, IND_WB_CLASS, sub( mode, 2 ), 1 ); + push_indice( st_fx->hBstr, IND_WB_CLASS, sub( mode, 2 ), 1 ); } hBWE_FD->prev_mode = mode; @@ -820,7 +820,7 @@ void swb_bwe_enc_fx( /* write FB BWE frame gain to the bitstream */ IF( EQ_16( st_fx->extl, FB_BWE ) ) { - push_indice_fx( st_fx->hBstr, IND_FB_SLOPE, idxGain, NUM_BITS_FB_FRAMEGAIN ); + push_indice( st_fx->hBstr, IND_FB_SLOPE, idxGain, NUM_BITS_FB_FRAMEGAIN ); } return; @@ -2476,7 +2476,7 @@ Word16 WB_BWE_encoding_fx( /* o : classification of wb index = WB_BWE_fenv_q_fx( WB_fenv_fx, F_2_5_fx, 32, 2 ); - push_indice_fx( st_fx->hBstr, IND_WB_FENV, index, 5 ); + push_indice( st_fx->hBstr, IND_WB_FENV, index, 5 ); return ( mode ); } @@ -2665,7 +2665,7 @@ static Word16 SWB_BWE_encoding_fx( { mode = IsTransient; move16(); - push_indice_fx( hBstr, IND_SWB_CLASS, mode, 2 ); + push_indice( hBstr, IND_SWB_CLASS, mode, 2 ); /* Energy for the different bands and global energies */ global_gain_fx = L_deposit_l( 0 ); @@ -2924,13 +2924,13 @@ static Word16 SWB_BWE_encoding_fx( index = shr( add( SWB_tenv_tmp_fx[n_band], 1024 ), 11 ); } - push_indice_fx( hBstr, IND_SWB_TENV, index, 4 ); + push_indice( hBstr, IND_SWB_TENV, index, 4 ); } MSVQ_Interpol_Tran_fx( SWB_fenv_fx, indice ); - push_indice_fx( hBstr, IND_SWB_FENV, indice[0], 7 ); - push_indice_fx( hBstr, IND_SWB_FENV, indice[1], 6 ); + push_indice( hBstr, IND_SWB_FENV, indice[0], 7 ); + push_indice( hBstr, IND_SWB_FENV, indice[1], 6 ); } ELSE { @@ -2955,7 +2955,7 @@ static Word16 SWB_BWE_encoding_fx( global_gain_fx = L_shr( global_gain_fx, 1 ); /*2*Q_shb */ mode = FD_BWE_class_fx( yos_fx, global_gain_fx, tilt_nb_fx, Q_synth, Q_shb, st_fx ); - push_indice_fx( hBstr, IND_SWB_CLASS, mode, 2 ); + push_indice( hBstr, IND_SWB_CLASS, mode, 2 ); energy_control_fx( st_fx, ACELP_CORE, mode, -1, yos_fx, st_offset, energy_factor_fx, Q_synth_lf ); @@ -2990,11 +2990,11 @@ static Word16 SWB_BWE_encoding_fx( /* Energy VQ */ msvq_interpol_fx( SWB_fenv_fx, w_env_fx, indice ); - push_indice_fx( hBstr, IND_SWB_FENV, indice[0], 5 ); - push_indice_fx( hBstr, IND_SWB_FENV, indice[1], 7 ); - push_indice_fx( hBstr, IND_SWB_FENV, indice[2], 6 ); - push_indice_fx( hBstr, IND_SWB_FENV, indice[3], 5 ); - push_indice_fx( hBstr, IND_SWB_FENV, indice[4], 6 ); + push_indice( hBstr, IND_SWB_FENV, indice[0], 5 ); + push_indice( hBstr, IND_SWB_FENV, indice[1], 7 ); + push_indice( hBstr, IND_SWB_FENV, indice[2], 6 ); + push_indice( hBstr, IND_SWB_FENV, indice[3], 5 ); + push_indice( hBstr, IND_SWB_FENV, indice[4], 6 ); } hBWE_FD->prev_mode = mode; move16(); @@ -3939,7 +3939,7 @@ void hq_generic_encoding_fx( IF( EQ_16( hHQ_core->hq_generic_speech_class, 1 ) ) { - push_indice_fx( hBstr, IND_HQ_SWB_EXC_SP_CLAS, 1, 1 ); + push_indice( hBstr, IND_HQ_SWB_EXC_SP_CLAS, 1, 1 ); *hq_generic_exc_clas = HQ_GENERIC_SP_EXC; move16(); } @@ -3947,8 +3947,8 @@ void hq_generic_encoding_fx( { *hq_generic_exc_clas = decision_hq_generic_class_fx_32( coefs_fx, hq_generic_offset ); move16(); - push_indice_fx( hBstr, IND_HQ_SWB_EXC_SP_CLAS, 0, 1 ); - push_indice_fx( hBstr, IND_HQ_SWB_EXC_CLAS, *hq_generic_exc_clas, 1 ); + push_indice( hBstr, IND_HQ_SWB_EXC_SP_CLAS, 0, 1 ); + push_indice( hBstr, IND_HQ_SWB_EXC_CLAS, *hq_generic_exc_clas, 1 ); } FOR( n_band = 0; n_band < nenv; n_band++ ) @@ -4069,23 +4069,23 @@ void hq_generic_encoding_fx( move16(); } - push_indice_fx( hBstr, IND_SWB_FENV_HQ, indice[0], 5 ); - push_indice_fx( hBstr, IND_SWB_FENV_HQ, indice[1], 7 ); - push_indice_fx( hBstr, IND_SWB_FENV_HQ, indice[2], 6 ); - push_indice_fx( hBstr, IND_SWB_FENV_HQ, indice[3], 5 ); + push_indice( hBstr, IND_SWB_FENV_HQ, indice[0], 5 ); + push_indice( hBstr, IND_SWB_FENV_HQ, indice[1], 7 ); + push_indice( hBstr, IND_SWB_FENV_HQ, indice[2], 6 ); + push_indice( hBstr, IND_SWB_FENV_HQ, indice[3], 5 ); IF( LE_16( hq_generic_offset, HQ_GENERIC_FOFFSET_24K4 ) ) { - push_indice_fx( hBstr, IND_SWB_FENV_HQ, indice[4], 6 ); + push_indice( hBstr, IND_SWB_FENV_HQ, indice[4], 6 ); } ELSE { - push_indice_fx( hBstr, IND_SWB_FENV_HQ, indice[4], 5 ); + push_indice( hBstr, IND_SWB_FENV_HQ, indice[4], 5 ); } IF( EQ_16( st_fx->bwidth, FB ) ) { - push_indice_fx( hBstr, IND_FB_FENV_HQ, indice[5], 5 ); + push_indice( hBstr, IND_FB_FENV_HQ, indice[5], 5 ); } FOR( n_band = 0; n_band < nenv; n_band++ ) diff --git a/lib_enc/swb_bwe_enc_hr_fx.c b/lib_enc/swb_bwe_enc_hr_fx.c index fd4a9f125..8b5a17353 100644 --- a/lib_enc/swb_bwe_enc_hr_fx.c +++ b/lib_enc/swb_bwe_enc_hr_fx.c @@ -189,7 +189,7 @@ void swb_bwe_enc_hr_fx( st_fx->EnergyLT_fx_exp = exp1; move16(); - push_indice_fx( hBstr, IND_HR_IS_TRANSIENT, is_transient, 1 ); + push_indice( hBstr, IND_HR_IS_TRANSIENT, is_transient, 1 ); /*---------------------------------------------------------------------* * OLA and MDCT @@ -309,7 +309,7 @@ void swb_bwe_enc_hr_fx( ind1 = gain_quant_fx( &L_gain_fx, &gain1_fx, LG10_MIN_GLOB_GAIN_BWE_HR_Q14, LG10_MAX_GLOB_GAIN_BWE_HR_Q13, NBITS_GLOB_GAIN_BWE_HR, &exp1 ); - push_indice_fx( hBstr, IND_HR_GAIN, ind1, NBITS_GLOB_GAIN_BWE_HR ); + push_indice( hBstr, IND_HR_GAIN, ind1, NBITS_GLOB_GAIN_BWE_HR ); nBits = sub( nBits, NBITS_GLOB_GAIN_BWE_HR ); /* normalization with global gain */ @@ -353,7 +353,7 @@ void swb_bwe_enc_hr_fx( { ind1 = en_band_quant_fx( en_band_fx, swb_hr_env_code3_fx, NUM_ENVLOPE_CODE_HR_TR ); - push_indice_fx( hBstr, IND_HR_ENVELOPE, ind1, NBITS_ENVELOPE_BWE_HR_TR ); + push_indice( hBstr, IND_HR_ENVELOPE, ind1, NBITS_ENVELOPE_BWE_HR_TR ); nBits = sub( nBits, NBITS_ENVELOPE_BWE_HR_TR ); ind2 = ind1; move16(); @@ -369,7 +369,7 @@ void swb_bwe_enc_hr_fx( ind1 = en_band_quant_fx( en_band_fx, swb_hr_env_code3_fx + ( NUM_ENVLOPE_CODE_HR_TR2 * 2 ), NUM_ENVLOPE_CODE_HR_TR2 ); } - push_indice_fx( hBstr, IND_HR_ENVELOPE, ind1, NBITS_ENVELOPE_BWE_HR_TR - 1 ); + push_indice( hBstr, IND_HR_ENVELOPE, ind1, NBITS_ENVELOPE_BWE_HR_TR - 1 ); nBits = sub( nBits, NBITS_ENVELOPE_BWE_HR_TR - 1 ); } @@ -439,7 +439,7 @@ void swb_bwe_enc_hr_fx( L_en_noncoded_fx = L_deposit_h( en_band_fx[N_BANDS_TRANS_BWE_HR - 1] ); /* to Put in Q16+9 */ } - push_indice_fx( hBstr, IND_HR_HF_GAIN, ind1, NBITS_HF_GAIN_BWE_HR ); + push_indice( hBstr, IND_HR_HF_GAIN, ind1, NBITS_HF_GAIN_BWE_HR ); nBits = sub( nBits, NBITS_HF_GAIN_BWE_HR ); } ELSE @@ -507,7 +507,7 @@ void swb_bwe_enc_hr_fx( L_gain_fx = L_shr( L_tmp, sub( 31 - 16, exp2 ) ); /* 31: 'L_tmp' is already in Q31 */ ind1 = gain_quant_fx( &L_gain_fx, &gain1_fx, LG10_MIN_GLOB_GAIN_BWE_HR_Q14, LG10_MAX_GLOB_GAIN_BWE_HR_Q13, NBITS_GLOB_GAIN_BWE_HR, &exp1 ); - push_indice_fx( hBstr, IND_HR_GAIN, ind1, NBITS_GLOB_GAIN_BWE_HR ); + push_indice( hBstr, IND_HR_GAIN, ind1, NBITS_GLOB_GAIN_BWE_HR ); nBits = sub( nBits, NBITS_GLOB_GAIN_BWE_HR ); /* normalization with global gain */ @@ -547,8 +547,8 @@ void swb_bwe_enc_hr_fx( ind1 = en_band_quant_fx( en_band_fx, swb_hr_env_code1_fx, NUM_ENVLOPE_CODE_HR1 ); ind2 = en_band_quant_fx( en_band_fx + 2, swb_hr_env_code2_fx, NUM_ENVLOPE_CODE_HR2 ); - push_indice_fx( hBstr, IND_HR_ENVELOPE, ind1, NBITS_ENVELOPE_BWE_HR1 ); - push_indice_fx( hBstr, IND_HR_ENVELOPE, ind2, NBITS_ENVELOPE_BWE_HR2 ); + push_indice( hBstr, IND_HR_ENVELOPE, ind1, NBITS_ENVELOPE_BWE_HR1 ); + push_indice( hBstr, IND_HR_ENVELOPE, ind2, NBITS_ENVELOPE_BWE_HR2 ); nBits = sub( nBits, NBITS_ENVELOPE_BWE_HR1 + NBITS_ENVELOPE_BWE_HR2 ); @@ -673,7 +673,7 @@ void swb_bwe_enc_hr_fx( L_en_noncoded_fx = L_mult0( min_env_fx, 16384 ); } - push_indice_fx( hBstr, IND_HR_HF_GAIN, ind1, NBITS_HF_GAIN_BWE_HR ); + push_indice( hBstr, IND_HR_HF_GAIN, ind1, NBITS_HF_GAIN_BWE_HR ); nBits = sub( nBits, NBITS_HF_GAIN_BWE_HR ); } ELSE @@ -758,7 +758,7 @@ void swb_bwe_enc_hr_fx( /* Put in Q16 */ L_gain_fx = L_shr( L_temp, sub( 31 - 16, temp2 ) ); /* 31: 'L_temp' is already in Q31 */ ind1 = gain_quant_fx( &L_gain_fx, &gain2_fx, LG10_MIN_GLOB_GAIN_BWE_HR_Q14, LG10_MAX_GLOB_GAIN_BWE_HR_Q13, NBITS_GLOB_GAIN_BWE_HR, &exp2 ); - push_indice_fx( hBstr, IND_HR_GAIN, ind1, NBITS_GLOB_GAIN_BWE_HR ); + push_indice( hBstr, IND_HR_GAIN, ind1, NBITS_GLOB_GAIN_BWE_HR ); nBits = sub( nBits, NBITS_GLOB_GAIN_BWE_HR ); /* normalize with global gain */ @@ -784,7 +784,7 @@ void swb_bwe_enc_hr_fx( WHILE( nBits > 0 ) { i = s_min( nBits, 16 ); - push_indice_fx( hBstr, IND_UNUSED, 0, i ); + push_indice( hBstr, IND_UNUSED, 0, i ); nBits = sub( nBits, i ); } return; diff --git a/lib_enc/swb_bwe_enc_lr_fx.c b/lib_enc/swb_bwe_enc_lr_fx.c index 1a397c514..938cdd971 100644 --- a/lib_enc/swb_bwe_enc_lr_fx.c +++ b/lib_enc/swb_bwe_enc_lr_fx.c @@ -806,7 +806,7 @@ static void gethar_noisegn_fx( } } - push_indice_fx( hBstr, IND_NOISEG, imin_fx, 2 ); + push_indice( hBstr, IND_NOISEG, imin_fx, 2 ); /*g=(float) pow (10.0f,gain_table[imin]);*/ L_temp = L_mult( gain_table_SWB_BWE_fx[imin_fx], 27213 ); /* Q14+Q13+1=Q28 log(10)/log(2)=3.3219 27213.23(Q13) */ @@ -909,7 +909,7 @@ static void EncodeSWBSubbands_fx( /* Write the indices into the bitstream */ FOR( k = 0; k < nBands_search_fx; k++ ) { - push_indice_fx( st_fx->hBstr, IND_LAGINDICES, lagIndices_fx[k], bits_lagIndices_mode0_Har[k] ); + push_indice( st_fx->hBstr, IND_LAGINDICES, lagIndices_fx[k], bits_lagIndices_mode0_Har[k] ); } IF( flag_dis == 0 ) @@ -974,7 +974,7 @@ static void EncodeSWBSubbands_fx( } ELSE { - push_indice_fx( st_fx->hBstr, IND_LAGINDICES, lagIndices_fx[k], bits_lagIndices_modeNormal[k] ); + push_indice( st_fx->hBstr, IND_LAGINDICES, lagIndices_fx[k], bits_lagIndices_modeNormal[k] ); } } diff --git a/lib_enc/swb_tbe_enc_fx.c b/lib_enc/swb_tbe_enc_fx.c index c5d5e651e..1a14e7acb 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -866,7 +866,7 @@ void wb_tbe_enc_fx( } ELSE { - push_indice_fx( st_fx->hBstr, IND_SHB_LSF, i, NUM_BITS_LBR_WB_LSF ); + push_indice( st_fx->hBstr, IND_SHB_LSF, i, NUM_BITS_LBR_WB_LSF ); } Copy( lbr_wb_bwe_lsfvq_cbook_2bit_fx + i * LPC_SHB_ORDER_LBR_WB, lsp_wb, LPC_SHB_ORDER_LBR_WB ); @@ -928,7 +928,7 @@ void wb_tbe_enc_fx( } ELSE { - push_indice_fx( st_fx->hBstr, IND_SHB_LSF, i, NUM_BITS_WB_LSF ); + push_indice( st_fx->hBstr, IND_SHB_LSF, i, NUM_BITS_WB_LSF ); } Copy( wb_bwe_lsfvq_cbook_8bit_fx + i * LPC_SHB_ORDER_WB, lsp_wb, LPC_SHB_ORDER_WB ); @@ -1162,7 +1162,7 @@ void wb_tbe_enc_fx( } ELSE { - push_indice_fx( st_fx->hBstr, IND_UV_FLAG, uv_flag, 1 ); + push_indice( st_fx->hBstr, IND_UV_FLAG, uv_flag, 1 ); /* Quantization of the subframe gain parameter */ QuantizeSHBsubgains_fx( st_fx, GainShape, st_fx->extl ); @@ -2482,7 +2482,7 @@ void swb_tbe_enc_fx( } ELSE { - push_indice_fx( st_fx->hBstr, IND_SHB_VF, vf_ind_fx, NUM_BITS_SHB_VF ); + push_indice( st_fx->hBstr, IND_SHB_VF, vf_ind_fx, NUM_BITS_SHB_VF ); } } @@ -5330,7 +5330,7 @@ static void QuantizeSHBsubgains_fx( idxSubGain = closest_centroid_lc_fx( subgains + NUM_SHB_SUBFR / 4, HBCB_SubGain5bit_fx, 1 << NUM_BITS_SHB_SUBGAINS ); Copy( HBCB_SubGain5bit_fx + idxSubGain * NUM_SHB_SUBFR / 4, subgains, NUM_SHB_SUBFR / 4 ); - push_indice_fx( hBstr, IND_SHB_SUBGAIN, idxSubGain, NUM_BITS_SHB_SUBGAINS ); + push_indice( hBstr, IND_SHB_SUBGAIN, idxSubGain, NUM_BITS_SHB_SUBGAINS ); FOR( i = 0; i < NUM_SHB_SUBFR / 4; i++ ) { @@ -5401,7 +5401,7 @@ static void QuantizeSHBsubgains_fx( move16(); IF( NE_16( st_fx->codec_mode, MODE2 ) ) { - push_indice_fx( hBstr, IND_SHB_SUBGAIN, idxSubGain, NUM_BITS_SHB_SUBGAINS ); + push_indice( hBstr, IND_SHB_SUBGAIN, idxSubGain, NUM_BITS_SHB_SUBGAINS ); } } @@ -5596,7 +5596,7 @@ static void Quant_shb_ener_sf_fx( move16(); IF( NE_16( st_fx->codec_mode, MODE2 ) ) { - push_indice_fx( st_fx->hBstr, IND_SHB_ENER_SF, idxSubEner_fx, NUM_BITS_SHB_ENER_SF ); + push_indice( st_fx->hBstr, IND_SHB_ENER_SF, idxSubEner_fx, NUM_BITS_SHB_ENER_SF ); } return; } @@ -5683,7 +5683,7 @@ static void Quant_shb_res_gshape_fx( move16(); IF( NE_16( st_fx->codec_mode, MODE2 ) ) { - push_indice_fx( st_fx->hBstr, IND_SHB_RES_GS1 + i, idxSubGain_fx[i], NUM_BITS_SHB_RES_GS ); + push_indice( st_fx->hBstr, IND_SHB_RES_GS1 + i, idxSubGain_fx[i], NUM_BITS_SHB_RES_GS ); } } } @@ -5787,7 +5787,7 @@ static void QuantizeSHBframegain_fx( 1 << NUM_BITS_SHB_FrameGain, &idxFrameGain, &Q_GainFrame, SHBCB_FrameGain64_fx ); - push_indice_fx( st_fx->hBstr, IND_SHB_FRAMEGAIN, idxFrameGain, NUM_BITS_SHB_FrameGain ); + push_indice( st_fx->hBstr, IND_SHB_FRAMEGAIN, idxFrameGain, NUM_BITS_SHB_FrameGain ); *rf_gainFrame_ind = idxFrameGain; move16(); /* Q18 */ } @@ -5852,7 +5852,7 @@ static void QuantizeSHBframegain_fx( move16(); IF( NE_16( st_fx->codec_mode, MODE2 ) ) { - push_indice_fx( st_fx->hBstr, IND_SHB_FRAMEGAIN, idxFrameGain, NUM_BITS_SHB_FRAMEGAIN ); + push_indice( st_fx->hBstr, IND_SHB_FRAMEGAIN, idxFrameGain, NUM_BITS_SHB_FRAMEGAIN ); } *rf_gainFrame_ind = idxFrameGain; move16(); @@ -7176,7 +7176,7 @@ static void Quant_BWE_LSF_fx( move16(); IF( NE_16( st_fx->codec_mode, MODE2 ) ) { - push_indice_fx( hBstr, IND_SHB_LSF, lsf_idx[i], lsf_q_num_bits[i] ); + push_indice( hBstr, IND_SHB_LSF, lsf_idx[i], lsf_q_num_bits[i] ); } } @@ -7186,7 +7186,7 @@ static void Quant_BWE_LSF_fx( move16(); IF( NE_16( st_fx->codec_mode, MODE2 ) ) { - push_indice_fx( hBstr, IND_SHB_MIRROR, m_idx, MIRROR_POINT_BITS ); + push_indice( hBstr, IND_SHB_MIRROR, m_idx, MIRROR_POINT_BITS ); } grid_idx = Find_LSF_grid_fx( lsf, lsf_q, m ); @@ -7194,7 +7194,7 @@ static void Quant_BWE_LSF_fx( hBWE_TD->grid_idx = grid_idx; IF( NE_16( st_fx->codec_mode, MODE2 ) ) { - push_indice_fx( hBstr, IND_SHB_GRID, grid_idx, NUM_LSF_GRID_BITS ); + push_indice( hBstr, IND_SHB_GRID, grid_idx, NUM_LSF_GRID_BITS ); } FOR( i = 0; i < LPC_SHB_ORDER; i++ ) @@ -7407,7 +7407,7 @@ void fb_tbe_enc_fx( } ELSE { - push_indice_fx( st->hBstr, IND_FB_SLOPE, idxGain, 4 ); + push_indice( st->hBstr, IND_FB_SLOPE, idxGain, 4 ); } return; diff --git a/lib_enc/tcq_core_enc_fx.c b/lib_enc/tcq_core_enc_fx.c index 82088be50..d5841094f 100644 --- a/lib_enc/tcq_core_enc_fx.c +++ b/lib_enc/tcq_core_enc_fx.c @@ -449,11 +449,11 @@ ivas_error tcq_core_LR_enc_fx( j = sub( bit_budget, shl( nb_bytes, 3 ) ); FOR( i = 0; i < nb_bytes; i++ ) { - push_indice_fx( hBstr, IND_HQ2_SUBBAND_TCQ, pbs_fx->buf[i], 8 ); + push_indice( hBstr, IND_HQ2_SUBBAND_TCQ, pbs_fx->buf[i], 8 ); } IF( j > 0 ) { - push_indice_fx( hBstr, IND_HQ2_SUBBAND_TCQ, shr( pbs_fx->buf[nb_bytes], ( 8 - j ) ), j ); + push_indice( hBstr, IND_HQ2_SUBBAND_TCQ, shr( pbs_fx->buf[nb_bytes], ( 8 - j ) ), j ); } /* Clear decoding buffer */ set32_fx( coefs_quant_fx, 0, sfm_end[BANDS - 1] + 1 ); diff --git a/lib_enc/transition_enc_fx.c b/lib_enc/transition_enc_fx.c index 7fe813d12..253cc9717 100644 --- a/lib_enc/transition_enc_fx.c +++ b/lib_enc/transition_enc_fx.c @@ -389,7 +389,7 @@ void transition_enc_fx( /* 7bit ENCODER */ /* index = (*T0-pit_start)*2 + *T0_frac/2;*/ index = add( shl( sub( *T0, pit_start ), 1 ), shr( *T0_frac, 1 ) ); - push_indice_fx( hBstr, IND_PITCH, index, nBits ); + push_indice( hBstr, IND_PITCH, index, nBits ); /* Find the adaptive codebook vector - ACELP long-term prediction */ pred_lt4( &exc_fx[i_subfr], &exc_fx[i_subfr], *T0, *T0_frac, L_SUBFR + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); @@ -438,7 +438,7 @@ void transition_enc_fx( limit_T0_fx( L_FRAME, 8, pit_flag, limit_flag, *T0, 0, T0_min, T0_max ); /* find T0_min and T0_max for delta search */ index = add( shl( sub( *T0, pit_start ), 1 ), shr( *T0_frac, 1 ) ); - push_indice_fx( hBstr, IND_PITCH, index, nBits ); + push_indice( hBstr, IND_PITCH, index, nBits ); /* Find the adaptive codebook vector - ACELP long-term prediction */ pred_lt4( &exc_fx[i_subfr], &exc_fx[i_subfr], *T0, *T0_frac, L_SUBFR + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); @@ -502,7 +502,7 @@ void transition_enc_fx( *T0_frac = 0; move16(); } - push_indice_fx( hBstr, IND_PITCH, index, nBits ); + push_indice( hBstr, IND_PITCH, index, nBits ); /* Find the adaptive codebook vector - ACELP long-term prediction */ pred_lt4( &exc_fx[i_subfr], &exc_fx[i_subfr], *T0, *T0_frac, L_SUBFR + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); @@ -526,7 +526,7 @@ void transition_enc_fx( *T0 = pitch_fr4_fx( &exc_fx[i_subfr], xn_fx, h1_fx, *T0_min, *T0_max, T0_frac, pit_flag, limit_flag, PIT_MIN, PIT_FR1_8b, L_FRAME, L_SUBFR ); move16(); index = delta_pit_enc_fx( 2, *T0, *T0_frac, *T0_min ); - push_indice_fx( hBstr, IND_PITCH, index, nBits ); + push_indice( hBstr, IND_PITCH, index, nBits ); /* Find the adaptive codebook vector - ACELP long-term prediction */ pred_lt4( &exc_fx[i_subfr], &exc_fx[i_subfr], *T0, *T0_frac, L_SUBFR + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); @@ -607,7 +607,7 @@ void transition_enc_fx( IF( EQ_16( lp_flag, NORMAL_OPERATION ) ) { - push_indice_fx( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); + push_indice( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); } } @@ -768,7 +768,7 @@ void transition_enc_fx( /*index = (*T0)*2 + ((*T0_frac)>>1) - (PIT16k_FR2_TC0_2SUBFR*2) + ((PIT16k_FR2_TC0_2SUBFR-PIT16k_MIN)*4);*/ index = add( sub( add( shl( *T0, 1 ), shr( *T0_frac, 1 ) ), ( PIT16k_FR2_TC0_2SUBFR * 2 ) ), ( PIT16k_FR2_TC0_2SUBFR - PIT16k_MIN ) * 4 ); } - push_indice_fx( hBstr, IND_PITCH, index, nBits ); + push_indice( hBstr, IND_PITCH, index, nBits ); } ELSE IF( EQ_16( nBits, 6 ) ) { @@ -777,7 +777,7 @@ void transition_enc_fx( move16(); index = delta_pit_enc_fx( 4, *T0, *T0_frac, *T0_min ); - push_indice_fx( hBstr, IND_PITCH, index, nBits ); + push_indice( hBstr, IND_PITCH, index, nBits ); } IF( EQ_16( nBits, 6 ) ) { @@ -804,7 +804,7 @@ void transition_enc_fx( move16(); set16_fx( &exc_fx[i_subfr], 0, L_SUBFR + 1 ); /* set excitation for current subrame to 0 */ - push_indice_fx( hBstr, IND_LP_FILT_SELECT, 0, 1 ); /* this bit is actually not needed */ + push_indice( hBstr, IND_LP_FILT_SELECT, 0, 1 ); /* this bit is actually not needed */ Copy( xn_fx, xn2_fx, L_SUBFR ); /* target vector for codebook search */ set16_fx( y1_fx, 0, L_SUBFR ); /* set filtered adaptive excitation to 0 */ @@ -839,7 +839,7 @@ void transition_enc_fx( IF( EQ_16( lp_flag, NORMAL_OPERATION ) ) { - push_indice_fx( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); + push_indice( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); } *Jopt_flag = 1; @@ -1886,7 +1886,7 @@ static void tc_enc_fx( /* write pitch index */ IF( ( GE_16( *T0, L_SUBFR ) ) && ( NE_16( *tc_subfr, 3 * L_SUBFR ) ) ) { - push_indice_fx( hBstr, IND_PITCH, 0, nBits ); + push_indice( hBstr, IND_PITCH, 0, nBits ); } ELSE IF( EQ_16( *tc_subfr, 3 * L_SUBFR ) ) { @@ -1898,7 +1898,7 @@ static void tc_enc_fx( { index = abs_pit_enc_fx( 2, 0, *T0, *T0_frac ); } - push_indice_fx( hBstr, IND_PITCH, index, nBits ); + push_indice( hBstr, IND_PITCH, index, nBits ); limit_T0_fx( L_FRAME, 8, 0, 0, *T0, 0, T0_min, T0_max ); } @@ -1907,12 +1907,12 @@ static void tc_enc_fx( IF( EQ_16( nBits, 6 ) ) { index = delta_pit_enc_fx( 2, *T0, *T0_frac, PIT_MIN - 1 ); - push_indice_fx( hBstr, IND_PITCH, index, nBits ); + push_indice( hBstr, IND_PITCH, index, nBits ); } ELSE { index = delta_pit_enc_fx( 0, *T0, *T0_frac, PIT_MIN - 1 ); - push_indice_fx( hBstr, IND_PITCH, index, nBits ); + push_indice( hBstr, IND_PITCH, index, nBits ); } } } @@ -1926,13 +1926,13 @@ static void tc_enc_fx( ELSE IF( EQ_16( nBits, 6 ) ) { index = add( shl( sub( *T0, PIT16k_MIN ), 1 ), shr( *T0_frac, 1 ) ); - push_indice_fx( hBstr, IND_PITCH, index, nBits ); + push_indice( hBstr, IND_PITCH, index, nBits ); } } - push_indice_fx( hBstr, IND_TC_IMP_SHAPE, imp_shape, 3 ); - push_indice_fx( hBstr, IND_TC_IMP_POS, imp_pos, 6 ); - push_indice_fx( hBstr, IND_TC_IMP_SIGN, pitch_sign_fx, 1 ); - push_indice_fx( hBstr, IND_TC_IMP_GAIN, pitch_index, 3 ); + push_indice( hBstr, IND_TC_IMP_SHAPE, imp_shape, 3 ); + push_indice( hBstr, IND_TC_IMP_POS, imp_pos, 6 ); + push_indice( hBstr, IND_TC_IMP_SIGN, pitch_sign_fx, 1 ); + push_indice( hBstr, IND_TC_IMP_GAIN, pitch_index, 3 ); *position = add( imp_pos, i_subfr ); move16(); diff --git a/lib_enc/voiced_enc_fx.c b/lib_enc/voiced_enc_fx.c index b0dba61de..8081b2909 100644 --- a/lib_enc/voiced_enc_fx.c +++ b/lib_enc/voiced_enc_fx.c @@ -1156,7 +1156,7 @@ ivas_error ppp_voiced_encoder_fx( { Q_delta_lag = add( delta_lag_E, 11 ); /* to make it positive always */ - push_indice_fx( hBstr, IND_DELTALAG, Q_delta_lag, 5 ); + push_indice( hBstr, IND_DELTALAG, Q_delta_lag, 5 ); } WIsyn_fx( *dtfs_temp_fx, CURRP_Q_E_FX, lpc2_fx, &( hSC_VBR->ph_offset_E_fx ), out_fx, L_FRAME, 0, S_fx, C_fx, -- GitLab From 5e088823aeb430144a4f3d0827e8efaff2d11a4e Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 25 Mar 2025 14:01:42 -0400 Subject: [PATCH 02/14] fix clang --- lib_enc/transition_enc_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/transition_enc_fx.c b/lib_enc/transition_enc_fx.c index 253cc9717..6718552c5 100644 --- a/lib_enc/transition_enc_fx.c +++ b/lib_enc/transition_enc_fx.c @@ -803,7 +803,7 @@ void transition_enc_fx( *Jopt_flag = 0; move16(); - set16_fx( &exc_fx[i_subfr], 0, L_SUBFR + 1 ); /* set excitation for current subrame to 0 */ + set16_fx( &exc_fx[i_subfr], 0, L_SUBFR + 1 ); /* set excitation for current subrame to 0 */ push_indice( hBstr, IND_LP_FILT_SELECT, 0, 1 ); /* this bit is actually not needed */ Copy( xn_fx, xn2_fx, L_SUBFR ); /* target vector for codebook search */ -- GitLab From 7b1d6dbda6d6917bedda67b9bcd73a99f1bee6ea Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 25 Mar 2025 14:05:40 -0400 Subject: [PATCH 03/14] replace EVS push_next_indice_fx byt IVAS one --- lib_com/bitstream_fx.c | 4 +- lib_com/igf_base_fx.c | 2 +- lib_com/parameter_bitmaping_fx.c | 2 +- lib_enc/ACcontextMapping_enc_fx.c | 2 +- lib_enc/ari_hm_enc_fx.c | 4 +- lib_enc/decision_matrix_enc_fx.c | 4 +- lib_enc/enc_prm_fx.c | 130 +++++++++++++++--------------- lib_enc/evs_enc_fx.c | 14 ++-- lib_enc/fd_cng_enc_fx.c | 4 +- lib_enc/guided_plc_enc_fx.c | 6 +- lib_enc/igf_enc_fx.c | 4 +- lib_enc/igf_scf_enc_fx.c | 2 +- lib_enc/lsf_msvq_ma_enc_fx.c | 10 +-- lib_enc/qlpc_avq_fx.c | 20 ++--- lib_enc/swb_tbe_enc_fx.c | 28 +++---- 15 files changed, 118 insertions(+), 118 deletions(-) diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index 667958264..8cb968bf1 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -288,9 +288,8 @@ void push_indice_fx( return; } -#endif /*-------------------------------------------------------------------* - * push_next_indice_fx() * + * push_next_indice() * * Push a new indice into the buffer at the next position *-------------------------------------------------------------------*/ @@ -315,6 +314,7 @@ void push_next_indice_fx( return; } +#endif /*-------------------------------------------------------------------* diff --git a/lib_com/igf_base_fx.c b/lib_com/igf_base_fx.c index fbccdb519..44cf27c5f 100644 --- a/lib_com/igf_base_fx.c +++ b/lib_com/igf_base_fx.c @@ -1242,7 +1242,7 @@ void IGFCommonFuncsWriteSerialBit( IF( hBstr ) { - push_next_indice_fx( hBstr, bit, 1 ); + push_next_indice( hBstr, bit, 1 ); } *pBitOffset = add( *pBitOffset, 1 ); move16(); diff --git a/lib_com/parameter_bitmaping_fx.c b/lib_com/parameter_bitmaping_fx.c index 0846c618b..923872090 100644 --- a/lib_com/parameter_bitmaping_fx.c +++ b/lib_com/parameter_bitmaping_fx.c @@ -21,7 +21,7 @@ static Word16 PutIntoBitstream_fx( value = *( *pStream )++; codedValue = EncodeValue( value, index ); - push_next_indice_fx( hBstr, codedValue, nBits ); + push_next_indice( hBstr, codedValue, nBits ); return value; } diff --git a/lib_enc/ACcontextMapping_enc_fx.c b/lib_enc/ACcontextMapping_enc_fx.c index c52fddf97..4e02b1f11 100644 --- a/lib_enc/ACcontextMapping_enc_fx.c +++ b/lib_enc/ACcontextMapping_enc_fx.c @@ -343,7 +343,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx( /* Push number of encoded tuples */ value = sub( shr( lastnz, 1 ), 1 ); /* Q0 */ - push_next_indice_fx( hBstr, value, nbbits_ntuples ); + push_next_indice( hBstr, value, nbbits_ntuples ); /* Push arithmetic coded bits */ push_next_bits_fx( hBstr, &ptr[nbbits_ntuples], sub( bp, nbbits_ntuples ) ); diff --git a/lib_enc/ari_hm_enc_fx.c b/lib_enc/ari_hm_enc_fx.c index 76d48ccf4..343f1890f 100644 --- a/lib_enc/ari_hm_enc_fx.c +++ b/lib_enc/ari_hm_enc_fx.c @@ -42,12 +42,12 @@ Word16 EncodeIndex_fx( NumRatioBitsBwLtpIndx = NumRatioBits[Bandwidth][LtpPitchIndex]; move16(); - push_next_indice_fx( hBst, s_and( PeriodicityIndex, 0xff ), NumRatioBitsBwLtpIndx ); + push_next_indice( hBst, s_and( PeriodicityIndex, 0xff ), NumRatioBitsBwLtpIndx ); return NumRatioBitsBwLtpIndx; } ELSE { - push_next_indice_fx( hBst, PeriodicityIndex, 8 ); + push_next_indice( hBst, PeriodicityIndex, 8 ); return 8; } } diff --git a/lib_enc/decision_matrix_enc_fx.c b/lib_enc/decision_matrix_enc_fx.c index 63a13aa1a..bc5feeb6b 100644 --- a/lib_enc/decision_matrix_enc_fx.c +++ b/lib_enc/decision_matrix_enc_fx.c @@ -527,8 +527,8 @@ void signalling_enc_fx( assert( !st_fx->tcxonly ); assert( st_fx->core == HQ_CORE ); - push_next_indice_fx( hBstr, 1, 1 ); /* TCX */ - push_next_indice_fx( hBstr, 1, 1 ); /* HQ_CORE */ + push_next_indice( hBstr, 1, 1 ); /* TCX */ + push_next_indice( hBstr, 1, 1 ); /* HQ_CORE */ /* write ACELP->HQ core switching flag */ test(); diff --git a/lib_enc/enc_prm_fx.c b/lib_enc/enc_prm_fx.c index ecd4e2f01..6c052e596 100644 --- a/lib_enc/enc_prm_fx.c +++ b/lib_enc/enc_prm_fx.c @@ -33,7 +33,7 @@ static void enc_prm_hm( } /* Flag */ - push_next_indice_fx( hBstr, prm_hm[0], 1 ); + push_next_indice( hBstr, prm_hm[0], 1 ); IF( prm_hm[0] ) { @@ -50,7 +50,7 @@ static void enc_prm_hm( IF( EQ_16( st->hTcxCfg->coder_type, VOICED ) ) { /* Gain index */ - push_next_indice_fx( hBstr, prm_hm[2], kTcxHmNumGainBits ); + push_next_indice( hBstr, prm_hm[2], kTcxHmNumGainBits ); } } } @@ -152,7 +152,7 @@ void enc_prm_rf_ivas_fx( index = 3; move16(); } - push_next_indice_fx( hBstr, index, 2 ); + push_next_indice( hBstr, index, 2 ); IF( EQ_16( rf_frame_type, RF_TCXFD ) ) { @@ -296,9 +296,9 @@ void enc_prm_rf_fx( /* LSF indices */ IF( EQ_16( rf_frame_type, RF_TCXFD ) ) { - push_next_indice_fx( hBstr, hRF->rf_indx_lsf[fec_offset][0], lsf_numbits[0] ); /* VQ 1 */ - push_next_indice_fx( hBstr, hRF->rf_indx_lsf[fec_offset][1], lsf_numbits[1] ); /* VQ 2 */ - push_next_indice_fx( hBstr, hRF->rf_indx_lsf[fec_offset][2], lsf_numbits[2] ); /* VQ 3 */ + push_next_indice( hBstr, hRF->rf_indx_lsf[fec_offset][0], lsf_numbits[0] ); /* VQ 1 */ + push_next_indice( hBstr, hRF->rf_indx_lsf[fec_offset][1], lsf_numbits[1] ); /* VQ 2 */ + push_next_indice( hBstr, hRF->rf_indx_lsf[fec_offset][2], lsf_numbits[2] ); /* VQ 3 */ } /* classification */ @@ -324,12 +324,12 @@ void enc_prm_rf_fx( index = 3; move16(); } - push_next_indice_fx( hBstr, index, 2 ); + push_next_indice( hBstr, index, 2 ); IF( EQ_16( rf_frame_type, RF_TCXFD ) ) { /* TCX global gain = 7 bits */ - push_next_indice_fx( hBstr, hRF->rf_gain_tcx[fec_offset], 7 ); + push_next_indice( hBstr, hRF->rf_gain_tcx[fec_offset], 7 ); /*window info 1 bit for long overlap 2 if minimum or half overlap*/ @@ -345,35 +345,35 @@ void enc_prm_rf_fx( test(); IF( ( EQ_16( rf_frame_type, RF_TCXTD1 ) || EQ_16( rf_frame_type, RF_TCXTD2 ) ) && hTcxEnc->tcxltp != 0 ) { - push_next_indice_fx( hBstr, hRF->rf_tcxltp_param[fec_offset], 9 ); + push_next_indice( hBstr, hRF->rf_tcxltp_param[fec_offset], 9 ); } } } ELSE IF( EQ_16( rf_frame_type, 7 ) ) /* NELP bitstream writing */ { /* LSF indices */ - push_next_indice_fx( hBstr, hRF->rf_indx_lsf[fec_offset][0], 8 ); /* VQ 1 */ - push_next_indice_fx( hBstr, hRF->rf_indx_lsf[fec_offset][1], 8 ); /* VQ 2 */ + push_next_indice( hBstr, hRF->rf_indx_lsf[fec_offset][0], 8 ); /* VQ 1 */ + push_next_indice( hBstr, hRF->rf_indx_lsf[fec_offset][1], 8 ); /* VQ 2 */ /* NELP gain indices */ - push_next_indice_fx( hBstr, hRF->rf_indx_nelp_iG1[fec_offset], 5 ); - push_next_indice_fx( hBstr, hRF->rf_indx_nelp_iG2[fec_offset][0], 6 ); - push_next_indice_fx( hBstr, hRF->rf_indx_nelp_iG2[fec_offset][1], 6 ); + push_next_indice( hBstr, hRF->rf_indx_nelp_iG1[fec_offset], 5 ); + push_next_indice( hBstr, hRF->rf_indx_nelp_iG2[fec_offset][0], 6 ); + push_next_indice( hBstr, hRF->rf_indx_nelp_iG2[fec_offset][1], 6 ); /* NELP filter selection index */ - push_next_indice_fx( hBstr, hRF->rf_indx_nelp_fid[fec_offset], 2 ); + push_next_indice( hBstr, hRF->rf_indx_nelp_fid[fec_offset], 2 ); /* tbe gainFr */ - push_next_indice_fx( hBstr, hRF->rf_indx_tbeGainFr[fec_offset], 5 ); + push_next_indice( hBstr, hRF->rf_indx_tbeGainFr[fec_offset], 5 ); } ELSE IF( GE_16( rf_frame_type, 4 ) ) /* rf_frame_type ALL_PRED: 4, NO_PRED: 5, GEN_PRED: 6 */ { /* LSF indices */ - push_next_indice_fx( hBstr, hRF->rf_indx_lsf[fec_offset][0], 8 ); /* VQ 1 */ - push_next_indice_fx( hBstr, hRF->rf_indx_lsf[fec_offset][1], 8 ); /* VQ 2 */ + push_next_indice( hBstr, hRF->rf_indx_lsf[fec_offset][0], 8 ); /* VQ 1 */ + push_next_indice( hBstr, hRF->rf_indx_lsf[fec_offset][1], 8 ); /* VQ 2 */ /* ES pred */ - push_next_indice_fx( hBstr, hRF->rf_indx_EsPred[fec_offset], 3 ); + push_next_indice( hBstr, hRF->rf_indx_EsPred[fec_offset], 3 ); ltp_mode = ACELP_LTP_MODE[1][1][rf_frame_type]; /* Q0 */ ltf_mode = ACELP_LTF_MODE[1][1][rf_frame_type]; /* Q0 */ @@ -386,13 +386,13 @@ void enc_prm_rf_fx( n = ACELP_LTP_BITS_SFR[ltp_mode][sfr]; IF( n != 0 ) { - push_next_indice_fx( hBstr, hRF->rf_indx_pitch[fec_offset][sfr], n ); + push_next_indice( hBstr, hRF->rf_indx_pitch[fec_offset][sfr], n ); } /* Adaptive codebook filtering (1 bit) */ IF( EQ_16( ltf_mode, 2 ) ) { - push_next_indice_fx( hBstr, hRF->rf_indx_ltfMode[fec_offset][sfr], 1 ); + push_next_indice( hBstr, hRF->rf_indx_ltfMode[fec_offset][sfr], 1 ); } /*Innovative codebook*/ @@ -403,7 +403,7 @@ void enc_prm_rf_fx( ( EQ_16( rf_frame_type, RF_GENPRED ) && ( sfr == 0 || EQ_16( sfr, 2 ) ) ) ) { - push_next_indice_fx( hBstr, hRF->rf_indx_fcb[fec_offset][sfr], 7 ); + push_next_indice( hBstr, hRF->rf_indx_fcb[fec_offset][sfr], 7 ); } /* Gains (5b, 6b or 7b / subfr) */ @@ -411,11 +411,11 @@ void enc_prm_rf_fx( IF( sfr == 0 || EQ_16( sfr, 2 ) ) { n = ACELP_GAINS_BITS[gains_mode]; - push_next_indice_fx( hBstr, hRF->rf_indx_gain[fec_offset][sfr], n ); + push_next_indice( hBstr, hRF->rf_indx_gain[fec_offset][sfr], n ); } } /* tbe gainFr */ - push_next_indice_fx( hBstr, hRF->rf_indx_tbeGainFr[fec_offset], 2 ); + push_next_indice( hBstr, hRF->rf_indx_tbeGainFr[fec_offset], 2 ); } /***************/ @@ -429,15 +429,15 @@ void enc_prm_rf_fx( test(); IF( EQ_16( fec_offset, 2 ) ) { - push_next_indice_fx( hBstr, 0, 2 ); + push_next_indice( hBstr, 0, 2 ); } ELSE IF( EQ_16( fec_offset, 3 ) || EQ_16( fec_offset, 5 ) || EQ_16( fec_offset, 7 ) ) { - push_next_indice_fx( hBstr, ( fec_offset - 1 ) / 2, 2 ); + push_next_indice( hBstr, ( fec_offset - 1 ) / 2, 2 ); } /* write RF frame type last in the bitstream */ - push_next_indice_fx( hBstr, rf_frame_type, 3 ); + push_next_indice( hBstr, rf_frame_type, 3 ); } @@ -533,7 +533,7 @@ void enc_prm_fx( IF( st->tcxonly ) { - push_next_indice_fx( hBstr, core == TCX_10_CORE, 1 ); + push_next_indice( hBstr, core == TCX_10_CORE, 1 ); { index = 3; move16(); @@ -553,7 +553,7 @@ void enc_prm_fx( index = 2; move16(); } - push_next_indice_fx( hBstr, index, 2 ); + push_next_indice( hBstr, index, 2 ); } } ELSE @@ -581,13 +581,13 @@ void enc_prm_fx( { idx = add( idx, 1 ); /* Q0 */ } - push_next_indice_fx( hBstr, idx - start_idx, nBits ); - push_next_indice_fx( hBstr, 0, 1 ); /* Indicate to the decoder that the core is ACELP*/ + push_next_indice( hBstr, idx - start_idx, nBits ); + push_next_indice( hBstr, 0, 1 ); /* Indicate to the decoder that the core is ACELP*/ nbits_start = 3; /* Q0 */ } ELSE { - push_next_indice_fx( hBstr, coder_type, 3 ); + push_next_indice( hBstr, coder_type, 3 ); } } ELSE @@ -595,15 +595,15 @@ void enc_prm_fx( IF( EQ_16( st->mdct_sw, MODE1 ) ) { /* 2 bits instead of 3 as TCX is already signaled */ - push_next_indice_fx( hBstr, st->hTcxCfg->coder_type, 2 ); + push_next_indice( hBstr, st->hTcxCfg->coder_type, 2 ); } ELSE { IF( EQ_16( st->mdct_sw_enable, MODE2 ) ) { - push_next_indice_fx( hBstr, 1, 1 ); /* TCX */ - push_next_indice_fx( hBstr, 0, 1 ); /* not HQ_CORE */ - push_next_indice_fx( hBstr, st->hTcxCfg->coder_type, 2 ); + push_next_indice( hBstr, 1, 1 ); /* TCX */ + push_next_indice( hBstr, 0, 1 ); /* not HQ_CORE */ + push_next_indice( hBstr, st->hTcxCfg->coder_type, 2 ); } ELSE { @@ -641,13 +641,13 @@ void enc_prm_fx( { idx = add( idx, 1 ); } - push_next_indice_fx( hBstr, idx - start_idx, nBits ); - push_next_indice_fx( hBstr, 1, 1 ); /* Indicate to the decoder that the core is TCX*/ + push_next_indice( hBstr, idx - start_idx, nBits ); + push_next_indice( hBstr, 1, 1 ); /* Indicate to the decoder that the core is TCX*/ nbits_start = 3; } ELSE { - push_next_indice_fx( hBstr, 4 + st->hTcxCfg->coder_type, 3 ); + push_next_indice( hBstr, 4 + st->hTcxCfg->coder_type, 3 ); } } } @@ -667,7 +667,7 @@ void enc_prm_fx( tmp = TCX_20_CORE; move16(); } - push_next_indice_fx( hBstr, tmp, 1 ); + push_next_indice( hBstr, tmp, 1 ); } /* write TCX overlap mode (1 bit: full, 2 bits: half or no overlap) */ @@ -696,7 +696,7 @@ void enc_prm_fx( overlap_code = 0; move16(); } - push_next_indice_fx( hBstr, overlap_code, nbits_tcx ); + push_next_indice( hBstr, overlap_code, nbits_tcx ); } IF( st->hPlcExt->enableGplc ) @@ -719,7 +719,7 @@ void enc_prm_fx( IF( EQ_16( core, ACELP_CORE ) ) { - push_next_indice_fx( hBstr, st->glr_idx[0], G_LPC_RECOVERY_BITS ); + push_next_indice( hBstr, st->glr_idx[0], G_LPC_RECOVERY_BITS ); } } @@ -789,7 +789,7 @@ void enc_prm_fx( IF( n != 0 ) { - push_next_indice_fx( hBstr, st->bpf_gain_param, n ); + push_next_indice( hBstr, st->bpf_gain_param, n ); } /* Mean energy (2 or 3 bits) */ @@ -797,7 +797,7 @@ void enc_prm_fx( IF( n != 0 ) { - push_next_indice_fx( hBstr, prm[j++], n ); + push_next_indice( hBstr, prm[j++], n ); } /* Subframe parameters */ @@ -810,14 +810,14 @@ void enc_prm_fx( IF( n != 0 ) { - push_next_indice_fx( hBstr, prm[j++], n ); + push_next_indice( hBstr, prm[j++], n ); } /* Adaptive codebook filtering (1 bit) */ IF( EQ_16( st->acelp_cfg.ltf_mode, 2 ) ) { - push_next_indice_fx( hBstr, prm[j++], 1 ); + push_next_indice( hBstr, prm[j++], 1 ); } /*Innovative codebook*/ @@ -839,12 +839,12 @@ void enc_prm_fx( FOR( ix = 0; ix < wordcnt; ix++ ) { - push_next_indice_fx( hBstr, prm[j++], 16 ); + push_next_indice( hBstr, prm[j++], 16 ); } IF( bitcnt ) { - push_next_indice_fx( hBstr, prm[j++], bitcnt ); + push_next_indice( hBstr, prm[j++], bitcnt ); } j = add( j_old, 8 ); /* Q0 */ @@ -852,7 +852,7 @@ void enc_prm_fx( /* Gains (5b, 6b or 7b / subfr) */ n = ACELP_GAINS_BITS[st->acelp_cfg.gains_mode[sfr]]; - push_next_indice_fx( hBstr, prm[j++], n ); + push_next_indice( hBstr, prm[j++], n ); } /*end of for(sfr)*/ } /*end of mode[0]==0*/ @@ -866,14 +866,14 @@ void enc_prm_fx( move16(); IF( st->enablePlcWaveadjust ) { - push_next_indice_fx( hBstr, st->Tonal_SideInfo, 1 ); + push_next_indice( hBstr, st->Tonal_SideInfo, 1 ); } /* TCX Gain = 7 bits */ - push_next_indice_fx( hBstr, prm[j++], 7 ); + push_next_indice( hBstr, prm[j++], 7 ); /* TCX Noise Filling = NBITS_NOISE_FILL_LEVEL bits */ - push_next_indice_fx( hBstr, prm[j++], NBITS_NOISE_FILL_LEVEL ); + push_next_indice( hBstr, prm[j++], NBITS_NOISE_FILL_LEVEL ); /* LTP data */ test(); @@ -881,13 +881,13 @@ void enc_prm_fx( { IF( prm[j] ) { - push_next_indice_fx( hBstr, 1, 1 ); - push_next_indice_fx( hBstr, prm[j + 1], 9 ); - push_next_indice_fx( hBstr, prm[j + 2], 2 ); + push_next_indice( hBstr, 1, 1 ); + push_next_indice( hBstr, prm[j + 1], 9 ); + push_next_indice( hBstr, prm[j + 2], 2 ); } ELSE { - push_next_indice_fx( hBstr, 0, 1 ); + push_next_indice( hBstr, 0, 1 ); } } j = add( j, 3 ); @@ -932,7 +932,7 @@ void enc_prm_fx( test(); IF( st->hTcxCfg->ctx_hm && NE_16( last_core, ACELP_CORE ) ) { - push_next_indice_fx( hBstr, prm[j], 1 ); + push_next_indice( hBstr, prm[j], 1 ); IF( prm[j] ) { @@ -1015,14 +1015,14 @@ void enc_prm_fx( test(); IF( st->enablePlcWaveadjust && k ) { - push_next_indice_fx( hBstr, st->Tonal_SideInfo, 1 ); + push_next_indice( hBstr, st->Tonal_SideInfo, 1 ); } /* TCX Gain = 7 bits */ - push_next_indice_fx( hBstr, prm[j++], 7 ); + push_next_indice( hBstr, prm[j++], 7 ); /* TCX Noise Filling = NBITS_NOISE_FILL_LEVEL bits */ - push_next_indice_fx( hBstr, prm[j++], NBITS_NOISE_FILL_LEVEL ); + push_next_indice( hBstr, prm[j++], NBITS_NOISE_FILL_LEVEL ); /* LTP data */ test(); @@ -1031,13 +1031,13 @@ void enc_prm_fx( { IF( prm[j] ) { - push_next_indice_fx( hBstr, 1, 1 ); - push_next_indice_fx( hBstr, prm[j + 1], 9 ); - push_next_indice_fx( hBstr, prm[j + 2], 2 ); + push_next_indice( hBstr, 1, 1 ); + push_next_indice( hBstr, prm[j + 1], 9 ); + push_next_indice( hBstr, prm[j + 2], 2 ); } ELSE { - push_next_indice_fx( hBstr, 0, 1 ); + push_next_indice( hBstr, 0, 1 ); } } j = add( j, 3 ); @@ -1079,7 +1079,7 @@ void enc_prm_fx( test(); IF( st->hTcxCfg->ctx_hm && !( last_core == ACELP_CORE && k == 0 ) ) { - push_next_indice_fx( hBstr, prm[j], 1 ); + push_next_indice( hBstr, prm[j], 1 ); IF( prm[j] ) { diff --git a/lib_enc/evs_enc_fx.c b/lib_enc/evs_enc_fx.c index c86b7e061..396e97c6f 100644 --- a/lib_enc/evs_enc_fx.c +++ b/lib_enc/evs_enc_fx.c @@ -419,7 +419,7 @@ ivas_error evs_enc_fx( FOR( i = 0; i < padBits; i++ ) { - push_next_indice_fx( hBstr, 0, 1 ); + push_next_indice( hBstr, 0, 1 ); } } @@ -678,19 +678,19 @@ static void writeFrameHeader_loc( Encoder_State *st ) IF( EQ_16( st->cng_type, FD_CNG ) ) { /* write SID/CNG type flag */ - push_next_indice_fx( hBstr, 1, 1 ); + push_next_indice( hBstr, 1, 1 ); /* write bandwidth mode */ - push_next_indice_fx( hBstr, st->bwidth, 2 ); + push_next_indice( hBstr, st->bwidth, 2 ); /* write L_frame */ IF( EQ_16( st->L_frame, L_FRAME ) ) { - push_next_indice_fx( hBstr, 0, 1 ); + push_next_indice( hBstr, 0, 1 ); } ELSE { - push_next_indice_fx( hBstr, 1, 1 ); + push_next_indice( hBstr, 1, 1 ); } } } @@ -698,7 +698,7 @@ static void writeFrameHeader_loc( Encoder_State *st ) { IF( st->rf_mode == 0 ) { - push_next_indice_fx( hBstr, sub( st->bwidth, FrameSizeConfig[st->frame_size_index].bandwidth_min ), FrameSizeConfig[st->frame_size_index].bandwidth_bits ); + push_next_indice( hBstr, sub( st->bwidth, FrameSizeConfig[st->frame_size_index].bandwidth_min ), FrameSizeConfig[st->frame_size_index].bandwidth_bits ); } } @@ -706,7 +706,7 @@ static void writeFrameHeader_loc( Encoder_State *st ) test(); IF( FrameSizeConfig[st->frame_size_index].reserved_bits && st->rf_mode == 0 ) { - push_next_indice_fx( hBstr, 0, FrameSizeConfig[st->frame_size_index].reserved_bits ); + push_next_indice( hBstr, 0, FrameSizeConfig[st->frame_size_index].reserved_bits ); } } diff --git a/lib_enc/fd_cng_enc_fx.c b/lib_enc/fd_cng_enc_fx.c index 2eb13646c..d182e4a44 100644 --- a/lib_enc/fd_cng_enc_fx.c +++ b/lib_enc/fd_cng_enc_fx.c @@ -1211,9 +1211,9 @@ void FdCng_encodeSID_fx( HANDLE_FD_CNG_ENC stenc, /* i/o: pointer to FD_CNG stru { FOR( i = 0; i < stages_37bits; i++ ) { - push_next_indice_fx( hBstr, indices[i], bits_37bits[i] ); + push_next_indice( hBstr, indices[i], bits_37bits[i] ); } - push_next_indice_fx( hBstr, index, 7 ); + push_next_indice( hBstr, index, 7 ); } ELSE { diff --git a/lib_enc/guided_plc_enc_fx.c b/lib_enc/guided_plc_enc_fx.c index 60a3f8f50..81e50d099 100644 --- a/lib_enc/guided_plc_enc_fx.c +++ b/lib_enc/guided_plc_enc_fx.c @@ -215,7 +215,7 @@ void enc_prm_side_Info_fx( IF( GT_16( hPlc_Ext->nBits, 1 ) ) { - push_next_indice_fx( st->hBstr, 1, 1 ); + push_next_indice( st->hBstr, 1, 1 ); diff_pitch = sub( hPlc_Ext->T0, hPlc_Ext->T0_4th ); test(); @@ -225,11 +225,11 @@ void enc_prm_side_Info_fx( move16(); } - push_next_indice_fx( st->hBstr, add( diff_pitch, search_range ), bits_per_subfr ); + push_next_indice( st->hBstr, add( diff_pitch, search_range ), bits_per_subfr ); } ELSE { - push_next_indice_fx( st->hBstr, 0, 1 ); + push_next_indice( st->hBstr, 0, 1 ); } return; diff --git a/lib_enc/igf_enc_fx.c b/lib_enc/igf_enc_fx.c index cc4840876..f5c13df57 100644 --- a/lib_enc/igf_enc_fx.c +++ b/lib_enc/igf_enc_fx.c @@ -1513,13 +1513,13 @@ Word16 IGFEncWriteConcatenatedBitstream_fx( tmp = shr( hPrivateData->igfBitstreamBits, 3 ); FOR( i = 0; i < tmp; i++ ) { - push_next_indice_fx( hBstr, pBitstream[i], 8 ); + push_next_indice( hBstr, pBitstream[i], 8 ); } bitsLeft = s_and( hPrivateData->igfBitstreamBits, 0x7 ); IF( bitsLeft > 0 ) { - push_next_indice_fx( hBstr, shr( pBitstream[i], sub( 8, bitsLeft ) ), bitsLeft ); + push_next_indice( hBstr, shr( pBitstream[i], sub( 8, bitsLeft ) ), bitsLeft ); } return hInstance->infoTotalBitsWritten; diff --git a/lib_enc/igf_scf_enc_fx.c b/lib_enc/igf_scf_enc_fx.c index 8659d53a1..ed52349dc 100644 --- a/lib_enc/igf_scf_enc_fx.c +++ b/lib_enc/igf_scf_enc_fx.c @@ -358,7 +358,7 @@ Word16 IGFSCFEncoderEncode_fx( { FOR( i = 0; i < hPublicData->ptrBitIndex; ++i ) { - push_next_indice_fx( hBstr, ptr[i], 1 ); + push_next_indice( hBstr, ptr[i], 1 ); } } diff --git a/lib_enc/lsf_msvq_ma_enc_fx.c b/lib_enc/lsf_msvq_ma_enc_fx.c index aa2255c68..8f6a21d03 100644 --- a/lib_enc/lsf_msvq_ma_enc_fx.c +++ b/lib_enc/lsf_msvq_ma_enc_fx.c @@ -834,7 +834,7 @@ Word16 enc_lsf_tcxlpc_fx( move16(); FOR( i = 0; i < TCXLPC_NUMSTAGES; ++i ) { - push_next_indice_fx( hBstr, **indices, lsf_numbits[i] ); + push_next_indice( hBstr, **indices, lsf_numbits[i] ); ++*indices; } @@ -843,7 +843,7 @@ Word16 enc_lsf_tcxlpc_fx( NumBits = add( NumBits, TCXLPC_IND_NUMBITS ); FOR( i = 0; i < TCXLPC_IND_NUMSTAGES; ++i ) { - push_next_indice_fx( hBstr, **indices, lsf_ind_numbits[i] ); + push_next_indice( hBstr, **indices, lsf_ind_numbits[i] ); ++*indices; } } @@ -909,7 +909,7 @@ Word16 lsf_msvq_ma_encprm_fx( FOR( i = 0; i < no_indices; i++ ) { - push_next_indice_fx( hBstr, *param_lpc, bits_param_lpc[i] ); + push_next_indice( hBstr, *param_lpc, bits_param_lpc[i] ); param_lpc++; nbits_lpc = add( nbits_lpc, bits_param_lpc[i] ); } @@ -919,7 +919,7 @@ Word16 lsf_msvq_ma_encprm_fx( IF( ( core == ACELP_CORE ) && acelp_midLpc ) { - push_next_indice_fx( hBstr, *param_lpc, bits_midlpc ); + push_next_indice( hBstr, *param_lpc, bits_midlpc ); nbits_lpc = add( nbits_lpc, bits_midlpc ); } } @@ -981,7 +981,7 @@ Word16 lsf_bctcvq_encprm_fx( FOR( i = 0; i < no_indices; i++ ) { - push_next_indice_fx( hBstr, *param_lpc, bits_param_lpc[i] ); + push_next_indice( hBstr, *param_lpc, bits_param_lpc[i] ); param_lpc++; nbits_lpc = add( nbits_lpc, bits_param_lpc[i] ); } diff --git a/lib_enc/qlpc_avq_fx.c b/lib_enc/qlpc_avq_fx.c index 13e0a3cf7..288612e43 100644 --- a/lib_enc/qlpc_avq_fx.c +++ b/lib_enc/qlpc_avq_fx.c @@ -143,12 +143,12 @@ static Word16 unary_code( FOR( ; ind > 0; ind-- ) { - push_next_indice_fx( hBstr, 1, 1 ); + push_next_indice( hBstr, 1, 1 ); nb_bits = add( nb_bits, 1 ); // Q0 } /* Stop bit */ - push_next_indice_fx( hBstr, 0, 1 ); + push_next_indice( hBstr, 0, 1 ); return ( nb_bits ); } @@ -195,7 +195,7 @@ static Word16 unpack4bits( IF( nbits == 0 ) { - push_next_indice_fx( hBstr, 0, 0 ); + push_next_indice( hBstr, 0, 0 ); i = 1; move16(); } @@ -206,10 +206,10 @@ static Word16 unpack4bits( FOR( ; nbits > 4; nbits -= 4 ) { - push_next_indice_fx( hBstr, prm[i], 4 ); + push_next_indice( hBstr, prm[i], 4 ); i = add( i, 1 ); } - push_next_indice_fx( hBstr, prm[i], nbits ); + push_next_indice( hBstr, prm[i], nbits ); i = add( i, 1 ); } @@ -330,7 +330,7 @@ Word16 encode_lpc_avq_fx( { nb = 1; move16(); - push_next_indice_fx( hBstr, q_type, nb ); + push_next_indice( hBstr, q_type, nb ); } nb_bits = add( nb_bits, nb ); // Q0 @@ -342,7 +342,7 @@ Word16 encode_lpc_avq_fx( IF( ( ( q_type == 0 ) && NE_16( element_mode, IVAS_CPE_MDCT ) ) || ( ( q_type == 0 ) && ( GE_16( st1, 0 ) ) && EQ_16( element_mode, IVAS_CPE_MDCT ) ) ) { /* Absolute quantizer with 1st stage stochastic codebook */ - push_next_indice_fx( hBstr, st1, bits_for_abs_quant ); + push_next_indice( hBstr, st1, bits_for_abs_quant ); nb_bits = add( nb_bits, bits_for_abs_quant ); // Q0 } @@ -350,7 +350,7 @@ Word16 encode_lpc_avq_fx( test(); IF( EQ_16( element_mode, IVAS_CPE_MDCT ) && EQ_16( stereo_mode, 3 ) && st1 < 0 ) { - push_next_indice_fx( hBstr, add( st1, 2 ), 1 ); + push_next_indice( hBstr, add( st1, 2 ), 1 ); nb_bits = add( nb_bits, 1 ); // Q0 } @@ -368,7 +368,7 @@ Word16 encode_lpc_avq_fx( move16(); i = 3; } - push_next_indice_fx( hBstr, i, 2 ); + push_next_indice( hBstr, i, 2 ); i = sub( qn2, 2 ); @@ -377,7 +377,7 @@ Word16 encode_lpc_avq_fx( move16(); i = 3; } - push_next_indice_fx( hBstr, i, 2 ); + push_next_indice( hBstr, i, 2 ); /* Unary code for abs and rel LPC0/LPC2 */ /* Q5 = 0, Q6=10, Q0=110, Q7=1110, ... */ diff --git a/lib_enc/swb_tbe_enc_fx.c b/lib_enc/swb_tbe_enc_fx.c index 1a14e7acb..316a5b549 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -7579,10 +7579,10 @@ void tbe_write_bitstream_fx( IF( ( st_fx->rf_mode || EQ_32( st_fx->total_brate, ACELP_9k60 ) ) && ( EQ_16( st_fx->bwidth, WB ) ) ) { /* WB LSF */ - push_next_indice_fx( hBstr, hBWE_TD->lsf_WB, NUM_BITS_LBR_WB_LSF ); + push_next_indice( hBstr, hBWE_TD->lsf_WB, NUM_BITS_LBR_WB_LSF ); /* WB frame */ - push_next_indice_fx( hBstr, hBWE_TD->gFrame_WB, NUM_BITS_SHB_FrameGain_LBR_WB ); + push_next_indice( hBstr, hBWE_TD->gFrame_WB, NUM_BITS_SHB_FrameGain_LBR_WB ); } ELSE IF( ( GE_32( st_fx->total_brate, ACELP_9k60 ) ) && ( LE_32( st_fx->total_brate, ACELP_32k ) ) && ( ( EQ_16( st_fx->bwidth, SWB ) ) || ( EQ_16( st_fx->bwidth, FB ) ) ) ) @@ -7592,53 +7592,53 @@ void tbe_write_bitstream_fx( test(); IF( ( EQ_16( st_fx->rf_mode, 1 ) ) || EQ_32( st_fx->total_brate, ACELP_9k60 ) ) { - push_next_indice_fx( hBstr, hBWE_TD->lsf_idx[0], 8 ); + push_next_indice( hBstr, hBWE_TD->lsf_idx[0], 8 ); } ELSE { FOR( i = 0; i < NUM_Q_LSF; i++ ) { - push_next_indice_fx( hBstr, hBWE_TD->lsf_idx[i], lsf_q_num_bits[i] ); + push_next_indice( hBstr, hBWE_TD->lsf_idx[i], lsf_q_num_bits[i] ); } /* LSF mirror points */ - push_next_indice_fx( hBstr, hBWE_TD->m_idx, MIRROR_POINT_BITS ); + push_next_indice( hBstr, hBWE_TD->m_idx, MIRROR_POINT_BITS ); /* LSF grid points */ - push_next_indice_fx( hBstr, hBWE_TD->grid_idx, NUM_LSF_GRID_BITS ); + push_next_indice( hBstr, hBWE_TD->grid_idx, NUM_LSF_GRID_BITS ); } /* Gain shape */ - push_next_indice_fx( hBstr, hBWE_TD->idxSubGains, NUM_BITS_SHB_SUBGAINS ); + push_next_indice( hBstr, hBWE_TD->idxSubGains, NUM_BITS_SHB_SUBGAINS ); /* frame gain */ - push_next_indice_fx( hBstr, hBWE_TD->idxFrameGain, NUM_BITS_SHB_FRAMEGAIN ); + push_next_indice( hBstr, hBWE_TD->idxFrameGain, NUM_BITS_SHB_FRAMEGAIN ); IF( GE_32( st_fx->total_brate, ACELP_24k40 ) ) { /* sub frame energy*/ - push_next_indice_fx( hBstr, hBWE_TD->idx_shb_fr_gain, NUM_BITS_SHB_ENER_SF ); + push_next_indice( hBstr, hBWE_TD->idx_shb_fr_gain, NUM_BITS_SHB_ENER_SF ); /* gain shapes residual */ FOR( i = 0; i < NB_SUBFR16k; i++ ) { - push_next_indice_fx( hBstr, hBWE_TD->idx_res_gs[i], NUM_BITS_SHB_RES_GS ); + push_next_indice( hBstr, hBWE_TD->idx_res_gs[i], NUM_BITS_SHB_RES_GS ); } /* voicing factor */ - push_next_indice_fx( hBstr, hBWE_TD->idx_mixFac, NUM_BITS_SHB_VF ); + push_next_indice( hBstr, hBWE_TD->idx_mixFac, NUM_BITS_SHB_VF ); } IF( EQ_16( st_fx->tec_tfa, 1 ) ) { - push_next_indice_fx( hBstr, st_fx->tec_flag, BITS_TEC ); - push_next_indice_fx( hBstr, st_fx->tfa_flag, BITS_TFA ); + push_next_indice( hBstr, st_fx->tec_flag, BITS_TEC ); + push_next_indice( hBstr, st_fx->tfa_flag, BITS_TFA ); } } IF( EQ_16( st_fx->bwidth, FB ) ) { - push_next_indice_fx( hBstr, hBWE_TD->idxGain, 4 ); + push_next_indice( hBstr, hBWE_TD->idxGain, 4 ); } } -- GitLab From 9591d921755e6f02cc087afadbf0b16082dbec60 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 25 Mar 2025 15:03:51 -0400 Subject: [PATCH 04/14] replace other EVS bitstream related stuff --- lib_com/bitstream_fx.c | 9 ++++++--- lib_enc/ACcontextMapping_enc_fx.c | 6 +++--- lib_enc/enc_prm_fx.c | 2 +- lib_enc/igf_enc.c | 4 ++-- lib_enc/igf_enc_fx.c | 4 ++-- lib_enc/lib_enc.c | 2 ++ lib_enc/tcx_utils_enc_fx.c | 26 +++++++++++++++++++++----- 7 files changed, 37 insertions(+), 16 deletions(-) diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index 8cb968bf1..d3aab2616 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -314,11 +314,10 @@ void push_next_indice_fx( return; } -#endif /*-------------------------------------------------------------------* - * push_next_bits_fx() + * push_next_bits() * Push a bit buffer into the buffer at the next position *-------------------------------------------------------------------*/ @@ -368,6 +367,7 @@ void push_next_bits_fx( hBstr->nb_bits_tot = add( hBstr->nb_bits_tot, nb_bits ); move16(); } +#endif /*-------------------------------------------------------------------* * get_next_indice_fx( ) @@ -565,6 +565,7 @@ void reset_indices_dec_fx( * * Write the buffer of indices to a file *-------------------------------------------------------------------*/ +#if 0 void write_indices_fx( Encoder_State *st_fx, /* i/o: encoder state structure */ @@ -663,12 +664,13 @@ void write_indices_fx( return; } +#endif /*-------------------------------------------------------------------* * write_indices_buf_fx() * * Write the buffer of indices to a file *-------------------------------------------------------------------*/ - +#if 0 void write_indices_buf_fx( Encoder_State *st_fx, /* i/o: encoder state structure */ BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */ @@ -772,6 +774,7 @@ void write_indices_buf_fx( return; } +#endif /*-------------------------------------------------------------------* * indices_to_serial() * diff --git a/lib_enc/ACcontextMapping_enc_fx.c b/lib_enc/ACcontextMapping_enc_fx.c index 4e02b1f11..43bd30fd4 100644 --- a/lib_enc/ACcontextMapping_enc_fx.c +++ b/lib_enc/ACcontextMapping_enc_fx.c @@ -346,10 +346,10 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx( push_next_indice( hBstr, value, nbbits_ntuples ); /* Push arithmetic coded bits */ - push_next_bits_fx( hBstr, &ptr[nbbits_ntuples], sub( bp, nbbits_ntuples ) ); + push_next_bits( hBstr, (UWord16 *) &ptr[nbbits_ntuples], sub( bp, nbbits_ntuples ) ); /* Push sign bits */ - push_next_bits_fx( hBstr, signs, nbbits_signs ); + push_next_bits( hBstr, (UWord16 *) signs, nbbits_signs ); bp = add( bp, nbbits_signs ); /* Q0 */ /*write residual Quantization bits*/ @@ -372,7 +372,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx( assert( bp + k <= nbbits ); /* Push the rest of the buffer */ - push_next_bits_fx( hBstr, &ptr[bp], sub( nbbits, bp ) ); + push_next_bits( hBstr, (UWord16 *) &ptr[bp], sub( nbbits, bp ) ); return /*(bp+nbbits_lsbs)*/; /*return only for debug plot*/ } diff --git a/lib_enc/enc_prm_fx.c b/lib_enc/enc_prm_fx.c index 6c052e596..1d619e6c5 100644 --- a/lib_enc/enc_prm_fx.c +++ b/lib_enc/enc_prm_fx.c @@ -965,7 +965,7 @@ void enc_prm_fx( IF( hTcxEnc->tcx_lpc_shaped_ari != 0 ) { - push_next_bits_fx( hBstr, &prm[++j], nbits_tcx ); + push_next_bits( hBstr, ( UWord16 * ) &prm[++j], nbits_tcx ); j = add( j, nbits_tcx ); /* Q0 */ } ELSE diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index 2680bd9f6..d0c9fa329 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -2429,7 +2429,7 @@ void IGFEncSetMode_ivas_fx( * * IGF bitstream concatenation for TCX10 modes *-------------------------------------------------------------------*/ - +#if 0 /* Float code */ void IGFEncConcatenateBitstream( const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ const Word16 bsBits, /* i : number of IGF bits written to list of indices */ @@ -2487,7 +2487,7 @@ move16(); return; } - +#endif /*-------------------------------------------------------------------* * IGFEncResetTCX10BitCounter_ivas_fx() diff --git a/lib_enc/igf_enc_fx.c b/lib_enc/igf_enc_fx.c index f5c13df57..a8a64422f 100644 --- a/lib_enc/igf_enc_fx.c +++ b/lib_enc/igf_enc_fx.c @@ -1449,7 +1449,7 @@ hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, nb_bits_written ); return; } - +#if 0 /* old bitstream */ /**********************************************************************/ /* IGF bitsream concatenation for TCX10 modes **************************************************************************/ @@ -1475,7 +1475,7 @@ void IGFEncConcatenateBitstream_fx( const IGF_ENC_INSTANCE_HANDLE hInstance, /** move16(); return; } - +#endif /**********************************************************************/ /* IGF reset bitsream bit counter for TCX10 modes **************************************************************************/ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 877fc2045..b17ba61df 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1892,6 +1892,7 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( } /* write indices into bitstream buffer */ +#if 0 IF( hEncoderConfig->element_mode_init == EVS_MONO ) { test(); @@ -1905,6 +1906,7 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( } } ELSE +#endif { write_indices_ivas_fx( st_ivas, outputBitStream, numOutBits ); } diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index 7d268b92a..fd6293124 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -3650,7 +3650,7 @@ Word16 tcx_res_Q_spec_ivas_fx( return bits; } - +#if 1 //TV void ProcessIGF_fx( IGF_ENC_INSTANCE_HANDLE const hInstance, /**< in: instance handle of IGF Encoder */ Encoder_State *st, /**< in: Encoder state */ @@ -3667,8 +3667,9 @@ void ProcessIGF_fx( Word16 igfGridIdx; Word16 isIndepFlag; Word16 bsBits; - Word16 bsStart; + Word16 bsStart, pBsStart; BSTR_ENC_HANDLE hBstr = st->hBstr; + IGF_ENC_INSTANCE_HANDLE hIGFEnc = st->hIGFEnc; isIndepFlag = 1; @@ -3721,6 +3722,8 @@ void ProcessIGF_fx( Word16 Q_A; Word16 predictionGain = 0; Word16 *flatteningTrigger = &( st->hIGFEnc->flatteningTrigger ); + + move32(); move16(); move16(); @@ -3750,6 +3753,7 @@ void ProcessIGF_fx( { IGFEncWriteBitstream_fx( hInstance, NULL, &hInstance->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); } +#if 0 ELSE { IGFEncWriteBitstream_fx( hInstance, st->hBstr, &hInstance->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); @@ -3760,8 +3764,20 @@ void ProcessIGF_fx( { IGFEncConcatenateBitstream_fx( hInstance, bsBits, &hBstr->next_ind_fx, &hBstr->nb_bits_tot, hBstr->ind_list ); } -} +#else + ELSE + { + pBsStart = hBstr->nb_ind_tot; + move16(); + + IGFEncWriteBitstream_ivas_fx( hIGFEnc, hBstr, &hIGFEnc->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); + bsBits = sub( hBstr->nb_ind_tot, pBsStart ); + IGFEncConcatenateBitstream_ivas_fx( hIGFEnc, bsBits, hBstr ); + } +#endif +} + #endif void attenuateNbSpectrum_fx( Word16 L_frame, Word32 *spectrum ) { Word16 i, length, att; @@ -3877,7 +3893,7 @@ void ProcessIGF_ivas_fx( IGFEncWriteBitstream_ivas_fx( hIGFEnc, hBstr, &hIGFEnc->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); bsBits = sub( hBstr->nb_ind_tot, pBsStart ); - IGFEncConcatenateBitstream( hIGFEnc, bsBits, hBstr ); + IGFEncConcatenateBitstream_ivas_fx( hIGFEnc, bsBits, hBstr ); } return; @@ -3981,7 +3997,7 @@ void ProcessStereoIGF_fx( IGFEncWriteBitstream_ivas_fx( hIGFEnc[ch], hBstr, &hIGFEnc[ch]->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); bsBits = sub( hBstr->nb_ind_tot, pBsStart ); - IGFEncConcatenateBitstream( hIGFEnc[ch], bsBits, hBstr ); + IGFEncConcatenateBitstream_ivas_fx( hIGFEnc[ch], bsBits, hBstr ); } } return; -- GitLab From bb876b28b8dbda2b645171bb99f8c5877501f058 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 25 Mar 2025 15:06:06 -0400 Subject: [PATCH 05/14] fix clang --- lib_com/bitstream_fx.c | 2 +- lib_enc/enc_prm_fx.c | 4 ++-- lib_enc/tcx_utils_enc_fx.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index d3aab2616..f0e564a8a 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -664,7 +664,7 @@ void write_indices_fx( return; } -#endif +#endif /*-------------------------------------------------------------------* * write_indices_buf_fx() * diff --git a/lib_enc/enc_prm_fx.c b/lib_enc/enc_prm_fx.c index 1d619e6c5..6d6a2d575 100644 --- a/lib_enc/enc_prm_fx.c +++ b/lib_enc/enc_prm_fx.c @@ -583,7 +583,7 @@ void enc_prm_fx( } push_next_indice( hBstr, idx - start_idx, nBits ); push_next_indice( hBstr, 0, 1 ); /* Indicate to the decoder that the core is ACELP*/ - nbits_start = 3; /* Q0 */ + nbits_start = 3; /* Q0 */ } ELSE { @@ -965,7 +965,7 @@ void enc_prm_fx( IF( hTcxEnc->tcx_lpc_shaped_ari != 0 ) { - push_next_bits( hBstr, ( UWord16 * ) &prm[++j], nbits_tcx ); + push_next_bits( hBstr, (UWord16 *) &prm[++j], nbits_tcx ); j = add( j, nbits_tcx ); /* Q0 */ } ELSE diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index fd6293124..06de6a2fa 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -3650,7 +3650,7 @@ Word16 tcx_res_Q_spec_ivas_fx( return bits; } -#if 1 //TV +#if 1 // TV void ProcessIGF_fx( IGF_ENC_INSTANCE_HANDLE const hInstance, /**< in: instance handle of IGF Encoder */ Encoder_State *st, /**< in: Encoder state */ @@ -3777,7 +3777,7 @@ void ProcessIGF_fx( } #endif } - #endif +#endif void attenuateNbSpectrum_fx( Word16 L_frame, Word32 *spectrum ) { Word16 i, length, att; -- GitLab From 2aa5710dacbe699f30781227bfbf45088225bf6d Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 25 Mar 2025 15:13:41 -0400 Subject: [PATCH 06/14] fix clang --- lib_enc/tcx_utils_enc_fx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index 06de6a2fa..ec1db2cf3 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -3667,7 +3667,11 @@ void ProcessIGF_fx( Word16 igfGridIdx; Word16 isIndepFlag; Word16 bsBits; +#if 0 Word16 bsStart, pBsStart; +#else + Word16 pBsStart; +#endif BSTR_ENC_HANDLE hBstr = st->hBstr; IGF_ENC_INSTANCE_HANDLE hIGFEnc = st->hIGFEnc; @@ -3744,8 +3748,9 @@ void ProcessIGF_fx( } } +#if 0 bsStart = hBstr->next_ind_fx; - +#endif move16(); hInstance->infoTotalBitsPerFrameWritten = 0; move16(); -- GitLab From 8f109c520aa15d566107d3273893c11c30b52a1d Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Wed, 26 Mar 2025 09:06:17 -0400 Subject: [PATCH 07/14] work on encoder config duplication --- lib_enc/ivas_init_enc_fx.c | 46 ++++++++++++++++++-------------------- lib_enc/lib_enc.c | 10 ++++++--- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/lib_enc/ivas_init_enc_fx.c b/lib_enc/ivas_init_enc_fx.c index 57858b03e..19996e2e4 100644 --- a/lib_enc/ivas_init_enc_fx.c +++ b/lib_enc/ivas_init_enc_fx.c @@ -463,7 +463,7 @@ void ivas_initialize_handles_enc_fx( * * Initialize IVAS encoder state structure *-------------------------------------------------------------------*/ - +#if 0 ivas_error ivas_init_encoder( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ) @@ -1073,6 +1073,7 @@ ivas_error ivas_init_encoder( } return error; } +#endif ivas_error ivas_init_encoder_fx( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ) @@ -1100,10 +1101,10 @@ ivas_error ivas_init_encoder_fx( hEncoderConfig->last_ivas_total_brate = ivas_total_brate; /* Q0 */ move32(); - IF( NE_16( ivas_format, MONO_FORMAT ) ) + if ( NE_16( ivas_format, MONO_FORMAT ) ) { /* In IVAS, ensure that minimum coded bandwidth is WB */ - hEncoderConfig->max_bwidth = extract_l( L_max( hEncoderConfig->max_bwidth, WB ) ); /* Q0 */ + hEncoderConfig->max_bwidth = s_max( hEncoderConfig->max_bwidth, WB ); /* Q0 */ move16(); } st_ivas->ism_mode = ISM_MODE_NONE; @@ -1142,7 +1143,10 @@ ivas_error ivas_init_encoder_fx( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point input audio buffer!\n" ) ); } + set32_fx( st_ivas->p_data_fx[n], 0, extract_l( Mpy_32_16_1( input_Fs, INV_FRAME_PER_SEC_Q15 ) ) ); } + st_ivas->q_data_fx = Q11; + move16(); FOR( ; n < MAX_INPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) { st_ivas->p_data_fx[n] = NULL; @@ -1196,7 +1200,7 @@ ivas_error ivas_init_encoder_fx( /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles *-----------------------------------------------------------------*/ - test(); + IF( EQ_32( ivas_format, MONO_FORMAT ) ) { st_ivas->nSCE = 1; /* in mono, there is always only one SCE */ @@ -1209,19 +1213,9 @@ ivas_error ivas_init_encoder_fx( move16(); test(); - IF( st_ivas->hEncoderConfig->element_mode_init == EVS_MONO ) + IF( NE_32( ( error = create_evs_sce_enc_fx( st_ivas, sce_id, ivas_total_brate ) ), IVAS_ERR_OK ) ) { - IF( NE_32( ( error = create_evs_sce_enc_fx( st_ivas, sce_id, ivas_total_brate ) ), IVAS_ERR_OK ) ) - { - return error; - } - } - ELSE - { - IF( ( error = create_sce_enc_fx( st_ivas, sce_id, ivas_total_brate ) ) != IVAS_ERR_OK ) - { - return error; - } + return error; } /* prepare stereo downmix for EVS */ @@ -1342,7 +1336,7 @@ ivas_error ivas_init_encoder_fx( FOR( n = 0; n < CPE_CHANNELS; n++ ) { - IF( hEncoderConfig->Opt_DTX_ON ) + if ( hEncoderConfig->Opt_DTX_ON ) { st_ivas->hCPE[cpe_id]->hCoreCoder[n]->cng_sba_flag = 1; move16(); @@ -1350,7 +1344,7 @@ ivas_error ivas_init_encoder_fx( } } - IF( st_ivas->nCPE > 1 ) + IF( GT_16( st_ivas->nCPE, 1 ) ) { IF( ( error = create_mct_enc_fx( st_ivas ) ) != IVAS_ERR_OK ) { @@ -1358,7 +1352,7 @@ ivas_error ivas_init_encoder_fx( } } } - ELSE IF( EQ_32( ivas_format, MASA_ISM_FORMAT ) ) + ELSE IF( EQ_16( ivas_format, MASA_ISM_FORMAT ) ) { Word32 ism_total_brate; Word16 k; @@ -1428,12 +1422,12 @@ ivas_error ivas_init_encoder_fx( ELSE IF( EQ_32( ivas_format, SBA_ISM_FORMAT ) ) { st_ivas->ism_mode = ISM_MODE_NONE; - move32(); + move16(); IF( GE_32( ivas_total_brate, IVAS_256k ) ) { st_ivas->ism_mode = ISM_SBA_MODE_DISC; - move32(); + move16(); } IF( ( error = ivas_ism_metadata_enc_create_fx( st_ivas, hEncoderConfig->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) @@ -1523,7 +1517,7 @@ ivas_error ivas_init_encoder_fx( return error; } - IF( NE_32( st_ivas->mc_mode, MC_MODE_MCT ) ) + IF( EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) ) { st_ivas->nSCE = 0; move16(); @@ -1596,7 +1590,9 @@ ivas_error ivas_init_encoder_fx( FOR( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) { - IF( ( error = create_cpe_enc_fx( st_ivas, cpe_id, ivas_total_brate / ( st_ivas->nCPE + st_ivas->nSCE ) ) ) != IVAS_ERR_OK ) + Word32 res_dec, res_frac; + iDiv_and_mod_32( ivas_total_brate, add( st_ivas->nCPE, st_ivas->nSCE ), &res_dec, &res_frac, 0 ); + IF( ( error = create_cpe_enc_fx( st_ivas, cpe_id, res_dec ) ) != IVAS_ERR_OK ) { return error; } @@ -1658,7 +1654,9 @@ ivas_error ivas_init_encoder_fx( *-----------------------------------------------------------------*/ /* set number of input channels used for analysis/coding */ - n = getNumChanAnalysis_fx( st_ivas ); + n = getNumChanAnalysis_fx( st_ivas ); /* Q0 */ + move16(); + IF( n > 0 ) { IF( ( st_ivas->mem_hp20_in_fx = (Word32 **) malloc( n * sizeof( Word32 * ) ) ) == NULL ) diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index b17ba61df..52734b4bd 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -70,7 +70,7 @@ struct IVAS_ENC * Local functions *---------------------------------------------------------------------*/ -static ivas_error configureEncoder_fx( IVAS_ENC_HANDLE hIvasEnc, const Word32 inputFs, const Word32 initBitrate, const IVAS_ENC_BANDWIDTH initBandwidth, const IVAS_ENC_DTX_CONFIG dtxConfig, const IVAS_ENC_CHANNEL_AWARE_CONFIG caConfig ); +//static ivas_error configureEncoder_fx( IVAS_ENC_HANDLE hIvasEnc, const Word32 inputFs, const Word32 initBitrate, const IVAS_ENC_BANDWIDTH initBandwidth, const IVAS_ENC_DTX_CONFIG dtxConfig, const IVAS_ENC_CHANNEL_AWARE_CONFIG caConfig ); static ivas_error setBandwidth_fx( IVAS_ENC_HANDLE hIvasEnc, const IVAS_ENC_BANDWIDTH maxBandwidth ); static ivas_error setChannelAwareConfig_fx( IVAS_ENC_HANDLE hIvasEnc, const IVAS_ENC_CHANNEL_AWARE_CONFIG caConfig ); static ivas_error sanitizeBandwidth_fx( const IVAS_ENC_HANDLE hIvasEnc ); @@ -609,6 +609,7 @@ ivas_error IVAS_ENC_ConfigureForAmbisonics( return error; } +#if 0 ivas_error IVAS_ENC_ConfigureForAmbisonics_fx( IVAS_ENC_HANDLE hIvasEnc, /* i/o: IVAS encoder handle */ const Word32 inputFs, /* i : input sampling frequency */ @@ -649,11 +650,12 @@ ivas_error IVAS_ENC_ConfigureForAmbisonics_fx( hIvasEnc->maxBandwidthUser = max_bwidth_user; - error = configureEncoder_fx( hIvasEnc, inputFs, bitrate, maxBandwidth, dtxConfig, IVAS_ENC_GetDefaultChannelAwareConfig() ); + error = configureEncoder( hIvasEnc, inputFs, bitrate, maxBandwidth, dtxConfig, IVAS_ENC_GetDefaultChannelAwareConfig() ); return error; } +#endif /*---------------------------------------------------------------------* * IVAS_ENC_ConfigureForSBAObjects() * @@ -1188,7 +1190,7 @@ static ivas_error configureEncoder( * Finalize initialization *-----------------------------------------------------------------*/ - IF( ( error = ivas_init_encoder( st_ivas ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_init_encoder_fx( st_ivas ) ) != IVAS_ERR_OK ) { return error; } @@ -1211,6 +1213,7 @@ static ivas_error configureEncoder( return error; } +#if 0 static ivas_error configureEncoder_fx( IVAS_ENC_HANDLE hIvasEnc, const Word32 inputFs, @@ -1543,6 +1546,7 @@ static ivas_error configureEncoder_fx( return error; } +#endif /*---------------------------------------------------------------------* * IVAS_ENC_GetDelay() * -- GitLab From 1597e6dd757408df3772eacb2b4266524045a8d1 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Wed, 26 Mar 2025 13:46:47 -0400 Subject: [PATCH 08/14] Addition of compiler switch, code compiles and run, but not BE --- lib_com/bitstream_fx.c | 7 +++--- lib_com/options.h | 2 ++ lib_enc/igf_enc.c | 2 +- lib_enc/igf_enc_fx.c | 2 +- lib_enc/init_enc_fx.c | 48 ++++++++++++++++++++++++++++---------- lib_enc/ivas_init_enc_fx.c | 7 +++--- lib_enc/ivas_sce_enc_fx.c | 27 +++++++++++++++++---- lib_enc/lib_enc.c | 6 ++--- lib_enc/tcx_utils_enc_fx.c | 6 ++--- 9 files changed, 76 insertions(+), 31 deletions(-) diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index f0e564a8a..f29dc6aee 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -244,7 +244,7 @@ Word16 rate2EVSmode( * * Push a new indice into the buffer *-------------------------------------------------------------------*/ -#if 0 +#ifndef HARM_PUSH_BIT void push_indice_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */ Word16 id, /* i : ID of the indice */ @@ -565,8 +565,7 @@ void reset_indices_dec_fx( * * Write the buffer of indices to a file *-------------------------------------------------------------------*/ -#if 0 - +#ifndef HARM_PUSH_BIT void write_indices_fx( Encoder_State *st_fx, /* i/o: encoder state structure */ BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */ @@ -670,7 +669,7 @@ void write_indices_fx( * * Write the buffer of indices to a file *-------------------------------------------------------------------*/ -#if 0 +#ifndef HARM_PUSH_BIT void write_indices_buf_fx( Encoder_State *st_fx, /* i/o: encoder state structure */ BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */ diff --git a/lib_com/options.h b/lib_com/options.h index 2133b86ac..183edaa71 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -75,4 +75,6 @@ /* Both following 2 macros (IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST*) are independent from each other, they refer to different code blocks */ #define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE /* FhG: reduces WMOPS of param_mc_prm_est, bit-exact to previous version */ #define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE /* FhG: reduces WMOPS of param_mc_prm_est, not bit-exact to previous version */ +#define HARM_PUSH_BIT +#define HARM_ENC_INIT #endif diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index d0c9fa329..c8e8974c2 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -2429,7 +2429,7 @@ void IGFEncSetMode_ivas_fx( * * IGF bitstream concatenation for TCX10 modes *-------------------------------------------------------------------*/ -#if 0 /* Float code */ +#ifndef HARM_PUSH_BIT /* Float code */ void IGFEncConcatenateBitstream( const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ const Word16 bsBits, /* i : number of IGF bits written to list of indices */ diff --git a/lib_enc/igf_enc_fx.c b/lib_enc/igf_enc_fx.c index a8a64422f..96f8d0202 100644 --- a/lib_enc/igf_enc_fx.c +++ b/lib_enc/igf_enc_fx.c @@ -1449,7 +1449,7 @@ hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, nb_bits_written ); return; } -#if 0 /* old bitstream */ +#ifndef HARM_PUSH_BIT /* old bitstream */ /**********************************************************************/ /* IGF bitsream concatenation for TCX10 modes **************************************************************************/ diff --git a/lib_enc/init_enc_fx.c b/lib_enc/init_enc_fx.c index ea944dd75..4913e410d 100644 --- a/lib_enc/init_enc_fx.c +++ b/lib_enc/init_enc_fx.c @@ -20,6 +20,7 @@ * * Initialization of state variables *-----------------------------------------------------------------------*/ +#if 1 ivas_error init_encoder_fx( Encoder_State *st_fx /* i/o: Encoder static variables structure */ ) @@ -946,6 +947,7 @@ ivas_error init_encoder_fx( move32(); return error; } +#endif /*-----------------------------------------------------------------------* * LPDmem_enc_init_fx() * @@ -1498,14 +1500,7 @@ ivas_error init_encoder_ivas_fx( IF( st->element_mode == EVS_MONO ) { /* This is done to as in EVS T_CldfbVadState structure is present in Encoder State */ - /* - if ( ( st->hVAD_CLDFB = (VAD_CLDFB_HANDLE) malloc( sizeof( T_CldfbVadState ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB VAD\n" ) ); - } - */ st->hVAD_CLDFB = &st->vad_st; - vad_init_fx( st->hVAD_CLDFB ); } ELSE @@ -1670,9 +1665,23 @@ ivas_error init_encoder_ivas_fx( test(); IF( ( NE_16( st->element_mode, IVAS_CPE_MDCT ) && idchan == 0 ) || ( EQ_16( st->element_mode, IVAS_CPE_MDCT ) && st->Opt_DTX_ON ) ) { - IF( ( error = openCldfb_ivas_fx( &st->cldfbAnaEnc, CLDFB_ANALYSIS, st->input_Fs, CLDFB_PROTOTYPE_1_25MS, ENC ) ) != IVAS_ERR_OK ) + IF( EQ_16( st->element_mode, EVS_MONO ) ) { - return error; + /* open analysis for input SR */ + st->input_frame_fx = extract_l( Mult_32_16( st->input_Fs, 0x0290 ) ); + + if ( ( error = openCldfb( &st->cldfbAnaEnc, CLDFB_ANALYSIS, CLDFB_getNumChannels( st->input_Fs ), st->input_frame_fx ) ) != IVAS_ERR_OK ) + { + return error; + } + } + ELSE + { + + IF( ( error = openCldfb_ivas_fx( &st->cldfbAnaEnc, CLDFB_ANALYSIS, st->input_Fs, CLDFB_PROTOTYPE_1_25MS, ENC ) ) != IVAS_ERR_OK ) + { + return error; + } } } ELSE @@ -1784,11 +1793,20 @@ ivas_error init_encoder_ivas_fx( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD BWE\n" ) ); } - IF( ( error = openCldfb_ivas_fx( &st->cldfbSynTd, CLDFB_SYNTHESIS, 16000, CLDFB_PROTOTYPE_1_25MS, ENC ) ) != IVAS_ERR_OK ) + IF( st->element_mode == EVS_MONO ) { - return error; + if ( ( error = openCldfb( &st->cldfbSynTd, CLDFB_SYNTHESIS, CLDFB_getNumChannels( 16000 ), L_FRAME16k ) ) != IVAS_ERR_OK ) + { + return error; + } + } + ELSE + { + IF( ( error = openCldfb_ivas_fx( &st->cldfbSynTd, CLDFB_SYNTHESIS, 16000, CLDFB_PROTOTYPE_1_25MS, ENC ) ) != IVAS_ERR_OK ) + { + return error; + } } - InitSWBencBuffer_ivas_fx( st ); ResetSHBbuffer_Enc_fx( st ); } @@ -2144,7 +2162,13 @@ ivas_error init_encoder_ivas_fx( } ELSE { +#ifndef HARM_ENC_INIT InitTransientDetection_ivas_fx( frame_length, NS2SA_FX2( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet, 0 ); +#else + InitTransientDetection_fx( extract_l( Mult_32_16( st->input_Fs, 0x0290 ) ), + NS2SA_FX2( st->input_Fs, DELAY_FIR_RESAMPL_NS ), + &st->transientDetection ); +#endif } /*-----------------------------------------------------------------* diff --git a/lib_enc/ivas_init_enc_fx.c b/lib_enc/ivas_init_enc_fx.c index 19996e2e4..7c72d4780 100644 --- a/lib_enc/ivas_init_enc_fx.c +++ b/lib_enc/ivas_init_enc_fx.c @@ -269,7 +269,7 @@ Word16 getNumChanAnalysis_fx( return n; } - +#ifndef HARM_ENC_INIT /*-------------------------------------------------------------------* * copy_encoder_config_ivas_fx() * @@ -321,6 +321,7 @@ void copy_encoder_config_ivas_fx( return; } +#endif /*-------------------------------------------------------------------* * copy_encoder_config_fx() * @@ -463,7 +464,7 @@ void ivas_initialize_handles_enc_fx( * * Initialize IVAS encoder state structure *-------------------------------------------------------------------*/ -#if 0 +#ifndef HARM_ENC_INIT ivas_error ivas_init_encoder( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ) @@ -1213,7 +1214,7 @@ ivas_error ivas_init_encoder_fx( move16(); test(); - IF( NE_32( ( error = create_evs_sce_enc_fx( st_ivas, sce_id, ivas_total_brate ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = create_sce_enc_fx( st_ivas, sce_id, ivas_total_brate ) ), IVAS_ERR_OK ) ) { return error; } diff --git a/lib_enc/ivas_sce_enc_fx.c b/lib_enc/ivas_sce_enc_fx.c index f1631ba4f..3f80cce2b 100644 --- a/lib_enc/ivas_sce_enc_fx.c +++ b/lib_enc/ivas_sce_enc_fx.c @@ -466,12 +466,31 @@ ivas_error create_sce_enc_fx( st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; move32(); move32(); - + st->max_bwidth = st_ivas->hEncoderConfig->max_bwidth; + st->input_Fs = st_ivas->hEncoderConfig->input_Fs; + st->input_frame_fx = extract_l( Mult_32_16( st->input_Fs, 0x0290 ) ); +#if 0 + IF( NE_32( ( error = init_encoder_ivas_fx( st, st_ivas, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode, hSCE->element_brate ) ), IVAS_ERR_OK ) ) + //IF( NE_32( ( error = init_encoder_ivas_fx( st, st_ivas, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode, hSCE->element_brate ) ), IVAS_ERR_OK ) ) + { + return error; + } +#else IF( NE_32( ( error = init_encoder_ivas_fx( st, st_ivas, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode, hSCE->element_brate ) ), IVAS_ERR_OK ) ) + //IF( NE_32( ( error = init_encoder_ivas_fx( st, st_ivas, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode, hSCE->element_brate ) ), IVAS_ERR_OK ) ) { return error; } - hSCE->hCoreCoder[0] = st; + //IF( NE_32( ( error = init_encoder_fx( st) ), IVAS_ERR_OK ) ) + //{ + // return error; + //} + + //st->hBstr->ind_list = ind_list; + // st_fx->hBstr->ind_list_fx = st->hBstr->ind_list; + //reset_indices_enc_fx( st->hBstr, MAX_NUM_INDICES ); +#endif + hSCE->hCoreCoder[0] = st; st_ivas->hSCE[sce_id] = hSCE; @@ -483,7 +502,7 @@ ivas_error create_sce_enc_fx( * * Create, allocate and initialize EVS encoder SCE handle *-------------------------------------------------------------------------*/ - +#if 0 ivas_error create_evs_sce_enc_fx( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ const Word16 sce_id, /* i : SCE # identifier */ @@ -614,7 +633,7 @@ ivas_error create_evs_sce_enc_fx( return error; } - +#endif /*------------------------------------------------------------------------- * destroy_sce_enc_fx() * diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 52734b4bd..fdf410df5 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -609,7 +609,7 @@ ivas_error IVAS_ENC_ConfigureForAmbisonics( return error; } -#if 0 +#ifndef HARM_ENC_INIT ivas_error IVAS_ENC_ConfigureForAmbisonics_fx( IVAS_ENC_HANDLE hIvasEnc, /* i/o: IVAS encoder handle */ const Word32 inputFs, /* i : input sampling frequency */ @@ -1213,7 +1213,7 @@ static ivas_error configureEncoder( return error; } -#if 0 +#ifndef HARM_ENC_INIT static ivas_error configureEncoder_fx( IVAS_ENC_HANDLE hIvasEnc, const Word32 inputFs, @@ -1896,7 +1896,7 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( } /* write indices into bitstream buffer */ -#if 0 +#ifndef HARM_PUSH_BIT IF( hEncoderConfig->element_mode_init == EVS_MONO ) { test(); diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index ec1db2cf3..5bea901bb 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -3667,7 +3667,7 @@ void ProcessIGF_fx( Word16 igfGridIdx; Word16 isIndepFlag; Word16 bsBits; -#if 0 +#ifndef HARM_PUSH_BIT Word16 bsStart, pBsStart; #else Word16 pBsStart; @@ -3748,7 +3748,7 @@ void ProcessIGF_fx( } } -#if 0 +#ifndef HARM_PUSH_BIT bsStart = hBstr->next_ind_fx; #endif move16(); @@ -3758,7 +3758,7 @@ void ProcessIGF_fx( { IGFEncWriteBitstream_fx( hInstance, NULL, &hInstance->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); } -#if 0 +#ifndef HARM_PUSH_BIT ELSE { IGFEncWriteBitstream_fx( hInstance, st->hBstr, &hInstance->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); -- GitLab From c100d602b808183aea6cca0f0ccdf47db47b89e2 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Wed, 26 Mar 2025 14:08:20 -0400 Subject: [PATCH 09/14] fix BE issue, still crashed mid-file --- lib_com/options.h | 1 + lib_enc/ivas_init_enc_fx.c | 10 ++++++++-- lib_enc/ivas_sce_enc_fx.c | 41 +++++++++++++++++++++----------------- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 183edaa71..4653bb460 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -77,4 +77,5 @@ #define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE /* FhG: reduces WMOPS of param_mc_prm_est, not bit-exact to previous version */ #define HARM_PUSH_BIT #define HARM_ENC_INIT +//#define HARM_SCE_INIT #endif diff --git a/lib_enc/ivas_init_enc_fx.c b/lib_enc/ivas_init_enc_fx.c index 7c72d4780..04b99f039 100644 --- a/lib_enc/ivas_init_enc_fx.c +++ b/lib_enc/ivas_init_enc_fx.c @@ -1212,13 +1212,19 @@ ivas_error ivas_init_encoder_fx( move16(); sce_id = 0; move16(); - +#ifndef HARM_SCE_INIT + test(); + IF( NE_32( ( error = create_evs_sce_enc_fx( st_ivas, sce_id, ivas_total_brate ) ), IVAS_ERR_OK ) ) + { + return error; + } +#else test(); IF( NE_32( ( error = create_sce_enc_fx( st_ivas, sce_id, ivas_total_brate ) ), IVAS_ERR_OK ) ) { return error; } - +#endif /* prepare stereo downmix for EVS */ IF( EQ_16( hEncoderConfig->stereo_dmx_evs, 1 ) ) { diff --git a/lib_enc/ivas_sce_enc_fx.c b/lib_enc/ivas_sce_enc_fx.c index 3f80cce2b..2e1aed092 100644 --- a/lib_enc/ivas_sce_enc_fx.c +++ b/lib_enc/ivas_sce_enc_fx.c @@ -469,27 +469,11 @@ ivas_error create_sce_enc_fx( st->max_bwidth = st_ivas->hEncoderConfig->max_bwidth; st->input_Fs = st_ivas->hEncoderConfig->input_Fs; st->input_frame_fx = extract_l( Mult_32_16( st->input_Fs, 0x0290 ) ); -#if 0 - IF( NE_32( ( error = init_encoder_ivas_fx( st, st_ivas, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode, hSCE->element_brate ) ), IVAS_ERR_OK ) ) - //IF( NE_32( ( error = init_encoder_ivas_fx( st, st_ivas, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode, hSCE->element_brate ) ), IVAS_ERR_OK ) ) - { - return error; - } -#else + IF( NE_32( ( error = init_encoder_ivas_fx( st, st_ivas, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode, hSCE->element_brate ) ), IVAS_ERR_OK ) ) - //IF( NE_32( ( error = init_encoder_ivas_fx( st, st_ivas, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode, hSCE->element_brate ) ), IVAS_ERR_OK ) ) { return error; } - //IF( NE_32( ( error = init_encoder_fx( st) ), IVAS_ERR_OK ) ) - //{ - // return error; - //} - - //st->hBstr->ind_list = ind_list; - // st_fx->hBstr->ind_list_fx = st->hBstr->ind_list; - //reset_indices_enc_fx( st->hBstr, MAX_NUM_INDICES ); -#endif hSCE->hCoreCoder[0] = st; st_ivas->hSCE[sce_id] = hSCE; @@ -502,7 +486,7 @@ ivas_error create_sce_enc_fx( * * Create, allocate and initialize EVS encoder SCE handle *-------------------------------------------------------------------------*/ -#if 0 +#ifndef HARM_SCE_INIT ivas_error create_evs_sce_enc_fx( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ const Word16 sce_id, /* i : SCE # identifier */ @@ -624,9 +608,30 @@ ivas_error create_evs_sce_enc_fx( { return error; } +#ifdef HARM_PUSH_BIT + /*-----------------------------------------------------------------* + * Bitstream + *-----------------------------------------------------------------*/ + IF( ( st_fx->hBstr = (BSTR_ENC_HANDLE) malloc( sizeof( BSTR_ENC_DATA ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Bitstream structure\n" ) ); + } + + /* set pointer to the buffer of indices */ + st_fx->hBstr->ind_list = st_ivas->ind_list; + st_fx->hBstr->ivas_ind_list_zero = &st_ivas->ind_list; + st_fx->hBstr->ivas_max_num_indices = &st_ivas->ivas_max_num_indices; + st_fx->hBstr->nb_ind_tot = 0; + move16(); + st_fx->hBstr->nb_bits_tot = 0; + move16(); + st_fx->hBstr->st_ivas = st_ivas; +#else st_fx->hBstr->ind_list = ind_list; // st_fx->hBstr->ind_list_fx = st->hBstr->ind_list; reset_indices_enc_fx( st_fx->hBstr, MAX_NUM_INDICES ); +#endif + hSCE->hCoreCoder[0] = st_fx; st_ivas->hSCE[sce_id] = hSCE; -- GitLab From 448c79f670d8581070ed5ecadd5615a1b373c0b8 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Thu, 27 Mar 2025 09:43:27 -0400 Subject: [PATCH 10/14] fix during switching --- lib_com/bitstream_fx.c | 3 ++- lib_enc/acelp_core_switch_enc_fx.c | 18 +++++++++++++++++- lib_enc/stat_enc.h | 3 ++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index f29dc6aee..07a6a632f 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -530,11 +530,12 @@ void reset_indices_enc_fx( move16(); hBstr->nb_bits_tot = 0; move16(); +#ifndef HARM_PUSH_BIT hBstr->next_ind_fx = 0; move16(); hBstr->last_ind_fx = -1; move16(); - +#endif FOR( i = 0; i < max_num_indices; i++ ) { hBstr->ind_list[i].nb_bits = -1; diff --git a/lib_enc/acelp_core_switch_enc_fx.c b/lib_enc/acelp_core_switch_enc_fx.c index 9b0ed8b58..8226748f7 100644 --- a/lib_enc/acelp_core_switch_enc_fx.c +++ b/lib_enc/acelp_core_switch_enc_fx.c @@ -62,7 +62,10 @@ void acelp_core_switch_enc_fx( Word16 Aq[2 * ( M + 1 )]; LPD_state_HANDLE hLPDmem; /* ACELP LPDmem memories */ BSTR_ENC_HANDLE hBstr = st_fx->hBstr; - +#ifdef HARM_PUSH_BIT + UWord16 value; + Word16 nb_bits; +#endif hLPDmem = st_fx->hLPDmem; /* initializations */ @@ -153,6 +156,18 @@ void acelp_core_switch_enc_fx( encod_gen_voic_core_switch_fx( st_fx, st_fx->last_L_frame, inp, Aq, A, T_op, exc, cbrate, shift, Q_new ); +#ifdef HARM_PUSH_BIT + i = find_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START, &value, &nb_bits ); +#ifdef DEBUGGING + assert( i >= 0 && "Internal error in ACELP core switching - unable to find ACELP subframe indices!" ); +#endif + while ( hBstr->ind_list[i].id == TAG_ACELP_SUBFR_LOOP_START ) + { + push_indice( hBstr, IND_CORE_SWITCHING_CELP_SUBFRAME, hBstr->ind_list[i].value, hBstr->ind_list[i].nb_bits ); + i++; + } + delete_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START ); +#else /*----------------------------------------------------------------* * bit-stream: modify the layer of sub frame CELP *----------------------------------------------------------------*/ @@ -165,6 +180,7 @@ void acelp_core_switch_enc_fx( hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].nb_bits = -1; /* Q0 */ move16(); } +#endif /*----------------------------------------------------------------* * BWE encoding *----------------------------------------------------------------*/ diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 64ab13ea2..5305a8bdc 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -92,9 +92,10 @@ 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 */ +#ifndef HARM_PUSH_BIT Word16 next_ind_fx; /* pointer to the next empty slot in the list of indices */ Word16 last_ind_fx; /* last written indice */ - +#endif } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; /*----------------------------------------------------------------------------------* -- GitLab From a69f82222c1b56b8b3cf1f3fc53b445c3f467c59 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Thu, 27 Mar 2025 09:50:15 -0400 Subject: [PATCH 11/14] fix when erasing indices --- lib_enc/cng_enc_fx.c | 4 ++++ lib_enc/eval_pit_contr_fx.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib_enc/cng_enc_fx.c b/lib_enc/cng_enc_fx.c index 221454970..d6cb59b17 100644 --- a/lib_enc/cng_enc_fx.c +++ b/lib_enc/cng_enc_fx.c @@ -2460,8 +2460,12 @@ static void shb_CNG_encod_fx( push_indice( hBstr, IND_SHB_CNG_GAIN, idx_ener_fx, 4 ); push_indice( hBstr, IND_SID_BW, 1, 1 ); +#ifdef HARM_PUSH_BIT + delete_indice( hBstr, IND_CNG_ENV1 ); +#else hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, hBstr->ind_list[IND_CNG_ENV1].nb_bits ); hBstr->ind_list[IND_CNG_ENV1].nb_bits = -1; +#endif move16(); move16(); diff --git a/lib_enc/eval_pit_contr_fx.c b/lib_enc/eval_pit_contr_fx.c index df629f295..5e1c8dfe3 100644 --- a/lib_enc/eval_pit_contr_fx.c +++ b/lib_enc/eval_pit_contr_fx.c @@ -378,6 +378,16 @@ Word16 Pit_exc_contribution_len_fx( /* o : bin where pit move16(); set16_fx( pitch_buf, shl( L_SUBFR, 6 ), NB_SUBFR16k ); + +#ifdef HARM_PUSH_BIT + /* pitch contribution useless - delete all previously written indices belonging to pitch contribution */ + for ( i = TAG_ACELP_SUBFR_LOOP_START; i < TAG_ACELP_SUBFR_LOOP_END; i++ ) + { + delete_indice( hBstr, i ); + } + + delete_indice( hBstr, IND_ES_PRED ); +#else /* pitch contribution useless - delete all previously written indices belonging to pitch contribution */ FOR( i = TAG_ACELP_SUBFR_LOOP_START; i < TAG_ACELP_SUBFR_LOOP_END; i++ ) { @@ -396,6 +406,7 @@ Word16 Pit_exc_contribution_len_fx( /* o : bin where pit hBstr->ind_list[IND_ES_PRED].nb_bits = -1; move16(); } +#endif } IF( LT_32( st_fx->core_brate, CFREQ_BITRATE ) ) { -- GitLab From a2b10d391aaf9aedf613c199ffaa2293ac8ffda4 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Thu, 27 Mar 2025 09:54:11 -0400 Subject: [PATCH 12/14] fix clang --- lib_enc/cng_enc_fx.c | 2 +- lib_enc/igf_enc_fx.c | 2 +- lib_enc/init_enc_fx.c | 2 +- lib_enc/ivas_sce_enc_fx.c | 2 +- lib_enc/lib_enc.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_enc/cng_enc_fx.c b/lib_enc/cng_enc_fx.c index d6cb59b17..b031ca528 100644 --- a/lib_enc/cng_enc_fx.c +++ b/lib_enc/cng_enc_fx.c @@ -2460,7 +2460,7 @@ static void shb_CNG_encod_fx( push_indice( hBstr, IND_SHB_CNG_GAIN, idx_ener_fx, 4 ); push_indice( hBstr, IND_SID_BW, 1, 1 ); -#ifdef HARM_PUSH_BIT +#ifdef HARM_PUSH_BIT delete_indice( hBstr, IND_CNG_ENV1 ); #else hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, hBstr->ind_list[IND_CNG_ENV1].nb_bits ); diff --git a/lib_enc/igf_enc_fx.c b/lib_enc/igf_enc_fx.c index 96f8d0202..f508b313f 100644 --- a/lib_enc/igf_enc_fx.c +++ b/lib_enc/igf_enc_fx.c @@ -1449,7 +1449,7 @@ hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, nb_bits_written ); return; } -#ifndef HARM_PUSH_BIT /* old bitstream */ +#ifndef HARM_PUSH_BIT /* old bitstream */ /**********************************************************************/ /* IGF bitsream concatenation for TCX10 modes **************************************************************************/ diff --git a/lib_enc/init_enc_fx.c b/lib_enc/init_enc_fx.c index 4913e410d..60e6019aa 100644 --- a/lib_enc/init_enc_fx.c +++ b/lib_enc/init_enc_fx.c @@ -1675,7 +1675,7 @@ ivas_error init_encoder_ivas_fx( return error; } } - ELSE + ELSE { IF( ( error = openCldfb_ivas_fx( &st->cldfbAnaEnc, CLDFB_ANALYSIS, st->input_Fs, CLDFB_PROTOTYPE_1_25MS, ENC ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_sce_enc_fx.c b/lib_enc/ivas_sce_enc_fx.c index 2e1aed092..41127a98e 100644 --- a/lib_enc/ivas_sce_enc_fx.c +++ b/lib_enc/ivas_sce_enc_fx.c @@ -474,7 +474,7 @@ ivas_error create_sce_enc_fx( { return error; } - hSCE->hCoreCoder[0] = st; + hSCE->hCoreCoder[0] = st; st_ivas->hSCE[sce_id] = hSCE; diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index fdf410df5..dd01386d8 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -70,7 +70,7 @@ struct IVAS_ENC * Local functions *---------------------------------------------------------------------*/ -//static ivas_error configureEncoder_fx( IVAS_ENC_HANDLE hIvasEnc, const Word32 inputFs, const Word32 initBitrate, const IVAS_ENC_BANDWIDTH initBandwidth, const IVAS_ENC_DTX_CONFIG dtxConfig, const IVAS_ENC_CHANNEL_AWARE_CONFIG caConfig ); +// static ivas_error configureEncoder_fx( IVAS_ENC_HANDLE hIvasEnc, const Word32 inputFs, const Word32 initBitrate, const IVAS_ENC_BANDWIDTH initBandwidth, const IVAS_ENC_DTX_CONFIG dtxConfig, const IVAS_ENC_CHANNEL_AWARE_CONFIG caConfig ); static ivas_error setBandwidth_fx( IVAS_ENC_HANDLE hIvasEnc, const IVAS_ENC_BANDWIDTH maxBandwidth ); static ivas_error setChannelAwareConfig_fx( IVAS_ENC_HANDLE hIvasEnc, const IVAS_ENC_CHANNEL_AWARE_CONFIG caConfig ); static ivas_error sanitizeBandwidth_fx( const IVAS_ENC_HANDLE hIvasEnc ); -- GitLab From 3f70046df9d1c9ae2fc6c373d60b5165a865593a Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Thu, 27 Mar 2025 11:34:05 -0400 Subject: [PATCH 13/14] fix reset indice for dtx case --- lib_enc/dtx_fx.c | 4 ++++ lib_enc/enc_ppp_fx.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib_enc/dtx_fx.c b/lib_enc/dtx_fx.c index 9a66572ab..6d8a29795 100644 --- a/lib_enc/dtx_fx.c +++ b/lib_enc/dtx_fx.c @@ -838,7 +838,11 @@ void dtx_fx( /* reset the bitstream (IVAS format signalling was already written) */ IF( NE_16( st_fx->element_mode, IVAS_CPE_MDCT ) && st_fx->hBstr != NULL ) { +#ifdef HARM_PUSH_BIT + reset_indices_enc_fx( st_fx->hBstr, st_fx->hBstr->nb_ind_tot ); +#else reset_indices_enc_fx( st_fx->hBstr, MAX_NUM_INDICES ); +#endif } } diff --git a/lib_enc/enc_ppp_fx.c b/lib_enc/enc_ppp_fx.c index c2aeaa7ca..9d1ffad60 100644 --- a/lib_enc/enc_ppp_fx.c +++ b/lib_enc/enc_ppp_fx.c @@ -189,8 +189,11 @@ ivas_error encod_ppp_fx( /* We write signalling indices again only in case of bump_up */ /* delete previous indices */ +#ifdef HARM_PUSH_BIT + reset_indices_enc_fx( hBstr, hBstr->nb_ind_tot ); +#else reset_indices_enc_fx( hBstr, MAX_NUM_INDICES ); - +#endif /* signalling matrix (writing of signalling bits) */ signalling_enc_fx( st_fx ); } @@ -373,8 +376,11 @@ ivas_error encod_ppp_ivas_fx( /* We write signalling indices again only in case of bump_up */ /* delete previous indices */ +#ifdef HARM_PUSH_BIT + reset_indices_enc_fx( hBstr, hBstr->nb_ind_tot ); +#else reset_indices_enc_fx( hBstr, MAX_NUM_INDICES ); - +#endif /* signalling matrix (writing of signalling bits) */ signalling_enc_fx( st_fx ); } -- GitLab From 16b3fe618f72cd1b7df54b0c3384092df6d62c85 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Thu, 27 Mar 2025 12:52:49 -0400 Subject: [PATCH 14/14] Fix bitrate switching --- lib_enc/lib_enc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index dd01386d8..063f39dea 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1817,6 +1817,16 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( /* set pointers to the new buffers of indices in each element */ FOR( n = 0; n < st_ivas->nSCE; n++ ) { +#ifdef HARM_PUSH_BIT + st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ind_list = st_ivas->ind_list; + st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ivas_ind_list_zero = &st_ivas->ind_list; + + if ( st_ivas->hSCE[n]->hMetaData != NULL ) + { + st_ivas->hSCE[n]->hMetaData->ind_list = st_ivas->ind_list_metadata; + st_ivas->hSCE[n]->hMetaData->ivas_ind_list_zero = &st_ivas->ind_list_metadata; + } +#else test(); IF( !( hIvasEnc->hCoreCoder == NULL && EQ_32( hEncoderConfig->ivas_format, MONO_FORMAT ) ) ) { @@ -1832,6 +1842,7 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( st_ivas->hSCE[n]->hMetaData->ind_list = st_ivas->ind_list_metadata; st_ivas->hSCE[n]->hMetaData->ivas_ind_list_zero = &st_ivas->ind_list_metadata; } +#endif } FOR( n = 0; n < st_ivas->nCPE; n++ ) -- GitLab