From edcb1ede3e33480d4722822fd11ab447e50c59ac Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Thu, 1 Aug 2024 14:32:30 +0530 Subject: [PATCH] Division and modulus operator optimizations - 1 [x] Replaced get_next_indice_1, get_next_indice and sr2fscale with get_next_indice_1_fx, get_next_indice_fx and sr2fscale_fx respectively --- lib_com/bitstream_fx.c | 14 ++-- lib_com/hq_tools_fx.c | 4 +- lib_com/isf_dec_amr_wb_fx.c | 34 ++++----- lib_com/ivas_arith.c | 7 +- lib_com/low_rate_band_att.c | 2 + lib_com/low_rate_band_att_fx.c | 2 +- lib_com/tns_base.c | 2 +- lib_dec/acelp_core_dec_ivas_fx.c | 6 +- lib_dec/acelp_core_switch_dec_fx.c | 4 +- lib_dec/ari_dec.c | 2 + lib_dec/ari_dec_fx.c | 4 +- lib_dec/avq_dec_fx.c | 14 ++-- lib_dec/cng_dec_fx.c | 12 ++-- lib_dec/dec2t32_fx.c | 6 +- lib_dec/dec4t64_fx.c | 30 ++++---- lib_dec/dec_gen_voic_fx.c | 2 +- lib_dec/dec_higher_acelp_fx.c | 2 +- lib_dec/dec_pit_exc_fx.c | 2 +- lib_dec/dec_prm_fx.c | 106 ++++++++++++++--------------- lib_dec/dec_uv_fx.c | 2 +- lib_dec/decision_matrix_dec_fx.c | 26 +++---- lib_dec/fd_cng_dec_fx.c | 4 +- lib_dec/gain_dec.c | 2 + lib_dec/gain_dec_fx.c | 24 +++---- lib_dec/gaus_dec.c | 2 + lib_dec/gaus_dec_fx.c | 6 +- lib_dec/gs_dec_fx.c | 28 ++++---- lib_dec/hdecnrm_fx.c | 36 +++++----- lib_dec/hq_classifier_dec_fx.c | 4 +- lib_dec/hq_core_dec_fx.c | 4 +- lib_dec/hq_env_dec_fx.c | 10 +-- lib_dec/hq_hr_dec_fx.c | 2 +- lib_dec/hq_lr_dec_fx.c | 42 ++++++------ lib_dec/igf_dec_fx.c | 16 ++--- lib_dec/inov_dec_fx.c | 8 +-- lib_dec/ivas_core_dec.c | 2 +- lib_dec/ivas_decision_matrix_dec.c | 29 ++++---- lib_dec/ivas_entropy_decoder.c | 7 +- lib_dec/ivas_mdct_core_dec.c | 20 +++--- lib_dec/ivas_sce_dec_fx.c | 4 +- lib_dec/ivas_spar_md_dec.c | 10 +-- lib_dec/ivas_stereo_adapt_GR_dec.c | 9 +-- lib_dec/ivas_stereo_cng_dec.c | 2 +- lib_dec/ivas_stereo_dft_dec_fx.c | 4 +- lib_dec/ivas_tcx_core_dec.c | 2 +- lib_dec/lp_exc_d_fx.c | 2 +- lib_dec/lsf_dec_fx.c | 18 ++--- lib_dec/lsf_msvq_ma_dec.c | 2 + lib_dec/nelp_dec_fx.c | 8 +-- lib_dec/peak_vq_dec_fx.c | 26 +++---- lib_dec/ppp_dec.c | 2 + lib_dec/ppp_dec_fx.c | 8 +-- lib_dec/pvq_core_dec.c | 2 + lib_dec/pvq_decode.c | 2 + lib_dec/range_dec.c | 2 + lib_dec/range_dec_fx.c | 4 +- lib_dec/stat_noise_uv_dec_fx.c | 2 +- lib_dec/swb_bwe_dec.c | 8 +-- lib_dec/swb_bwe_dec_fx.c | 22 +++--- lib_dec/swb_bwe_dec_hr_fx.c | 20 +++--- lib_dec/swb_bwe_dec_lr_fx.c | 6 +- lib_dec/swb_tbe_dec_fx.c | 102 +++++++++++++-------------- lib_dec/tcq_core_dec.c | 2 + lib_dec/tcq_core_dec_fx.c | 4 +- lib_dec/transition_dec_fx.c | 44 ++++++------ lib_dec/voiced_dec_fx.c | 2 +- 66 files changed, 435 insertions(+), 413 deletions(-) diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index 1dc907e43..67f959a1d 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -1121,7 +1121,7 @@ void dec_prm_core( Decoder_State *st ) } /* Get bandwidth mode */ - st->bwidth = get_next_indice( st, FrameSizeConfig[frame_size_index].bandwidth_bits ); + st->bwidth = get_next_indice_fx( st, FrameSizeConfig[frame_size_index].bandwidth_bits ); move16(); st->bwidth = add( st->bwidth, FrameSizeConfig[frame_size_index].bandwidth_min ); @@ -1147,11 +1147,11 @@ void dec_prm_core( Decoder_State *st ) /* Skip reserved bit */ get_next_indice_tmp_fx( st, FrameSizeConfig[frame_size_index].reserved_bits ); - IF( get_next_indice_1( st ) != 0 ) /* TCX */ + IF( get_next_indice_1_fx( st ) != 0 ) /* TCX */ { st->core = TCX_20_CORE; move16(); - if ( get_next_indice_1( st ) != 0 ) + if ( get_next_indice_1_fx( st ) != 0 ) { st->core = HQ_CORE; move16(); @@ -1214,7 +1214,7 @@ void decision_matrix_core_dec( ELSE IF( GE_32( st->total_brate, ACELP_24k40 ) && LE_32( st->total_brate, ACELP_64k ) ) { /* read the ACELP/HQ core selection bit */ - st->core = imult1616( get_next_indice( st, 1 ), HQ_CORE ); + st->core = imult1616( get_next_indice_fx( st, 1 ), HQ_CORE ); move16(); } ELSE @@ -1245,7 +1245,7 @@ void decision_matrix_core_dec( start_idx = add( start_idx, 1 ); /* retrieve the signalling indice */ - ind = acelp_sig_tbl[add( start_idx, get_next_indice( st, nBits ) )]; + ind = acelp_sig_tbl[add( start_idx, get_next_indice_fx( st, nBits ) )]; st->bwidth = extract_l( L_and( L_shr( ind, 3 ), 0x7 ) ); move16(); @@ -1265,7 +1265,7 @@ void decision_matrix_core_dec( IF( EQ_16( st->core, HQ_CORE ) ) { /* read the HQ/TCX core switching flag */ - if ( get_next_indice( st, 1 ) != 0 ) + if ( get_next_indice_fx( st, 1 ) != 0 ) { st->core = TCX_20_CORE; move16(); @@ -1275,7 +1275,7 @@ void decision_matrix_core_dec( test(); IF( EQ_16( st->core, TCX_20_CORE ) && GT_32( st->total_brate, ACELP_16k40 ) ) { - ind = get_next_indice( st, 2 ); + ind = get_next_indice_fx( st, 2 ); IF( ind == 0 ) { diff --git a/lib_com/hq_tools_fx.c b/lib_com/hq_tools_fx.c index ddc12e4eb..d9f95a06b 100644 --- a/lib_com/hq_tools_fx.c +++ b/lib_com/hq_tools_fx.c @@ -1892,7 +1892,7 @@ Word16 get_nor_delta_hf_fx( move16(); IF( GE_16( core_sfm, num_env_bands ) ) { - bitsforDelta = (Word16) get_next_indice( st, 2 ); + bitsforDelta = (Word16) get_next_indice_fx( st, 2 ); bitsforDelta = add( bitsforDelta, 2 ); add_bits_denv = add( add_bits_denv, 2 ); @@ -1900,7 +1900,7 @@ Word16 get_nor_delta_hf_fx( { IF( Rsubband[i] != 0 ) { - delta = (Word16) get_next_indice( st, bitsforDelta ); + delta = (Word16) get_next_indice_fx( st, bitsforDelta ); ynrm[i] = add( ynrm[i], sub( delta, ( shl( 1, sub( bitsforDelta, 1 ) ) ) ) ); move16(); diff --git a/lib_com/isf_dec_amr_wb_fx.c b/lib_com/isf_dec_amr_wb_fx.c index 586dea535..a054e08ca 100644 --- a/lib_com/isf_dec_amr_wb_fx.c +++ b/lib_com/isf_dec_amr_wb_fx.c @@ -67,15 +67,15 @@ void isf_dec_amr_wb_fx( IF( EQ_32( st->core_brate, SID_1k75 ) ) { - indice[0] = (Word16) get_next_indice( st, 6 ); + indice[0] = (Word16) get_next_indice_fx( st, 6 ); move16(); - indice[1] = (Word16) get_next_indice( st, 6 ); + indice[1] = (Word16) get_next_indice_fx( st, 6 ); move16(); - indice[2] = (Word16) get_next_indice( st, 6 ); + indice[2] = (Word16) get_next_indice_fx( st, 6 ); move16(); - indice[3] = (Word16) get_next_indice( st, 5 ); + indice[3] = (Word16) get_next_indice_fx( st, 5 ); move16(); - indice[4] = (Word16) get_next_indice( st, 5 ); + indice[4] = (Word16) get_next_indice_fx( st, 5 ); move16(); disf_ns_28b_fx( indice, isf_new ); @@ -93,34 +93,34 @@ void isf_dec_amr_wb_fx( IF( EQ_32( st->core_brate, ACELP_6k60 ) ) { - indice[0] = (Word16) get_next_indice( st, 8 ); + indice[0] = (Word16) get_next_indice_fx( st, 8 ); move16(); - indice[1] = (Word16) get_next_indice( st, 8 ); + indice[1] = (Word16) get_next_indice_fx( st, 8 ); move16(); - indice[2] = (Word16) get_next_indice( st, 7 ); + indice[2] = (Word16) get_next_indice_fx( st, 7 ); move16(); - indice[3] = (Word16) get_next_indice( st, 7 ); + indice[3] = (Word16) get_next_indice_fx( st, 7 ); move16(); - indice[4] = (Word16) get_next_indice( st, 6 ); + indice[4] = (Word16) get_next_indice_fx( st, 6 ); move16(); disf_2s_36b_fx( indice, isf_new, st->mem_AR_fx, st->mem_MA_fx, 1 ); } ELSE { - indice[0] = (Word16) get_next_indice( st, 8 ); + indice[0] = (Word16) get_next_indice_fx( st, 8 ); move16(); - indice[1] = (Word16) get_next_indice( st, 8 ); + indice[1] = (Word16) get_next_indice_fx( st, 8 ); move16(); - indice[2] = (Word16) get_next_indice( st, 6 ); + indice[2] = (Word16) get_next_indice_fx( st, 6 ); move16(); - indice[3] = (Word16) get_next_indice( st, 7 ); + indice[3] = (Word16) get_next_indice_fx( st, 7 ); move16(); - indice[4] = (Word16) get_next_indice( st, 7 ); + indice[4] = (Word16) get_next_indice_fx( st, 7 ); move16(); - indice[5] = (Word16) get_next_indice( st, 5 ); + indice[5] = (Word16) get_next_indice_fx( st, 5 ); move16(); - indice[6] = (Word16) get_next_indice( st, 5 ); + indice[6] = (Word16) get_next_indice_fx( st, 5 ); move16(); disf_2s_46b_fx( indice, isf_new, st->mem_AR_fx, st->mem_MA_fx, 1 ); diff --git a/lib_com/ivas_arith.c b/lib_com/ivas_arith.c index 92357f05e..166c8e0ed 100644 --- a/lib_com/ivas_arith.c +++ b/lib_com/ivas_arith.c @@ -35,6 +35,7 @@ #include "wmc_auto.h" #include "prot.h" #include "ivas_prot.h" +#include "prot_fx.h" #include "ivas_prot_fx.h" #include "stat_dec.h" @@ -56,13 +57,13 @@ void ivas_ari_start_decoding_14bits_ext_1_lfe( IF( GE_16( st->bits_frame, add( st->next_bit_pos, cbitsnew ) ) ) { - val = get_next_indice( st, cbitsnew ); + val = get_next_indice_fx( st, cbitsnew ); } ELSE { Word16 rem_bits; rem_bits = sub( st->bits_frame, st->next_bit_pos ); - val = get_next_indice( st, rem_bits ); + val = get_next_indice_fx( st, rem_bits ); val = L_shl( val, sub( cbitsnew, rem_bits ) ); *extra_bits_read = add( *extra_bits_read, sub( cbitsnew, rem_bits ) ); move16(); @@ -217,7 +218,7 @@ UWord16 ivas_ari_decode_14bits_bit_ext_1_lfe( } ELSE { - value = UL_or( UL_lshl( value, 1 ), get_next_indice_1( st ) ); + value = UL_or( UL_lshl( value, 1 ), get_next_indice_1_fx( st ) ); } } diff --git a/lib_com/low_rate_band_att.c b/lib_com/low_rate_band_att.c index 288a11d86..33265c6a5 100644 --- a/lib_com/low_rate_band_att.c +++ b/lib_com/low_rate_band_att.c @@ -155,6 +155,7 @@ void get_max_pulses( return; } +#ifndef IVAS_FLOAT_FIXED /*--------------------------------------------------------------------------* * fine_gain_dec() * @@ -190,3 +191,4 @@ void fine_gain_dec( return; } +#endif diff --git a/lib_com/low_rate_band_att_fx.c b/lib_com/low_rate_band_att_fx.c index f593089b1..e7bf74116 100644 --- a/lib_com/low_rate_band_att_fx.c +++ b/lib_com/low_rate_band_att_fx.c @@ -329,7 +329,7 @@ void fine_gain_dec_fx( { IF( fg_pred[band] != 0 ) { - idx = get_next_indice( st, gbits ); + idx = get_next_indice_fx( st, gbits ); gain_dbq = finegain_fx[gbits - 1][idx]; move16(); diff --git a/lib_com/tns_base.c b/lib_com/tns_base.c index 9aafaddba..c91308770 100644 --- a/lib_com/tns_base.c +++ b/lib_com/tns_base.c @@ -693,7 +693,7 @@ static Word16 DecodeUsingTable( Decoder_State *st, Word16 *pValue, const Coding WHILE( valueIndex == nSize ) { - code = add( shl( code, 1 ), get_next_indice( st, 1 ) ); + code = add( shl( code, 1 ), get_next_indice_fx( st, 1 ) ); nBits = add( nBits, 1 ); if ( nBits > nSize || nBits > 16 ) { diff --git a/lib_dec/acelp_core_dec_ivas_fx.c b/lib_dec/acelp_core_dec_ivas_fx.c index 270b9a5bc..ddad02b9e 100644 --- a/lib_dec/acelp_core_dec_ivas_fx.c +++ b/lib_dec/acelp_core_dec_ivas_fx.c @@ -628,7 +628,7 @@ ivas_error acelp_core_dec_ivas_fx( test(); if ( EQ_16( st->coder_type, AUDIO ) || ( st->coder_type == INACTIVE && LE_32( st->total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) { - st->GSC_IVAS_mode = get_next_indice( st, 2 ); + st->GSC_IVAS_mode = get_next_indice_fx( st, 2 ); move16(); } } @@ -900,7 +900,7 @@ ivas_error acelp_core_dec_ivas_fx( { Word16 beta_index; - beta_index = get_next_indice( st, TDM_IC_LSF_PRED_BITS ); + beta_index = get_next_indice_fx( st, TDM_IC_LSF_PRED_BITS ); tdm_SCh_lsf_reuse_fx( DEC, st->element_brate, lsf_new_fx, lsp_new_fx, tdm_lsfQ_PCh_fx, NULL, &beta_index ); } ELSE @@ -1026,7 +1026,7 @@ ivas_error acelp_core_dec_ivas_fx( IF( nb_bits > 0 ) { - indice = get_next_indice( st, nb_bits ); + indice = get_next_indice_fx( st, nb_bits ); Es_pred_dec_fx( &Es_pred_fx, indice, nb_bits, uc_two_stage_flag ); } diff --git a/lib_dec/acelp_core_switch_dec_fx.c b/lib_dec/acelp_core_switch_dec_fx.c index 415d5fac0..95242729c 100644 --- a/lib_dec/acelp_core_switch_dec_fx.c +++ b/lib_dec/acelp_core_switch_dec_fx.c @@ -248,9 +248,9 @@ ivas_error acelp_core_switch_dec_fx( IF( !( ( EQ_16( inner_frame_tbl[st_fx->bwidth], L_FRAME16k ) && EQ_16( st_fx->last_L_frame, L_FRAME16k ) ) || EQ_16( inner_frame_tbl[st_fx->bwidth], L_FRAME8k ) ) ) { /* Decoding of BWE */ - d1m = (Word16) get_next_indice( st_fx, AUDIODELAYBITS ); + d1m = (Word16) get_next_indice_fx( st_fx, AUDIODELAYBITS ); move16(); - ind1 = (Word16) get_next_indice( st_fx, NOOFGAINBITS1 ); + ind1 = (Word16) get_next_indice_fx( st_fx, NOOFGAINBITS1 ); move16(); gain = usdequant_fx( ind1, MINVALUEOFFIRSTGAIN_FX, shr( DELTAOFFIRSTGAIN_FX, 3 ) ); /*Q13*/ decode_bwe = 1; diff --git a/lib_dec/ari_dec.c b/lib_dec/ari_dec.c index 51badb5bc..e92565f6b 100644 --- a/lib_dec/ari_dec.c +++ b/lib_dec/ari_dec.c @@ -129,6 +129,7 @@ Word16 ari_start_decoding_14bits_prm_ivas_fx( } #endif +#ifndef IVAS_FLOAT_FIXED /*--------------------------------------------------------------- * ari_decode_14bits_s17_ext_ivas() * @@ -459,6 +460,7 @@ void ari_decode_14bits_bit_ext_ivas( return; } +#endif /*------------------------------------------------------------------------ * Function: ari_decode_14bits_pow_ivas() diff --git a/lib_dec/ari_dec_fx.c b/lib_dec/ari_dec_fx.c index 8a310b8b8..385a50d41 100644 --- a/lib_dec/ari_dec_fx.c +++ b/lib_dec/ari_dec_fx.c @@ -30,7 +30,7 @@ void ari_start_decoding_14bits_fx( { Word32 val; - val = L_and( L_deposit_l( get_next_indice( st, cbitsnew ) ), 0xffffL ); + val = L_and( L_deposit_l( get_next_indice_fx( st, cbitsnew ) ), 0xffffL ); s->low = L_deposit_l( 0 ); move32(); @@ -305,7 +305,7 @@ static Word16 ari_decode_14bits_ext_fx( high = L_msu( high, 1, tab_ari_qnew[L_msb_high][L_msb_low] ); high = L_shl( high, 1 ); value = L_msu( value, 1, tab_ari_qnew[L_msb_high][L_msb_low] ); - value = L_mac0( L_shl( value, 1 ), 1, get_next_indice_1( st ) ); + value = L_mac0( L_shl( value, 1 ), 1, get_next_indice_1_fx( st ) ); } s->low = low; diff --git a/lib_dec/avq_dec_fx.c b/lib_dec/avq_dec_fx.c index e739484b6..fa865d0ed 100644 --- a/lib_dec/avq_dec_fx.c +++ b/lib_dec/avq_dec_fx.c @@ -140,7 +140,7 @@ void AVQ_demuxdec_fx( BREAK; } } - WHILE( get_next_indice_1( st ) ); + WHILE( get_next_indice_1_fx( st ) ); if ( EQ_16( add( add( shl( nq[k], 2 ), nq[k] ), 4 ), bits ) ) /* check the overflow */ { @@ -248,7 +248,7 @@ void AVQ_demuxdec_fx( BREAK; } } - WHILE( get_next_indice_1( st ) ); + WHILE( get_next_indice_1_fx( st ) ); unusedbitsFlag = 0; move16(); @@ -449,13 +449,13 @@ static void read_cv_fx( } ELSE IF( LT_16( nq, 5 ) ) /* Q2, Q3, Q4 */ { - *I = get_next_indice( st, shl( nq, 2 ) ); + *I = get_next_indice_fx( st, shl( nq, 2 ) ); move32(); bits = sub( bits, shl( nq, 2 ) ); } ELSE IF( ( s_and( nq, 1 ) == 0 ) ) /* Q4 + Voronoi extensions r=1,2,3,... */ { - *I = get_next_indice( st, 16 ); + *I = get_next_indice_fx( st, 16 ); move32(); bits = sub( bits, 16 ); order_v = (Word16) sub( shr( nq, 1 ), 2 ); @@ -463,21 +463,21 @@ static void read_cv_fx( FOR( j = 0; j < 8; j++ ) { - kv[j] = get_next_indice( st, order_v ); + kv[j] = get_next_indice_fx( st, order_v ); move16(); } bits = sub( bits, ( shl( order_v, 3 ) ) ); } ELSE /* Q3 + Voronoi extensions r=1,2,3,... */ { - *I = get_next_indice( st, 12 ); + *I = get_next_indice_fx( st, 12 ); move32(); bits = sub( bits, 12 ); order_v = (Word16) sub( shr( nq, 1 ), 1 ); FOR( j = 0; j < 8; j++ ) { - kv[j] = get_next_indice( st, order_v ); + kv[j] = get_next_indice_fx( st, order_v ); move32(); } bits = sub( bits, shl( order_v, 3 ) ); diff --git a/lib_dec/cng_dec_fx.c b/lib_dec/cng_dec_fx.c index b612638f9..549da6bfa 100644 --- a/lib_dec/cng_dec_fx.c +++ b/lib_dec/cng_dec_fx.c @@ -172,7 +172,7 @@ void CNG_dec_fx( } /* decode the energy index */ - L_enr_index = get_next_indice( st_fx, num_bits ); + L_enr_index = get_next_indice_fx( st_fx, num_bits ); IF( LE_32( st_fx->last_core_brate, SID_2k40 ) || EQ_16( st_fx->prev_bfi, 1 ) ) { @@ -226,13 +226,13 @@ void CNG_dec_fx( IF( EQ_32( st_fx->core_brate, SID_2k40 ) ) { - burst_ho_cnt = get_next_indice( st_fx, 3 ); /* 3bit */ + burst_ho_cnt = get_next_indice_fx( st_fx, 3 ); /* 3bit */ - *sid_bw = get_next_indice( st_fx, 1 ); + *sid_bw = get_next_indice_fx( st_fx, 1 ); move16(); IF( *sid_bw == 0 ) { - env_idx[0] = get_next_indice( st_fx, 6 ); + env_idx[0] = get_next_indice_fx( st_fx, 6 ); move16(); /* get quantized res_env_details */ @@ -862,7 +862,7 @@ static void shb_CNG_decod_fx( test(); IF( EQ_32( st_fx->core_brate, SID_2k40 ) && EQ_16( sid_bw, 1 ) ) { - idx_ener_fx = get_next_indice( st_fx, 4 ); + idx_ener_fx = get_next_indice_fx( st_fx, 4 ); if ( !idx_ener_fx ) { @@ -1150,7 +1150,7 @@ static void shb_CNG_decod_ivas_fx( { IF( EQ_32( st->core_brate, SID_2k40 ) && EQ_16( sid_bw, 1 ) ) { - idx_ener = get_next_indice( st, 4 ); + idx_ener = get_next_indice_fx( st, 4 ); IF( EQ_16( idx_ener, 0 ) ) { diff --git a/lib_dec/dec2t32_fx.c b/lib_dec/dec2t32_fx.c index b6e1c2053..d6f822765 100644 --- a/lib_dec/dec2t32_fx.c +++ b/lib_dec/dec2t32_fx.c @@ -41,7 +41,7 @@ void dec_acelp_2t32_fx( Word16 index, i0, i1; - index = (Word16) get_next_indice( st_fx, 12 ); + index = (Word16) get_next_indice_fx( st_fx, 12 ); move16(); set16_fx( code, 0, L_SUBFR ); @@ -106,12 +106,12 @@ void dec_acelp_1t64_fx( *-----------------------------------------------------------------*/ IF( EQ_16( L_subfr, L_SUBFR ) ) { - pos = (Word16) get_next_indice( st_fx, 7 ); + pos = (Word16) get_next_indice_fx( st_fx, 7 ); move16(); } ELSE /* L_subfr == 2*L_SUBFR */ { - pos = (Word16) get_next_indice( st_fx, 8 ); + pos = (Word16) get_next_indice_fx( st_fx, 8 ); move16(); } diff --git a/lib_dec/dec4t64_fx.c b/lib_dec/dec4t64_fx.c index 47c481dc4..dd126cc2d 100644 --- a/lib_dec/dec4t64_fx.c +++ b/lib_dec/dec4t64_fx.c @@ -112,12 +112,12 @@ void dec_acelp_4t64_fx( bitcnt = s_and( nbbits, 15 ); FOR( i = 0; i < wordcnt; i++ ) { - indexing_indices[i] = get_next_indice( st_fx, 16 ); + indexing_indices[i] = get_next_indice_fx( st_fx, 16 ); move16(); } IF( bitcnt ) { - indexing_indices[i] = get_next_indice( st_fx, bitcnt ); + indexing_indices[i] = get_next_indice_fx( st_fx, bitcnt ); move16(); } @@ -135,7 +135,7 @@ void dec_acelp_4t64_fx( { FOR( k = 0; k < NB_TRACK_FCB_4T; k++ ) { - L_index = get_next_indice( st_fx, 5 ); + L_index = get_next_indice_fx( st_fx, 5 ); dec_1p_N1_fx( L_index, 4, 0, pos ); add_pulses_fx( pos, 1, k, code ); } @@ -144,7 +144,7 @@ void dec_acelp_4t64_fx( { FOR( k = 0; k < NB_TRACK_FCB_4T; k++ ) { - L_index = get_next_indice( st_fx, 9 ); + L_index = get_next_indice_fx( st_fx, 9 ); dec_2p_2N1_fx( L_index, 4, 0, pos ); add_pulses_fx( pos, 2, k, code ); } @@ -153,14 +153,14 @@ void dec_acelp_4t64_fx( { FOR( k = 0; k < NB_TRACK_FCB_4T - 2; k++ ) { - L_index = get_next_indice( st_fx, 13 ); + L_index = get_next_indice_fx( st_fx, 13 ); dec_3p_3N1_fx( L_index, 4, 0, pos ); add_pulses_fx( pos, 3, k, code ); } FOR( k = 2; k < NB_TRACK_FCB_4T; k++ ) { - L_index = get_next_indice( st_fx, 9 ); + L_index = get_next_indice_fx( st_fx, 9 ); dec_2p_2N1_fx( L_index, 4, 0, pos ); add_pulses_fx( pos, 2, k, code ); } @@ -169,7 +169,7 @@ void dec_acelp_4t64_fx( { FOR( k = 0; k < NB_TRACK_FCB_4T; k++ ) { - L_index = get_next_indice( st_fx, 13 ); + L_index = get_next_indice_fx( st_fx, 13 ); dec_3p_3N1_fx( L_index, 4, 0, pos ); add_pulses_fx( pos, 3, k, code ); } @@ -178,12 +178,12 @@ void dec_acelp_4t64_fx( { FOR( k = 0; k < NB_TRACK_FCB_4T; k++ ) { - ind1[k] = get_next_indice( st_fx, 2 ); + ind1[k] = get_next_indice_fx( st_fx, 2 ); move32(); } FOR( k = 0; k < NB_TRACK_FCB_4T; k++ ) { - index2 = get_next_indice( st_fx, 14 ); + index2 = get_next_indice_fx( st_fx, 14 ); L_index = L_add( L_shl( ind1[k], 14 ), index2 ); dec_4p_4N_fx( L_index, 4, 0, pos ); add_pulses_fx( pos, 4, k, code ); @@ -193,24 +193,24 @@ void dec_acelp_4t64_fx( { FOR( k = 0; k < NB_TRACK_FCB_4T - 2; k++ ) { - ind1[k] = get_next_indice( st_fx, 10 ); + ind1[k] = get_next_indice_fx( st_fx, 10 ); move32(); } FOR( k = 2; k < NB_TRACK_FCB_4T; k++ ) { - ind1[k] = get_next_indice( st_fx, 2 ); + ind1[k] = get_next_indice_fx( st_fx, 2 ); move32(); } FOR( k = 0; k < NB_TRACK_FCB_4T - 2; k++ ) { - index2 = get_next_indice( st_fx, 10 ); + index2 = get_next_indice_fx( st_fx, 10 ); L_index = L_add( L_shl( ind1[k], 10 ), index2 ); dec_5p_5N_fx( L_index, 4, 0, pos ); add_pulses_fx( pos, 5, k, code ); } FOR( k = 2; k < NB_TRACK_FCB_4T; k++ ) { - index2 = get_next_indice( st_fx, 14 ); + index2 = get_next_indice_fx( st_fx, 14 ); L_index = L_add( L_shl( ind1[k], 14 ), index2 ); dec_4p_4N_fx( L_index, 4, 0, pos ); add_pulses_fx( pos, 4, k, code ); @@ -220,12 +220,12 @@ void dec_acelp_4t64_fx( { FOR( k = 0; k < NB_TRACK_FCB_4T; k++ ) { - ind1[k] = get_next_indice( st_fx, 11 ); + ind1[k] = get_next_indice_fx( st_fx, 11 ); move16(); } FOR( k = 0; k < NB_TRACK_FCB_4T; k++ ) { - index2 = get_next_indice( st_fx, 11 ); + index2 = get_next_indice_fx( st_fx, 11 ); L_index = L_add( L_shl( ind1[k], 11 ), index2 ); dec_6p_6N2_fx( L_index, 4, 0, pos ); add_pulses_fx( pos, 6, k, code ); diff --git a/lib_dec/dec_gen_voic_fx.c b/lib_dec/dec_gen_voic_fx.c index 597cfea19..23363dd67 100644 --- a/lib_dec/dec_gen_voic_fx.c +++ b/lib_dec/dec_gen_voic_fx.c @@ -618,7 +618,7 @@ ivas_error decod_gen_voic_ivas_fx( test(); IF( ( GE_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) && LE_32( st_fx->core_brate, MAX_BRATE_AVQ_EXC_TD ) ) && EQ_16( st_fx->coder_type, GENERIC ) ) { - harm_flag_acelp = (Word16) get_next_indice( st_fx, 1 ); + harm_flag_acelp = (Word16) get_next_indice_fx( st_fx, 1 ); } /*------------------------------------------------------------------* diff --git a/lib_dec/dec_higher_acelp_fx.c b/lib_dec/dec_higher_acelp_fx.c index eea2c8a62..fb32be0d4 100644 --- a/lib_dec/dec_higher_acelp_fx.c +++ b/lib_dec/dec_higher_acelp_fx.c @@ -64,7 +64,7 @@ void transf_cdbk_dec_fx( * Dequantize prequantizer excitation gain *--------------------------------------------------------------*/ - index = (Word16) get_next_indice( st_fx, G_AVQ_BITS ); + index = (Word16) get_next_indice_fx( st_fx, G_AVQ_BITS ); IF( EQ_16( st_fx->coder_type, INACTIVE ) ) { diff --git a/lib_dec/dec_pit_exc_fx.c b/lib_dec/dec_pit_exc_fx.c index 27abc3ddf..fc06c6649 100644 --- a/lib_dec/dec_pit_exc_fx.c +++ b/lib_dec/dec_pit_exc_fx.c @@ -678,7 +678,7 @@ void dec_pit_exc_ivas_fx( gain_code_fx = L_deposit_l( 0 ); st_fx->tilt_code_fx = 0; move16(); - pit_idx_fx = (Word16) get_next_indice( st_fx, nbits ); + pit_idx_fx = (Word16) get_next_indice_fx( st_fx, nbits ); move16(); gain_pit_fx = add( 9590, dic_gp_fx[pit_idx_fx] ); diff --git a/lib_dec/dec_prm_fx.c b/lib_dec/dec_prm_fx.c index 22b0c7047..feef8f2be 100644 --- a/lib_dec/dec_prm_fx.c +++ b/lib_dec/dec_prm_fx.c @@ -644,9 +644,9 @@ void dec_prm_fx( /* Modes (ACE_GC, ACE_UC, TCX20, TCX10...) */ IF( st->tcxonly ) { - st->core = add( get_next_indice( st, 1 ), 1 ); + st->core = add( get_next_indice_fx( st, 1 ), 1 ); move16(); - ind = get_next_indice( st, 2 ); + ind = get_next_indice_fx( st, 2 ); st->clas_dec = ONSET; move16(); if ( ind == 0 ) @@ -681,7 +681,7 @@ void dec_prm_fx( /* 2 bits instead of 3 as TCX is already signaled */ st->core = TCX_20_CORE; move16(); - st->hTcxCfg->coder_type = get_next_indice( st, 2 ); + st->hTcxCfg->coder_type = get_next_indice_fx( st, 2 ); move16(); *coder_type = st->hTcxCfg->coder_type; move16(); @@ -690,9 +690,9 @@ void dec_prm_fx( { IF( EQ_16( st->mdct_sw_enable, MODE2 ) ) { - IF( get_next_indice_1( st ) != 0 ) /* TCX */ + IF( get_next_indice_1_fx( st ) != 0 ) /* TCX */ { - tmp = get_next_indice( st, 3 ); + tmp = get_next_indice_fx( st, 3 ); assert( !( tmp & 4 ) || !"HQ_CORE encountered in dec_prm_fx" ); st->core = TCX_20_CORE; move16(); @@ -705,7 +705,7 @@ void dec_prm_fx( { st->core = ACELP_CORE; move16(); - *coder_type = get_next_indice( st, 2 ); + *coder_type = get_next_indice_fx( st, 2 ); move16(); } } @@ -715,7 +715,7 @@ void dec_prm_fx( { IF( !( st->use_partial_copy ) ) { - tmp = get_next_indice( st, 1 ); + tmp = get_next_indice_fx( st, 1 ); IF( tmp == 0 ) { st->core = ACELP_CORE; @@ -734,7 +734,7 @@ void dec_prm_fx( { st->core = ACELP_CORE; move16(); - *coder_type = get_next_indice( st, 3 ); + *coder_type = get_next_indice_fx( st, 3 ); move16(); IF( GE_16( *coder_type, ACELP_MODE_MAX ) ) { @@ -788,7 +788,7 @@ void dec_prm_fx( test(); IF( ( NE_16( st->core, ACELP_CORE ) || st->hTcxCfg->lfacNext > 0 ) && st->use_partial_copy == 0 ) { - st->last_core_from_bs = get_next_indice( st, 1 ); + st->last_core_from_bs = get_next_indice_fx( st, 1 ); move16(); /* @@ -866,9 +866,9 @@ void dec_prm_fx( tmp = 0; move16(); /* if current TCX mode is not 0 (full overlap), read another bit */ - if ( get_next_indice( st, 1 ) ) + if ( get_next_indice_fx( st, 1 ) ) { - tmp = add( 2, get_next_indice( st, 1 ) ); + tmp = add( 2, get_next_indice_fx( st, 1 ) ); } st->hTcxCfg->tcx_curr_overlap_mode = tmp; move16(); @@ -894,14 +894,14 @@ void dec_prm_fx( search_range = 8; move16(); - st->flagGuidedAcelp = get_next_indice( st, 1 ); + st->flagGuidedAcelp = get_next_indice_fx( st, 1 ); move16(); pitchDiff = 0; move16(); IF( st->flagGuidedAcelp ) { - pitchDiff = get_next_indice( st, bits_per_subfr ); + pitchDiff = get_next_indice_fx( st, bits_per_subfr ); move16(); st->guidedT0 = sub( pitchDiff, search_range ); move16(); @@ -925,7 +925,7 @@ void dec_prm_fx( st->dec_glr_idx = -1; if ( EQ_16( st->core, ACELP_CORE ) ) { - st->dec_glr_idx = get_next_indice( st, G_LPC_RECOVERY_BITS ); + st->dec_glr_idx = get_next_indice_fx( st, G_LPC_RECOVERY_BITS ); move16(); } } @@ -1006,19 +1006,19 @@ void dec_prm_fx( { param_lpc[0] = 0; move16(); - param_lpc[1] = get_next_indice( st, lsf_numbits[0] ); /* VQ 1 */ + param_lpc[1] = get_next_indice_fx( st, lsf_numbits[0] ); /* VQ 1 */ move16(); - param_lpc[2] = get_next_indice( st, lsf_numbits[1] ); /* VQ 2 */ + param_lpc[2] = get_next_indice_fx( st, lsf_numbits[1] ); /* VQ 2 */ move16(); - param_lpc[3] = get_next_indice( st, lsf_numbits[2] ); /* VQ 3 */ + param_lpc[3] = get_next_indice_fx( st, lsf_numbits[2] ); /* VQ 3 */ move16(); } ELSE IF( GE_16( st->rf_frame_type, RF_ALLPRED ) && LE_16( st->rf_frame_type, RF_NELP ) ) { /* LSF indices */ - param_lpc[0] = get_next_indice( st, 8 ); /* VQ 1 */ + param_lpc[0] = get_next_indice_fx( st, 8 ); /* VQ 1 */ move16(); - param_lpc[1] = get_next_indice( st, 8 ); /* VQ 2 */ + param_lpc[1] = get_next_indice_fx( st, 8 ); /* VQ 2 */ move16(); } } @@ -1056,7 +1056,7 @@ void dec_prm_fx( st->bpf_gain_param = shl( st->acelp_cfg.bpf_mode, 1 ); if ( n != 0 ) { - st->bpf_gain_param = get_next_indice( st, n ); + st->bpf_gain_param = get_next_indice_fx( st, n ); move16(); } @@ -1065,7 +1065,7 @@ void dec_prm_fx( move16(); if ( n != 0 ) { - prm[j] = get_next_indice( st, n ); + prm[j] = get_next_indice_fx( st, n ); j = add( j, 1 ); move16(); } @@ -1079,7 +1079,7 @@ void dec_prm_fx( IF( n != 0 ) { - prm[j] = get_next_indice( st, n ); + prm[j] = get_next_indice_fx( st, n ); j = add( j, 1 ); move16(); } @@ -1087,7 +1087,7 @@ void dec_prm_fx( /* Adaptive codebook filtering (1 bit) */ IF( EQ_16( st->acelp_cfg.ltf_mode, 2 ) ) { - prm[j] = get_next_indice( st, 1 ); + prm[j] = get_next_indice_fx( st, 1 ); j = add( j, 1 ); move16(); } @@ -1112,13 +1112,13 @@ void dec_prm_fx( FOR( ix = 0; ix < wordcnt; ix++ ) { - prm[j] = get_next_indice( st, 16 ); + prm[j] = get_next_indice_fx( st, 16 ); j = add( j, 1 ); move16(); } if ( bitcnt ) { - prm[j] = get_next_indice( st, bitcnt ); + prm[j] = get_next_indice_fx( st, bitcnt ); move16(); } @@ -1129,7 +1129,7 @@ void dec_prm_fx( n = ACELP_GAINS_BITS[st->acelp_cfg.gains_mode[sfr]]; move16(); - prm[j] = get_next_indice( st, n ); + prm[j] = get_next_indice_fx( st, n ); j = add( j, 1 ); move16(); } /*end of subfr loop*/ @@ -1154,25 +1154,25 @@ void dec_prm_fx( IF( EQ_16( st->rf_frame_type, RF_NELP ) ) { /* NELP gain indices */ - st->rf_indx_nelp_iG1 = get_next_indice( st, 5 ); - st->rf_indx_nelp_iG2[0] = get_next_indice( st, 6 ); + st->rf_indx_nelp_iG1 = get_next_indice_fx( st, 5 ); + st->rf_indx_nelp_iG2[0] = get_next_indice_fx( st, 6 ); move16(); - st->rf_indx_nelp_iG2[1] = get_next_indice( st, 6 ); + st->rf_indx_nelp_iG2[1] = get_next_indice_fx( st, 6 ); move16(); /* NELP filter selection index */ - st->rf_indx_nelp_fid = get_next_indice( st, 2 ); + st->rf_indx_nelp_fid = get_next_indice_fx( st, 2 ); move16(); /* tbe gainFr */ - st->rf_indx_tbeGainFr = get_next_indice( st, 5 ); + st->rf_indx_tbeGainFr = get_next_indice_fx( st, 5 ); move16(); } ELSE { /* rf_frame_type ALL_PRED: 4, NO_PRED: 5, GEN_PRED: 6*/ /* ES pred */ - prm[j] = get_next_indice( st, 3 ); + prm[j] = get_next_indice_fx( st, 3 ); move16(); j = add( j, 1 ); @@ -1189,7 +1189,7 @@ void dec_prm_fx( move16(); IF( n != 0 ) { - prm[j] = get_next_indice( st, n ); + prm[j] = get_next_indice_fx( st, n ); j = add( j, 1 ); move16(); } @@ -1202,7 +1202,7 @@ void dec_prm_fx( { /* NOTE: FCB actual bits need to be backed up as well */ /*n = ACELP_FIXED_CDK_BITS(st->rf_indx_fcb[fec_offset][sfr]) & 15;*/ - prm[j] = get_next_indice( st, 7 ); + prm[j] = get_next_indice_fx( st, 7 ); move16(); j = add( j, 8 ); } @@ -1213,13 +1213,13 @@ void dec_prm_fx( { n = ACELP_GAINS_BITS[gains_mode]; move16(); - prm[j] = get_next_indice( st, n ); + prm[j] = get_next_indice_fx( st, n ); j = add( j, 1 ); move16(); } } - st->rf_indx_tbeGainFr = get_next_indice( st, 2 ); + st->rf_indx_tbeGainFr = get_next_indice_fx( st, 2 ); move16(); } } @@ -1235,17 +1235,17 @@ void dec_prm_fx( if ( st->enablePlcWaveadjust ) { - st->tonality_flag = get_next_indice( st, 1 ); + st->tonality_flag = get_next_indice_fx( st, 1 ); move16(); } /* TCX Gain = 7 bits */ - prm[j] = get_next_indice( st, 7 ); + prm[j] = get_next_indice_fx( st, 7 ); j = add( j, 1 ); move16(); /* TCX Noise Filling = NBITS_NOISE_FILL_LEVEL bits */ - prm[j] = get_next_indice( st, NBITS_NOISE_FILL_LEVEL ); + prm[j] = get_next_indice_fx( st, NBITS_NOISE_FILL_LEVEL ); j = add( j, 1 ); move16(); @@ -1255,14 +1255,14 @@ void dec_prm_fx( IF( hTcxLtpDec->tcxltp != 0 || GT_32( st->sr_core, 25600 ) ) { - prm[j] = get_next_indice( st, 1 ); + prm[j] = get_next_indice_fx( st, 1 ); move16(); IF( prm[j] ) { - prm[j + 1] = get_next_indice( st, 9 ); + prm[j + 1] = get_next_indice_fx( st, 9 ); move16(); - prm[j + 2] = get_next_indice( st, 2 ); + prm[j + 2] = get_next_indice_fx( st, 2 ); move16(); } @@ -1342,7 +1342,7 @@ void dec_prm_fx( test(); IF( st->hTcxCfg->ctx_hm && NE_16( st->last_core_from_bs, ACELP_CORE ) ) { - prm[j] = get_next_indice( st, 1 ); + prm[j] = get_next_indice_fx( st, 1 ); move16(); nbits_tcx = sub( nbits_tcx, 1 ); @@ -1404,7 +1404,7 @@ void dec_prm_fx( prms = &prm[j]; FOR( ix = 0; ix < nbits_tcx; ix++ ) { - prms[ix] = get_next_indice_1( st ); + prms[ix] = get_next_indice_1_fx( st ); move16(); } set16_fx( prms + nbits_tcx, 1, 32 ); @@ -1430,7 +1430,7 @@ void dec_prm_fx( IF( GE_16( st->rf_frame_type, RF_TCXFD ) && LE_16( st->rf_frame_type, RF_TCXTD2 ) && EQ_16( st->use_partial_copy, 1 ) ) { /* classification */ - ind = get_next_indice( st, 2 ); + ind = get_next_indice_fx( st, 2 ); st->clas_dec = ONSET; move16(); @@ -1461,7 +1461,7 @@ void dec_prm_fx( IF( EQ_16( st->rf_frame_type, RF_TCXFD ) ) { /* TCX Gain = 7 bits */ - hTcxDec->old_gaintcx_bfi = get_next_indice( st, 7 ); + hTcxDec->old_gaintcx_bfi = get_next_indice_fx( st, 7 ); move16(); } ELSE @@ -1474,7 +1474,7 @@ void dec_prm_fx( { prm_ltp[0] = 1; move16(); /* LTP active*/ - prm_ltp[1] = get_next_indice( st, 9 ); + prm_ltp[1] = get_next_indice_fx( st, 9 ); prm_ltp[2] = 3; move16(); /* max ampl. quantizer output (2bits), anyway not used later*/ @@ -1537,16 +1537,16 @@ void dec_prm_fx( test(); if ( st->enablePlcWaveadjust && k ) { - st->tonality_flag = get_next_indice( st, 1 ); + st->tonality_flag = get_next_indice_fx( st, 1 ); move16(); } /* TCX Gain = 7 bits */ - prm[j] = get_next_indice( st, 7 ); + prm[j] = get_next_indice_fx( st, 7 ); j = add( j, 1 ); move16(); /* TCX Noise Filling = NBITS_NOISE_FILL_LEVEL bits */ - prm[j] = get_next_indice( st, NBITS_NOISE_FILL_LEVEL ); + prm[j] = get_next_indice_fx( st, NBITS_NOISE_FILL_LEVEL ); j = add( j, 1 ); move16(); @@ -1555,15 +1555,15 @@ void dec_prm_fx( test(); IF( ( k == 0 ) && ( ( hTcxLtpDec->tcxltp != 0 ) || ( GT_32( st->sr_core, 25600 ) ) ) ) { - prm[j] = get_next_indice( st, 1 ); + prm[j] = get_next_indice_fx( st, 1 ); move16(); IF( prm[j] ) { - prm[j + 1] = get_next_indice( st, 9 ); + prm[j + 1] = get_next_indice_fx( st, 9 ); move16(); - prm[j + 2] = get_next_indice( st, 2 ); + prm[j + 2] = get_next_indice_fx( st, 2 ); move16(); tcxltp_prm_0 = prm[j]; diff --git a/lib_dec/dec_uv_fx.c b/lib_dec/dec_uv_fx.c index 8a4f4c05e..ceb4d2650 100644 --- a/lib_dec/dec_uv_fx.c +++ b/lib_dec/dec_uv_fx.c @@ -195,7 +195,7 @@ void decod_unvoiced_ivas_fx( { tmp_idx_1 = idiv1616( i_subfr_fx, L_SUBFR ); } - Word16 index = get_next_indice( st_fx, st_fx->acelp_cfg.gains_mode[tmp_idx_1] ); + Word16 index = get_next_indice_fx( st_fx, st_fx->acelp_cfg.gains_mode[tmp_idx_1] ); // gain_dec_gacelp_uv(index, code, code2, Es_pred, L_SUBFR, &gain_pit, &gain_code, &gain_code2, &(st->past_gpit_float), &norm_gain_code, &gain_inov); gain_dec_gacelp_uv_fx( index, code_fx, code2_fx, Es_pred_fx, L_SUBFR, &gain_pit_fx, &gain_code_fx, &gain_code2_fx, &( st_fx->past_gpit ), &norm_gain_code_fx, &gain_inov_fx ); diff --git a/lib_dec/decision_matrix_dec_fx.c b/lib_dec/decision_matrix_dec_fx.c index 7362cb20b..fc727fa3b 100644 --- a/lib_dec/decision_matrix_dec_fx.c +++ b/lib_dec/decision_matrix_dec_fx.c @@ -69,14 +69,14 @@ void decision_matrix_dec_fx( IF( NE_32( st->total_brate, FRAME_NO_DATA ) ) { - st->cng_type = get_next_indice( st, 1 ); + st->cng_type = get_next_indice_fx( st, 1 ); IF( EQ_16( st->cng_type, LP_CNG ) ) { st->L_frame = L_FRAME; move16(); - tmp16 = get_next_indice( st, 1 ); + tmp16 = get_next_indice_fx( st, 1 ); IF( EQ_16( tmp16, 1 ) ) { st->L_frame = L_FRAME16k; @@ -85,9 +85,9 @@ void decision_matrix_dec_fx( } ELSE { - st->bwidth = get_next_indice( st, 2 ); + st->bwidth = get_next_indice_fx( st, 2 ); - tmp16 = get_next_indice( st, 1 ); + tmp16 = get_next_indice_fx( st, 1 ); move16(); st->L_frame = L_FRAME16k; @@ -142,9 +142,9 @@ void decision_matrix_dec_fx( st->vbr_hw_BWE_disable_dec = 1; move16(); - get_next_indice( st, 1 ); + get_next_indice_fx( st, 1 ); - ppp_nelp_mode = get_next_indice( st, 2 ); + ppp_nelp_mode = get_next_indice_fx( st, 2 ); /* 0 - PPP_NB, 1 - PPP_WB, 2 - NELP_NB, 3 - NELP_WB */ IF( ppp_nelp_mode == 0 ) @@ -201,7 +201,7 @@ void decision_matrix_dec_fx( ELSE IF( GE_32( st->total_brate, ACELP_24k40 ) && LE_32( st->total_brate, ACELP_64k ) ) { /* read the ACELP/HQ core selection bit */ - temp_core = get_next_indice( st, 1 ); + temp_core = get_next_indice_fx( st, 1 ); st->core = HQ_CORE; move16(); @@ -242,7 +242,7 @@ void decision_matrix_dec_fx( nBits = extract_l( acelp_sig_tbl[start_idx] ); start_idx = add( start_idx, 1 ); - start_idx = add( start_idx, get_next_indice( st, nBits ) ); + start_idx = add( start_idx, get_next_indice_fx( st, nBits ) ); IF( GE_16( start_idx, MAX_ACELP_SIG ) ) { ind = 0; @@ -421,7 +421,7 @@ void decision_matrix_dec_fx( ELSE IF( EQ_16( st->core, ACELP_CORE ) && EQ_16( st->bwidth, WB ) && GE_32( st->total_brate, ACELP_9k60 ) && LE_32( st->total_brate, ACELP_16k40 ) ) { /* read the WB TBE/BWE selection bit */ - tmp16 = get_next_indice( st, 1 ); + tmp16 = get_next_indice_fx( st, 1 ); IF( EQ_16( tmp16, 1 ) ) { st->extl = WB_BWE; @@ -456,7 +456,7 @@ void decision_matrix_dec_fx( /* read the SWB TBE/BWE selection bit */ ELSE { - tmp16 = get_next_indice( st, 1 ); + tmp16 = get_next_indice_fx( st, 1 ); IF( tmp16 ) { st->extl = SWB_BWE; @@ -519,7 +519,7 @@ void decision_matrix_dec_fx( } /* read ACELP->HQ core switching flag */ - *core_switching_flag = get_next_indice( st, 1 ); + *core_switching_flag = get_next_indice_fx( st, 1 ); IF( EQ_16( *core_switching_flag, 1 ) ) { @@ -529,7 +529,7 @@ void decision_matrix_dec_fx( /* read ACELP L_frame info */ st->last_L_frame = L_FRAME16k; move16(); - tmp16 = get_next_indice( st, 1 ); + tmp16 = get_next_indice_fx( st, 1 ); IF( tmp16 == 0 ) { st->last_L_frame = L_FRAME; @@ -543,7 +543,7 @@ void decision_matrix_dec_fx( /* read/set band-width (needed for different I/O sampling rate support) */ IF( GT_32( st->total_brate, ACELP_16k40 ) ) { - tmp16 = get_next_indice( st, 2 ); + tmp16 = get_next_indice_fx( st, 2 ); IF( tmp16 == 0 ) { diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 4e93acdfb..a50653526 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3178,10 +3178,10 @@ void FdCng_decodeSID_fx( HANDLE_FD_CNG_COM st, Decoder_State *corest ) /* Read bitstream */ FOR( i = 0; i < stages_37bits; i++ ) { - indices[i] = get_next_indice( corest, bits_37bits[i] ); + indices[i] = get_next_indice_fx( corest, bits_37bits[i] ); move16(); } - index = get_next_indice( corest, 7 ); + index = get_next_indice_fx( corest, 7 ); /* MSVQ decoder */ #ifdef IVAS_FLOAT_FIXED diff --git a/lib_dec/gain_dec.c b/lib_dec/gain_dec.c index 64ea85de2..c0aea3813 100644 --- a/lib_dec/gain_dec.c +++ b/lib_dec/gain_dec.c @@ -42,6 +42,7 @@ #include "prot.h" #include "wmc_auto.h" +#ifndef IVAS_FLOAT_FIXED /*---------------------------------------------------------------------* * Es_pred_dec() * @@ -694,3 +695,4 @@ float gain_dec_gaus( return gain; } +#endif diff --git a/lib_dec/gain_dec_fx.c b/lib_dec/gain_dec_fx.c index ab561a354..d9639bbcc 100644 --- a/lib_dec/gain_dec_fx.c +++ b/lib_dec/gain_dec_fx.c @@ -162,7 +162,7 @@ void gain_dec_tc_fx( *------------------------------------------------------------------------------------------*/ /* index = (Word16)get_indice( st_fx,"gain_code", i_subfr_fx, ACELP_CORE);move16();*/ - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); move16(); @@ -302,7 +302,7 @@ void gain_dec_tc_ivas_fx( *------------------------------------------------------------------------------------------*/ /* index = (Word16)get_indice( st_fx,"gain_code", i_subfr_fx, ACELP_CORE);move16();*/ - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); IF( GT_16( nBits, 3 ) ) @@ -400,7 +400,7 @@ void gain_dec_mless_fx( ( EQ_16( tc_subfr_fx, 4 * L_SUBFR ) && EQ_16( i_subfr_fx, 4 * L_SUBFR ) && EQ_16( L_frame_fx, L_FRAME16k ) ) ) { /* decode pitch gain */ - index = (Word16) get_next_indice( st_fx, shr( nBits, 1 ) ); + index = (Word16) get_next_indice_fx( st_fx, shr( nBits, 1 ) ); /*Ei = (G_PITCH_MAX_TC192 - G_PITCH_MIN_TC192) / ((1 << (nBits>>1)) - 1);*/ /* set quantization step */ tmp_fx = div_s( 1, sub( shl( 1, shr( nBits, 1 ) ), 1 ) ); /*Q15*/ @@ -454,7 +454,7 @@ void gain_dec_mless_fx( /* decode normalized codebook gain */ /*index = (short)get_indice( st_fx, "gain_code", i_subfr_fx, ACELP_CORE );move16();*/ - index = (Word16) get_next_indice( st_fx, shr( add( nBits, 1 ), 1 ) ); + index = (Word16) get_next_indice_fx( st_fx, shr( add( nBits, 1 ), 1 ) ); /**gain_code = gain_dequant( index, G_CODE_MIN_TC192, G_CODE_MAX_TC192, (nBits+1)>>1 );*/ gain_code16 = gain_dequant_fx( index, G_CODE_MIN_TC192_Q15, G_CODE_MAX_TC192_Q0, shr( add( nBits, 1 ), 1 ), &expg ); @@ -505,7 +505,7 @@ void gain_dec_mless_fx( nBits = sub( nBits, 1 ); } - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); *gain_pit_fx = qua_table_fx[index * 2]; move16(); @@ -722,7 +722,7 @@ void gain_dec_lbr_fx( /* retrieve the codebook index and calculate both gains */ /*index = (Word16)get_indice( st_fx,"gain", i_subfr, ACELP_CORE);move16();*/ - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); *gain_pit_fx = cdbk_fx[index * 2]; move16(); @@ -795,7 +795,7 @@ void gain_dec_lbr_fx( exp_gcode0 = sub( exp_gcode0, 14 ); /* retrieve the codebook index and calculate both gains */ - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); *gain_pit_fx = cdbk_fx[index * 2]; move16(); @@ -872,7 +872,7 @@ void gain_dec_lbr_fx( exp_gcode0 = sub( exp_gcode0, 14 ); /* retrieve the codebook index and calculate both gains */ - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); *gain_pit_fx = cdbk_fx[shl( index, 1 )]; move16(); @@ -959,7 +959,7 @@ void gain_dec_lbr_fx( exp_gcode0 = sub( exp_gcode0, 14 ); /* retrieve the codebook index and calculate both gains */ - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); move16(); *gain_pit_fx = cdbk_fx[shl( index, 1 )]; move16(); @@ -1350,7 +1350,7 @@ void gain_dec_SQ_fx( * decode pitch gain *-----------------------------------------------------------------*/ - index = (Word16) get_next_indice( st_fx, shr( nBits, 1 ) ); + index = (Word16) get_next_indice_fx( st_fx, shr( nBits, 1 ) ); /*Ei = (G_PITCH_MAX - G_PITCH_MIN) / ((1 << (nBits>>1)) - 1); set quantization step */ tmp16 = div_s( 1, sub( shl( 1, shr( nBits, 1 ) ), 1 ) ); /* Q15*/ @@ -1400,7 +1400,7 @@ void gain_dec_SQ_fx( * decode normalized codebook gain *-----------------------------------------------------------------*/ - index = (Word16) get_next_indice( st_fx, shr( add( nBits, 1 ), 1 ) ); + index = (Word16) get_next_indice_fx( st_fx, shr( add( nBits, 1 ), 1 ) ); tmp16 = gain_dequant_fx( index, G_CODE_MIN_TC_Q15, G_CODE_MAX_TC_Q0, shr( add( nBits, 1 ), 1 ), &expg ); @@ -1516,7 +1516,7 @@ void gain_dec_amr_wb_fx( * Decode pitch gain *-----------------------------------------------------------------*/ - index = (Word16) get_next_indice( st_fx, nbits ); + index = (Word16) get_next_indice_fx( st_fx, nbits ); index2 = shl( index, 1 ); *gain_pit = t_qua_gain[index2]; move16(); diff --git a/lib_dec/gaus_dec.c b/lib_dec/gaus_dec.c index e5d7adc32..b7a89bec9 100644 --- a/lib_dec/gaus_dec.c +++ b/lib_dec/gaus_dec.c @@ -42,6 +42,7 @@ #include "prot.h" #include "wmc_auto.h" +#ifndef IVAS_FLOAT_FIXED /*---------------------------------------------------------------------* * Local function prototypes *---------------------------------------------------------------------*/ @@ -263,3 +264,4 @@ void gaus_L2_dec_flt( return; } +#endif diff --git a/lib_dec/gaus_dec_fx.c b/lib_dec/gaus_dec_fx.c index 9cd2214bc..7b70d7281 100644 --- a/lib_dec/gaus_dec_fx.c +++ b/lib_dec/gaus_dec_fx.c @@ -70,7 +70,7 @@ void gaus_dec_fx( nb_bits = st_fx->acelp_cfg.gains_mode[shr( i_subfr, 6 )]; move16(); - idx = (Word16) get_next_indice( st_fx, nb_bits ); + idx = (Word16) get_next_indice_fx( st_fx, nb_bits ); /* safety check in case of bit errors */ test(); @@ -165,8 +165,8 @@ void gaus_dec2v_fx( step = shr( 0x80, nb_bits ); - idx = (Word16) get_next_indice( st_fx, add( shl( nb_bits, 1 ), 1 ) ); - index_delta = (Word16) get_next_indice( st_fx, 3 ); + idx = (Word16) get_next_indice_fx( st_fx, add( shl( nb_bits, 1 ), 1 ) ); + index_delta = (Word16) get_next_indice_fx( st_fx, 3 ); dec_2pos_fx( idx, &ind1, &ind2, &sign1, &sign2, nb_bits ); diff --git a/lib_dec/gs_dec_fx.c b/lib_dec/gs_dec_fx.c index 9bd541bc9..4fa3ee0ae 100644 --- a/lib_dec/gs_dec_fx.c +++ b/lib_dec/gs_dec_fx.c @@ -71,7 +71,7 @@ void decod_audio_fx( move16(); /* decode GSC attack flag (used to reduce possible pre-echo) */ - gsc_attack_flag = (Word16) get_next_indice( st_fx, 1 ); + gsc_attack_flag = (Word16) get_next_indice_fx( st_fx, 1 ); /* decode GSC SWB speech flag */ test(); @@ -82,7 +82,7 @@ void decod_audio_fx( ( st_fx->element_mode > EVS_MONO && st_fx->total_brate > MIN_BRATE_GSC_NOISY_FLAG && st_fx->bwidth >= SWB && !st_fx->flag_ACELP16k ) ) ) ) #endif { - st_fx->GSC_noisy_speech = (Word16) get_next_indice( st_fx, 1 ); + st_fx->GSC_noisy_speech = (Word16) get_next_indice_fx( st_fx, 1 ); move16(); } @@ -143,12 +143,12 @@ void decod_audio_fx( { IF( LE_32( st_fx->core_brate, ACELP_8k00 ) ) { - hGSCDec->noise_lev = add( (Word16) get_next_indice( st_fx, 2 ), NOISE_LEVEL_SP2 ); + hGSCDec->noise_lev = add( (Word16) get_next_indice_fx( st_fx, 2 ), NOISE_LEVEL_SP2 ); move16(); } ELSE { - hGSCDec->noise_lev = add( (Word16) get_next_indice( st_fx, 3 ), NOISE_LEVEL_SP0 ); + hGSCDec->noise_lev = add( (Word16) get_next_indice_fx( st_fx, 3 ), NOISE_LEVEL_SP0 ); move16(); } @@ -179,7 +179,7 @@ void decod_audio_fx( nbits = 2; } #endif - nb_frame_flg = (Word16) get_next_indice( st_fx, nbits ); + nb_frame_flg = (Word16) get_next_indice_fx( st_fx, nbits ); if ( s_and( nb_frame_flg, 0x1 ) == 0 ) { @@ -236,7 +236,7 @@ void decod_audio_fx( } ELSE { - pit_band_idx = (Word16) get_next_indice( st_fx, nbits ); + pit_band_idx = (Word16) get_next_indice_fx( st_fx, nbits ); } if ( pit_band_idx != 0 ) @@ -293,7 +293,7 @@ void decod_audio_fx( move16(); } - indice = get_next_indice( st_fx, nbits ); + indice = get_next_indice_fx( st_fx, nbits ); Es_pred_dec_fx( &Es_pred, indice, nbits, 0 ); } @@ -576,7 +576,7 @@ void decod_audio_ivas_fx( move16(); /* decode GSC attack flag (used to reduce possible pre-echo) */ - gsc_attack_flag = (Word16) get_next_indice( st_fx, 1 ); + gsc_attack_flag = (Word16) get_next_indice_fx( st_fx, 1 ); /* decode GSC SWB speech flag */ test(); @@ -593,7 +593,7 @@ void decod_audio_ivas_fx( ( 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 ) ) ) ) #endif { - st_fx->GSC_noisy_speech = (Word16) get_next_indice( st_fx, 1 ); + st_fx->GSC_noisy_speech = (Word16) get_next_indice_fx( st_fx, 1 ); move16(); } @@ -659,12 +659,12 @@ void decod_audio_ivas_fx( { IF( LE_32( st_fx->core_brate, ACELP_8k00 ) ) { - hGSCDec->noise_lev = add( (Word16) get_next_indice( st_fx, 2 ), NOISE_LEVEL_SP2 ); + hGSCDec->noise_lev = add( (Word16) get_next_indice_fx( st_fx, 2 ), NOISE_LEVEL_SP2 ); move16(); } ELSE { - hGSCDec->noise_lev = add( (Word16) get_next_indice( st_fx, 3 ), NOISE_LEVEL_SP0 ); + hGSCDec->noise_lev = add( (Word16) get_next_indice_fx( st_fx, 3 ), NOISE_LEVEL_SP0 ); move16(); } @@ -701,7 +701,7 @@ void decod_audio_ivas_fx( move16(); } #endif - nb_frame_flg = (Word16) get_next_indice( st_fx, nbits ); + nb_frame_flg = (Word16) get_next_indice_fx( st_fx, nbits ); test(); IF( s_and( nb_frame_flg, 0x1 ) == 0 ) @@ -762,7 +762,7 @@ void decod_audio_ivas_fx( } ELSE { - pit_band_idx = (Word16) get_next_indice( st_fx, nbits ); + pit_band_idx = (Word16) get_next_indice_fx( st_fx, nbits ); } IF( pit_band_idx != 0 ) @@ -826,7 +826,7 @@ void decod_audio_ivas_fx( move16(); } - indice = get_next_indice( st_fx, nbits ); + indice = get_next_indice_fx( st_fx, nbits ); Es_pred_dec_fx( &Es_pred, indice, nbits, 0 ); } diff --git a/lib_dec/hdecnrm_fx.c b/lib_dec/hdecnrm_fx.c index c97344274..28aeeceb4 100644 --- a/lib_dec/hdecnrm_fx.c +++ b/lib_dec/hdecnrm_fx.c @@ -32,12 +32,12 @@ void hdecnrm_fx( k = (Word16) 0; move16(); - if ( get_next_indice_1( st_fx ) != 0 ) + if ( get_next_indice_1_fx( st_fx ) != 0 ) { j = (Word16) 1; move16(); } - if ( get_next_indice_1( st_fx ) != 0 ) + if ( get_next_indice_1_fx( st_fx ) != 0 ) { k = (Word16) 1; move16(); @@ -45,14 +45,14 @@ void hdecnrm_fx( n = add( shl( j, 1 ), k ); j = shl( j, 2 ); temp = sub( add( 16, n ), j ); - IF( get_next_indice_1( st_fx ) != 0 ) + IF( get_next_indice_1_fx( st_fx ) != 0 ) { temp = add( add( 12, n ), j ); - IF( get_next_indice_1( st_fx ) != 0 ) + IF( get_next_indice_1_fx( st_fx ) != 0 ) { j = (Word16) 0; move16(); - if ( get_next_indice_1( st_fx ) != 0 ) + if ( get_next_indice_1_fx( st_fx ) != 0 ) { j = 1; move16(); @@ -62,12 +62,12 @@ void hdecnrm_fx( { temp = add( temp, 12 ); } - IF( get_next_indice_1( st_fx ) != 0 ) + IF( get_next_indice_1_fx( st_fx ) != 0 ) { temp = n; move16(); - if ( get_next_indice_1( st_fx ) != 0 ) + if ( get_next_indice_1_fx( st_fx ) != 0 ) { temp = add( 4, n ); } @@ -110,7 +110,7 @@ Word16 decode_huff_context_fx( tmp_l = sub( hufftab[hufftab_idx], shl( tmp_h, 4 ) ); *rbits = add( *rbits, tmp_l ); move16(); - hufftab_idx = L_add( hufftab_idx, L_add( L_deposit_l( tmp_h ), get_next_indice( st_fx, tmp_l ) ) ); + hufftab_idx = L_add( hufftab_idx, L_add( L_deposit_l( tmp_h ), get_next_indice_fx( st_fx, tmp_l ) ) ); } return negate( hufftab[hufftab_idx] ); } @@ -189,7 +189,7 @@ void hdecnrm_resize_fx( FOR( j = 0; j < 11; j++ ) { - IF( get_next_indice_1( st_fx ) != 0 ) + IF( get_next_indice_1_fx( st_fx ) != 0 ) { k = add( k, 1 ); move16(); @@ -216,7 +216,7 @@ void hdecnrm_resize_fx( move16(); } ELSE{ - IF( get_next_indice_1( st_fx ) != 0 ){ + IF( get_next_indice_1_fx( st_fx ) != 0 ){ temp = add( 16, k ); } ELSE @@ -266,7 +266,7 @@ void huff_dec_fx( last_bits = sub( buffer_len, j ); val = lshl( val, last_bits ); val = s_and( val, sub( lshl( 1, buffer_len ), 1 ) ); - val = s_or( val, get_next_indice( st_fx, last_bits ) ); + val = s_or( val, get_next_indice_fx( st_fx, last_bits ) ); /* Find codeword length */ j = sub( num_lengths, 1 ); @@ -312,13 +312,13 @@ void hdecnrm_tran_fx( move16(); k = 0; move16(); - if ( get_next_indice_1( st_fx ) != 0 ) + if ( get_next_indice_1_fx( st_fx ) != 0 ) { j = 1; move16(); } - if ( get_next_indice_1( st_fx ) != 0 ) + if ( get_next_indice_1_fx( st_fx ) != 0 ) { k = 1; move16(); @@ -338,17 +338,17 @@ void hdecnrm_tran_fx( temp = sub( add( 15, l ), n ); } ELSE{ - IF( get_next_indice_1( st_fx ) != 0 ){ + IF( get_next_indice_1_fx( st_fx ) != 0 ){ temp = sub( add( 15, n ), l ); } ELSE { temp = sub( add( 15, l ), n ); - IF( get_next_indice_1( st_fx ) != 0 ) + IF( get_next_indice_1_fx( st_fx ) != 0 ) { FOR( k = 0; k < 3; ) { - IF( get_next_indice_1( st_fx ) != 0 ) + IF( get_next_indice_1_fx( st_fx ) != 0 ) { k = add( k, 1 ); } @@ -374,10 +374,10 @@ void hdecnrm_tran_fx( ELSE { temp = add( temp, 2 ); - IF( get_next_indice_1( st_fx ) != 0 ) + IF( get_next_indice_1_fx( st_fx ) != 0 ) { temp = add( temp, 1 ); - if ( get_next_indice_1( st_fx ) != 0 ) + if ( get_next_indice_1_fx( st_fx ) != 0 ) { temp = add( temp, 1 ); } diff --git a/lib_dec/hq_classifier_dec_fx.c b/lib_dec/hq_classifier_dec_fx.c index 430c27cd7..ace2e535c 100644 --- a/lib_dec/hq_classifier_dec_fx.c +++ b/lib_dec/hq_classifier_dec_fx.c @@ -38,7 +38,7 @@ Word16 ivas_hq_classifier_dec_fx( /* o : Consumed bits test(); IF( ( EQ_16( length, L_SPEC32k ) || EQ_16( length, L_SPEC48k ) ) && LE_32( core_brate, max_brate ) ) { - *hqswb_clas = (Word16) get_next_indice( st_fx, 2 ); + *hqswb_clas = (Word16) get_next_indice_fx( st_fx, 2 ); move16(); bits = 2; move16(); @@ -52,7 +52,7 @@ Word16 ivas_hq_classifier_dec_fx( /* o : Consumed bits } ELSE { - *hqswb_clas = get_next_indice( st_fx, 1 ); + *hqswb_clas = get_next_indice_fx( st_fx, 1 ); move16(); bits = 1; move16(); diff --git a/lib_dec/hq_core_dec_fx.c b/lib_dec/hq_core_dec_fx.c index d629365f3..b8a7e4dd4 100644 --- a/lib_dec/hq_core_dec_fx.c +++ b/lib_dec/hq_core_dec_fx.c @@ -712,7 +712,7 @@ void ivas_hq_core_dec_fx( test(); IF( !( core_switching_flag ) && GT_32( st_fx->core_brate, MINIMUM_RATE_TO_ENCODE_VOICING_FLAG ) ) { - hHQ_core->HqVoicing = get_next_indice( st_fx, 1 ); + hHQ_core->HqVoicing = get_next_indice_fx( st_fx, 1 ); num_bits = sub( num_bits, 1 ); } ELSE @@ -924,7 +924,7 @@ void ivas_hq_core_dec_fx( move16(); L_spec = hTcxDec->L_frameTCX; move16(); - st_fx->fscale = sr2fscale( st_fx->sr_core ); + st_fx->fscale = sr2fscale_fx( st_fx->sr_core ); // fscaleFB = sr2fscale( st_fx->output_Fs ); // encoderLookahead = ( L_LOOK_12k8 * st_fx->fscale ) / FSCALE_DENOM; // encoderLookaheadFB = ( L_LOOK_12k8 * fscaleFB ) / FSCALE_DENOM; diff --git a/lib_dec/hq_env_dec_fx.c b/lib_dec/hq_env_dec_fx.c index df1635e37..db710413e 100644 --- a/lib_dec/hq_env_dec_fx.c +++ b/lib_dec/hq_env_dec_fx.c @@ -34,13 +34,13 @@ Word16 decode_envelope_indices_fx( /* o : Number of b test(); IF( EQ_16( flag_HQ2, LOW_RATE_HQ_CORE ) || EQ_16( flag_HQ2, LOW_RATE_HQ_CORE_TRAN ) ) { - LCmode = (Word16) get_next_indice( st_fx, BITS_DE_HMODE ); - difidx[start_norm] = (Word16) get_next_indice( st_fx, BITS_DE_FCOMP ); + LCmode = (Word16) get_next_indice_fx( st_fx, BITS_DE_HMODE ); + difidx[start_norm] = (Word16) get_next_indice_fx( st_fx, BITS_DE_FCOMP ); } ELSE { - LCmode = (Word16) get_next_indice( st_fx, 2 ); - difidx[start_norm] = (Word16) get_next_indice( st_fx, NORM0_BITS ); + LCmode = (Word16) get_next_indice_fx( st_fx, 2 ); + difidx[start_norm] = (Word16) get_next_indice_fx( st_fx, NORM0_BITS ); } test(); @@ -130,7 +130,7 @@ Word16 decode_envelope_indices_fx( /* o : Number of b pDifidx = &difidx[startNormPlus1]; FOR( i = 0; i < numSfmMinus1; i++ ) { - *pDifidx++ = (Word16) get_next_indice( st_fx, NORMI_BITS ); + *pDifidx++ = (Word16) get_next_indice_fx( st_fx, NORMI_BITS ); move16(); } hcode_l = numnrmibits; diff --git a/lib_dec/hq_hr_dec_fx.c b/lib_dec/hq_hr_dec_fx.c index 4814b86e5..a4c5ebf13 100644 --- a/lib_dec/hq_hr_dec_fx.c +++ b/lib_dec/hq_hr_dec_fx.c @@ -224,7 +224,7 @@ void ivas_hq_hr_dec_fx( test(); IF( !*is_transient && NE_16( *hqswb_clas, HQ_HVQ ) && !( EQ_16( length, L_FRAME16k ) && LE_32( st_fx->core_brate, HQ_32k ) ) ) { - nf_idx = get_next_indice( st_fx, 2 ); + nf_idx = get_next_indice_fx( st_fx, 2 ); } /*------------------------------------------------------------------* diff --git a/lib_dec/hq_lr_dec_fx.c b/lib_dec/hq_lr_dec_fx.c index a954f98aa..f6bedf43b 100644 --- a/lib_dec/hq_lr_dec_fx.c +++ b/lib_dec/hq_lr_dec_fx.c @@ -74,7 +74,7 @@ static void spt_shorten_domain_set_dec_fx( move16(); IF( EQ_16( p2a_flags[k], 1 ) ) { - spt_shorten_flag[j] = get_next_indice( st_fx, 1 ); + spt_shorten_flag[j] = get_next_indice_fx( st_fx, 1 ); *bit_budget = sub( *bit_budget, 1 ); IF( EQ_16( spt_shorten_flag[j], 1 ) ) { @@ -201,7 +201,7 @@ void hq_lr_dec_fx( test(); IF( EQ_16( st_fx->bwidth, SWB ) && ( EQ_32( L_bwe_br, HQ_16k40 ) || EQ_32( L_bwe_br, HQ_13k20 ) ) ) { - hqswb_clas_fx = get_next_indice( st_fx, 2 ); + hqswb_clas_fx = get_next_indice_fx( st_fx, 2 ); num_bits = sub( num_bits, 2 ); *is_transient_fx = 0; @@ -215,7 +215,7 @@ void hq_lr_dec_fx( ELSE { /* decode transient flag */ - *is_transient_fx = get_next_indice( st_fx, 1 ); + *is_transient_fx = get_next_indice_fx( st_fx, 1 ); num_bits = sub( num_bits, 1 ); } @@ -389,7 +389,7 @@ void hq_lr_dec_fx( j = 0; FOR( i = 0; i < 2; i++ ) { - last_bitalloc_max_band[i] = get_next_indice( st_fx, 1 ); + last_bitalloc_max_band[i] = get_next_indice_fx( st_fx, 1 ); move16(); } lowband = 6; @@ -603,7 +603,7 @@ void hq_lr_dec_fx( FOR( i = 0; i < 2; i++ ) { - last_bitalloc_max_band[i] = get_next_indice( st_fx, 1 ); + last_bitalloc_max_band[i] = get_next_indice_fx( st_fx, 1 ); move16(); } FOR( i = 0; i < bands_fx; i++ ) @@ -1016,7 +1016,7 @@ static Word16 small_symbol_dec_fx( /* o : bits /* Decoding LSB bit packing */ FOR( i = 0; i < bands; ++i ) { - LSB = get_next_indice( st_fx, BITS_DE_LSB ); + LSB = get_next_indice_fx( st_fx, BITS_DE_LSB ); difidx[i] = s_or( shl( difidx[i], 1 ), LSB ); move16(); } @@ -1048,7 +1048,7 @@ static Word16 decode_huff_8s_fx( WHILE( *hufftab > 0 ) { *rbits = add( *rbits, s_and( *hufftab, 0xf ) ); - bit = get_next_indice( st_fx, s_and( *hufftab, 0xf ) ); + bit = get_next_indice_fx( st_fx, s_and( *hufftab, 0xf ) ); move16(); hufftab += add( shr( *hufftab, 4 ), bit ); } @@ -1070,21 +1070,21 @@ static Word16 large_symbol_dec_fx( /* o : bits cntbits = BITS_DE_8SMODE; move16(); - ns2mode = get_next_indice( st_fx, BITS_DE_8SMODE ); + ns2mode = get_next_indice_fx( st_fx, BITS_DE_8SMODE ); IF( ns2mode == 0 ) { - ns2mode0 = get_next_indice( st_fx, BITS_DE_8SMODE_N0 ); - ns2mode1 = get_next_indice( st_fx, BITS_DE_8SMODE_N1 ); + ns2mode0 = get_next_indice_fx( st_fx, BITS_DE_8SMODE_N0 ); + ns2mode1 = get_next_indice_fx( st_fx, BITS_DE_8SMODE_N1 ); cntbits = add( cntbits, BITS_DE_8SMODE_N0 + BITS_DE_8SMODE_N1 ); IF( ns2mode0 == 0 ) { IF( EQ_16( ns2mode1, 1 ) ) { - pos_outlyer = get_next_indice( st_fx, BITS_DE_8SPOS ); + pos_outlyer = get_next_indice_fx( st_fx, BITS_DE_8SPOS ); cntbits = add( cntbits, BITS_DE_8SPOS ); - qbidx[pos_outlyer] = sub( get_next_indice( st_fx, BITS_ABS_ENG ), ABS_ENG_OFFSET ); + qbidx[pos_outlyer] = sub( get_next_indice_fx( st_fx, BITS_ABS_ENG ), ABS_ENG_OFFSET ); move16(); cntbits = add( cntbits, BITS_ABS_ENG ); } @@ -1116,12 +1116,12 @@ static Word16 large_symbol_dec_fx( /* o : bits { IF( EQ_16( ns2mode1, 1 ) ) { - pos_outlyer = get_next_indice( st_fx, BITS_DE_8SPOS ); + pos_outlyer = get_next_indice_fx( st_fx, BITS_DE_8SPOS ); cntbits = add( cntbits, BITS_DE_8SPOS ); - qbidx[0] = sub( get_next_indice( st_fx, BITS_ABS_ENG ), ABS_ENG_OFFSET ); + qbidx[0] = sub( get_next_indice_fx( st_fx, BITS_ABS_ENG ), ABS_ENG_OFFSET ); move16(); cntbits = add( cntbits, BITS_ABS_ENG ); - qbidx[pos_outlyer] = sub( get_next_indice( st_fx, BITS_ABS_ENG ), ABS_ENG_OFFSET ); + qbidx[pos_outlyer] = sub( get_next_indice_fx( st_fx, BITS_ABS_ENG ), ABS_ENG_OFFSET ); move16(); cntbits = add( cntbits, BITS_ABS_ENG ); } @@ -1129,7 +1129,7 @@ static Word16 large_symbol_dec_fx( /* o : bits { pos_outlyer = 0; move16(); - qbidx[0] = sub( get_next_indice( st_fx, BITS_ABS_ENG ), ABS_ENG_OFFSET ); + qbidx[0] = sub( get_next_indice_fx( st_fx, BITS_ABS_ENG ), ABS_ENG_OFFSET ); move16(); cntbits = add( cntbits, BITS_ABS_ENG ); } @@ -1155,7 +1155,7 @@ static Word16 large_symbol_dec_fx( /* o : bits } ELSE { - basic_shift = get_next_indice( st_fx, BITS_MAX_DEPTH ); + basic_shift = get_next_indice_fx( st_fx, BITS_MAX_DEPTH ); cntbits = add( cntbits, BITS_MAX_DEPTH ); FOR( i = 0; i < bands; ++i ) @@ -1171,7 +1171,7 @@ static Word16 large_symbol_dec_fx( /* o : bits FOR( i = 0; i < bands; ++i ) { - LSB[0] = get_next_indice( st_fx, basic_shift ); + LSB[0] = get_next_indice_fx( st_fx, basic_shift ); move16(); qbidx[i] = add( qbidx[i], LSB[0] ); move16(); @@ -1212,7 +1212,7 @@ static Word16 band_energy_dequant_fx( /* parsing energy difference coding mode */ - deng_cmode = get_next_indice( st_fx, BITS_DE_CMODE ); + deng_cmode = get_next_indice_fx( st_fx, BITS_DE_CMODE ); IF( deng_cmode == 0 ) { @@ -1291,7 +1291,7 @@ static Word16 p2a_threshold_dequant_fx( move16(); FOR( k = sub( bands, p2a_bands ); k < bands; k++ ) { - p2a_flags[k] = get_next_indice( st_fx, 1 ); + p2a_flags[k] = get_next_indice_fx( st_fx, 1 ); move16(); j = add( j, 1 ); } @@ -1361,7 +1361,7 @@ static void mdct_spectrum_fine_gain_dec_fx( FOR( k = sub( bands, Ngq ); k < bands; k++ ) { - imin_fx = get_next_indice( st_fx, gqbits ); + imin_fx = get_next_indice_fx( st_fx, gqbits ); /*gamma = gain_table[imin]; */ gamma_fx = gain_table_fx[imin_fx]; diff --git a/lib_dec/igf_dec_fx.c b/lib_dec/igf_dec_fx.c index daf14cc1a..a81472302 100644 --- a/lib_dec/igf_dec_fx.c +++ b/lib_dec/igf_dec_fx.c @@ -391,7 +391,7 @@ static void IGF_decode_whitening_level( Decoder_State *st, Word16 tmp; - tmp = get_next_indice( st, 1 ); + tmp = get_next_indice_fx( st, 1 ); IF( tmp == 0 ) { @@ -401,7 +401,7 @@ static void IGF_decode_whitening_level( Decoder_State *st, return; } - tmp = get_next_indice( st, 1 ); + tmp = get_next_indice_fx( st, 1 ); hPrivateData->currWhiteningLevel[p] = IGF_WHITENING_STRONG; move16(); @@ -419,7 +419,7 @@ static void IGF_decode_temp_flattening_trigger( Decoder_State *st, IGF_DEC_INSTANCE_HANDLE hInstance /**< in: | instance handle of IGF Deccoder */ ) { - hInstance->flatteningTrigger = get_next_indice( st, 1 ); + hInstance->flatteningTrigger = get_next_indice_fx( st, 1 ); } /**********************************************************************/ /* @@ -3082,7 +3082,7 @@ void IGFDecReadData_ivas_fx( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in IF( isIndepFrame == 0 ) { - tmp = get_next_indice( st, 1 ); + tmp = get_next_indice_fx( st, 1 ); } IF( tmp == 1 ) @@ -3104,7 +3104,7 @@ void IGFDecReadData_ivas_fx( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in } ELSE { - tmp = get_next_indice( st, 1 ); + tmp = get_next_indice_fx( st, 1 ); } IF( EQ_16( tmp, 1 ) ) @@ -3167,7 +3167,7 @@ void IGFDecReadData( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | ins IF( isIndepFrame == 0 ) { - tmp = get_next_indice( st, 1 ); + tmp = get_next_indice_fx( st, 1 ); } IF( EQ_16( tmp, 1 ) ) @@ -3181,7 +3181,7 @@ void IGFDecReadData( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | ins ELSE { IGF_decode_whitening_level( st, hPrivateData, 0 ); - tmp = get_next_indice( st, 1 ); + tmp = get_next_indice_fx( st, 1 ); IF( EQ_16( tmp, 1 ) ) { FOR( p = 1; p < nT; p++ ) @@ -3235,7 +3235,7 @@ void IGFDecReadLevel( /**< ou hGrid = &hPrivateData->igfInfo.grid[igfGridIdx]; m_igfSfbStart = hGrid->startSfb; move16(); - IGFAllZero = get_next_indice( st, 1 ); + IGFAllZero = get_next_indice_fx( st, 1 ); IF( IGFAllZero == 0 ) { diff --git a/lib_dec/inov_dec_fx.c b/lib_dec/inov_dec_fx.c index b91724125..49461af4d 100644 --- a/lib_dec/inov_dec_fx.c +++ b/lib_dec/inov_dec_fx.c @@ -121,12 +121,12 @@ void inov_decode_fx( // PMT("CONDITION above is missing -> idchan") FOR( i = 0; i < wordcnt; i++ ) { - indexing_indices[i] = get_next_indice( st_fx, 16 ); + indexing_indices[i] = get_next_indice_fx( st_fx, 16 ); move16(); } IF( bitcnt ) { - indexing_indices[i] = get_next_indice( st_fx, bitcnt ); + indexing_indices[i] = get_next_indice_fx( st_fx, bitcnt ); move16(); } config = PulseConfTable[st_fx->acelp_cfg.fixed_cdk_index[i_subfr / L_SUBFR]]; @@ -311,11 +311,11 @@ void inov_decode_ivas_fx( // PMT("CONDITION above is missing -> idchan") FOR( i = 0; i < wordcnt; i++ ) { - indexing_indices[i] = get_next_indice( st_fx, 16 ); + indexing_indices[i] = get_next_indice_fx( st_fx, 16 ); } IF( bitcnt ) { - indexing_indices[i] = get_next_indice( st_fx, bitcnt ); + indexing_indices[i] = get_next_indice_fx( st_fx, bitcnt ); } config = PulseConfTable[st_fx->acelp_cfg.fixed_cdk_index[i_subfr / L_SUBFR]]; D_ACELP_indexing_fx( code, config, NB_TRACK_FCB_4T, indexing_indices, &st_fx->BER_detect ); diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 9d2aa6d7e..cbf26cad4 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -324,7 +324,7 @@ ivas_error ivas_core_dec_fx( st->sr_core = L_mult0( st->L_frame, FRAMES_PER_SEC ); st->fscale_old = st->fscale; move16(); - st->fscale = sr2fscale( st->sr_core ); + st->fscale = sr2fscale_fx( st->sr_core ); } ELSE { diff --git a/lib_dec/ivas_decision_matrix_dec.c b/lib_dec/ivas_decision_matrix_dec.c index c6623f9e5..111678e82 100644 --- a/lib_dec/ivas_decision_matrix_dec.c +++ b/lib_dec/ivas_decision_matrix_dec.c @@ -39,6 +39,9 @@ #include "ivas_cnst.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" +#ifdef IVAS_FLOAT_FIXED +#include "prot_fx.h" +#endif /*-----------------------------------------------------------------* * ivas_decision_matrix_dec() @@ -527,14 +530,14 @@ void ivas_decision_matrix_dec_fx( { IF( NE_16( st->element_mode, IVAS_CPE_DFT ) ) { - st->cng_type = get_next_indice( st, 1 ); + st->cng_type = get_next_indice_fx( st, 1 ); IF( EQ_16( st->cng_type, FD_CNG ) ) { - st->bwidth = get_next_indice( st, 2 ); + st->bwidth = get_next_indice_fx( st, 2 ); } } - IF( get_next_indice( st, 1 ) ) + IF( get_next_indice_fx( st, 1 ) ) { st->L_frame = L_FRAME16k; move16(); @@ -549,7 +552,7 @@ void ivas_decision_matrix_dec_fx( { /* read channel coherence */ Word16 index; - index = get_next_indice( st, 4 ); + index = get_next_indice_fx( st, 4 ); st->hFdCngDec->hFdCngCom->coherence_fx = get_next_index_4_by_15[index]; move16(); @@ -557,7 +560,7 @@ void ivas_decision_matrix_dec_fx( // st->hFdCngDec->hFdCngCom->coherence_flt = ( (float) get_next_index_4_by_15[index] ) / ( ( 1 << 15 ) - 1 ); /* read flag for no side noise shape */ - st->hFdCngDec->hFdCngCom->no_side_flag = get_next_indice( st, 1 ); + st->hFdCngDec->hFdCngCom->no_side_flag = get_next_indice_fx( st, 1 ); } test(); @@ -615,7 +618,7 @@ void ivas_decision_matrix_dec_fx( IF( EQ_16( st->element_mode, IVAS_CPE_TD ) || GE_32( st->total_brate, STEREO_TCX_MIN_RATE ) ) { /* ACELP/transform core selection bit */ - IF( get_next_indice( st, 1 ) ) + IF( get_next_indice_fx( st, 1 ) ) { st->core = HQ_CORE; move16(); @@ -673,7 +676,7 @@ void ivas_decision_matrix_dec_fx( { IF( LT_32( element_brate, FRMT_SHP_MIN_BRATE_IVAS ) ) { - st->coder_type = get_next_indice( st, 3 ); + st->coder_type = get_next_indice_fx( st, 3 ); *sharpFlag = 0; move16(); @@ -689,10 +692,10 @@ void ivas_decision_matrix_dec_fx( ELSE { /* get coder_type info */ - st->coder_type = get_next_indice( st, 3 ); + st->coder_type = get_next_indice_fx( st, 3 ); /* get sharpening flag */ - *sharpFlag = get_next_indice( st, 1 ); + *sharpFlag = get_next_indice_fx( st, 1 ); } } } @@ -731,7 +734,7 @@ void ivas_decision_matrix_dec_fx( ELSE IF( EQ_16( st->bwidth, WB ) && GE_32( st->total_brate, MIN_BRATE_WB_BWE ) && !st->flag_ACELP16k ) { /* read the WB TBE/BWE selection bit */ - IF( get_next_indice( st, 1 ) ) + IF( get_next_indice_fx( st, 1 ) ) { st->extl = WB_BWE; move16(); @@ -769,7 +772,7 @@ void ivas_decision_matrix_dec_fx( IF( GE_32( st->total_brate, MIN_BRATE_SWB_BWE ) || ( GE_32( st->total_brate, MIN_MIN_BRATE_LRTD_SWB_BWE ) && EQ_16( st->element_mode, IVAS_CPE_TD ) && EQ_16( st->bwidth, SWB ) && st->tdm_LRTD_flag ) || ( LT_32( element_brate, IVAS_16k4 ) && GE_32( st->total_brate, MIN_MIN_BRATE_LRTD_SWB_BWE ) && EQ_16( st->element_mode, IVAS_CPE_TD ) && EQ_16( st->bwidth, SWB ) ) ) { /* read the SWB TBE/BWE selection bit */ - tmp = get_next_indice( st, 1 ); + tmp = get_next_indice_fx( st, 1 ); IF( tmp ) { @@ -893,7 +896,7 @@ void ivas_decision_matrix_dec_fx( test(); IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) && !( EQ_16( st->idchan, 1 ) && EQ_16( st->element_mode, IVAS_CPE_TD ) ) && EQ_16( st->core, HQ_CORE ) ) { - IF( get_next_indice( st, 1 ) ) + IF( get_next_indice_fx( st, 1 ) ) { st->core = TCX_20_CORE; move16(); @@ -924,7 +927,7 @@ void ivas_decision_matrix_dec_fx( IF( EQ_16( st->core, HQ_CORE ) ) { /* read ACELP->HQ core switching flag */ - *core_switching_flag = get_next_indice( st, 1 ); + *core_switching_flag = get_next_indice_fx( st, 1 ); } ELSE { diff --git a/lib_dec/ivas_entropy_decoder.c b/lib_dec/ivas_entropy_decoder.c index 9c769bf57..b2c140e65 100644 --- a/lib_dec/ivas_entropy_decoder.c +++ b/lib_dec/ivas_entropy_decoder.c @@ -38,6 +38,7 @@ #include "ivas_rom_com.h" #include #include "wmc_auto.h" +#include "prot_fx.h" #ifdef IVAS_FLOAT_FIXED #include "ivas_prot_fx.h" #endif @@ -73,7 +74,7 @@ static void ivas_arith_decode_array( { IF( pArith->dyn_model_bits > 0 ) { - model_idx = get_next_indice( st0, pArith->dyn_model_bits ); + model_idx = get_next_indice_fx( st0, pArith->dyn_model_bits ); IF( model_idx > 0 ) { @@ -212,7 +213,7 @@ ivas_error ivas_huffman_decode( { Word16 code, num_bits_read, ind, bit; - code = get_next_indice( st0, huff_cfg->min_len ); + code = get_next_indice_fx( st0, huff_cfg->min_len ); num_bits_read = huff_cfg->min_len; move16(); @@ -220,7 +221,7 @@ ivas_error ivas_huffman_decode( WHILE( GT_16( ind, huff_cfg->sym_len ) ) { - bit = get_next_indice( st0, 1 ); + bit = get_next_indice_fx( st0, 1 ); num_bits_read = add( num_bits_read, 1 ); code = s_or( shl( code, 1 ), bit ); ind = ivas_huffman_code_bits_present( huff_cfg->codebook, code, num_bits_read, huff_cfg->sym_len ); diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index e8c854128..538cb2301 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -207,7 +207,7 @@ static void dec_prm_tcx_sidebits_fx( IF( ( ( st->last_core == ACELP_CORE ) && ( st->last_total_brate == FRAME_NO_DATA ) ) || st->prev_bfi ) { /* needed for cases where first TCX frame after a certain transition (e.g. inactive SID/zero frame -> active or stereo switching) is lost */ - st->last_core_from_bs = get_next_indice( st0, 1 ); + st->last_core_from_bs = get_next_indice_fx( st0, 1 ); move16(); /* ACELP -> TCX_10 transitions are forbidden */ @@ -220,7 +220,7 @@ static void dec_prm_tcx_sidebits_fx( } ELSE { - st->last_core = get_next_indice( st0, 1 ); + st->last_core = get_next_indice_fx( st0, 1 ); move16(); st->last_core_from_bs = st->last_core; move16(); @@ -233,16 +233,16 @@ static void dec_prm_tcx_sidebits_fx( move16(); IF( st->last_core_from_bs != ACELP_CORE ) { - st->hTcxDec->kernel_type[0] = get_next_indice( st0, 2 ); + st->hTcxDec->kernel_type[0] = get_next_indice_fx( st0, 2 ); } ELSE { - st->hTcxDec->kernel_type[0] = get_next_indice( st0, 1 ); + st->hTcxDec->kernel_type[0] = get_next_indice_fx( st0, 1 ); } move16(); IF( EQ_16( st->core, TCX_10_CORE ) ) { - st->hTcxDec->kernel_type[1] = add( shl( s_and( st->hTcxDec->kernel_type[0], 1 ), 1 ), get_next_indice( st0, 1 ) ); + st->hTcxDec->kernel_type[1] = add( shl( s_and( st->hTcxDec->kernel_type[0], 1 ), 1 ), get_next_indice_fx( st0, 1 ) ); move16(); } IF( EQ_16( st->core, TCX_20_CORE ) ) @@ -604,7 +604,7 @@ void ivas_mdct_dec_side_bits_frame_channel_fx( st = sts[ch]; IF( MCT_flag ) { - tmp = get_next_indice( st0, 1 ); + tmp = get_next_indice_fx( st0, 1 ); IF( tmp ) { st->mct_chan_mode = MCT_CHAN_MODE_IGNORE; @@ -688,7 +688,7 @@ void ivas_mdct_dec_side_bits_frame_channel_fx( FOR( Word16 n = 0; n < nSubframes; ++n ) { - param_lpc[0][n] = get_next_indice( st0, 1 ); + param_lpc[0][n] = get_next_indice_fx( st0, 1 ); move16(); } @@ -697,7 +697,7 @@ void ivas_mdct_dec_side_bits_frame_channel_fx( { IF( EQ_16( param_lpc[0][n], SNS_STEREO_MODE_MS ) ) { - param_lpc[0][n + ( SNS_STEREO_MODE_OFFSET_INDICES / 2 )] = get_next_indice( st0, 1 ); + param_lpc[0][n + ( SNS_STEREO_MODE_OFFSET_INDICES / 2 )] = get_next_indice_fx( st0, 1 ); move16(); } } @@ -784,14 +784,14 @@ void ivas_mdct_dec_side_bits_frame_channel_fx( IF( ( ch == 0 ) || skipped_first_channel ) { /* read SNS stereo mode */ - param_lpc[0][0] = shl( (Word16) get_next_indice( st0, 1 ), 1 ); + param_lpc[0][0] = shl( (Word16) get_next_indice_fx( st0, 1 ), 1 ); /* read low br mode flag (if it is possible to be non-zero) */ test(); test(); IF( EQ_32( sts[0]->element_brate, IVAS_48k ) && !( EQ_16( sts[0]->core, TCX_20 ) && EQ_16( sts[1]->core, TCX_20 ) ) ) { - sns_low_br_mode = get_next_indice( st0, 1 ); + sns_low_br_mode = get_next_indice_fx( st0, 1 ); } } diff --git a/lib_dec/ivas_sce_dec_fx.c b/lib_dec/ivas_sce_dec_fx.c index 8e1b5d140..070cbf4ed 100644 --- a/lib_dec/ivas_sce_dec_fx.c +++ b/lib_dec/ivas_sce_dec_fx.c @@ -146,13 +146,13 @@ ivas_error ivas_sce_dec_fx( ( LT_32( hSCE->element_brate, MIN_BRATE_FB_ISM ) && st->is_ism_format ) ) { /* WB and SWB are supported */ - st->bwidth = add( get_next_indice( st, 1 ), WB ); + st->bwidth = add( get_next_indice_fx( st, 1 ), WB ); move16(); } ELSE { /* WB, SWB and FB are supported */ - st->bwidth = get_next_indice( st, NBITS_BWIDTH ); + st->bwidth = get_next_indice_fx( st, NBITS_BWIDTH ); move16(); } } diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index bf72059f0..8fa79a7be 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -3156,7 +3156,7 @@ static void ivas_spar_dec_parse_md_bs_fx( IF( GE_32( ivas_total_brate, BRATE_SPAR_Q_STRAT ) ) { /*only one bit written for quantization strategy to indicate either a fixed quantization strategy or dtx_vad==0 */ - qsi = get_next_indice( st0, 1 ); + qsi = get_next_indice_fx( st0, 1 ); if ( EQ_32( qsi, 1 ) ) { *dtx_vad = 0; @@ -3173,7 +3173,7 @@ static void ivas_spar_dec_parse_md_bs_fx( } ELSE { - qsi = get_next_indice( st0, hMdDec->spar_md_cfg.quant_strat_bits ); + qsi = get_next_indice_fx( st0, hMdDec->spar_md_cfg.quant_strat_bits ); } } } @@ -3263,7 +3263,7 @@ static void ivas_spar_dec_parse_md_bs_fx( move16(); move16(); - strat = get_next_indice( st0, 3 ); + strat = get_next_indice_fx( st0, 3 ); no_ec = 0; move16(); @@ -4465,7 +4465,7 @@ static void ivas_parse_parameter_bitstream_dtx( pr_pd_bits = ivas_get_bits_to_encode( L_mult0( pd_q_lvls, pr_q_lvls ) ); - value = get_next_indice( st0, pr_pd_bits ); + value = get_next_indice_fx( st0, pr_pd_bits ); IF( value != 0 ) { @@ -4509,7 +4509,7 @@ static void ivas_parse_parameter_bitstream_dtx( FOR( j = 0; j < zero_pad_bits; j++ ) { - get_next_indice( st0, 1 ); + get_next_indice_fx( st0, 1 ); } ivas_spar_unquant_dtx_indicies( pSpar_md, num_bands, bw, num_dmx_per_band ); diff --git a/lib_dec/ivas_stereo_adapt_GR_dec.c b/lib_dec/ivas_stereo_adapt_GR_dec.c index 6eaef9c9e..3eed99635 100644 --- a/lib_dec/ivas_stereo_adapt_GR_dec.c +++ b/lib_dec/ivas_stereo_adapt_GR_dec.c @@ -38,6 +38,7 @@ #include "ivas_rom_com.h" #include "rom_dec.h" #ifdef IVAS_FLOAT_FIXED +#include "prot_fx.h" #include "ivas_prot_fx.h" #endif @@ -419,8 +420,8 @@ Word16 read_itd( Word16 huff_flag, sign_flag, I, i, nb = 0, ready; move16(); - huff_flag = (Word16) get_next_indice( st, 1 ); - sign_flag = (Word16) get_next_indice( st, 1 ); + huff_flag = (Word16) get_next_indice_fx( st, 1 ); + sign_flag = (Word16) get_next_indice_fx( st, 1 ); nb = add( nb, 2 ); IF( EQ_16( huff_flag, 1 ) ) @@ -433,7 +434,7 @@ Word16 read_itd( WHILE( ( ready == 0 ) && ( LT_16( nb, 10 ) ) ) { test(); - I = add( shl( I, 1 ), (Word16) get_next_indice( st, 1 ) ); + I = add( shl( I, 1 ), (Word16) get_next_indice_fx( st, 1 ) ); nb = add( nb, 1 ); FOR( i = 0; i < 20; i++ ) @@ -456,7 +457,7 @@ Word16 read_itd( } ELSE { - I = (Word16) get_next_indice( st, STEREO_DFT_ITD_NBITS - 1 ); + I = (Word16) get_next_indice_fx( st, STEREO_DFT_ITD_NBITS - 1 ); nb = add( nb, STEREO_DFT_ITD_NBITS - 1 ); } diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index f4464f79c..246c284cc 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -78,6 +78,7 @@ #define STEREO_CNA_SOFT_VAD_DN 0.95f /* long-term averaging factor for downward soft VAD update in stereo CNA */ +#ifndef IVAS_FLOAT_FIXED /*------------------------------------------------------------------- * stereo_dft_dec_sid_coh() * @@ -193,7 +194,6 @@ void stereo_dft_dec_sid_coh( } -#ifndef IVAS_FLOAT_FIXED /*------------------------------------------------------------------- * stereo_dft_generate_comfort_noise() * diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index ea5f56998..e15f0fb4f 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -3667,7 +3667,7 @@ void stereo_dft_dec_read_BS_fx( IF( !hStereoDft->frame_sid_nodata ) { - itd_mode = get_next_indice( st, STEREO_DFT_ITD_MODE_NBITS ); + itd_mode = get_next_indice_fx( st, STEREO_DFT_ITD_MODE_NBITS ); ( *nb_bits ) = add( ( *nb_bits ), STEREO_DFT_ITD_MODE_NBITS ); /*ITD mode flag: 1bit*/ hStereoDft->itd_fx[k + k_offset] = 0; @@ -3772,7 +3772,7 @@ void stereo_dft_dec_read_BS_fx( /* Read bit for adaptive SF (WB/SWB & FB) */ IF( EQ_16( hStereoDft->hConfig->res_cod_mode, STEREO_DFT_RES_COD_OFF ) ) { - hStereoDft->reverb_flag = get_next_indice( st, STEREO_DFT_REVERB_MODE_NBITS ); + hStereoDft->reverb_flag = get_next_indice_fx( st, STEREO_DFT_REVERB_MODE_NBITS ); ( *nb_bits ) = add( ( *nb_bits ), STEREO_DFT_REVERB_MODE_NBITS ); nb = add( nb, STEREO_DFT_REVERB_MODE_NBITS ); IF( hStereoDft->reverb_flag ) diff --git a/lib_dec/ivas_tcx_core_dec.c b/lib_dec/ivas_tcx_core_dec.c index 922f6e369..67d867d82 100644 --- a/lib_dec/ivas_tcx_core_dec.c +++ b/lib_dec/ivas_tcx_core_dec.c @@ -85,7 +85,7 @@ void stereo_tcx_init_dec_fx( /*sampling rate*/ st->sr_core = getCoreSamplerateMode2( st->element_mode, L_mult0( st->bits_frame_nominal, FRAMES_PER_SEC ), st->bwidth, st->flag_ACELP16k, st->rf_flag, st->is_ism_format ); move32(); - st->fscale = sr2fscale( st->sr_core ); + st->fscale = sr2fscale_fx( st->sr_core ); move16(); /*frame size*/ diff --git a/lib_dec/lp_exc_d_fx.c b/lib_dec/lp_exc_d_fx.c index 76d4b4676..56deb5dd5 100644 --- a/lib_dec/lp_exc_d_fx.c +++ b/lib_dec/lp_exc_d_fx.c @@ -53,7 +53,7 @@ void lp_filt_exc_dec_fx( { IF( EQ_16( lp_flag, NORMAL_OPERATION ) ) { - lp_flag = (Word16) get_next_indice( st_fx, 1 ); + lp_flag = (Word16) get_next_indice_fx( st_fx, 1 ); } } IF( EQ_16( lp_flag, LOW_PASS ) ) diff --git a/lib_dec/lsf_dec_fx.c b/lib_dec/lsf_dec_fx.c index 5db486999..4d9a93586 100644 --- a/lib_dec/lsf_dec_fx.c +++ b/lib_dec/lsf_dec_fx.c @@ -37,11 +37,11 @@ static void dqlsf_CNG_fx( Word16 indice[4]; Word16 ber_flag; - indice[0] = (Word16) get_next_indice( st_fx, 4 ); + indice[0] = (Word16) get_next_indice_fx( st_fx, 4 ); move16(); - indice[1] = (Word16) get_next_indice( st_fx, LEN_INDICE ); + indice[1] = (Word16) get_next_indice_fx( st_fx, LEN_INDICE ); move16(); - indice[2] = (Word16) get_next_indice( st_fx, LSF_BITS_CNG - 4 - LEN_INDICE ); + indice[2] = (Word16) get_next_indice_fx( st_fx, LSF_BITS_CNG - 4 - LEN_INDICE ); move16(); /* deindex_lvq_cng decoder does not need to know the sampling rate, the sampling rate data is embedded inside the LSF coefficients */ @@ -428,7 +428,7 @@ void lsf_end_dec_fx( #endif { /* this bit is used only for primary channel or mono */ - coder_type = (Word16) get_next_indice( st, 1 ); + coder_type = (Word16) get_next_indice_fx( st, 1 ); coder_type = add( coder_type, 2 ); test(); test(); @@ -507,7 +507,7 @@ void lsf_end_dec_fx( } ELSE { - safety_net = (Word16) get_next_indice( st, 1 ); + safety_net = (Word16) get_next_indice_fx( st, 1 ); } } @@ -556,7 +556,7 @@ void lsf_end_dec_fx( move16(); FOR( i = 0; i < M / 2 + 3; i++ ) { - TCQIdx[i + 1] = get_next_indice( st, Bit_alloc1[i] ); + TCQIdx[i + 1] = get_next_indice_fx( st, Bit_alloc1[i] ); move16(); } } @@ -620,7 +620,7 @@ void lsf_end_dec_fx( { num_bits = bits[i]; move16(); - lindice[i + 1] = (Word16) get_next_indice( st, num_bits ); + lindice[i + 1] = (Word16) get_next_indice_fx( st, num_bits ); move16(); } @@ -641,7 +641,7 @@ void lsf_end_dec_fx( move16(); } - lindice[i + 1] = (Word16) get_next_indice( st, num_bits ); + lindice[i + 1] = (Word16) get_next_indice_fx( st, num_bits ); move16(); i = add( i, 1 ); } @@ -930,7 +930,7 @@ void lsf_mid_dec_fx( } /* Retrieve mid-frame LSF index */ - idx = (Word16) get_next_indice( st_fx, nb_bits ); + idx = (Word16) get_next_indice_fx( st_fx, nb_bits ); /* Calculation of mid-LSF vector */ FOR( j = 0; j < M; j++ ) diff --git a/lib_dec/lsf_msvq_ma_dec.c b/lib_dec/lsf_msvq_ma_dec.c index d18d49fff..32fdcb28c 100644 --- a/lib_dec/lsf_msvq_ma_dec.c +++ b/lib_dec/lsf_msvq_ma_dec.c @@ -42,6 +42,7 @@ #include "basop_proto_func.h" #include "wmc_auto.h" +#ifndef IVAS_FLOAT_FIXED /*---------------------------------------------------------------------* * lsf_msvq_ma_decprm_ivas() * @@ -278,3 +279,4 @@ int16_t dec_lsf_tcxlpc_ivas( return st->next_bit_pos - start_bit_pos; } +#endif diff --git a/lib_dec/nelp_dec_fx.c b/lib_dec/nelp_dec_fx.c index 6943e0b82..b873d398d 100644 --- a/lib_dec/nelp_dec_fx.c +++ b/lib_dec/nelp_dec_fx.c @@ -164,11 +164,11 @@ void nelp_decoder_fx( Decoder_State *st_fx, Word16 *exc_nelp, Word16 *exc, Word1 ELSE { /* Do Unvoiced/NELP Decoding */ - iG1 = (Word16) get_next_indice( st_fx, 5 ); + iG1 = (Word16) get_next_indice_fx( st_fx, 5 ); move16(); - iG2[0] = (Word16) get_next_indice( st_fx, 6 ); + iG2[0] = (Word16) get_next_indice_fx( st_fx, 6 ); move16(); - iG2[1] = (Word16) get_next_indice( st_fx, 6 ); + iG2[1] = (Word16) get_next_indice_fx( st_fx, 6 ); move16(); } @@ -184,7 +184,7 @@ void nelp_decoder_fx( Decoder_State *st_fx, Word16 *exc_nelp, Word16 *exc, Word1 } ELSE { - fid = (Word16) get_next_indice( st_fx, 2 ); + fid = (Word16) get_next_indice_fx( st_fx, 2 ); move16(); } } diff --git a/lib_dec/peak_vq_dec_fx.c b/lib_dec/peak_vq_dec_fx.c index a23ff76b4..5658d7ef1 100644 --- a/lib_dec/peak_vq_dec_fx.c +++ b/lib_dec/peak_vq_dec_fx.c @@ -46,7 +46,7 @@ void hvq_dec_fx( FOR( i = 0; i < HVQ_BWE_NOISE_BANDS; i++ ) { - noise_level_idx = get_next_indice( st_fx, 2 ); /* 2-bits => max noise_level-idx = 3 */ + noise_level_idx = get_next_indice_fx( st_fx, 2 ); /* 2-bits => max noise_level-idx = 3 */ noise_level[i] = i_mult( noise_level_idx, PK_VQ_NOISE_DELTA ); move16(); /* max noise_level=3*0.1 => Q15 is good enough */ @@ -138,7 +138,7 @@ static void peak_vq_dec_fx( } /* Get number of peaks */ - vq_peaks = get_next_indice( st_fx, 5 ); + vq_peaks = get_next_indice_fx( st_fx, 5 ); vq_peaks = sub( max_peaks, vq_peaks ); *Npeaks = vq_peaks; move16(); @@ -192,10 +192,10 @@ static void peak_vq_dec_fx( } /* Huffman or differential coding */ - FlagN = (Word16) get_next_indice( st_fx, 1 ); + FlagN = (Word16) get_next_indice_fx( st_fx, 1 ); /* De-quantize peak gains */ - pgain_difidx[0] = get_next_indice( st_fx, GAIN0_BITS ); + pgain_difidx[0] = get_next_indice_fx( st_fx, GAIN0_BITS ); move16(); /* safety check in case of bit errors */ @@ -230,7 +230,7 @@ static void peak_vq_dec_fx( { FOR( i = 1; i < vq_peaks; i++ ) { - pgain_difidx[i] = get_next_indice( st_fx, GAINI_BITS ); + pgain_difidx[i] = get_next_indice_fx( st_fx, GAINI_BITS ); move16(); hcode_l = add( hcode_l, GAINI_BITS ); } @@ -291,7 +291,7 @@ static void peak_vq_dec_fx( FOR( i = 0; i < HVQ_NF_GROUPS; i++ ) { - nf_gains_idx[i] = get_next_indice( st_fx, 5 ); + nf_gains_idx[i] = get_next_indice_fx( st_fx, 5 ); move16(); nf_gains_fx[i] = L_shr( dicn_fx[nf_gains_idx[i]], 1 ); move32(); /* nf_gains in Q14 */ @@ -337,7 +337,7 @@ static void peak_vq_dec_fx( pSelBnds = sel_bnds; FOR( k = 0; k < pvq_bands; k++ ) { - pvq_norm[k] = add( get_next_indice( st_fx, HVQ_PVQ_GAIN_BITS ), 8 ); + pvq_norm[k] = add( get_next_indice_fx( st_fx, HVQ_PVQ_GAIN_BITS ), 8 ); // pvq_norm[k] = add( pvq_norm[k], 8 ); move16(); @@ -403,8 +403,8 @@ static void dequant_peaks_fx( Word32 absPeakGain1, absPeakGain; UWord16 dontCare; - hvq_cb_rev = get_next_indice( st_fx, 1 ); - cb_idx = get_next_indice( st_fx, 8 ); + hvq_cb_rev = get_next_indice_fx( st_fx, 1 ); + cb_idx = get_next_indice_fx( st_fx, 8 ); indx = shl( cb_idx, 2 ); IF( hvq_cb_rev ) @@ -485,7 +485,7 @@ static Word16 hvq_dec_pos_fx( move16(); set16_fx( pos_vec, 0, length ); - mode = get_next_indice( st_fx, 1 ); + mode = get_next_indice_fx( st_fx, 1 ); num_bits = add( num_bits, 1 ); IF( mode == HVQ_CP_DELTA ) @@ -535,7 +535,7 @@ static Word16 hvq_dec_pos_fx( FOR( i = 0; i < num_peaks; i++ ) { - IF( get_next_indice_1( st_fx ) == 0 ) + IF( get_next_indice_1_fx( st_fx ) == 0 ) { sign_vec[i] = -1; move16(); @@ -592,7 +592,7 @@ static Word16 sparse_dec_pos_fx( FOR( i = 0; i < layer_length; i++ ) { - layer2[i] = get_next_indice_1( st_fx ); + layer2[i] = get_next_indice_1_fx( st_fx ); move16(); } bits = add( bits, layer_length ); @@ -601,7 +601,7 @@ static Word16 sparse_dec_pos_fx( { IF( EQ_16( layer2[j], 1 ) ) { - idx = get_next_indice( st_fx, HVQ_CP_MAP_IDX_LEN ); + idx = get_next_indice_fx( st_fx, HVQ_CP_MAP_IDX_LEN ); bits = add( bits, HVQ_CP_MAP_IDX_LEN ); val = hvq_cp_layer1_map5[idx]; diff --git a/lib_dec/ppp_dec.c b/lib_dec/ppp_dec.c index be326a764..84cc2802f 100644 --- a/lib_dec/ppp_dec.c +++ b/lib_dec/ppp_dec.c @@ -43,6 +43,7 @@ #include "wmc_auto.h" +#ifndef IVAS_FLOAT_FIXED /*-------------------------------------------------------------------* * DTFS_dequant_cw() * @@ -181,3 +182,4 @@ ivas_error ppp_quarter_decoder( return error; } +#endif diff --git a/lib_dec/ppp_dec_fx.c b/lib_dec/ppp_dec_fx.c index 275229e36..b3514a980 100644 --- a/lib_dec/ppp_dec_fx.c +++ b/lib_dec/ppp_dec_fx.c @@ -297,10 +297,10 @@ ivas_error ppp_quarter_decoder_fx( DTFS_copy_fx( PREVDTFS_FX, PREV_CW_D_FX ); IF( bfi == 0 ) { - POWER_IDX_fx = (Word16) get_next_indice( st_fx, 6 ); - AMP_IDX_fx[0] = (Word16) get_next_indice( st_fx, 6 ); + POWER_IDX_fx = (Word16) get_next_indice_fx( st_fx, 6 ); + AMP_IDX_fx[0] = (Word16) get_next_indice_fx( st_fx, 6 ); move16(); - AMP_IDX_fx[1] = (Word16) get_next_indice( st_fx, 6 ); + AMP_IDX_fx[1] = (Word16) get_next_indice_fx( st_fx, 6 ); move16(); /* Amplitude Dequantization */ @@ -358,7 +358,7 @@ ivas_error ppp_quarter_decoder_fx( copy_phase_fx( PREVDTFS_FX, *CURRCW_Q_DTFS_FX, CURRCW_Q_DTFS_FX ); { - temp_fx = (Word16) get_next_indice( st_fx, 3 ); + temp_fx = (Word16) get_next_indice_fx( st_fx, 3 ); temp_fx = sub( temp_fx, 3 ); temp_fx = shl( temp_fx, 2 ); /*Q2 */ diff --git a/lib_dec/pvq_core_dec.c b/lib_dec/pvq_core_dec.c index 6333fd52d..5d66001da 100644 --- a/lib_dec/pvq_core_dec.c +++ b/lib_dec/pvq_core_dec.c @@ -43,6 +43,7 @@ #include "stl.h" #include "wmc_auto.h" +#ifndef IVAS_FLOAT_FIXED /*-------------------------------------------------------------------* * Local prototypes * @@ -521,3 +522,4 @@ static int16_t get_pvq_splits( return Np; } +#endif diff --git a/lib_dec/pvq_decode.c b/lib_dec/pvq_decode.c index b5be8605b..294838e9a 100644 --- a/lib_dec/pvq_decode.c +++ b/lib_dec/pvq_decode.c @@ -41,6 +41,7 @@ #include "rom_com.h" #include "wmc_auto.h" +#ifndef IVAS_FLOAT_FIXED /*-------------------------------------------------------------------* * Function pvq_decode() * * * @@ -107,3 +108,4 @@ void pvq_decode( return; } +#endif diff --git a/lib_dec/range_dec.c b/lib_dec/range_dec.c index 1aa0f116e..4ad813b42 100644 --- a/lib_dec/range_dec.c +++ b/lib_dec/range_dec.c @@ -41,6 +41,7 @@ #include "prot.h" #include "wmc_auto.h" +#ifndef IVAS_FLOAT_FIXED /*-------------------------------------------------------------------* * Local prototypes *-------------------------------------------------------------------*/ @@ -243,3 +244,4 @@ static int16_t rc_dec_read( return get_next_indice( st, 8 ); } } +#endif diff --git a/lib_dec/range_dec_fx.c b/lib_dec/range_dec_fx.c index a51625892..960662e76 100644 --- a/lib_dec/range_dec_fx.c +++ b/lib_dec/range_dec_fx.c @@ -215,10 +215,10 @@ static Word16 rc_dec_read_fx( /* If the end of the buffer has been reached, pad the last byte with zeros */ IF( sub( bits, 8 ) < 0 ) { - return shl( get_next_indice( st_fx, bits ), sub( 8, bits ) ); + return shl( get_next_indice_fx( st_fx, bits ), sub( 8, bits ) ); } ELSE { - return get_next_indice( st_fx, 8 ); + return get_next_indice_fx( st_fx, 8 ); } } diff --git a/lib_dec/stat_noise_uv_dec_fx.c b/lib_dec/stat_noise_uv_dec_fx.c index 651fb179e..7f8823cd1 100644 --- a/lib_dec/stat_noise_uv_dec_fx.c +++ b/lib_dec/stat_noise_uv_dec_fx.c @@ -37,7 +37,7 @@ void stat_noise_uv_dec_fx( IF( ( EQ_16( coder_type, UNVOICED ) && !uc_two_stage_flag ) || ( coder_type == INACTIVE && LE_32( st_fx->core_brate, ACELP_9k60 ) ) ) { /* read the noisiness parameter */ - noisiness = (Word16) get_next_indice( st_fx, 5 ); + noisiness = (Word16) get_next_indice_fx( st_fx, 5 ); } /*-----------------------------------------------------------------* diff --git a/lib_dec/swb_bwe_dec.c b/lib_dec/swb_bwe_dec.c index a1b61cdc6..9264d6900 100644 --- a/lib_dec/swb_bwe_dec.c +++ b/lib_dec/swb_bwe_dec.c @@ -527,9 +527,7 @@ static int16_t WB_BWE_gain_deq( return ( mode ); } -#endif -#ifndef IVAS_FLOAT_FIXED /*-------------------------------------------------------------------* * wb_bwe_dec_flt() * @@ -639,7 +637,6 @@ void wb_bwe_dec_flt( return; } -#endif /*-------------------------------------------------------------------* * swb_bwe_gain_deq_flt() @@ -845,7 +842,7 @@ int16_t swb_bwe_gain_deq_flt( * * SWB BWE decoder *-------------------------------------------------------------------*/ -#ifndef IVAS_FLOAT_FIXED + void swb_bwe_dec_flt( Decoder_State *st, /* i/o: decoder state structure */ const float output[], /* i : synthesis @internal Fs */ @@ -1054,7 +1051,6 @@ void swb_bwe_dec_flt( #endif #ifdef IVAS_FLOAT_FIXED - Word16 swb_bwe_dec_fx32( Decoder_State *st_fx, /* i/o: decoder state structure */ Word32 output_fx[], /* i : synthesis @internal Fs Q11 */ @@ -1240,7 +1236,7 @@ Word16 swb_bwe_dec_fx32( { IF( !st_fx->bfi ) { - idxGain = (Word16) get_next_indice( st_fx, NUM_BITS_FB_FRAMEGAIN ); + idxGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_FB_FRAMEGAIN ); fb_ener_adjust_fx = usdequant_fx( idxGain, FB_GAIN_QLOW_FX, FB_GAIN_QDELTA_FX ); /*Q15 */ } ELSE IF( st_fx->bfi ) diff --git a/lib_dec/swb_bwe_dec_fx.c b/lib_dec/swb_bwe_dec_fx.c index 4b172de7b..3fc6c9617 100644 --- a/lib_dec/swb_bwe_dec_fx.c +++ b/lib_dec/swb_bwe_dec_fx.c @@ -315,8 +315,8 @@ Word16 WB_BWE_gain_deq_fx( Word32 L_tmp; Word16 tmp, exp, frac; - index = (Word16) get_next_indice( st_fx, 5 ); - mode = add( extract_l( get_next_indice( st_fx, 1 ) ), 2 ); + index = (Word16) get_next_indice_fx( st_fx, 5 ); + mode = add( extract_l( get_next_indice_fx( st_fx, 1 ) ), 2 ); index2 = shl( index, 1 ); L_tmp = L_shr( F_2_5_fx[index2], 1 ); @@ -707,10 +707,10 @@ Word16 swb_bwe_gain_deq_fx( /* o : BWE class IF( hqswb_clas > 0 ) { - mode = (Word16) get_next_indice( st_fx, 1 ); + mode = (Word16) get_next_indice_fx( st_fx, 1 ); IF( mode == 0 ) { - mode = (Word16) get_next_indice( st_fx, 1 ); + mode = (Word16) get_next_indice_fx( st_fx, 1 ); } ELSE { @@ -720,7 +720,7 @@ Word16 swb_bwe_gain_deq_fx( /* o : BWE class } ELSE { - mode = (Word16) get_next_indice( st_fx, 2 ); + mode = (Word16) get_next_indice_fx( st_fx, 2 ); } test(); @@ -728,14 +728,14 @@ Word16 swb_bwe_gain_deq_fx( /* o : BWE class { FOR( n_band = 0; n_band < SWB_TENV; n_band++ ) { - index = (Word16) get_next_indice( st_fx, 4 ); + index = (Word16) get_next_indice_fx( st_fx, 4 ); SWB_tenv[n_band] = shl_sat( 1, index ); move16(); } - indice[0] = (Word16) get_next_indice( st_fx, 7 ); + indice[0] = (Word16) get_next_indice_fx( st_fx, 7 ); move16(); - indice[1] = (Word16) get_next_indice( st_fx, 6 ); + indice[1] = (Word16) get_next_indice_fx( st_fx, 6 ); move16(); tmp = shl( indice[0], 1 ); @@ -821,13 +821,13 @@ Word16 swb_bwe_gain_deq_fx( /* o : BWE class FOR( n_band = 0; n_band < 5; n_band++ ) { - indice[n_band] = (Word16) get_next_indice( st_fx, nb_bits[n_band] ); + indice[n_band] = (Word16) get_next_indice_fx( st_fx, nb_bits[n_band] ); move16(); } IF( EQ_16( hqswb_clas, HQ_GEN_FB ) ) { - indice[n_band] = (Word16) get_next_indice( st_fx, 5 ); + indice[n_band] = (Word16) get_next_indice_fx( st_fx, 5 ); move16(); } @@ -1113,7 +1113,7 @@ Word16 swb_bwe_dec_fx( { IF( !st_fx->bfi ) { - idxGain = (Word16) get_next_indice( st_fx, NUM_BITS_FB_FRAMEGAIN ); + idxGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_FB_FRAMEGAIN ); fb_ener_adjust_fx = usdequant_fx( idxGain, FB_GAIN_QLOW_FX, FB_GAIN_QDELTA_FX ); /*Q15 */ } ELSE IF( st_fx->bfi ) diff --git a/lib_dec/swb_bwe_dec_hr_fx.c b/lib_dec/swb_bwe_dec_hr_fx.c index 2ff899705..51880fe61 100644 --- a/lib_dec/swb_bwe_dec_hr_fx.c +++ b/lib_dec/swb_bwe_dec_hr_fx.c @@ -505,7 +505,7 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB * get transient frame flag *---------------------------------------------------------------------*/ - is_transient = (Word16) get_next_indice( st_fx, 1 ); + is_transient = (Word16) get_next_indice_fx( st_fx, 1 ); IF( is_transient ) { @@ -545,21 +545,21 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB *---------------------------------------------------------------------*/ /* get global gain */ - ind1 = (Word16) get_next_indice( st_fx, NBITS_GLOB_GAIN_BWE_HR ); + ind1 = (Word16) get_next_indice_fx( st_fx, NBITS_GLOB_GAIN_BWE_HR ); gain_fx = Gain_Dequant_HR( ind1, MIN_GLOB_GAIN_BWE_HR_FX, NBITS_GLOB_GAIN_BWE_HR, &exp1 ); nBits = sub( nBits, NBITS_GLOB_GAIN_BWE_HR ); /* get energy per band */ IF( k == 0 ) { - ind1 = (Word16) get_next_indice( st_fx, NBITS_ENVELOPE_BWE_HR_TR ); + ind1 = (Word16) get_next_indice_fx( st_fx, NBITS_ENVELOPE_BWE_HR_TR ); ind2 = ind1; move16(); nBits = sub( nBits, NBITS_ENVELOPE_BWE_HR_TR ); } ELSE { - ind1 = (Word16) get_next_indice( st_fx, NBITS_ENVELOPE_BWE_HR_TR - 1 ); + ind1 = (Word16) get_next_indice_fx( st_fx, NBITS_ENVELOPE_BWE_HR_TR - 1 ); if ( GE_16( ind2, 8 ) ) { ind1 = add( ind1, NUM_ENVLOPE_CODE_HR_TR2 ); @@ -585,7 +585,7 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB IF( EQ_16( st_fx->extl, FB_BWE_HIGHRATE ) ) { - ind1 = (Word16) get_next_indice( st_fx, NBITS_HF_GAIN_BWE_HR ); + ind1 = (Word16) get_next_indice_fx( st_fx, NBITS_HF_GAIN_BWE_HR ); nBits = sub( nBits, NBITS_HF_GAIN_BWE_HR ); IF( EQ_16( ind1, 1 ) ) @@ -779,12 +779,12 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB *---------------------------------------------------------------------*/ /* get global gain */ - ind1 = (Word16) get_next_indice( st_fx, NBITS_GLOB_GAIN_BWE_HR ); + ind1 = (Word16) get_next_indice_fx( st_fx, NBITS_GLOB_GAIN_BWE_HR ); gain_fx = Gain_Dequant_HR( ind1, MIN_GLOB_GAIN_BWE_HR_FX, NBITS_GLOB_GAIN_BWE_HR, &exp1 ); /* get energy per band */ - ind1 = (Word16) get_next_indice( st_fx, NBITS_ENVELOPE_BWE_HR1 ); - ind2 = (Word16) get_next_indice( st_fx, NBITS_ENVELOPE_BWE_HR2 ); + ind1 = (Word16) get_next_indice_fx( st_fx, NBITS_ENVELOPE_BWE_HR1 ); + ind2 = (Word16) get_next_indice_fx( st_fx, NBITS_ENVELOPE_BWE_HR2 ); temp = shl( ind1, 1 ); en_band[0] = swb_hr_env_code1_fx[temp]; @@ -840,7 +840,7 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB IF( EQ_16( st_fx->extl, FB_BWE_HIGHRATE ) ) { - ind1 = (Word16) get_next_indice( st_fx, NBITS_HF_GAIN_BWE_HR ); + ind1 = (Word16) get_next_indice_fx( st_fx, NBITS_HF_GAIN_BWE_HR ); nBits = sub( nBits, NBITS_HF_GAIN_BWE_HR ); if ( EQ_16( ind1, 1 ) ) @@ -880,7 +880,7 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB test(); IF( GE_16( nBits, 9 + NBITS_GLOB_GAIN_BWE_HR ) && sum16_fx( nq, Nsv ) > 0 ) { - ind1 = (Word16) get_next_indice( st_fx, NBITS_GLOB_GAIN_BWE_HR ); + ind1 = (Word16) get_next_indice_fx( st_fx, NBITS_GLOB_GAIN_BWE_HR ); gain2_fx = Gain_Dequant_HR( ind1, MIN_GLOB_GAIN_BWE_HR_FX, NBITS_GLOB_GAIN_BWE_HR, &exp2 ); /* gain2_flt *= 0.0625f */ exp2 = add( exp2, 4 ); diff --git a/lib_dec/swb_bwe_dec_lr_fx.c b/lib_dec/swb_bwe_dec_lr_fx.c index 485bbe6e2..fa9dcfc58 100644 --- a/lib_dec/swb_bwe_dec_lr_fx.c +++ b/lib_dec/swb_bwe_dec_lr_fx.c @@ -29,14 +29,14 @@ static void DecodeSWBGenericParameters_fx( { IF( EQ_16( hq_swb_clas_fx, HQ_HARMONIC ) ) { - lagIndices_fx[sb] = (Word16) get_next_indice( st_fx, bits_lagIndices_mode0_Har[sb] ); + lagIndices_fx[sb] = (Word16) get_next_indice_fx( st_fx, bits_lagIndices_mode0_Har[sb] ); move16(); } ELSE { IF( p2a_flags_fx[add( sub( BANDS_fx, NB_SWB_SUBBANDS ), sb )] == 0 ) { - lagIndices_fx[sb] = (Word16) get_next_indice( st_fx, bits_lagIndices_modeNormal[sb] ); + lagIndices_fx[sb] = (Word16) get_next_indice_fx( st_fx, bits_lagIndices_modeNormal[sb] ); move16(); } ELSE @@ -143,7 +143,7 @@ static void DecodeSWBSubbands_fx( /* Generate HF noise */ genhf_noise_fx( sspectra_diff_fx, Qss, L_xSynth_har, QsL, sspectra_fx, BANDS_fx, har_bands_fx, har_freq_est2, pos_max_hfe2, pul_res_fx, pk_sf_fx, fLenLow_fx, fLenHigh_fx, sbWidth_fx, lagIndices_fx, subband_offsets_fx, subband_search_offset_fx ); - imin_fx = (Word16) get_next_indice( st_fx, 2 ); + imin_fx = (Word16) get_next_indice_fx( st_fx, 2 ); /* g= pow(10.0f, gain_table_SWB_BWE[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) */ L_temp = L_shr( L_temp, 12 ); /* Q28-Q12 -> Q16 */ diff --git a/lib_dec/swb_tbe_dec_fx.c b/lib_dec/swb_tbe_dec_fx.c index b986d136b..41d198f72 100644 --- a/lib_dec/swb_tbe_dec_fx.c +++ b/lib_dec/swb_tbe_dec_fx.c @@ -4119,8 +4119,8 @@ void ivas_dequantizeSHBparams_fx_9_1( } ELSE { - idxFrameGain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_FrameGain_LBR_WB ); - idxLSF = (Word16) get_next_indice( st_fx, NUM_BITS_LBR_WB_LSF ); + idxFrameGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_FrameGain_LBR_WB ); + idxLSF = (Word16) get_next_indice_fx( st_fx, NUM_BITS_LBR_WB_LSF ); } Copy( lbr_wb_bwe_lsfvq_cbook_2bit_fx + i_mult( idxLSF, LPC_SHB_ORDER_LBR_WB ), Q_lsf, LPC_SHB_ORDER_LBR_WB ); @@ -4129,11 +4129,11 @@ void ivas_dequantizeSHBparams_fx_9_1( } ELSE { - *uv_flag = (Word16) get_next_indice( st_fx, 1 ); + *uv_flag = (Word16) get_next_indice_fx( st_fx, 1 ); move16(); - idxSubGain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_SUBGAINS ); - idxFrameGain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_FrameGain ); - idxLSF = (Word16) get_next_indice( st_fx, NUM_BITS_WB_LSF ); + idxSubGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_SUBGAINS ); + idxFrameGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_FrameGain ); + idxLSF = (Word16) get_next_indice_fx( st_fx, NUM_BITS_WB_LSF ); Copy( wb_bwe_lsfvq_cbook_8bit_fx + i_mult( idxLSF, LPC_SHB_ORDER_WB ), Q_lsf, LPC_SHB_ORDER_WB ); Copy( HBCB_SubGain5bit_fx + i_mult( idxSubGain, NUM_SHB_SUBFR / 4 ), Q_combined_gains, NUM_SHB_SUBFR / 4 ); @@ -4173,14 +4173,14 @@ void ivas_dequantizeSHBparams_fx_9_1( } ELSE { - idxSubGain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_SUBGAINS ); + idxSubGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_SUBGAINS ); IF( EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) { - idxFrameGain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_FRAMEGAIN_1k75 ); + idxFrameGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_FRAMEGAIN_1k75 ); } ELSE { - idxFrameGain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_FRAMEGAIN ); + idxFrameGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_FRAMEGAIN ); } } @@ -4189,7 +4189,7 @@ void ivas_dequantizeSHBparams_fx_9_1( test(); IF( GE_16( st_fx->element_mode, IVAS_CPE_DFT ) && !( EQ_16( st_fx->element_mode, IVAS_CPE_TD ) && st_fx->tdm_LRTD_flag ) ) { - *MSFlag = (Word16) get_next_indice( st_fx, STEREO_ICBWE_MSFLAG_BITS ); + *MSFlag = (Word16) get_next_indice_fx( st_fx, STEREO_ICBWE_MSFLAG_BITS ); move16(); } ELSE @@ -4207,7 +4207,7 @@ void ivas_dequantizeSHBparams_fx_9_1( } ELSE { - idx_shb_fr_gain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_ENER_SF ); + idx_shb_fr_gain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_ENER_SF ); } temp_shb_ener_sf_fx = usdequant_fx( idx_shb_fr_gain, 0, 86 ); /* 86 = 0.042f in Q11 = Qin-1 */ /* o: temp_shb_ener_sf_fx in Q12 */ @@ -4230,7 +4230,7 @@ void ivas_dequantizeSHBparams_fx_9_1( } ELSE { - idx_res_gs[i] = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_RES_GS ); + idx_res_gs[i] = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_RES_GS ); move16(); } Q_shb_res_gshape[i] = usdequant_fx( idx_res_gs[i], @@ -4248,7 +4248,7 @@ void ivas_dequantizeSHBparams_fx_9_1( } ELSE { - idx_mixFac = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_VF ); + idx_mixFac = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_VF ); } *Q_mixFactors = usdequant_fx( idx_mixFac, 4096 /* 0.125 in Q15 */, 2048 /* 0.125 in Q14 */ ); move16(); @@ -4261,7 +4261,7 @@ void ivas_dequantizeSHBparams_fx_9_1( test(); IF( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) { - idx_mixFac = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_VF ); + idx_mixFac = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_VF ); *Q_mixFactors = usdequant_fx( idx_mixFac, 0 /* 0.0f in Q15*/, 2341 /*1.0f / ((1 << NUM_BITS_SHB_VF) - 1) in Q14*/ ); move16(); } @@ -4289,7 +4289,7 @@ void ivas_dequantizeSHBparams_fx_9_1( IF( ( EQ_32( st_fx->extl_brate, SWB_TBE_0k95 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) ) && EQ_16( st_fx->codec_mode, MODE1 ) ) { set16_fx( lsf_idx, 0, 5 ); - lsf_idx[0] = (Word16) get_next_indice( st_fx, 8 ); + lsf_idx[0] = (Word16) get_next_indice_fx( st_fx, 8 ); move16(); grid_idx = 0; move16(); @@ -4317,7 +4317,7 @@ void ivas_dequantizeSHBparams_fx_9_1( /* VQ part */ num_bits_lvq = config_LSF_BWE[i_mult( sub( NUM_BITS_SHB_MSLVQ, nbits ), 3 )]; - Idx = get_next_indice( st_fx, num_bits_lvq ); + Idx = get_next_indice_fx( st_fx, num_bits_lvq ); v_add_16( lsf_q, cb_stage + i_mult( Idx, 6 ), lsf_q, 6 ); /* MSLVQ part */ @@ -4329,13 +4329,13 @@ void ivas_dequantizeSHBparams_fx_9_1( IF( EQ_16( num_bits_lvq, 16 ) ) { /* MSLVQ part */ - Idx_lvq = L_add( get_next_indice( st_fx, sub( num_bits_lvq, 1 ) ), L_shl( get_next_indice( st_fx, 1 ), 15 ) ); + Idx_lvq = L_add( get_next_indice_fx( st_fx, sub( num_bits_lvq, 1 ) ), L_shl( get_next_indice_fx( st_fx, 1 ), 15 ) ); deindex_lvq_SHB_fx( Idx_lvq, out, num_bits_lvq, 0 ); } ELSE { /* MSLVQ part */ - Idx_lvq = get_next_indice( st_fx, num_bits_lvq ); + Idx_lvq = get_next_indice_fx( st_fx, num_bits_lvq ); deindex_lvq_SHB_fx( Idx_lvq, out, num_bits_lvq, extract_l( LT_16( nbits, 19 ) ) ); } @@ -4352,7 +4352,7 @@ void ivas_dequantizeSHBparams_fx_9_1( } ELSE { - Idx_pred = (Word16) get_next_indice( st_fx, 1 ); + Idx_pred = (Word16) get_next_indice_fx( st_fx, 1 ); lsf_q[LATTICE_DIM] = dotp_loc( lsf_q, &LastCoefPred_1bit_fx[i_mult( 2 * ( LATTICE_DIM + 1 ), Idx_pred )], LATTICE_DIM ); move16(); lsf_q[LATTICE_DIM + 1] = dotp_loc( lsf_q, &LastCoefPred_1bit_fx[add( i_mult( 2 * ( LATTICE_DIM + 1 ), Idx_pred ), LATTICE_DIM + 1 )], LATTICE_DIM ); @@ -4361,7 +4361,7 @@ void ivas_dequantizeSHBparams_fx_9_1( IF( LT_16( nbits, NUM_BITS_SHB_MSLVQ ) ) { - Idx_pred = (Word16) get_next_indice( st_fx, sub( NUM_BITS_SHB_MSLVQ, nbits ) ); + Idx_pred = (Word16) get_next_indice_fx( st_fx, sub( NUM_BITS_SHB_MSLVQ, nbits ) ); } v_add_16( SHB_LSF_mean_fx, lsf_q, lsf_q, LPC_SHB_ORDER ); @@ -4387,7 +4387,7 @@ void ivas_dequantizeSHBparams_fx_9_1( { FOR( i = 0; i < NUM_Q_LSF; i++ ) { - lsf_idx[i] = (Word16) get_next_indice( st_fx, lsf_q_num_bits[i] ); + lsf_idx[i] = (Word16) get_next_indice_fx( st_fx, lsf_q_num_bits[i] ); move16(); } } @@ -4401,7 +4401,7 @@ void ivas_dequantizeSHBparams_fx_9_1( } ELSE { - m_idx = (Word16) get_next_indice( st_fx, MIRROR_POINT_BITS ); + m_idx = (Word16) get_next_indice_fx( st_fx, MIRROR_POINT_BITS ); } Dequant_mirror_point_fx( lsf_q, m_idx, &m ); @@ -4422,7 +4422,7 @@ void ivas_dequantizeSHBparams_fx_9_1( } ELSE { - grid_idx = (Word16) get_next_indice( st_fx, NUM_LSF_GRID_BITS ); + grid_idx = (Word16) get_next_indice_fx( st_fx, NUM_LSF_GRID_BITS ); } Map_higher_LSF_fx( lsf_q, m, lsf_grid_fx[grid_idx] ); @@ -4571,11 +4571,11 @@ static void dequantizeSHBparams_fx_9_1( } ELSE { - *uv_flag = (Word16) get_next_indice( st_fx, 1 ); + *uv_flag = (Word16) get_next_indice_fx( st_fx, 1 ); move16(); - idxSubGain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_SUBGAINS ); - idxFrameGain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_FrameGain ); - idxLSF = (Word16) get_next_indice( st_fx, NUM_BITS_WB_LSF ); + idxSubGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_SUBGAINS ); + idxFrameGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_FrameGain ); + idxLSF = (Word16) get_next_indice_fx( st_fx, NUM_BITS_WB_LSF ); Copy( wb_bwe_lsfvq_cbook_8bit_fx + i_mult( idxLSF, LPC_SHB_ORDER_WB ), Q_lsf, LPC_SHB_ORDER_WB ); Copy( HBCB_SubGain5bit_fx + i_mult( idxSubGain, NUM_SHB_SUBFR / 4 ), Q_combined_gains, NUM_SHB_SUBFR / 4 ); @@ -4615,8 +4615,8 @@ static void dequantizeSHBparams_fx_9_1( } ELSE { - idxSubGain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_SUBGAINS ); - idxFrameGain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_FRAMEGAIN ); + idxSubGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_SUBGAINS ); + idxFrameGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_FRAMEGAIN ); } test(); @@ -4629,7 +4629,7 @@ static void dequantizeSHBparams_fx_9_1( } ELSE { - idx_shb_fr_gain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_ENER_SF ); + idx_shb_fr_gain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_ENER_SF ); } temp_shb_ener_sf_fx = usdequant_fx( idx_shb_fr_gain, 0, 86 ); /* 86 = 0.042f in Q11 = Qin-1 */ /* o: temp_shb_ener_sf_fx in Q12 */ @@ -4652,7 +4652,7 @@ static void dequantizeSHBparams_fx_9_1( } ELSE { - idx_res_gs[i] = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_RES_GS ); + idx_res_gs[i] = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_RES_GS ); move16(); } Q_shb_res_gshape[i] = usdequant_fx( idx_res_gs[i], @@ -4670,7 +4670,7 @@ static void dequantizeSHBparams_fx_9_1( } ELSE { - idx_mixFac = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_VF ); + idx_mixFac = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_VF ); } *Q_mixFactors = usdequant_fx( idx_mixFac, 4096 /* 0.125 in Q15 */, 2048 /* 0.125 in Q14 */ ); move16(); @@ -4714,7 +4714,7 @@ static void dequantizeSHBparams_fx_9_1( { FOR( i = 0; i < NUM_Q_LSF; i++ ) { - lsf_idx[i] = (Word16) get_next_indice( st_fx, lsf_q_num_bits[i] ); + lsf_idx[i] = (Word16) get_next_indice_fx( st_fx, lsf_q_num_bits[i] ); move16(); } } @@ -4728,7 +4728,7 @@ static void dequantizeSHBparams_fx_9_1( } ELSE { - m_idx = (Word16) get_next_indice( st_fx, MIRROR_POINT_BITS ); + m_idx = (Word16) get_next_indice_fx( st_fx, MIRROR_POINT_BITS ); } Dequant_mirror_point_fx( lsf_q, m_idx, &m ); @@ -4749,7 +4749,7 @@ static void dequantizeSHBparams_fx_9_1( } ELSE { - grid_idx = (Word16) get_next_indice( st_fx, NUM_LSF_GRID_BITS ); + grid_idx = (Word16) get_next_indice_fx( st_fx, NUM_LSF_GRID_BITS ); } Map_higher_LSF_fx( lsf_q, m, lsf_grid_fx[grid_idx] ); @@ -4858,7 +4858,7 @@ void fb_tbe_dec_fx( } ELSE { - i = (Word16) get_next_indice( st, 4 ); + i = (Word16) get_next_indice_fx( st, 4 ); } #ifdef BASOP_NOGLOB ratio = shl_sat( 1, i ); @@ -4925,7 +4925,7 @@ void fb_tbe_dec_ivas_fx( } ELSE { - i = (Word16) get_next_indice( st, 4 ); + i = (Word16) get_next_indice_fx( st, 4 ); } #ifdef BASOP_NOGLOB ratio = shl_sat( 1, i ); @@ -4986,11 +4986,11 @@ void tbe_read_bitstream_fx( IF( ( EQ_16( st_fx->rf_flag, 1 ) || EQ_32( st_fx->total_brate, ACELP_9k60 ) ) && EQ_16( st_fx->bwidth, WB ) ) { /* WB LSF */ - hBWE_TD->lsf_WB = (Word16) get_next_indice( st_fx, NUM_BITS_LBR_WB_LSF ); + hBWE_TD->lsf_WB = (Word16) get_next_indice_fx( st_fx, NUM_BITS_LBR_WB_LSF ); move16(); /* WB frame gain */ - hBWE_TD->gFrame_WB = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_FrameGain_LBR_WB ); + hBWE_TD->gFrame_WB = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_FrameGain_LBR_WB ); move16(); } ELSE IF( ( GE_32( st_fx->total_brate, ACELP_9k60 ) ) && ( LE_32( st_fx->total_brate, ACELP_32k ) ) && @@ -5001,18 +5001,18 @@ void tbe_read_bitstream_fx( { FOR( i = 0; i < NUM_Q_LSF; i++ ) { - hBWE_TD->lsf_idx[i] = (Word16) get_next_indice( st_fx, lsf_q_num_bits[i] ); + hBWE_TD->lsf_idx[i] = (Word16) get_next_indice_fx( st_fx, lsf_q_num_bits[i] ); move16(); } - hBWE_TD->m_idx = (Word16) get_next_indice( st_fx, MIRROR_POINT_BITS ); + hBWE_TD->m_idx = (Word16) get_next_indice_fx( st_fx, MIRROR_POINT_BITS ); move16(); - hBWE_TD->grid_idx = (Word16) get_next_indice( st_fx, NUM_LSF_GRID_BITS ); + hBWE_TD->grid_idx = (Word16) get_next_indice_fx( st_fx, NUM_LSF_GRID_BITS ); move16(); } ELSE { - hBWE_TD->lsf_idx[0] = (Word16) get_next_indice( st_fx, 8 ); + hBWE_TD->lsf_idx[0] = (Word16) get_next_indice_fx( st_fx, 8 ); move16(); hBWE_TD->m_idx = 0; move16(); @@ -5021,36 +5021,36 @@ void tbe_read_bitstream_fx( } /* shape gains */ - hBWE_TD->idxSubGains = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_SUBGAINS ); + hBWE_TD->idxSubGains = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_SUBGAINS ); move16(); /* frame gain */ - hBWE_TD->idxFrameGain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_FRAMEGAIN ); + hBWE_TD->idxFrameGain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_FRAMEGAIN ); move16(); IF( GE_32( st_fx->total_brate, ACELP_24k40 ) ) { /* sub frame energy*/ - hBWE_TD->idx_shb_fr_gain = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_ENER_SF ); + hBWE_TD->idx_shb_fr_gain = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_ENER_SF ); move16(); /* gain shapes residual */ FOR( i = 0; i < NB_SUBFR16k; i++ ) { - hBWE_TD->idx_res_gs[i] = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_RES_GS ); + hBWE_TD->idx_res_gs[i] = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_RES_GS ); move16(); } /* voicing factor */ - hBWE_TD->idx_mixFac = (Word16) get_next_indice( st_fx, NUM_BITS_SHB_VF ); + hBWE_TD->idx_mixFac = (Word16) get_next_indice_fx( st_fx, NUM_BITS_SHB_VF ); move16(); } IF( EQ_16( st_fx->tec_tfa, 1 ) ) { - st_fx->tec_flag = (Word16) get_next_indice( st_fx, BITS_TEC ); + st_fx->tec_flag = (Word16) get_next_indice_fx( st_fx, BITS_TEC ); move16(); - st_fx->tfa_flag = (Word16) get_next_indice( st_fx, BITS_TFA ); + st_fx->tfa_flag = (Word16) get_next_indice_fx( st_fx, BITS_TFA ); move16(); test(); IF( st_fx->tfa_flag && st_fx->tec_flag ) @@ -5072,7 +5072,7 @@ void tbe_read_bitstream_fx( IF( EQ_16( st_fx->bwidth, FB ) ) { - hBWE_TD->idxGain = (Word16) get_next_indice( st_fx, 4 ); + hBWE_TD->idxGain = (Word16) get_next_indice_fx( st_fx, 4 ); move16(); } } diff --git a/lib_dec/tcq_core_dec.c b/lib_dec/tcq_core_dec.c index d7e61dfe4..78a0356c4 100644 --- a/lib_dec/tcq_core_dec.c +++ b/lib_dec/tcq_core_dec.c @@ -43,6 +43,7 @@ #include "basop_proto_func.h" #include "wmc_auto.h" +#ifndef IVAS_FLOAT_FIXED /*---------------------------------------------------------------------* * tcq_core_LR_enc() * @@ -471,3 +472,4 @@ void tcq_core_LR_dec( return; } +#endif diff --git a/lib_dec/tcq_core_dec_fx.c b/lib_dec/tcq_core_dec_fx.c index fcfe057ba..0986f5d17 100644 --- a/lib_dec/tcq_core_dec_fx.c +++ b/lib_dec/tcq_core_dec_fx.c @@ -163,14 +163,14 @@ void tcq_core_LR_dec_fx( k = sub( bit_budget, shl( nb_bytes, 3 ) ); FOR( i = 0; i < nb_bytes; i++ ) { - pbs_fx->buf[i] = (UWord8) get_next_indice( st_fx, 8 ); + pbs_fx->buf[i] = (UWord8) get_next_indice_fx( st_fx, 8 ); move16(); } IF( k > 0 ) { Word16 tmp; - tmp = (Word16) get_next_indice( st_fx, k ); + tmp = (Word16) get_next_indice_fx( st_fx, k ); pbs_fx->buf[nb_bytes] = (UWord8) shl( tmp, sub( 8, k ) ); move16(); /* i++; diff --git a/lib_dec/transition_dec_fx.c b/lib_dec/transition_dec_fx.c index edb86ffd4..4ebfeaf88 100644 --- a/lib_dec/transition_dec_fx.c +++ b/lib_dec/transition_dec_fx.c @@ -201,7 +201,7 @@ void transition_dec_fx( pit_limit = add( shl( pit_start, 1 ), *position ); /* 7 bit pitch DECODER */ - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); *T0 = add( pit_start, shr( ( index ), 1 ) ); move16(); @@ -232,7 +232,7 @@ void transition_dec_fx( /* 7bit pitch DECODER */ pit_start = sub( 2 * L_SUBFR, ( *position ) ); - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); *T0 = add( pit_start, shr( ( index ), 1 ) ); move16(); @@ -280,7 +280,7 @@ void transition_dec_fx( pit_limit = sub( 2 * L_FRAME - PIT_MAX, add( shl( ( *position ), 1 ), 2 ) ); - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); IF( LT_16( index, shl( sub( pit_limit, pit_start ), 1 ) ) ) { @@ -328,7 +328,7 @@ void transition_dec_fx( *--------------------------------------------------------*/ - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); delta_pit_dec_fx( 2, index, T0, T0_frac, *T0_min ); /* Find the adaptive codebook vector. ACELP long-term prediction */ @@ -348,7 +348,7 @@ void transition_dec_fx( *------------------------------------------------------------*/ ELSE { - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); pit_Q_dec_fx( 0, index, nBits, 8, pit_flag, limit_flag, T0, T0_frac, T0_min, T0_max, &st_fx->BER_detect ); @@ -473,7 +473,7 @@ void transition_dec_fx( nBits = st_fx->acelp_cfg.pitch_bits[i_subfridx]; move16(); - index = (Word16) get_next_indice( st_fx, nBits ); + index = (Word16) get_next_indice_fx( st_fx, nBits ); /*-----------------------------------------------------------------* * Find adaptive part of excitation, encode pitch period @@ -540,7 +540,7 @@ void transition_dec_fx( { /* no adaptive excitation in the second subframe */ set16_fx( &exc[i_subfr], 0, L_SUBFR + 1 ); - get_next_indice( st_fx, 1 ); /* this bit is actually not needed */ + get_next_indice_fx( st_fx, 1 ); /* this bit is actually not needed */ set16_fx( &bwe_exc[i_subfr * 2], 0, L_SUBFR * 2 ); } ELSE @@ -664,7 +664,7 @@ static void tc_dec_fx( } ELSE IF( EQ_16( tc_subfr, 3 * L_SUBFR ) ) { - i = (Word16) get_next_indice( st_fx, nBits ); + i = (Word16) get_next_indice_fx( st_fx, nBits ); IF( EQ_16( nBits, 9 ) ) { @@ -677,7 +677,7 @@ static void tc_dec_fx( } ELSE { - i = (Word16) get_next_indice( st_fx, nBits ); + i = (Word16) get_next_indice_fx( st_fx, nBits ); move16(); IF( i == 0 ) @@ -702,7 +702,7 @@ static void tc_dec_fx( } ELSE /* L_frame == L_FRAME16k */ { - i = (Word16) get_next_indice( st_fx, nBits ); + i = (Word16) get_next_indice_fx( st_fx, nBits ); move16(); IF( EQ_16( nBits, 10 ) ) @@ -737,13 +737,13 @@ static void tc_dec_fx( * decode other TC parameters *----------------------------------------------------------------*/ - imp_shape = (Word16) get_next_indice( st_fx, 3 ); + imp_shape = (Word16) get_next_indice_fx( st_fx, 3 ); move16(); - imp_pos = (Word16) get_next_indice( st_fx, 6 ); + imp_pos = (Word16) get_next_indice_fx( st_fx, 6 ); move16(); - imp_sign = (Word16) get_next_indice( st_fx, 1 ); + imp_sign = (Word16) get_next_indice_fx( st_fx, 1 ); move16(); - imp_gain = (Word16) get_next_indice( st_fx, 3 ); + imp_gain = (Word16) get_next_indice_fx( st_fx, 3 ); move16(); /*----------------------------------------------------------------* @@ -839,19 +839,19 @@ Word16 tc_classif_fx( #endif IF( EQ_16( st_fx->L_frame, L_FRAME ) ) { - IF( get_next_indice( st_fx, 1 ) ) + IF( get_next_indice_fx( st_fx, 1 ) ) { tc_subfr = TC_0_0; move16(); } ELSE { - IF( get_next_indice( st_fx, 1 ) ) + IF( get_next_indice_fx( st_fx, 1 ) ) { tc_subfr = 0; move16(); - IF( get_next_indice( st_fx, 1 ) ) + IF( get_next_indice_fx( st_fx, 1 ) ) { tc_subfr = TC_0_192; move16(); @@ -860,7 +860,7 @@ Word16 tc_classif_fx( { tc_subfr = TC_0_128; move16(); - if ( get_next_indice( st_fx, 1 ) ) + if ( get_next_indice_fx( st_fx, 1 ) ) { tc_subfr = TC_0_64; move16(); @@ -869,7 +869,7 @@ Word16 tc_classif_fx( } ELSE { - IF( get_next_indice( st_fx, 1 ) ) + IF( get_next_indice_fx( st_fx, 1 ) ) { tc_subfr = L_SUBFR; move16(); @@ -878,7 +878,7 @@ Word16 tc_classif_fx( { tc_subfr = 3 * L_SUBFR; move16(); - if ( get_next_indice( st_fx, 1 ) ) + if ( get_next_indice_fx( st_fx, 1 ) ) { tc_subfr = 2 * L_SUBFR; move16(); @@ -889,7 +889,7 @@ Word16 tc_classif_fx( } ELSE /* L_frame == L_FRAME16k */ { - indice = (Word16) get_next_indice( st_fx, 2 ); + indice = (Word16) get_next_indice_fx( st_fx, 2 ); IF( LT_16( indice, 3 ) ) { @@ -899,7 +899,7 @@ Word16 tc_classif_fx( { tc_subfr = 4 * L_SUBFR; move16(); - if ( get_next_indice( st_fx, 1 ) == 0 ) + if ( get_next_indice_fx( st_fx, 1 ) == 0 ) { tc_subfr = 3 * L_SUBFR; move16(); diff --git a/lib_dec/voiced_dec_fx.c b/lib_dec/voiced_dec_fx.c index a52332fa0..827089e01 100644 --- a/lib_dec/voiced_dec_fx.c +++ b/lib_dec/voiced_dec_fx.c @@ -146,7 +146,7 @@ ivas_error ppp_voiced_decoder_fx( } pl = s_min( rint_new_fx( st_fx->old_pitch_buf_fx[( 2 * NB_SUBFR ) - 1] ), MAX_LAG_PIT ); - delta_lag_D = (Word16) get_next_indice( st_fx, 5 ); + delta_lag_D = (Word16) get_next_indice_fx( st_fx, 5 ); l = s_min( MAX_LAG_PIT, add( pl, sub( delta_lag_D, 11 ) ) ); -- GitLab