diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index a162e40be3d95be0f0db806dfbac718c31540826..5ae9cb84d02ca54dcb42c640e33ab79da1cf4182 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -516,29 +516,27 @@ static ivas_error acelp_FCB_allocator( *--------------------------------------------------------------------*/ ivas_error config_acelp1( - const int16_t enc_dec, /* i : encoder/decoder flag */ - const int32_t total_brate, /* i : total bitrate */ - const int32_t core_brate_inp, /* i : core bitrate */ - const int16_t core, /* i : core */ - const int16_t extl, /* i : extension layer */ - const int32_t extl_brate, /* i : extension layer bitrate */ - const int16_t L_frame, /* i : frame length at internal Fs */ - const int16_t GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ - ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ - const int16_t signaling_bits, /* i : number of signaling bits */ - const int16_t coder_type, /* i : coder type */ - const int16_t tc_subfr, /* i : TC subfr ID */ - const int16_t tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ - int16_t *nBits_es_Pred, /* o : number of bits for Es_pred Q */ - int16_t *unbits, /* o : number of unused bits */ - const int16_t element_mode, /* i : element mode */ - int16_t *uc_two_stage_flag, /* o : flag undicating two-stage UC */ - const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ - const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ - const int16_t idchan, /* i : stereo channel ID */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE - const int16_t active_cnt, /* i : Active frame counter */ -#endif + const int16_t enc_dec, /* i : encoder/decoder flag */ + const int32_t total_brate, /* i : total bitrate */ + const int32_t core_brate_inp, /* i : core bitrate */ + const int16_t core, /* i : core */ + const int16_t extl, /* i : extension layer */ + const int32_t extl_brate, /* i : extension layer bitrate */ + const int16_t L_frame, /* i : frame length at internal Fs */ + const int16_t GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ + ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ + const int16_t signaling_bits, /* i : number of signaling bits */ + const int16_t coder_type, /* i : coder type */ + const int16_t tc_subfr, /* i : TC subfr ID */ + const int16_t tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ + int16_t *nBits_es_Pred, /* o : number of bits for Es_pred Q */ + int16_t *unbits, /* o : number of unused bits */ + const int16_t element_mode, /* i : element mode */ + int16_t *uc_two_stage_flag, /* o : flag undicating two-stage UC */ + const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ + const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ + const int16_t idchan, /* i : stereo channel ID */ + const int16_t active_cnt, /* i : Active frame counter */ const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ @@ -756,12 +754,10 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) { bits -= TDM_IC_LSF_PRED_BITS; } -#endif /* gain Q bit-budget - part 1 */ if ( ( coder_type != UNVOICED && coder_type != AUDIO && coder_type != INACTIVE && !( core_brate <= ACELP_8k00 && coder_type != TRANSITION ) ) || ( coder_type == INACTIVE && total_brate > MAX_GSC_INACTIVE_BRATE ) ) @@ -1318,7 +1314,6 @@ ivas_error config_acelp1( { if ( idchan > 0 && element_mode == IVAS_CPE_TD ) { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL if ( !tdm_lp_reuse_flag ) { acelp_cfg->lsf_bits += bits; /* increase LSF Q bits */ @@ -1348,33 +1343,6 @@ ivas_error config_acelp1( bits -= allocate_unused( core_brate, coder_type, bits, 1, 0, LSFPRM, &acelp_cfg->lsf_bits ); } } -#else - int16_t nb_prm = 4; - - if ( tdm_low_rate_mode == 1 ) - { - nb_prm = 2; - } - - /* First add remaining bits on gains */ - if ( !( *uc_two_stage_flag ) ) - { - bits -= allocate_unused( core_brate, coder_type, bits, nb_prm, 0, GAINSPRM, acelp_cfg->gains_mode ); - } - - /* Then, Increase pitch bit budget */ - if ( tdm_Pitch_reuse_flag == 0 && bits > 0 ) - { - bits -= allocate_unused( core_brate, coder_type, bits, nb_prm, 0, PITCHPRM, acelp_cfg->pitch_bits ); - } - - /* Increase mid-lsf bit budget */ - if ( tdm_lp_reuse_flag == 0 && bits > 0 ) - { - bits -= allocate_unused( core_brate, coder_type, bits, 1, 0, MID_LSFSPRM, &acelp_cfg->mid_lsf_bits ); - bits -= allocate_unused( core_brate, coder_type, bits, 1, 0, LSFPRM, &acelp_cfg->lsf_bits ); - } -#endif #ifdef DEBUGGING if ( idchan > 0 && bits > 0 && ( coder_type > UNVOICED || tdm_low_rate_mode == 0 ) ) { diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 8363a0299cd24700c38aa117ceafb744fa1f0ab2..0a206fcdb5de316ea3bfc629646888606395e946 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -1801,11 +1801,7 @@ ivas_error preview_indices( if ( bit_stream[2] == 0 ) { st_ivas->ivas_format = SBA_FORMAT; -#ifndef LBR_SBA - st_ivas->sba_mode = ivas_sba_mode_select( total_brate ); -#else st_ivas->sba_mode = ivas_sba_mode_select(); -#endif } else { diff --git a/lib_com/cnst.h b/lib_com/cnst.h index a374b46cfa0546ac3eb4c170abbb1138e410d9ac..261ef6f907f1777ec47a9c01f3ff7661b5999b80 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -294,9 +294,7 @@ enum IND_ISF_1_2, IND_ISF_1_3, IND_ISF_1_4, -#ifdef LSF_RE_USE_SECONDARY_CHANNEL IND_IC_LSF_PRED, -#endif IND_GSC_ATTACK, IND_GSC_SWB_SPEECH, IND_NOISE_LEVEL, @@ -1391,7 +1389,6 @@ enum #define NPARTCLDFB 10 #define NPART_SHAPING 62 -#ifdef ERI_FDCNGVQ_LOW_ROM #define FDCNG_VQ_MAX_LEN FD_CNG_maxN_37bits #define FDCNG_VQ_DCT_NSEGM 4 #define FDCNG_VQ_DCT_MINTRUNC 8 @@ -1408,7 +1405,6 @@ typedef enum _DCTTYPE IDCT_T2_XX_21 = 3 } DCTTYPE; -#endif #define MSSUBFRLEN 12 #define MSNUMSUBFR 6 diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 0f93ccdc54bd6349a5849411c1f300e1f7e7b509..0623cacb43df1f62dad36cfbca2c6bdcb5212316 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -791,11 +791,7 @@ enum fea_names #define TDM_LP_REUSE_BITS 1 /* number of bits to code LP reuse flag for secondary channel */ #define TDM_LR_CONTENT_BITS 1 /* number of bits to code flag when the content is LR or not */ #define TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS ( TDM_SECONDARY_SIGNALLING + TDM_RATIO_BITS + TDM_LP_REUSE_BITS + TDM_LR_CONTENT_BITS + STEREO_BITS_TCA ) -#ifdef LSF_RE_USE_SECONDARY_CHANNEL -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE #define TDM_IC_LSF_PRED_BITS 1 /* number of bits to code the inter channel LSF prediction mode */ -#endif -#endif /*----------------------------------------------------------------------------------* @@ -986,9 +982,7 @@ typedef enum /* Common SPAR metadata constants */ #define IVAS_ACTIVEW_DM_F_SCALE 0.5f #define IVAS_ACTIVEW_DM_F_SCALE_DTX 0.25f -#ifdef LBR_SBA #define IVAS_ACTIVEW_DM_F_SCALE_VLBR 0.25f -#endif #define IVAS_SPAR_FOA_DFLT_FREQ_PER_CHAN 24000 #define MAX_QUANT_STRATS 3 @@ -1021,11 +1015,7 @@ typedef enum DECX_COEFF } ivas_coeffs_type_t; -#ifdef LBR_SBA #define IVAS_SPAR_BR_TABLE_LEN 20 -#else -#define IVAS_SPAR_BR_TABLE_LEN 18 -#endif /* TD decorr */ // VE: not all 16CH are currently supported -> t be revisited later enum diff --git a/lib_com/ivas_cov_smooth.c b/lib_com/ivas_cov_smooth.c index ef2f5e369368c5128db1d70f23fa4b1e5c397a97..b5bd6369c5c41bcd0bb7a7e70183c5aaa533cb8a 100644 --- a/lib_com/ivas_cov_smooth.c +++ b/lib_com/ivas_cov_smooth.c @@ -52,14 +52,10 @@ static void ivas_set_up_cov_smoothing( const float max_update_rate, const int16_t min_pool_size, const int16_t nchan_inp /* i : number of input channels */ -#ifdef LBR_SBA_EXTRA_COV_SMOOTH , - const int32_t ivas_total_brate -#endif -) + const int32_t ivas_total_brate ) { int16_t j, k; -#ifdef LBR_SBA_DM_COV_FIX if ( ivas_total_brate < IVAS_24k4 ) { for ( j = 0; j < pFb->filterbank_num_bands; j++ ) @@ -77,7 +73,6 @@ static void ivas_set_up_cov_smoothing( } hCovState->pSmoothing_factor[j] = update_factor / min_pool_size; -#ifdef LBR_SBA_EXTRA_COV_SMOOTH float smooth_fact; if ( ivas_total_brate < IVAS_24k4 ) { @@ -88,9 +83,6 @@ static void ivas_set_up_cov_smoothing( smooth_fact = 0.75; } hCovState->pSmoothing_factor[j] *= ( j + 1 ) * smooth_fact; -#else - hCovState->pSmoothing_factor[j] *= ( j + 1 ) * 0.75f; -#endif if ( hCovState->pSmoothing_factor[j] > max_update_rate ) { @@ -98,9 +90,7 @@ static void ivas_set_up_cov_smoothing( } } } - else -#endif - if ( nchan_inp <= FOA_CHANNELS ) + else if ( nchan_inp <= FOA_CHANNELS ) { for ( j = 0; j < pFb->filterbank_num_bands; j++ ) { @@ -159,10 +149,8 @@ ivas_error ivas_spar_covar_smooth_enc_open( const ivas_cov_smooth_cfg_t *cov_smooth_cfg, /* i : SPAR config. handle */ ivas_filterbank_t *pFb, /* i/o: FB handle */ const int16_t nchan_inp /* i : number of input channels */ -#ifdef LBR_SBA_EXTRA_COV_SMOOTH , const int32_t ivas_total_brate /* i : IVAS total bitrate */ -#endif ) { ivas_cov_smooth_state_t *hCovState; @@ -190,11 +178,7 @@ ivas_error ivas_spar_covar_smooth_enc_open( } } -#ifdef LBR_SBA_EXTRA_COV_SMOOTH ivas_set_up_cov_smoothing( hCovState, pFb, cov_smooth_cfg->max_update_rate, cov_smooth_cfg->min_pool_size, nchan_inp, ivas_total_brate ); -#else - ivas_set_up_cov_smoothing( hCovState, pFb, cov_smooth_cfg->max_update_rate, cov_smooth_cfg->min_pool_size, nchan_inp ); -#endif *hCovState_out = hCovState; diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index ba36229d3e095a0b72a315dd79da5de35bc6fd58..e4bea78e7933298a895c5542ba684e20d0861301 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -261,18 +261,11 @@ void ivas_dirac_config_bands( { band_grouping[reduced_band] = max_band; } -#ifdef LBR_SBA for ( band = enc_param_start_band + ( DIRAC_MAX_NBANDS - enc_param_start_band ) / 2 - 1, reduced_band = DIRAC_MAX_NBANDS - 1; band >= enc_param_start_band; band--, reduced_band -= step ) { dirac_to_spar_md_bands[reduced_band] = dirac_to_spar_md_bands[band]; dirac_to_spar_md_bands[reduced_band - 1] = dirac_to_spar_md_bands[band]; } -#else - for ( band = enc_param_start_band + 1; band < DIRAC_MAX_NBANDS; band++ ) - { - dirac_to_spar_md_bands[band] = dirac_to_spar_md_bands[band - 1]; - } -#endif } else { diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 297db65f78592336832ae9116d2a80dfc824eb99..890390309fbd5e9af11b6c6e28b35006682fefe2 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1915,14 +1915,12 @@ void tdm_low_rate_dec( const float *lsf_new /* i : ISFs at the end of the frame */ ); -#ifdef LSF_RE_USE_SECONDARY_CHANNEL void tdm_SCh_LSF_intra_pred( const int32_t element_brate, /* i : element bitrate */ const float *tdm_lsfQ_PCh, /* i : primary channel LSFs */ float *pred_lsf_SCh /* o : predicted secondary channel LSFs */ ); -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE void tdm_SCh_lsf_reuse( const int16_t enc_dec, /* i : encoder/decoder flag */ const int32_t element_brate, /* i : element bitrate */ @@ -1932,8 +1930,6 @@ void tdm_SCh_lsf_reuse( const float lsf_wgts[M], /* i : LSF weights */ int16_t *beta_index /* i/o: quantization index */ ); -#endif -#endif void first_VQstages( const float *const *cb, @@ -3184,11 +3180,7 @@ void ivas_dirac_param_est_enc( /*! r: SBA format mode */ SBA_MODE ivas_sba_mode_select( -#ifndef LBR_SBA - const int32_t ivas_total_brate /* i : IVAS total bitrate */ -#else void -#endif ); void ivas_sba_config( @@ -4090,10 +4082,8 @@ ivas_error ivas_spar_md_enc_process( const int16_t dtx_vad, const int16_t nchan_inp, const int16_t sba_order /* i : Ambisonic (SBA) order */ -#ifdef LBR_SBA , float *prior_mixer[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH] /* i : prior mixer_matrix */ -#endif ); void ivas_compute_spar_params( @@ -4107,9 +4097,7 @@ void ivas_compute_spar_params( const int16_t num_ch, const int16_t bands_bw, const int16_t active_w, -#ifdef LBR_SBA const int16_t active_w_vlbr, -#endif ivas_spar_md_com_cfg *hSparCfg, ivas_spar_md_t *hSparMd, float *pWscale, @@ -4153,11 +4141,9 @@ void ivas_get_spar_md_from_dirac( const int16_t order, const int16_t dtx_vad, float Wscale_d[IVAS_MAX_NUM_BANDS] -#ifdef LBR_SBA , const uint8_t useLowerRes, const int16_t active_w_vlbr -#endif ); ivas_error ivas_spar_md_dec_open( @@ -4201,10 +4187,8 @@ void ivas_spar_to_dirac( ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ const int16_t dtx_vad, /* i : DTX frame flag */ const int16_t num_bands_out /* i : number of output bands */ -#ifdef LBR_SBA , const int16_t bw /* i : band joining factor */ -#endif ); void ivas_spar_update_md_hist( @@ -4234,10 +4218,8 @@ ivas_error ivas_spar_covar_enc_open( ivas_filterbank_t *pFb, /* i/o: FB handle */ const int32_t input_Fs, /* i : input sampling rate */ const int16_t nchan_inp /* i : number of input channels */ -#ifdef LBR_SBA_EXTRA_COV_SMOOTH , const int32_t ivas_total_brate /* i : IVAS total bitrate */ -#endif ); void ivas_spar_covar_enc_close( @@ -4264,10 +4246,8 @@ ivas_error ivas_spar_covar_smooth_enc_open( const ivas_cov_smooth_cfg_t *cov_smooth_cfg, /* i : SPAR config. handle */ ivas_filterbank_t *pFb, /* i/o: FB handle */ const int16_t nchan_inp /* i : number of input channels */ -#ifdef LBR_SBA_EXTRA_COV_SMOOTH , const int32_t ivas_total_brate /* i : IVAS total bitrate */ -#endif ); void ivas_spar_covar_smooth_enc_close( diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 2103609bebd0c34956fbf184a97ec5a8de8b3b6b..b220f19f9ecc9cde22ddc956675ab5fe67867662 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -628,7 +628,6 @@ const float tdm_den_ratio_tabl[TDM_NQ+1] = /* 1.0f/(2*LR_ratio*LR_ratio-2*LR_ra 1.2088f, 1.1429f, 1.0902f, 1.0501f, 1.0221f, 1.0000f, 1.0000f, 1.0000f }; -#ifdef LSF_RE_USE_SECONDARY_CHANNEL const int16_t tdm_bit_allc_tbl[5][6] = { /* IC -- UC -- GC -- TM --AC */ @@ -638,21 +637,8 @@ const int16_t tdm_bit_allc_tbl[5][6] = { 1650, 6050, 0, 10000, 0, 10000 }, /* IVAS_32k */ { 1650, 6050, 0, 13000, 0, 14000 } /* IVAS_48k */ }; -#else -const int16_t tdm_bit_allc_tbl[5][6] = -{ - /* IC -- UC -- GC -- TM --AC */ - { 1600, 3450, 0, 4400, 0, 5000 }, /* IVAS_13k2 */ - { 1600, 3450, 0, 5000, 0, 5000 }, /* IVAS_16k4 */ - { 1600, 3450, 0, 6000, 0, 5000 }, /* IVAS_24k4 */ - { 1600, 6000, 0, 10000, 0, 10000 }, /* IVAS_32k */ - { 1600, 6000, 0, 13000, 0, 14000 } /* IVAS_48k */ -}; -#endif -#ifdef LSF_RE_USE_SECONDARY_CHANNEL /* LSFs Intra-frame prediction tables */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE const float tdm_LSF_MEAN_RE_USE_OUT[M] = { 301.292f, 521.300f, 870.818f, 1340.278f, 1712.099f, 2091.456f, 2488.523f, 2841.096f, 3196.565f, 3593.040f, 3958.366f, 4293.334f, 4710.319f, 5118.806f, 5546.761f, 5918.579f, @@ -693,7 +679,6 @@ const float tdm_RE_USE_adaptive_beta_prd_diag_3[15 + 16 + 15] = 0.2043f, 0.6317f, 0.0543f, 0.1767f, 0.5396f, }; -#endif const float tdm_LSF_MEAN_PRED_QNT[M] = { @@ -729,7 +714,6 @@ const float tdm_PRED_QNT_fixed_beta_prd_diag_3[15 + 16 + 15] = 0.1709f, 0.6372f, 0.1060f, 0.1193f, 0.6574f, }; -#endif const int16_t fast_FCB_bits_2sfr[] = {8, 14, 18, 20, 24, 128/*stop value*/}; @@ -903,24 +887,14 @@ const ivas_spar_br_table_t ivas_spar_br_table_consts[IVAS_SPAR_BR_TABLE_LEN] = { /* When AGC is ON additional (AGC_BITS_PER_CH+1) bits may be taken from each core-coder channel so minimum core-coder bitrate per channel can be min core-coder bitrates as per the table - AGC_BITS_PER_CH */ -#ifdef LBR_SBA /* preferred tuning (3.2/4.9kbps) with/out TDD */ { 13200, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, -#ifdef LBR_SBA_PLANAR - { { 11000, 9600, 13150 } }, -#else { { 10000, 8300, 13150 } }, -#endif { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 }, { 16400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, -#ifdef LBR_SBA_PLANAR - { { 14200, 12800, 16350 } }, -#else { { 13200, 11500, 16350 } }, -#endif { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 }, -#endif { 24400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0,{ { 16400, 14850, 24350 } }, { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 }, diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 9e3c431e70117a09a3c5f44bed49085e1cd28d4a..e4bdc738a841cdc405896e235a2df314b103bf21 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -108,9 +108,7 @@ extern const float tdm_ratio_tabl[]; extern const float tdm_den_ratio_tabl[]; extern const int16_t tdm_bit_allc_tbl[5][6]; -#ifdef LSF_RE_USE_SECONDARY_CHANNEL /* LSFs Intra-frame prediction tables */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE extern const float tdm_LSF_MEAN_RE_USE_OUT[M]; extern const float tdm_LSF_MEAN_RE_USE_IN[M]; extern const float tdm_LSF_MEAN_RE_USE[M]; @@ -121,13 +119,11 @@ extern const float tdm_Beta_Q1bit_re_use_24k4_32k[2]; extern const float tdm_Beta_Q1bit_re_use_48k[2]; extern const float tdm_RE_USE_adaptive_beta_prd_diag_3[15 + 16 + 15]; -#endif extern const float tdm_LSF_MEAN_PRED_QNT_OUT[M]; extern const float tdm_LSF_MEAN_PRED_QNT_IN[M]; extern const float tdm_LSF_MEAN_PRED_QNT[M]; extern const float tdm_PRED_QNT_fixed_beta_prd_diag_3[15 + 16 + 15]; -#endif extern const int16_t fast_FCB_bits_2sfr[]; extern const int16_t fast_FCB_rates_2sfr[]; diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index 1dc3c4faede2b8aae704c8f3c40a759fcd753ec3..d307e3e9acc765144cbeff170123ac5f2802ad64 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -54,28 +54,9 @@ *-------------------------------------------------------------------*/ /*! r: SBA format mode */ -SBA_MODE ivas_sba_mode_select( -#ifndef LBR_SBA - const int32_t ivas_total_brate /* i : IVAS total bitrate */ -#endif -) +SBA_MODE ivas_sba_mode_select() { -#ifndef LBR_SBA - SBA_MODE sba_mode; - - if ( ivas_total_brate == IVAS_13k2 || ivas_total_brate == IVAS_16k4 ) - { - sba_mode = SBA_MODE_DIRAC; - } - else - { - sba_mode = SBA_MODE_SPAR; - } - - return sba_mode; -#else return SBA_MODE_SPAR; -#endif } /*-------------------------------------------------------------------* * ivas_sba_config() diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index da731676db38baed9b83242e64632632629ee9e5..481812d22d3ed082870c6a31a1481b3d2dfef2fc 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -59,11 +59,9 @@ #define IVAS_REMIX_MULT_FAC ( 0.5f ) -#define IVAS_ACTIVEW_DM_F ( 1.0f ) -#define IVAS_ACTIVEW_DM_F_DTX ( 0.25f ) -#ifdef LBR_SBA -#define IVAS_ACTIVEW_DM_F_VLBR ( 0.25f ) -#endif +#define IVAS_ACTIVEW_DM_F ( 1.0f ) +#define IVAS_ACTIVEW_DM_F_DTX ( 0.25f ) +#define IVAS_ACTIVEW_DM_F_VLBR ( 0.25f ) #define IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH ( 3.0f ) #define IVAS_P_NORM_SCALING ( 1.0f ) @@ -79,20 +77,11 @@ *------------------------------------------------------------------------------------------*/ -static void ivas_get_pred_coeffs( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ppPred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ppDM_Fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], const int16_t in_chans, const int16_t start_band, const int16_t end_band, const int16_t active_w, -#ifdef LBR_SBA - const int16_t active_w_vlbr, -#endif - const int16_t dtx_vad, - const int16_t from_dirac ); +static void ivas_get_pred_coeffs( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ppPred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ppDM_Fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], const int16_t in_chans, const int16_t start_band, const int16_t end_band, const int16_t active_w, const int16_t active_w_vlbr, const int16_t dtx_vad, const int16_t from_dirac ); static void ivas_reorder_array( float in_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS], const int16_t in_chans, const int16_t order[IVAS_SPAR_MAX_CH], float ***mixer_mat, const int16_t start_band, const int16_t end_band ); -static void ivas_get_Wscaling_factor( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ***mixer_mat, const int16_t start_band, const int16_t end_band, const int16_t dtx_vad, const int16_t num_ch, const int16_t *pNum_dmx, const int16_t bands_bw, const int16_t active_w, -#ifdef LBR_SBA - const int16_t active_w_vlbr, -#endif - float *pWscale ); +static void ivas_get_Wscaling_factor( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ***mixer_mat, const int16_t start_band, const int16_t end_band, const int16_t dtx_vad, const int16_t num_ch, const int16_t *pNum_dmx, const int16_t bands_bw, const int16_t active_w, const int16_t active_w_vlbr, float *pWscale ); static void ivas_calc_post_pred_per_band( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ***mixer_mat, const int16_t num_ch, const int16_t num_dmx, const int16_t band_idx, float postpred_cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH] ); @@ -350,11 +339,7 @@ void ivas_spar_config( { ivas_total_brate = IVAS_32k; } -#ifdef LBR_SBA assert( ivas_total_brate == IVAS_32k || ivas_total_brate == IVAS_24k4 || ivas_total_brate == IVAS_16k4 || ivas_total_brate == IVAS_13k2 ); -#else - assert( ivas_total_brate == IVAS_32k || ivas_total_brate == IVAS_24k4 ); -#endif if ( ivas_total_brate == IVAS_32k ) { *core_nominal_brate = ACELP_24k40; @@ -363,7 +348,6 @@ void ivas_spar_config( { *core_nominal_brate = ACELP_16k40; } -#ifdef LBR_SBA else if ( ivas_total_brate == IVAS_16k4 ) { *core_nominal_brate = ACELP_13k20; @@ -372,7 +356,6 @@ void ivas_spar_config( { *core_nominal_brate = ACELP_9k60; } -#endif } return; @@ -452,11 +435,7 @@ int16_t ivas_get_sba_num_TCs( { nchan_transport = 1; } -#ifndef LBR_SBA - else if ( ivas_sba_mode_select( ivas_total_brate ) == SBA_MODE_DIRAC ) -#else else if ( ivas_sba_mode_select() == SBA_MODE_DIRAC ) -#endif { nchan_transport = 1; } @@ -485,9 +464,7 @@ static void ivas_get_pred_coeffs( const int16_t start_band, const int16_t end_band, const int16_t active_w, -#ifdef LBR_SBA const int16_t active_w_vlbr, -#endif const int16_t dtx_vad, const int16_t from_dirac ) { @@ -578,11 +555,7 @@ static void ivas_get_pred_coeffs( } else { -#ifdef LBR_SBA dm_f_local = ( active_w_vlbr ) ? IVAS_ACTIVEW_DM_F_VLBR : IVAS_ACTIVEW_DM_F; -#else - dm_f_local = IVAS_ACTIVEW_DM_F; -#endif } for ( b = start_band; b < end_band; b++ ) @@ -681,9 +654,7 @@ static void ivas_get_Wscaling_factor( const int16_t *pNum_dmx, const int16_t bands_bw, const int16_t active_w, -#ifdef LBR_SBA const int16_t active_w_vlbr, -#endif float *pWscale ) { int16_t b, ch; @@ -696,11 +667,7 @@ static void ivas_get_Wscaling_factor( } else { -#ifdef LBR_SBA dm_f_local = ( active_w_vlbr ) ? IVAS_ACTIVEW_DM_F_SCALE_VLBR : IVAS_ACTIVEW_DM_F_SCALE; -#else - dm_f_local = IVAS_ACTIVEW_DM_F_SCALE; -#endif } for ( b = start_band; b < end_band; b++ ) @@ -1581,9 +1548,7 @@ void ivas_compute_spar_params( const int16_t num_ch, const int16_t bands_bw, const int16_t active_w, -#ifdef LBR_SBA const int16_t active_w_vlbr, -#endif ivas_spar_md_com_cfg *hSparCfg, ivas_spar_md_t *hSparMd, float *pWscale, @@ -1593,9 +1558,7 @@ void ivas_compute_spar_params( int16_t b, i, ndm; ivas_get_pred_coeffs( cov_real, pred_coeffs_re, dm_fv_re, num_ch, start_band, end_band, active_w, -#ifdef LBR_SBA active_w_vlbr, -#endif dtx_vad, from_dirac ); #ifdef SPAR_HOA_DBG @@ -1629,9 +1592,7 @@ void ivas_compute_spar_params( ivas_get_Wscaling_factor( cov_real, pred_coeffs_re, mixer_mat, start_band, end_band, dtx_vad, num_ch, hSparCfg->num_dmx_chans_per_band, bands_bw, active_w, -#ifdef LBR_SBA active_w_vlbr, -#endif pWscale ); for ( b = start_band; b < end_band; b++ ) @@ -1702,13 +1663,9 @@ void ivas_get_spar_md_from_dirac( const int16_t end_band, const int16_t order, const int16_t dtx_vad, - float Wscale_d[IVAS_MAX_NUM_BANDS] -#ifdef LBR_SBA - , + float Wscale_d[IVAS_MAX_NUM_BANDS], const uint8_t useLowerRes, - const int16_t active_w_vlbr -#endif -) + const int16_t active_w_vlbr ) { int16_t num_ch, band, i, j; int16_t block, ch; @@ -1744,11 +1701,7 @@ void ivas_get_spar_md_from_dirac( ppMixer_mat[i] = pMixer_mat[i]; } -#ifdef LBR_SBA if ( ( start_band >= 6 && hSpar_md_cfg->nchan_transport <= 2 && ( dtx_vad == 1 ) ) || ( useLowerRes && start_band >= 3 && hSpar_md_cfg->nchan_transport <= 2 && ( dtx_vad == 1 ) ) ) -#else - if ( start_band >= 6 && hSpar_md_cfg->nchan_transport <= 2 && ( dtx_vad == 1 ) ) -#endif { float P_norm[3]; int16_t idx; @@ -1807,12 +1760,10 @@ void ivas_get_spar_md_from_dirac( { ivas_dirac_dec_get_response( (int16_t) azi_dirac[band][i_ts], (int16_t) ele_dirac[band][i_ts], response_avg, order ); } -#ifdef LBR_SBA else if ( useLowerRes ) { ivas_dirac_dec_get_response( (int16_t) azi_dirac[band][0], (int16_t) ele_dirac[band][0], response_avg, order ); } -#endif else { for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) @@ -1976,9 +1927,7 @@ void ivas_get_spar_md_from_dirac( ivas_compute_spar_params( pCov_real, dm_fv_re, i_ts, ppMixer_mat, start_band, end_band, dtx_vad, num_ch, 1, hSpar_md_cfg->active_w, -#ifdef LBR_SBA active_w_vlbr, -#endif hSpar_md_cfg, hSpar_md, Wscale, 1 ); if ( mixer_mat != NULL ) diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index b1fa0a49c85c33d4879079ecc5d21927ce24d546..dee56c5dff17f6b34fb245fcf8beb729603e6b09 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -478,7 +478,6 @@ void td_stereo_param_updt( } -#ifdef LSF_RE_USE_SECONDARY_CHANNEL /*-------------------------------------------------------------------* * tdm_SCh_LSF_intra_pred_zero_bits() * @@ -597,8 +596,6 @@ void tdm_SCh_LSF_intra_pred( } -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE - /*-------------------------------------------------------------------* * tdm_SCh_LSF_intra_pred_one_bit_dec() * @@ -728,6 +725,3 @@ void tdm_SCh_lsf_reuse( return; } -#endif - -#endif diff --git a/lib_com/lsf_tools.c b/lib_com/lsf_tools.c index 5f0916dbd147f32788f2c4e7b49015cb17e8bf85..30ade5444ded3be6b7ffa7548147b588f007fb3f 100644 --- a/lib_com/lsf_tools.c +++ b/lib_com/lsf_tools.c @@ -2027,7 +2027,6 @@ int16_t tcxlpc_get_cdk( return cdk; } -#ifdef ERI_FDCNGVQ_LOW_ROM void dec_FDCNG_MSVQ_stage1( int16_t j_full, /* i: index full range */ int16_t n, /* i: dimension to generate */ @@ -2082,7 +2081,6 @@ void dec_FDCNG_MSVQ_stage1( v_add( idct_vec, cdk1r_tr_midQ_truncQ, uq, n ); assert( uq_ind == NULL ); } -#endif /*--------------------------------------------------------------------------* @@ -2093,19 +2091,17 @@ void dec_FDCNG_MSVQ_stage1( void msvq_dec( - const float *const *cb, /* i : Codebook (indexed cb[*stages][levels][p]) */ - const int16_t dims[], /* i : Dimension of each codebook stage (NULL: full dim.) */ - const int16_t offs[], /* i : Starting dimension of each codebook stage (NULL: 0) */ - const int16_t stages, /* i : Number of stages */ - const int16_t N, /* i : Vector dimension */ - const int16_t maxN, /* i : Codebook dimension */ - const int16_t Idx[], /* i : Indices */ -#ifdef ERI_FDCNGVQ_LOW_ROM + const float *const *cb, /* i : Codebook (indexed cb[*stages][levels][p]) */ + const int16_t dims[], /* i : Dimension of each codebook stage (NULL: full dim.) */ + const int16_t offs[], /* i : Starting dimension of each codebook stage (NULL: 0) */ + const int16_t stages, /* i : Number of stages */ + const int16_t N, /* i : Vector dimension */ + const int16_t maxN, /* i : Codebook dimension */ + const int16_t Idx[], /* i : Indices */ const int16_t applyIDCT_flag, /* i : applyIDCT flag */ const float *invTrfMatrix, /* i: matrix for IDCT synthesis */ -#endif - float *uq, /* o : quantized vector */ - Word16 *uq_ind /* o : quantized vector (fixed point) */ + float *uq, /* o : quantized vector */ + Word16 *uq_ind /* o : quantized vector (fixed point) */ ) { int16_t i, n, maxn, start; @@ -2141,7 +2137,6 @@ void msvq_dec( start = 0; } -#ifdef ERI_FDCNGVQ_LOW_ROM if ( i == 0 && applyIDCT_flag != 0 ) { assert( start == 0 ); @@ -2162,21 +2157,6 @@ void msvq_dec( } } #undef WMC_TOOL_SKIP -#else - - v_add( uq + start, cb[i] + Idx[i] * maxn, uq + start, n ); - -#define WMC_TOOL_SKIP - IF( uq_ind != NULL ) - { - FOR( j = 0; j < n; ++j ) - { - move16(); - uq_ind[start + j] = add( uq_ind[start + j], (Word16) ( cb[i][Idx[i] * maxn + j] * 2.0f * 1.28f ) ); - } - } -#undef WMC_TOOL_SKIP -#endif } return; @@ -2445,7 +2425,6 @@ void a2isf( return; } -#ifdef ERI_FDCNGVQ_LOW_ROM /*-------------------------------------------------------------------* * dctT2_N_apply_matrix() * @@ -2635,6 +2614,3 @@ void create_IDCT_N_Matrix( float *inv_matrixFloatQ, const int16_t N, const int16 } } } - - -#endif diff --git a/lib_com/options.h b/lib_com/options.h index 599b3e5d1b69b072288f48be74d249af04d16afb..1728371c0f27457127646da8b070dad074c03299 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -135,10 +135,6 @@ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ #define BITSTREAM_INDICES_MEMORY /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ -#define LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo Secondary channel LSF Q improvement */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL -#define LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE /* switch to isolate the reuse mode case */ -#endif #define DISABLE_ADAP_RES_COD_TMP /* temporary fix for IVAS-403, disables adaptive residual coding */ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define FIX_ISM_DTX_CNG_BWIDTH_ALT /* VA: issue 396 - alternative fix for bw changes on CNG frames in ISM DTX for objects that use the decoder-side noise estimation */ @@ -160,7 +156,6 @@ #define FIX_419_ISM_BRATE_SW_DTX /* VA: issue 419: fix ISM Bitrate Switching with dtx */ #define FIX_422 /* FhG: Issue 422: re-introduce fix for noisy speech buffer in ParamISM */ -#define ERI_FDCNGVQ_LOW_ROM /* Eri: Contribution #31 Table ROM saving for IVAS FDCNG-VQ modes */ #define FIX_416_ISM_BR_SWITCHING /* FhG: add missing CLDFB reconfig to ISM BR switching */ #define FIX_SP2A /* VA: Issue 412: Adjust threshold for the S_p2a feature in the tonal detector */ @@ -168,16 +163,6 @@ #define FIX_417_TD_DECORR_BRATE_SW /* VA: Issue 417: fix incorrect use of TD decorrelator in bitrate switching */ #define FIX_427_MAXIMUM_S_INDEX /* VA: issue 427: fix return index of function maximum_s() */ #define FIX_431_PARAMMC_PLC_INTERPOLATOR /* FhG: Issue 431: fix missing interpolator reset for ParamMC PCL */ -#define LBR_SBA /* Contribution 47: Master macro for low bitrate SBA (SPAR+DirAC) */ -#ifdef LBR_SBA -#define LBR_SBA_BR_SWITCHING /* Clean up changes for SBA bitrate switching */ -#define LBR_SBA_DM_COV_FIX /* Covariance smoothing and resetting fixes proposed at higher bitrates */ -#ifdef LBR_SBA_DM_COV_FIX -#define LBR_SBA_EXTRA_COV_SMOOTH /* Extra covariance smoothing for low bitrate SBA */ -#endif -/*#define LBR_SBA_PLANAR*/ /* Converting low bitrate SBA modes to Planar */ -#define LBR_ADAP_SMOOTHING -#endif #define FIX_391_SBA /* Dlb: Fix for issue 391 for SBA */ #define EUALER2QUAT_FIX /*Dlb :fix for issue 430 issue in euler2quat, sign of quat y is inverted*/ diff --git a/lib_com/prot.h b/lib_com/prot.h index c63a8d93de0e0381aa8b036e30d43f0a4b74c0b4..33fba361ce3cdb1c0814c84c4d0567adc9990a5d 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -2323,10 +2323,7 @@ ivas_error acelp_core_enc( float pitch_buf[NB_SUBFR16k], /* o : floating pitch for each subframe */ int16_t *unbits, /* o : number of unused bits */ STEREO_TD_ENC_DATA_HANDLE hStereoTD, /* i/o: TD stereo encoder handle */ -#ifndef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE - const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ -#endif - const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ + const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ ); ivas_error acelp_core_switch_dec_bfi( @@ -3024,10 +3021,8 @@ void lsf_enc( float *Aq, /* o : quantized A(z) for 4 subframes */ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL , const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ -#endif ); void isf_enc_amr_wb( @@ -4586,10 +4581,8 @@ void lsf_dec( float *lsp_new, /* o : de-quantized LSP vector */ float *lsp_mid, /* o : de-quantized mid-frame LSP vector */ const int16_t tdm_low_rate_mode /* i : secondary channel low rate mode flag */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL , const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ -#endif ); void isf_dec_amr_wb( @@ -8060,34 +8053,29 @@ void msvq_enc( const int16_t *levels, /* i : Number of levels in each stage */ const int16_t maxC, /* i : Tree search size (number of candidates kept from */ /* one stage to the next == M-best) */ - const int16_t stages, /* i : Number of stages */ - const float w[], /* i : Weights */ - const int16_t N, /* i : Vector dimension */ - const int16_t maxN, /* i : Codebook dimension */ -#ifdef ERI_FDCNGVQ_LOW_ROM + const int16_t stages, /* i : Number of stages */ + const float w[], /* i : Weights */ + const int16_t N, /* i : Vector dimension */ + const int16_t maxN, /* i : Codebook dimension */ const int16_t applyDCT_flag, /* i : applyDCT flag */ float *invTrfMatrix, /* i:/o expanded synthesis matrix */ -#endif - int16_t Idx[] /* o : Indices */ + int16_t Idx[] /* o : Indices */ ); void msvq_dec( - const float *const *cb, /* i : Codebook (indexed cb[*stages][levels][p]) */ - const int16_t dims[], /* i : Dimension of each codebook stage (NULL: full dim.) */ - const int16_t offs[], /* i : Starting dimension of each codebook stage (NULL: 0) */ - const int16_t stages, /* i : Number of stages */ - const int16_t N, /* i : Vector dimension */ - const int16_t maxN, /* i : Codebook dimension */ - const int16_t Idx[], /* i : Indices */ -#ifdef ERI_FDCNGVQ_LOW_ROM + const float *const *cb, /* i : Codebook (indexed cb[*stages][levels][p]) */ + const int16_t dims[], /* i : Dimension of each codebook stage (NULL: full dim.) */ + const int16_t offs[], /* i : Starting dimension of each codebook stage (NULL: 0) */ + const int16_t stages, /* i : Number of stages */ + const int16_t N, /* i : Vector dimension */ + const int16_t maxN, /* i : Codebook dimension */ + const int16_t Idx[], /* i : Indices */ const int16_t applyIDCT_flag, /* i : applyIDCT flag */ const float *invTrfMatrix, /* i: synthesis matrix */ -#endif - float *uq, /* o : quantized vector */ - Word16 *uq_ind /* o : quantized vector (fixed point) */ + float *uq, /* o : quantized vector */ + Word16 *uq_ind /* o : quantized vector (fixed point) */ ); -#ifdef ERI_FDCNGVQ_LOW_ROM void dec_FDCNG_MSVQ_stage1( int16_t j_full, /* i: index full range */ int16_t n, /* i: dimension to generate */ @@ -8123,7 +8111,6 @@ void extend_dctN_input( float *matrix, /* i: idct matrix of size N rows , n_cols columns*/ const int16_t n_cols, /* i: number of columns == truncation length */ DCTTYPE dcttype ); /* i: matrix type */ -#endif void PulseResynchronization( const float *src_exc, /* i : Input excitation buffer */ @@ -8254,11 +8241,8 @@ void lsf_end_enc( int16_t *lpc_param, int16_t *no_stages, int16_t *bits_param_lpc, - const int16_t coder_type_raw -#ifdef LSF_RE_USE_SECONDARY_CHANNEL - , + const int16_t coder_type_raw, const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ -#endif ); void lsf_end_dec( @@ -8270,10 +8254,8 @@ void lsf_end_dec( int16_t *lpc_param, /* i : LPC parameters */ int16_t *LSF_Q_prediction, /* o : LSF prediction mode */ int16_t *nb_indices /* o : number of indices */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL , const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ -#endif ); ivas_error find_pred_mode( @@ -9014,29 +8996,27 @@ int16_t BITS_ALLOC_config_acelp( ); ivas_error config_acelp1( - const int16_t enc_dec, /* i : encoder/decoder flag */ - const int32_t total_brate, /* i : total bitrate */ - const int32_t core_brate_inp, /* i : core bitrate */ - const int16_t core, /* i : core */ - const int16_t extl, /* i : extension layer */ - const int32_t extl_brate, /* i : extension layer bitrate */ - const int16_t L_frame, /* i : frame length at internal Fs */ - const int16_t GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ - ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ - const int16_t signaling_bits, /* i : number of signaling bits */ - const int16_t coder_type, /* i : coder type */ - const int16_t tc_subfr, /* i : TC subfr ID */ - const int16_t tc_call, /* i : TC call number (0,1,2) */ - int16_t *nBits_es_Pred, /* o : number of bits for Es_pred Q */ - int16_t *unbits, /* o : number of unused bits */ - const int16_t element_mode, /* i : element mode */ - int16_t *uc_two_stage_flag, /* o : flag undicating two-stage UC */ - const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel*/ - const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ - const int16_t idchan, /* i : channel id */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE - const int16_t active_cnt, /* i : Active frame counter */ -#endif + const int16_t enc_dec, /* i : encoder/decoder flag */ + const int32_t total_brate, /* i : total bitrate */ + const int32_t core_brate_inp, /* i : core bitrate */ + const int16_t core, /* i : core */ + const int16_t extl, /* i : extension layer */ + const int32_t extl_brate, /* i : extension layer bitrate */ + const int16_t L_frame, /* i : frame length at internal Fs */ + const int16_t GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ + ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ + const int16_t signaling_bits, /* i : number of signaling bits */ + const int16_t coder_type, /* i : coder type */ + const int16_t tc_subfr, /* i : TC subfr ID */ + const int16_t tc_call, /* i : TC call number (0,1,2) */ + int16_t *nBits_es_Pred, /* o : number of bits for Es_pred Q */ + int16_t *unbits, /* o : number of unused bits */ + const int16_t element_mode, /* i : element mode */ + int16_t *uc_two_stage_flag, /* o : flag undicating two-stage UC */ + const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel*/ + const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ + const int16_t idchan, /* i : channel id */ + const int16_t active_cnt, /* i : Active frame counter */ const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ diff --git a/lib_com/rom_com.c b/lib_com/rom_com.c index 6701d395344bc00b97762b37a1109b84ba511a15..9c2b49bca20ed1dfff728ec98f4396c89c2eb7e7 100644 --- a/lib_com/rom_com.c +++ b/lib_com/rom_com.c @@ -6036,7 +6036,6 @@ const FD_CNG_SETUP FdCngSetup_swb2 = { 640, 320, sizeof(sidPartitions_swb2)/size const int16_t levels_37bits[FD_CNG_stages_37bits] = { 128, 64, 64, 64, 64, 64 }; const int16_t bits_37bits[FD_CNG_stages_37bits] = { 7, 6, 6, 6, 6, 6 }; -#ifdef ERI_FDCNGVQ_LOW_ROM /* IDCT_MATRIX_ROM: 18*24 Word16 = 432 Word16 */ /* or compressed IDCT_MATRIX_ROM: 18*24 Word8 + 25 = 230 Word16 + WMOPS (INDIRECT(432) and STORE(432) ) */ @@ -6325,142 +6324,8 @@ const Word8 cdk1_ivas_segm_neighbour_rev[128] = { 106, 111, 110, 117, 120, 107, 37, 104, 122, 114, 121, 119, 42, 126, 41, 11 }; -#endif -#ifndef ERI_FDCNGVQ_LOW_ROM -const float cdk_37bits_1_ivas[3072] = -{ - 33.94763184f , 23.04196358f , 19.02036476f , 15.61426640f , 9.84622097f , 6.74968624f , 8.78495407f , 6.55844116f , 6.41478300f , 3.65438509f , 2.53205872f , 0.20947371f , -3.68736625f , -6.96642828f , -8.93218231f , -10.77195358f , -14.39207268f , -19.83006287f , -25.90260124f , -30.72169685f , -32.16821671f , -35.03061295f , -35.84580231f , -35.98442459f , - 23.05311012f , 15.34062386f , 11.67077923f , 9.03463936f , 7.33119154f , 6.01164532f , 4.86430264f , 3.36793089f , 2.00524712f , 1.02420747f , -0.28395364f , -1.14369977f , -2.29296756f , -3.49234462f , -4.55691099f , -5.82124615f , -7.01340151f , -8.19280529f , -9.51517677f , -11.88930511f , -12.41490746f , -13.91690540f , -15.41597271f , -17.46363640f , - 6.34591007f , 5.83291101f , 1.82374179f , 1.64918160f , 2.46284771f , 3.21434593f , 4.79773092f , 6.78620768f , 7.17590570f , 7.29561472f , 6.46074152f , 4.26570177f , 0.29191878f , -5.68994617f , -8.93541527f , -12.17100811f , -15.95464516f , -19.82475090f , -28.43348694f , -31.13560677f , -30.82723999f , -33.92724228f , -37.10982895f , -39.15046310f , - -1.97859216f , -1.29728901f , -0.68513793f , -0.59703761f , -0.19596121f , -0.48437589f , 0.41912374f , 0.32082281f , 0.42840490f , 0.33297276f , 0.00419650f , 0.25515109f , 0.07341246f , -0.05156118f , -0.17369615f , -0.39090252f , -0.53758574f , -0.97013980f , -1.37499487f , -2.59367585f , -2.67291665f , -3.56308174f , -5.09242105f , -7.33598137f , - 44.73780441f , 32.42730713f , 26.58676720f , 20.32800293f , 15.91747665f , 11.15012264f , 7.68650007f , 10.27048969f , 9.52919579f , 5.18821383f , 1.79746056f , -0.50318158f , -4.92894411f , -9.36254311f , -14.76678371f , -15.57420921f , -16.40379715f , -19.38558006f , -24.47130203f , -28.18117905f , -26.27810097f , -28.22804451f , -30.44338608f , -33.63451004f , - 27.92958260f , 17.48978424f , 9.02943993f , 2.00556946f , 0.77582097f , 1.75702107f , 2.96648121f , 4.17692900f , 5.20950508f , 4.89404440f , 3.14809656f , 2.02777839f , 0.06399647f , -2.44093847f , -5.23348236f , -7.73788691f , -9.60736561f , -11.49096489f , -12.88784599f , -14.62041187f , -14.05591011f , -13.97139835f , -13.55158806f , -12.38661575f , - 4.40041780f , 6.02715492f , 8.63421249f , 11.23643303f , 10.21946526f , 7.12535143f , 3.97593451f , 1.47885716f , -0.34547061f , -2.21350408f , -3.58581519f , -3.49226046f , 1.64697266f , -0.80884248f , -6.61078739f , -0.83386075f , -6.55604124f , -8.50729084f , -13.99620533f , -22.11815453f , -23.36925316f , -25.26130867f , -27.82377815f , -31.91535187f , - -0.31119800f , -0.22902243f , -0.18182723f , -0.17193857f , -0.22133952f , -0.25048682f , -0.19776741f , -0.20502391f , -0.15689729f , -0.08497809f , -0.04383328f , 0.10558389f , 0.22994623f , 0.27078405f , 0.26461646f , 0.21337126f , 0.07602444f , -0.07640435f , -0.08624625f , -0.01901877f , -0.37278932f , -0.55278486f , -0.50081939f , -0.57718313f , - 11.09673309f , 12.25163174f , 11.92947292f , 11.36766434f , 10.26155853f , 10.59420109f , 11.28228855f , 9.29032898f , 7.86474180f , 5.81516743f , 3.32581139f , 0.59270757f , -2.99105382f , -7.64252663f , -12.32353687f , -16.56275558f , -19.50693130f , -21.39342690f , -23.04017448f , -26.55841255f , -27.89498329f , -29.63920593f , -31.31513977f , -34.91411972f , - 14.63949299f , 9.97996807f , 7.52127123f , 6.06751871f , 4.64821386f , 3.74143553f , 3.04003358f , 2.11276221f , 1.27838099f , 0.61896890f , -0.12750353f , -0.75742245f , -1.50008225f , -2.24619722f , -2.86748576f , -3.65039921f , -4.29070568f , -5.12242794f , -6.06238365f , -7.87343836f , -7.91463709f , -9.02013016f , -10.03069305f , -11.15602875f , - 6.92497873f , 3.86428881f , 3.33403730f , 3.50285769f , 5.03133297f , 5.47784615f , 5.12933731f , 4.11465311f , 3.29701447f , 2.28059053f , 0.75228900f , -0.37691337f , -1.86169589f , -3.51180482f , -5.11985493f , -6.74894667f , -8.46384716f , -10.43132973f , -12.40718174f , -14.97575378f , -15.92234325f , -14.67680931f , -16.35786247f , -21.92259026f , - 9.03859520f , 6.23588181f , 4.69891214f , 3.76419306f , 2.91222286f , 2.25166726f , 2.02948308f , 1.35998511f , 0.74028724f , 0.50349784f , -0.12927644f , -0.45801210f , -0.88480383f , -1.52290273f , -1.84748936f , -2.22180009f , -2.73286033f , -3.21036029f , -3.73283100f , -5.33005810f , -4.96555710f , -5.72577906f , -6.40969419f , -7.14143419f , - 38.57890320f , 31.23274040f , 23.27908325f , 16.41319847f , 12.96908092f , 11.89987564f , 11.08193970f , 10.02814865f , 9.20901966f , 5.84658241f , 1.48919916f , -2.57032323f , -7.26163483f , -11.23550892f , -13.34285927f , -13.96859360f , -14.14492226f , -14.77427292f , -15.53306389f , -16.79932404f , -15.12855816f , -14.29256630f , -13.92473507f , -13.23437977f , - 23.30056572f , 13.31616783f , 10.53007698f , 7.97990513f , 7.58186388f , 6.05487776f , 6.38700247f , 4.46871328f , 3.73780274f , 1.15311646f , -0.16795112f , -1.00963080f , -2.99656630f , -4.04802418f , -5.87744474f , -7.26942492f , -8.01433468f , -8.85430908f , -8.93447399f , -10.80081940f , -10.03588772f , -9.56312180f , -9.49805927f , -9.08203316f , - 27.72716713f , 15.70166302f , 12.12497234f , 9.82916641f , 8.54480648f , 7.48498583f , 6.46852112f , 4.42398930f , 2.79946446f , 1.41388083f , -0.10821334f , -0.99111170f , -2.64519501f , -4.05361032f , -6.13559484f , -7.88495255f , -9.31697083f , -11.29918480f , -13.29217148f , -15.89776802f , -16.73270416f , -15.78193951f , -16.71963501f , -20.72499275f , - 0.09654448f , 0.05992651f , 0.07271793f , 0.06090590f , -0.01909172f , -0.02661837f , 0.00184859f , 0.00821958f , 0.01826876f , 0.00751956f , -0.02172063f , 0.03389538f , -0.00261579f , 0.00331171f , -0.00514964f , 0.00147764f , 0.00065488f , 0.01022588f , 0.00899184f , 0.02156001f , 0.01748813f , 0.01100880f , 0.01848303f , -0.00200717f , - 35.99007034f , 24.20862198f , 19.41031075f , 16.17420769f , 10.83719921f , 7.76013374f , 9.00250912f , 6.69725418f , 5.31352282f , 3.62490821f , 2.61681867f , 0.34085435f , -3.79527760f , -7.07614565f , -9.08049870f , -11.36665630f , -14.87462139f , -21.07974815f , -27.34793472f , -31.39986610f , -32.07981873f , -27.78803635f , -28.28388596f , -28.39242935f , - 13.10489750f , 20.89344025f , 21.64855194f , 15.43504715f , 10.25371075f , 3.34968066f , 1.78396285f , 0.43690255f , 0.33645880f , 2.18413949f , 0.30379224f , 2.14339352f , 2.11168623f , -3.22490501f , -5.35176468f , -6.71944952f , -7.60760832f , -7.25716639f , -9.25983143f , -10.88946342f , -12.36510563f , -14.32815361f , -16.37483597f , -19.41078377f , - 6.47920799f , 6.26157904f , 4.08267021f , 3.55930829f , 4.81190968f , 5.21526289f , 6.64490366f , 6.17979145f , 5.88209581f , 5.32573366f , 4.89284468f , 2.50707030f , -1.80236220f , -4.32998514f , -7.66879225f , -12.10674191f , -15.55172729f , -17.02550125f , -22.69219017f , -24.15981102f , -21.53298187f , -24.35451317f , -30.13893318f , -32.50536728f , - -1.27988362f , -1.28642356f , -0.84176970f , -0.75768483f , -0.62176520f , -0.62706548f , -0.67682666f , -0.86569685f , -0.75184637f , -0.68499511f , -0.73107177f , -0.44849658f , 0.61550426f , 3.18549967f , 2.15541792f , 0.41898161f , -0.96763957f , -2.28376174f , -2.21816230f , -1.44123793f , -1.10070240f , -1.48757422f , -1.94006848f , -2.04375577f , - 44.99568176f , 33.17905807f , 28.70528412f , 24.13981819f , 16.39375496f , 12.74631882f , 12.26308346f , 7.28386831f , 3.65083528f , 1.09594464f , -0.70640332f , -0.90420610f , -5.15652418f , -8.39927197f , -9.75838566f , -12.33563995f , -16.17337418f , -20.72145081f , -21.89005280f , -22.08177948f , -22.01576805f , -28.49225616f , -28.58443069f , -28.66851044f , - 27.27372360f , 16.82239342f , 9.52775478f , 4.54592752f , 2.38096476f , 1.92719686f , 2.83496809f , 3.88023591f , 4.84239244f , 4.33260632f , 2.40358329f , 1.26160026f , -0.59154904f , -2.84664989f , -5.20095921f , -7.12129021f , -8.10309982f , -9.32675076f , -10.37824821f , -12.16980839f , -11.58549690f , -11.62355518f , -11.35874844f , -10.43139648f , - 16.01709366f , 12.10370731f , 10.30418873f , 9.84315491f , 9.04705238f , 8.59515572f , 8.13945866f , 5.33055639f , 3.59784794f , 2.10469317f , 0.74735385f , -0.35173890f , -3.04881167f , -5.32683229f , -7.84610510f , -9.60193539f , -11.38669300f , -12.69159031f , -15.22157860f , -17.92496300f , -18.30335999f , -19.30245590f , -20.96332741f , -29.99128151f , - -1.49891376f , -0.94159925f , -1.59718812f , -2.73734355f , -4.95862293f , -5.62506247f , -3.84028316f , -1.86409163f , -1.10922730f , -0.37675977f , 0.54625863f , 1.08458769f , 2.59583378f , 4.74187803f , 4.85828352f , 2.72942448f , 1.21778154f , 0.61253220f , -0.12000842f , -0.42560402f , -0.47587356f , -0.59399730f , -0.54576296f , -0.64007539f , - 27.21817589f , 25.04722404f , 19.98665237f , 18.40707970f , 15.35737038f , 12.12910748f , 10.67379093f , 8.65770626f , 6.83053064f , 4.53696156f , 1.99311268f , -2.65666389f , -5.61365652f , -8.72017097f , -11.54872608f , -14.03052521f , -17.60883713f , -18.92860985f , -19.26733208f , -21.02047348f , -20.41023064f , -24.96704483f , -27.28151131f , -32.13149261f , - 16.58616257f , 6.07702732f , 3.20051527f , 2.19352865f , 1.25951850f , 0.52847487f , 0.36339840f , 1.22322381f , 1.40252435f , 0.78051162f , -0.14960484f , -0.19245568f , 0.80768329f , -0.03997936f , -0.45896211f , -1.94675004f , -3.57758331f , -4.74786758f , -6.30557394f , -7.96810246f , -7.85797882f , -8.40102768f , -8.70696068f , -14.50718975f , - 5.83877993f , 8.64909840f , 10.36191940f , 10.75121212f , 10.87299442f , 9.20523739f , 6.57943916f , 2.45789552f , 0.32793057f , -0.19492692f , -0.50667870f , -0.82865268f , -3.29967546f , -5.41881037f , -5.00245380f , -7.02534580f , -7.16695213f , -10.07062340f , -13.29201317f , -15.16228962f , -14.82801533f , -13.98322010f , -16.56229019f , -25.20559120f , - 6.31290579f , 4.29846334f , 3.09123778f , 2.35388660f , 2.08894801f , 1.51627553f , 1.61039710f , 1.01586986f , 0.50589812f , 0.34378609f , -0.11773424f , -0.29939151f , -0.59060657f , -1.10041618f , -1.30399191f , -1.66196144f , -2.00707245f , -2.30241942f , -2.72166705f , -4.15126562f , -3.61430144f , -4.17390060f , -4.64368582f , -5.19181061f , - 45.07491302f , 31.96612358f , 24.59359169f , 15.32010937f , 11.66156387f , 10.47190285f , 8.21482182f , 6.91866159f , 6.46052694f , 2.31078482f , -0.97819418f , -3.39280653f , -5.75906181f , -7.82967377f , -8.74781990f , -9.47419548f , -9.85650921f , -10.05874729f , -10.25747013f , -11.21096134f , -9.55652142f , -8.75567627f , -8.43642902f , -7.74934912f , - 29.56493187f , 22.29573250f , 13.46729183f , 9.18490410f , 7.02603865f , 5.38271475f , 3.58497858f , 2.35314894f , 2.17064548f , 0.43121719f , -0.60757560f , -1.00088501f , -1.82668996f , -2.00680733f , -4.21636438f , -5.02670193f , -6.26371956f , -6.65761995f , -7.37742567f , -9.00110912f , -9.04595757f , -10.59253120f , -12.24499798f , -13.79708004f , - 18.81605339f , 15.10544109f , 13.69033337f , 12.55228615f , 12.10694313f , 9.87893867f , 7.45830679f , 3.83573604f , 1.58222044f , 0.19975230f , -0.48743680f , -1.03465378f , -3.26008105f , -6.03337908f , -6.72951269f , -8.16258240f , -9.35424900f , -11.36496258f , -14.10615826f , -16.52154922f , -15.71789932f , -14.28701687f , -15.86503506f , -21.98985291f , - 0.58833683f , 1.93554544f , 1.01621759f , 0.17751050f , 1.44273913f , 1.63168383f , 0.87785423f , 0.63285774f , 0.44776136f , 0.05703505f , -0.13712768f , 0.28278413f , -0.80131322f , -0.86604142f , -1.59806752f , -0.93005019f , -1.04011548f , -0.89366192f , -0.64847207f , -0.61214101f , -0.55340266f , -0.16991313f , -0.15702423f , -0.17067310f , - 39.23077011f , 28.73466682f , 25.17003059f , 18.13150215f , 12.30397224f , 10.44106960f , 8.78819275f , 7.09760094f , 4.76503944f , 3.22303295f , 1.15491402f , -0.03009734f , -3.15244532f , -7.48607492f , -9.52877903f , -12.40654850f , -15.16987514f , -18.84217262f , -22.60379219f , -26.15986252f , -28.55947685f , -31.27477455f , -36.50263596f , -45.15930557f , - 17.17733002f , 11.81043625f , 8.99961948f , 7.02285528f , 5.70868826f , 4.43369055f , 3.63820124f , 2.49104285f , 1.49823487f , 0.74478340f , -0.16968371f , -0.91984361f , -1.82045591f , -2.59034872f , -3.43512726f , -4.35373259f , -5.22545052f , -6.16511250f , -7.18896103f , -9.18914032f , -9.45307922f , -10.67428303f , -11.84619045f , -13.22418404f , - -0.55165589f , 0.54447228f , -1.45378113f , 0.62164629f , 1.57039273f , 1.95998776f , 2.55171132f , 3.54153609f , 4.37655210f , 5.13829708f , 4.63276052f , 3.44003415f , 1.41755366f , -1.65012610f , -4.90518045f , -8.74811363f , -13.32540989f , -16.67502213f , -25.04341888f , -28.74816895f , -26.61729050f , -30.89074135f , -36.89068222f , -40.54713821f , - 0.52585047f , 0.25778684f , -0.68478346f , -0.63753521f , -0.85982674f , -0.45736870f , -0.39972550f , 0.19919159f , 0.21982291f , -0.21426015f , -0.17481731f , -0.30233619f , 0.35445356f , 0.53019482f , 0.62357306f , 0.10003661f , 0.38106197f , 0.59916449f , 0.29353949f , 0.19449981f , -2.91975641f , -2.99291539f , -3.24024558f , -3.85247374f , - 47.57529449f , 35.40103149f , 28.51466560f , 21.36822510f , 16.31501770f , 12.05416298f , 8.92814922f , 10.24798870f , 9.38683319f , 5.06438446f , 1.55697119f , -0.90166509f , -5.27530479f , -10.13637447f , -14.91060257f , -15.56597614f , -16.76358414f , -19.75214577f , -22.57003212f , -24.67880249f , -22.22905731f , -23.92941093f , -26.02715302f , -29.14421463f , - 32.45030594f , 18.47647858f , 10.55478764f , 2.66163707f , 0.48469192f , 0.89728785f , 2.66320086f , 4.46394491f , 5.75276375f , 5.15140963f , 3.30917573f , 2.07156634f , 0.32162985f , -2.37937927f , -5.25204325f , -7.75560665f , -9.72864151f , -11.49621296f , -12.90788174f , -14.53592110f , -14.00264931f , -13.90744686f , -13.50663280f , -12.31781673f , - 15.12892532f , 10.85012150f , 9.24257946f , 7.17304945f , 5.39838934f , 4.54048777f , 4.45172882f , 4.02888584f , 4.08525467f , 3.34242988f , 1.18552935f , 0.14054979f , -1.31041145f , -4.10797310f , -6.60405207f , -7.35080433f , -7.80001211f , -10.14729309f , -14.88454437f , -18.54398346f , -20.49944305f , -23.77704430f , -28.38242531f , -32.21464920f , - -0.70120311f , -0.36598748f , -0.27498749f , -0.18644568f , -0.13108316f , -0.05633634f , -0.12568842f , -0.05810567f , 0.00805399f , 0.04813070f , 0.01124786f , 0.06457995f , 0.05968979f , 0.04663355f , 0.04679099f , 0.04774757f , 0.03833918f , -0.06331048f , -0.10397947f , 0.00857244f , 0.29188818f , 0.54560822f , 0.49374610f , -0.00754885f , - 24.01022911f , 20.44940186f , 18.33339310f , 13.47519684f , 11.34601212f , 10.42150116f , 9.00321579f , 7.93997908f , 7.78757143f , 4.54246807f , 3.10096765f , -1.79380953f , -4.57441616f , -8.99514294f , -11.16653728f , -12.33127975f , -15.28052711f , -18.40486145f , -21.08405685f , -23.96353531f , -24.15535736f , -27.96574211f , -31.00701714f , -35.18267441f , - 10.95846939f , 7.75293112f , 5.94634438f , 4.67962313f , 3.86481786f , 3.06800008f , 2.68010044f , 1.77875984f , 1.08723342f , 0.60881591f , -0.11699903f , -0.66425866f , -1.27388847f , -1.93990111f , -2.43955994f , -3.04650831f , -3.60661364f , -4.21451235f , -4.87673521f , -6.57435703f , -6.46493149f , -7.41116762f , -8.24285698f , -8.84710217f , - 16.32924080f , 6.70306444f , 4.40889025f , 4.39005423f , 5.66961336f , 5.49213505f , 5.14747572f , 4.57054806f , 3.82850742f , 2.47304583f , 0.96936250f , -0.07546291f , -1.78923011f , -3.94788241f , -5.62404537f , -7.41395044f , -9.30011559f , -11.32884693f , -13.38846397f , -15.90376568f , -16.61722183f , -15.37379074f , -16.91991615f , -22.64369392f , - 20.29391861f , 10.14759159f , 7.41714382f , 5.43669033f , 4.22476673f , 3.05457902f , 2.12789893f , 1.46166980f , 0.68013304f , 0.10416872f , -0.62377477f , -0.69513589f , -1.11597610f , -1.73416364f , -2.00164723f , -2.48846936f , -2.99404836f , -3.36779451f , -4.50076723f , -6.23718977f , -6.32519245f , -7.00517225f , -7.63285732f , -8.34685898f , - 44.62683868f , 33.65060043f , 28.74439240f , 23.09117126f , 16.70447159f , 13.63468075f , 10.38835239f , 5.27151346f , 3.37364483f , 0.80086398f , -1.61115754f , -1.84962809f , -4.63047361f , -7.54744434f , -8.66370773f , -11.56917572f , -14.30193806f , -18.52358246f , -19.55438995f , -20.00398636f , -19.80403900f , -20.08826447f , -20.32636070f , -20.57789421f , - 25.43884087f , 14.71314049f , 10.84564495f , 7.29425287f , 5.99180174f , 4.52135897f , 4.43509150f , 2.96715736f , 2.20721149f , 0.85104460f , -0.42902783f , -1.01505911f , -1.67976689f , -3.03431702f , -4.04744673f , -5.05236149f , -5.71568680f , -7.14737368f , -7.96077490f , -9.41807270f , -8.88839054f , -8.62583065f , -8.43768692f , -8.79677773f , - 33.08629990f , 21.98393631f , 16.71452332f , 13.11685467f , 10.53023720f , 8.59362793f , 6.77428055f , 4.80111885f , 2.96947551f , 1.50105977f , -0.29485464f , -1.76483214f , -3.38473845f , -5.02232218f , -6.55174637f , -8.24214268f , -9.90916348f , -11.56876373f , -13.40682983f , -16.22795105f , -17.44435501f , -19.50963020f , -21.48133469f , -22.37619972f , - 0.14234349f , 0.00043129f , -0.46088508f , -0.47227818f , 0.19577537f , 0.57165289f , 0.14063163f , -0.08314086f , -0.17897955f , 0.26915708f , 0.29296365f , 0.25751004f , -0.29272652f , -0.35612249f , -0.45116535f , -0.22750567f , -0.13805020f , -0.08609761f , -0.08811182f , -0.00370739f , 0.04999773f , 0.10020024f , 0.12026346f , 0.12320870f , - 37.20217514f , 25.50048447f , 26.05090904f , 21.39400101f , 14.80546665f , 10.78633976f , 9.48393726f , 6.51000643f , 4.64587116f , 2.54244065f , 1.88398576f , -0.17826277f , -3.92847228f , -7.94585609f , -9.83112335f , -12.51981831f , -16.25451469f , -22.52105331f , -26.16354942f , -28.17800331f , -28.44519234f , -28.99005890f , -29.07491684f , -29.13504791f , - 22.87589455f , 20.69346428f , 16.08814049f , 12.09293556f , 8.58536339f , 6.12085295f , 5.03096294f , 2.46971536f , 1.38820446f , 0.41556263f , -0.71674269f , -1.87001503f , -1.97099841f , -3.12624931f , -4.61008024f , -5.90624523f , -5.81033182f , -7.63588858f , -9.32999802f , -11.98378181f , -13.66734123f , -15.22948647f , -17.72668266f , -22.15813255f , - 17.13776016f , 7.48015785f , 3.87183666f , 3.80275106f , 3.69309711f , 2.47135592f , 3.28866863f , 5.23638964f , 5.97343540f , 3.02334547f , 1.66290724f , 1.17763150f , 0.56503248f , -4.12660456f , -4.84892178f , -8.03931713f , -10.07701778f , -12.74638939f , -15.61114883f , -18.82812119f , -20.06874847f , -20.77385521f , -23.02597237f , -28.41068077f , - -0.68962491f , -0.67818958f , -0.47791985f , -0.18780768f , 0.07656835f , 0.29909450f , 0.36705506f , 0.60864949f , 0.66434783f , 0.54813319f , 0.31165063f , 0.41151917f , 0.27194378f , -0.09006688f , -0.59337950f , -1.27168393f , -1.60383165f , -2.03537226f , -1.01842117f , -1.12101495f , -2.20869303f , -2.13650179f , -1.40165854f , -1.00871158f , - 49.11537170f , 34.27339554f , 29.03029442f , 23.60639191f , 19.18561935f , 16.01621819f , 10.65990448f , 5.50423098f , 3.26754117f , 0.54238629f , -2.50046039f , -1.85086572f , -5.88433218f , -8.55415058f , -9.42830467f , -11.97149277f , -14.98629475f , -17.55759621f , -17.94509125f , -18.13786888f , -17.94290543f , -28.52441216f , -28.69857025f , -28.89863968f , - 32.58505249f , 18.45134735f , 10.62341118f , 4.82959938f , 2.78050184f , 2.30071044f , 2.89666629f , 3.55971622f , 4.36246777f , 3.80749893f , 2.22673583f , 1.03990865f , -0.54025501f , -2.73137355f , -4.92715406f , -6.82418060f , -7.95124388f , -9.07779884f , -9.96023846f , -11.46563911f , -10.75256252f , -10.58728790f , -10.22681522f , -9.05898476f , - 16.11109161f , 14.82219410f , 13.34882832f , 7.98469877f , 9.43520164f , 7.92174578f , 5.07156849f , 3.38034701f , 3.45362854f , 2.55894756f , 0.36423218f , -0.89059198f , -2.32811356f , -5.22609854f , -8.06139755f , -8.08888912f , -7.59058094f , -9.63050747f , -13.39019203f , -16.84990501f , -16.90269279f , -20.11418533f , -23.25974846f , -26.99926376f , - -1.15594578f , -1.16174018f , -1.02029443f , -0.85063583f , -0.73866522f , -0.75481141f , -0.86772621f , -1.00807703f , -1.13209546f , -1.11179471f , -1.20630574f , -1.01733243f , 0.24630366f , 3.09700346f , 3.12491417f , 1.54673541f , -0.17814836f , -1.87219131f , -0.85840708f , 1.11508834f , 1.62732244f , 0.97436380f , -0.19077510f , -0.80510545f , - 32.42321777f , 27.32720947f , 20.86049461f , 15.20588684f , 12.79125309f , 12.29267693f , 12.11658001f , 11.01210213f , 10.89878845f , 7.15270519f , 2.06876802f , -2.13045192f , -6.80808592f , -11.65817642f , -14.62570095f , -16.24762154f , -16.86284065f , -17.20292854f , -18.81791878f , -20.65732384f , -19.57567215f , -19.88597488f , -22.49367523f , -26.33296204f , - 25.36096573f , 13.31346798f , 8.91108418f , 5.01322508f , 3.48370409f , 2.18634796f , 2.12754703f , 1.25077868f , 0.72989434f , 0.29854974f , -0.73259068f , -0.59268522f , 0.14181496f , -0.68818730f , -1.80540454f , -2.34638786f , -4.05338144f , -5.46354723f , -7.10088396f , -9.38928127f , -8.44892311f , -9.48880005f , -9.86396503f , -10.07871723f , - 7.17678213f , 9.03277683f , 10.13266754f , 10.24296856f , 10.17098331f , 8.09959507f , 5.65843153f , 1.62803376f , -0.36960009f , -0.74838853f , -0.79447383f , -0.80214244f , -2.22858644f , -4.54312086f , -4.46352482f , -5.71911240f , -5.88809395f , -8.41744232f , -10.94176769f , -12.21683311f , -12.21341038f , -11.48782635f , -14.09292316f , -23.15090752f , - 18.21541405f , 14.70297527f , 14.13050365f , 12.94417000f , 11.81984806f , 9.76036167f , 6.53366423f , 4.50655460f , 0.83037621f , -0.42548206f , -1.35710704f , -2.34608483f , -3.56638503f , -5.17272615f , -5.63396835f , -7.03527308f , -7.91377544f , -8.77217388f , -10.20801735f , -12.21526527f , -12.12676907f , -11.62418461f , -12.46908951f , -15.99641514f , - 44.82578278f , 29.92639542f , 27.50827789f , 23.80286217f , 17.65353203f , 14.31119919f , 9.68513775f , 4.39934206f , 2.73908210f , 0.84895563f , -2.34653950f , -2.60779619f , -5.48460007f , -7.85637569f , -8.35718441f , -10.63293934f , -12.35181427f , -14.18777370f , -14.52088261f , -15.19802761f , -14.50250244f , -14.72802734f , -15.11614609f , -15.65816784f , - 22.81040764f , 18.14611626f , 15.16109562f , 7.86977768f , 8.17525578f , 4.43149519f , 3.84347200f , 1.57480264f , 0.94041783f , 0.21524446f , -0.86289990f , -1.21070933f , -2.15402818f , -2.98346281f , -3.67899656f , -4.07589436f , -4.21469736f , -4.80487633f , -5.08027840f , -6.07973146f , -5.15939760f , -4.76911354f , -4.57167721f , -4.45344400f , - 24.49489975f , 17.31044769f , 13.22760391f , 10.45895958f , 8.42623138f , 6.75540257f , 5.42271709f , 3.69801641f , 2.30738783f , 1.11391723f , -0.26593676f , -1.45248365f , -2.67149425f , -4.03488445f , -5.14615870f , -6.45010090f , -7.70261431f , -9.10985470f , -10.61737823f , -13.08172894f , -13.92179298f , -15.81127357f , -17.59627724f , -19.73897552f , - 8.98934364f , 4.76031303f , 2.62020183f , 1.48485959f , 0.28737816f , 0.05866807f , -0.01028116f , -0.07208341f , -0.13242376f , -0.04422715f , -0.09028641f , -0.04876806f , 0.10697100f , 0.04797191f , 0.01100808f , -0.07014611f , -0.04378227f , -0.04009765f , -0.17876917f , -0.72032106f , -0.11678807f , -0.05392319f , -0.07008670f , -0.21385938f , - 36.29371643f , 24.65291214f , 21.01904678f , 16.67200279f , 11.48446560f , 8.12246799f , 9.78220177f , 7.74590874f , 5.69669485f , 4.02027988f , 3.36120009f , 0.58418810f , -3.89836407f , -7.63864374f , -10.03672886f , -12.67631626f , -16.54735374f , -22.06600380f , -27.53655815f , -31.70346832f , -32.28223419f , -33.58357620f , -33.78388596f , -33.85955811f , - 20.20799255f , 13.75940609f , 10.45750713f , 8.23875809f , 6.45997095f , 5.16953897f , 4.34209776f , 2.95543051f , 1.74270713f , 0.87219697f , -0.25581297f , -1.09575856f , -2.07853103f , -3.06528211f , -3.94644260f , -5.01998711f , -6.08012724f , -7.13329268f , -8.25736523f , -10.45005131f , -10.79236698f , -12.32848263f , -13.70973110f , -15.25794792f , - 7.88285303f , 6.51488161f , 3.92537451f , 4.23367739f , 4.89059639f , 5.43539810f , 6.37946939f , 8.50651741f , 9.33964443f , 8.69559956f , 6.91200352f , 3.63401532f , -0.99519163f , -7.15117836f , -11.47043896f , -15.28446960f , -18.89196777f , -23.08573532f , -28.80813408f , -30.38180542f , -29.53565407f , -31.03279877f , -32.39319229f , -33.27596664f , - 0.40477216f , 0.24463084f , -0.76651365f , -0.71309596f , -0.87443089f , -0.30846810f , -0.39305758f , 0.23431541f , 0.22700633f , -0.23816873f , -0.20784868f , -0.32913551f , 0.34776384f , 0.50111002f , 0.59345955f , 0.10497253f , 0.34248179f , 0.54556167f , 0.25770640f , 0.16739839f , -4.25213432f , -4.33188486f , -4.59072590f , -5.18169022f , - 44.52682495f , 33.44413376f , 27.75477028f , 20.87782860f , 15.96038628f , 11.38267708f , 8.04888916f , 10.34346294f , 9.36942101f , 5.06397772f , 1.65765107f , -0.60627878f , -5.02781725f , -9.60684490f , -14.71248531f , -15.51352501f , -16.35951424f , -19.44139671f , -23.93828964f , -27.02204704f , -23.39621544f , -25.11229706f , -27.06189728f , -29.88434029f , - 30.53590775f , 18.24347496f , 10.48498344f , 3.34677172f , 1.29623032f , 1.39035857f , 2.45928121f , 3.70242572f , 4.65490055f , 4.28991556f , 2.71830440f , 1.69632769f , 0.22320883f , -2.12041640f , -4.55487108f , -6.90537930f , -8.85028553f , -10.44450092f , -11.88594723f , -13.62341404f , -13.19523811f , -13.18412113f , -12.81897163f , -11.68476582f , - 5.23515940f , 11.02192688f , 12.84599209f , 11.99070740f , 7.98806524f , 4.52272415f , 4.08583927f , 2.00564265f , -0.15996964f , -2.10115862f , -4.96646547f , -5.90554714f , 4.82052660f , 0.89168262f , -6.95808125f , 2.50679994f , -6.73005676f , -6.52649450f , -14.76829720f , -15.44077110f , -21.42759705f , -23.35196304f , -25.43357277f , -27.50794983f , - 1.84942830f , 0.77272046f , 0.24707772f , -0.08593588f , -0.23682129f , -0.24805132f , -0.09850720f , -0.04999159f , -0.00995130f , 0.02216339f , 0.08926903f , 0.20275106f , 0.22498472f , 0.26662621f , 0.16996276f , -0.06895026f , -0.26348418f , -0.41196167f , -0.47150335f , -0.43742141f , -0.53234649f , -0.56433624f , -0.59429443f , -0.65639752f , - 14.08870220f , 13.32911205f , 10.19654274f , 6.80626822f , 6.89704180f , 6.85630465f , 6.28267908f , 6.48725128f , 6.74154425f , 5.72381783f , 4.45444155f , 2.14331675f , -1.56116712f , -5.51466084f , -8.73317051f , -13.38193130f , -16.39547157f , -18.36110878f , -22.47372246f , -24.78481865f , -23.78740883f , -25.83082390f , -28.30295181f , -29.63710213f , - 12.11153984f , 11.18265629f , 8.56032085f , 6.07614088f , 4.32917595f , 3.62714767f , 2.88151503f , 0.00486909f , 0.16551718f , 0.11766627f , -1.01007175f , -1.58863187f , -0.66722620f , -1.26095092f , -2.03257895f , -2.68355250f , -1.88288093f , -2.89664102f , -3.82705688f , -5.15467978f , -5.96337652f , -7.68645287f , -9.75820160f , -14.60475540f , - 10.68691158f , 5.49249125f , 4.08632946f , 3.73180628f , 5.00127029f , 5.47980690f , 5.41938591f , 4.71624136f , 3.67419004f , 2.41826725f , 0.86259502f , -0.22994517f , -1.90842390f , -3.87555194f , -5.49712229f , -7.17735624f , -8.88335800f , -10.96466255f , -12.92337704f , -15.48291206f , -16.37232208f , -15.13042545f , -16.82096863f , -22.42011452f , - 15.85285378f , 10.13984489f , 8.02905941f , 4.50967121f , 2.95999980f , 2.60214114f , 0.53660029f , 0.86555701f , 0.22102003f , -0.33034071f , -0.07463158f , 0.21286504f , -0.93098062f , -1.75468397f , -1.58335686f , -1.24065292f , -1.48353171f , -1.76630950f , -2.04288220f , -3.12292504f , -2.45715189f , -2.74685717f , -3.16709018f , -5.91369343f , - 40.10007477f , 32.17766190f , 23.94418526f , 17.08811951f , 13.37568951f , 12.24086761f , 11.66988850f , 10.55005550f , 9.33296108f , 5.75441313f , 1.48114145f , -2.81252980f , -7.79981041f , -11.41279602f , -13.67298222f , -14.21839428f , -14.48849964f , -15.18556213f , -15.61604404f , -16.76811600f , -15.01851368f , -14.17923927f , -13.81790257f , -13.10479736f , - 24.85771179f , 14.51553345f , 11.72882080f , 8.90813828f , 8.43283081f , 6.32554102f , 6.22324610f , 3.79361701f , 4.27097321f , 0.56961524f , -1.24056125f , -1.41678429f , -3.11242867f , -4.09969568f , -5.68787241f , -6.75505066f , -7.30343008f , -8.00887489f , -7.82331944f , -9.66470909f , -8.76680851f , -8.39351845f , -8.12993431f , -7.16756201f , - 28.97707558f , 19.26215744f , 14.32650089f , 11.15691090f , 8.93038845f , 7.45748949f , 5.97504330f , 4.08204174f , 2.51096678f , 1.17593741f , -0.48250875f , -1.45828211f , -2.81734180f , -4.23465633f , -5.64280844f , -7.11844778f , -8.37782097f , -10.01226807f , -11.81233501f , -14.42724609f , -15.63475609f , -17.08984566f , -18.90253639f , -21.68543816f , - -0.37224483f , -0.21122639f , 0.15951714f , 0.02087032f , 1.22483158f , 0.00348772f , -0.18272802f , -0.44353136f , -0.08490600f , -0.11233181f , -0.16806731f , -0.22428627f , -0.01276036f , 0.06931113f , 0.01195190f , -0.11203818f , 0.03106703f , 0.26289529f , 0.23697743f , 0.22796448f , 0.04144126f , 0.09472501f , 0.14482924f , 0.17954086f , - 39.73665619f , 26.81943703f , 21.29967880f , 18.16204262f , 13.44168472f , 11.03711700f , 11.62625027f , 7.02647495f , 4.79233932f , 3.35499501f , 2.79116821f , -0.41337949f , -4.65079498f , -8.28630638f , -10.48777294f , -13.31785393f , -16.91392136f , -22.94918823f , -27.85824203f , -29.88930130f , -30.09802246f , -28.58382988f , -28.66120720f , -28.70516014f , - 19.10952950f , 22.74327850f , 23.97905540f , 21.18729591f , 11.64360809f , 6.94751596f , 4.65807104f , 0.78640783f , -0.24381419f , 1.02887869f , 0.82303244f , -0.54234630f , -0.94865251f , -1.77358091f , -5.30440760f , -8.68288422f , -8.39182663f , -8.75503826f , -11.02817535f , -13.34524441f , -13.31265545f , -13.47730160f , -16.70124626f , -23.44244576f , - 5.32545233f , 7.05786848f , 6.26387453f , 5.78526258f , 5.88421535f , 5.73053551f , 5.83421803f , 6.25754404f , 5.95633888f , 5.21652365f , 3.57697511f , 1.02363062f , -2.68831611f , -5.48803329f , -7.67456436f , -10.52217293f , -13.10689449f , -14.01679230f , -18.51670074f , -20.16453171f , -19.27928925f , -21.94375420f , -27.47334480f , -29.79807281f , - -2.60717487f , -1.83319664f , -1.31210554f , -0.76391363f , -0.20487705f , -0.30073228f , -0.07237651f , 0.09489144f , -0.11017539f , -0.08628271f , -0.06826403f , 0.06346101f , 0.18584041f , 0.16889001f , 0.13889854f , 0.14046463f , 0.05026200f , -0.19259109f , 0.12724322f , 0.05020098f , -0.06773847f , -0.35614878f , -0.63952541f , -0.86939591f , - 43.34894180f , 31.48630524f , 28.12536430f , 24.63106918f , 16.25746918f , 12.06399059f , 10.17741966f , 6.35993147f , 4.57542324f , 1.64055872f , 0.70682496f , -0.49986696f , -4.10422993f , -8.01978779f , -9.94273472f , -12.91026783f , -16.30473137f , -20.63467598f , -21.94548988f , -22.36483765f , -22.45355415f , -22.54744720f , -22.58737946f , -22.65038681f , - 30.95190620f , 18.16899109f , 9.72149658f , 4.10552931f , 2.30458689f , 2.12724614f , 2.85707808f , 4.13076019f , 5.31916714f , 4.81190920f , 3.00600863f , 1.67334628f , -0.53532135f , -3.10476613f , -5.73052549f , -7.79181433f , -9.06767464f , -10.22359562f , -11.19510365f , -12.66148758f , -12.00313091f , -11.91836929f , -11.49621868f , -10.27651405f , - 19.52749825f , 13.26932335f , 10.77497768f , 9.87707806f , 8.94397163f , 8.45470905f , 7.96926117f , 5.37859535f , 3.56771731f , 1.95985627f , 0.70804149f , -0.21590416f , -3.00161719f , -5.06863308f , -7.59307814f , -9.56244850f , -11.54047012f , -12.52976322f , -14.91271400f , -17.65096283f , -17.99032593f , -18.96465111f , -20.50286484f , -29.15997505f , - -0.41770393f , -0.57753342f , -1.20728409f , -2.88331747f , -5.34745789f , -6.08694220f , -3.71453929f , -2.12419772f , -1.18535638f , -0.59698033f , 0.42981535f , 1.32175910f , 2.83778572f , 4.84865475f , 5.04370260f , 3.07809186f , 1.49566460f , 0.65009278f , 0.04541466f , -0.15811041f , -0.29866409f , -0.41704908f , -0.46928179f , -0.48526672f , - 30.59598160f , 24.69124985f , 19.35356522f , 17.04518127f , 12.47758865f , 9.30305386f , 9.31541252f , 8.18128777f , 5.78386831f , 3.40561008f , 1.86525965f , -2.05713415f , -3.91759825f , -7.05117083f , -9.88467789f , -11.80012417f , -15.62137604f , -16.45769119f , -16.11259651f , -17.03925705f , -16.63202477f , -20.41814423f , -23.23829842f , -27.13690567f , - 22.04087639f , 9.82030296f , 6.62304544f , 3.54571700f , 2.28869224f , 1.43831360f , 1.01925826f , 0.60685647f , 0.52726758f , 0.28217983f , -0.60519862f , -0.40057555f , 0.33728161f , 0.16425660f , -0.30877599f , -1.72851086f , -3.62104511f , -5.35534239f , -7.36662674f , -9.61280251f , -9.84184837f , -9.76028061f , -10.30779839f , -12.96220016f , - 7.59925270f , 9.89327908f , 11.32660198f , 11.55432892f , 11.11032295f , 9.16942692f , 6.63248444f , 2.69755864f , 0.57976800f , 0.05171308f , -0.55509138f , -1.34203660f , -3.50475025f , -5.48786688f , -5.35051298f , -6.98438931f , -7.01662779f , -9.47507668f , -12.24847126f , -13.41042137f , -12.92720699f , -12.06966019f , -14.46927357f , -23.34392357f , - 6.96612597f , 5.00931787f , 3.76138091f , 3.18334484f , 2.03293252f , 1.34288895f , 1.58868873f , 1.00840783f , 0.40005356f , 0.06600340f , -0.13207078f , -0.20888096f , -0.49867839f , -0.91563702f , -1.39049554f , -1.52579367f , -1.76741624f , -2.06173539f , -2.48300815f , -3.86886954f , -3.38073707f , -3.92400837f , -4.47162819f , -5.09745169f , - 47.14703751f , 30.38273811f , 21.96264458f , 14.39871597f , 10.23386383f , 8.95710278f , 6.93860054f , 5.62253952f , 4.24646330f , 1.48851633f , -1.20669615f , -3.14844489f , -5.07624435f , -6.20617819f , -6.85559320f , -7.39740086f , -7.59652758f , -7.76342344f , -7.96090555f , -8.85080433f , -7.36783743f , -6.51624918f , -6.18211889f , -5.45559025f , - 33.12013626f , 16.84858894f , 12.65143013f , 8.74576950f , 7.71503162f , 5.75152826f , 5.57081461f , 3.33705091f , 2.19604564f , 0.46275416f , -1.08203483f , -1.74722302f , -2.23058796f , -3.73542142f , -4.79898882f , -5.51074600f , -5.92822361f , -7.29669523f , -7.87425613f , -9.19938278f , -8.26733780f , -7.79288721f , -7.17766953f , -6.91147518f , - 22.72534180f , 16.73917770f , 15.96501827f , 15.48456001f , 14.21817970f , 11.09321880f , 7.22196627f , 3.27875924f , 0.86349517f , -0.35276374f , -0.96022642f , -1.97590554f , -4.21987820f , -5.87952375f , -6.43021441f , -8.40103912f , -8.45606804f , -10.49744606f , -12.33858109f , -13.72036362f , -13.35521221f , -11.95208740f , -13.21454906f , -18.77292252f , - 0.89415503f , 2.55427527f , 2.19861484f , 1.76997423f , 1.68467879f , 1.11462021f , 0.72990263f , 0.68752390f , 0.55451417f , 0.46162665f , -0.10212867f , 0.08975709f , -1.02394462f , -0.74809217f , -1.54942429f , -0.89107299f , -1.00796068f , -0.70048058f , -0.53988647f , -0.51691598f , -0.45218167f , -0.00372395f , -0.01138951f , -0.04693869f , - 42.55582428f , 31.86493301f , 25.10536003f , 19.38906479f , 13.20624542f , 10.70058155f , 8.71647072f , 6.43070078f , 4.15740585f , 2.91404939f , 0.74730510f , -0.24514204f , -2.99233270f , -7.08516312f , -9.33087540f , -12.22711372f , -14.99213314f , -18.51732445f , -22.07689285f , -25.69321823f , -27.76980782f , -30.33328629f , -35.40525818f , -43.80059433f , - 17.17425156f , 15.04495525f , 13.74315548f , 9.50892258f , 6.63219738f , 3.98290706f , 2.99513650f , 0.72657228f , 0.40510508f , -0.37188929f , -0.42712122f , -0.44993770f , -0.85454285f , -2.16015244f , -2.33109641f , -3.77121162f , -4.37596750f , -5.36669207f , -5.62877464f , -7.46640444f , -6.83423185f , -7.70908165f , -7.39536428f , -11.27804089f , - 2.52714753f , 2.49289870f , -0.13784029f , -0.12163699f , 1.75517499f , 2.99553514f , 4.49444866f , 5.77764273f , 6.11328125f , 5.99628973f , 5.25506210f , 3.72307754f , 0.61337721f , -3.33252883f , -7.41996574f , -11.31843758f , -14.65295410f , -17.27932930f , -23.77917290f , -26.47192383f , -24.69055176f , -28.23755074f , -33.64114761f , -36.70846558f , - 0.26897269f , 0.29896018f , -0.59694219f , -0.58600718f , -0.59563857f , -0.14940611f , -0.22029303f , 0.11002608f , 0.09471268f , -0.08665721f , -0.04912328f , -0.19163008f , 0.17407294f , 0.29674888f , 0.32706621f , 0.06863109f , 0.22149041f , 0.41376126f , 0.17968638f , 0.12345629f , -1.91504288f , -1.83034718f , -1.79148746f , -2.04030466f , - 46.61645508f , 34.87612534f , 28.30528450f , 21.24158478f , 16.02840996f , 11.78007889f , 8.85846806f , 10.30448627f , 9.45803833f , 5.21806145f , 1.68192971f , -0.74372375f , -5.16118431f , -10.11946869f , -14.85457230f , -15.61676884f , -16.83375549f , -19.81565475f , -22.77931786f , -24.86022949f , -19.57012367f , -21.15659714f , -22.98768044f , -25.62114906f , - 33.50306320f , 20.94828606f , 11.29131508f , 3.76779723f , 1.88436973f , 2.24041677f , 3.07290483f , 3.88969660f , 4.82355642f , 4.29338741f , 2.81698418f , 1.50617039f , -0.22714122f , -2.44629383f , -5.18593407f , -7.46794319f , -9.20017433f , -10.38420296f , -11.62056923f , -13.33395100f , -12.78791428f , -12.68239403f , -12.26134491f , -11.07050896f , - 14.10636425f , 12.71654224f , 11.35340214f , 6.63278866f , 7.45038319f , 5.69565058f , 3.01491594f , 1.82628620f , 2.48782039f , 2.02510524f , 0.75415736f , -0.22476493f , -1.60228145f , -3.62377214f , -6.14920473f , -6.03494453f , -5.61935091f , -7.92571545f , -12.52105999f , -15.74191380f , -16.80817795f , -20.57492828f , -24.48945808f , -28.24258423f , - 0.19937749f , 0.12145615f , -0.77132010f , -0.71175891f , -0.93605912f , -0.31743777f , -0.29512858f , 0.09480342f , 0.14056028f , -0.12526789f , -0.09476471f , -0.30501965f , 0.25228870f , 0.52946067f , 0.56253082f , 0.14792542f , 0.34610838f , 0.49112254f , 0.26700655f , 0.18578406f , -0.02644314f , -0.05281431f , -0.03051598f , -0.05372978f , - 27.67247200f , 21.21397018f , 19.23110199f , 14.58107758f , 9.06582832f , 6.16479349f , 5.19902563f , 4.85638475f , 5.00597048f , 5.02013874f , 4.74315405f , 1.14152813f , -2.22816443f , -4.39935923f , -7.21801662f , -11.83607006f , -15.51521206f , -16.95382690f , -19.09778404f , -21.91887093f , -22.66965294f , -25.31122971f , -28.42613792f , -31.17256165f , - 11.87517643f , 8.35047531f , 6.28900909f , 4.94152260f , 3.84217644f , 2.98525238f , 2.59193397f , 1.77286649f , 1.13057005f , 0.57406390f , -0.14166087f , -0.61366737f , -1.26566494f , -1.89665902f , -2.40094352f , -3.00182557f , -3.57644248f , -4.17064571f , -4.82954073f , -6.52423048f , -6.40167952f , -7.34070396f , -8.16668510f , -8.83840561f , - 22.19146919f , 12.36240387f , 9.77023125f , 7.21114588f , 6.19833231f , 5.60523272f , 5.27842569f , 4.64398146f , 4.52219105f , 2.91414714f , 0.94011378f , 0.25184512f , -1.67108417f , -4.17819881f , -6.24735117f , -8.17109394f , -10.08654118f , -12.12491417f , -14.44429111f , -16.77396011f , -16.61188507f , -15.37945271f , -16.77342606f , -22.42259216f , - 24.26110077f , 14.98621845f , 11.37115288f , 7.53246927f , 5.87425423f , 4.31526375f , 3.63155198f , 2.21215534f , 1.20856023f , 0.27279723f , -0.83065307f , -1.13145101f , -1.61203635f , -2.64372611f , -3.19713020f , -3.79212451f , -4.30746126f , -5.19196177f , -6.05636358f , -7.64335585f , -7.13419104f , -7.34445190f , -7.59247351f , -8.24604034f , - 49.59980774f , 36.70146179f , 26.21045494f , 18.96593857f , 14.66215992f , 12.35246658f , 7.91571426f , 4.46859789f , 4.55067158f , 3.66973281f , -0.18894276f , -1.13036156f , -2.81119108f , -7.01159000f , -10.32988167f , -12.34438610f , -13.80298901f , -15.68917179f , -16.59648895f , -18.04370117f , -16.93032265f , -17.15782166f , -17.23012543f , -16.81400299f , - 26.24615288f , 16.32177734f , 12.63861752f , 8.90179348f , 7.98338699f , 5.88846350f , 5.62527227f , 3.35444164f , 2.27727008f , 0.38706595f , -1.15045261f , -1.47619927f , -2.39863658f , -3.88151002f , -5.00069237f , -5.60923672f , -5.99917269f , -7.16092062f , -7.55632973f , -8.88112926f , -7.98447180f , -7.57788992f , -7.00798178f , -6.71480894f , - 34.06352615f , 26.54057884f , 17.68980789f , 12.03931808f , 10.71124458f , 6.47080278f , 4.33683681f , 3.58446765f , 0.97453946f , 0.07721954f , -0.66921860f , -1.29634130f , -1.56973386f , -3.47828341f , -5.09566927f , -5.83764601f , -8.20822048f , -10.21011162f , -11.12835598f , -12.94603825f , -13.56561852f , -18.43250847f , -19.20955467f , -19.59786224f , - 0.95227748f , 0.58713847f , 0.31188840f , 0.27555063f , 0.34262455f , 0.30559424f , 0.15511483f , 0.24209952f , -0.01565590f , 0.27935538f , -0.07689041f , 0.16362046f , -0.12529252f , -0.41308093f , -0.45669210f , -0.33647329f , -0.06432384f , -0.04425672f , -0.05423176f , -0.09260799f , 1.18880558f , 1.71499527f , 1.66458070f , 1.84440422f , - 40.51910782f , 28.87430191f , 26.44847679f , 22.61171722f , 14.58166790f , 10.04493809f , 8.90122890f , 6.69188166f , 4.74618101f , 1.55060208f , 0.26953381f , -0.23009424f , -3.10289311f , -7.76883173f , -9.03342628f , -11.38734531f , -15.26344204f , -20.89108467f , -23.61590576f , -24.70707703f , -24.72460747f , -25.31776428f , -25.42388153f , -25.48863602f , - 21.86741066f , 19.33110237f , 16.09799957f , 12.12207603f , 7.65350389f , 5.31046820f , 4.50258398f , 3.46295428f , 1.98402655f , 0.36231637f , -0.75526041f , -2.47129464f , -1.34295225f , -2.90498233f , -4.77146578f , -5.83896399f , -5.19093323f , -5.94871426f , -6.67448521f , -9.30622387f , -10.69075203f , -13.05691051f , -14.45488358f , -18.82699394f , - 17.39302254f , 10.72895432f , 7.20909882f , 6.08006477f , 5.16837120f , 5.15259743f , 5.89495230f , 6.39498520f , 6.43017626f , 4.73164368f , 2.29907250f , 0.83655185f , -1.61507225f , -4.66745806f , -6.97347021f , -10.42446899f , -13.22788048f , -15.54260540f , -18.53327751f , -21.36825371f , -21.31904602f , -21.81181335f , -22.37908173f , -22.59859848f , - -0.01662111f , -0.25115231f , -0.21056390f , -0.29628995f , 0.14847504f , 0.01114315f , -0.00287740f , -0.02265828f , 0.20096491f , 0.01801417f , 0.01865144f , 0.08115936f , 0.06854093f , 0.03268814f , -0.06264148f , -0.19867666f , -0.29278329f , -0.48747075f , -0.51964116f , -0.52115518f , -0.62580901f , -0.67440128f , -0.64710861f , -0.70800090f , - 50.63159180f , 32.35544586f , 28.22938156f , 26.12494469f , 19.17036057f , 15.54605675f , 10.90270996f , 5.06216860f , 2.83115578f , 0.26169294f , -2.59751272f , -2.23182607f , -6.02089071f , -9.04337597f , -9.29519939f , -11.44281673f , -13.14252472f , -13.87999630f , -14.00658417f , -14.13973713f , -14.08796120f , -28.49422073f , -28.55380249f , -28.66899681f , - 32.93387222f , 21.26923561f , 12.45925331f , 7.33453608f , 4.77903414f , 2.72644329f , 2.77173924f , 3.24125862f , 4.11953831f , 3.23369288f , 1.40657330f , 0.18600486f , -0.99559313f , -2.52648664f , -4.61264372f , -6.59295559f , -7.73660517f , -8.74180222f , -9.62380314f , -10.94507694f , -10.15025043f , -10.08863640f , -9.69090939f , -8.64610767f , - 19.57560349f , 16.97666168f , 15.32033443f , 9.42695236f , 10.81062126f , 9.27347946f , 6.17076063f , 3.87660646f , 4.01463747f , 2.81778264f , -0.01208094f , -1.53821909f , -3.11120200f , -6.04038715f , -9.02472019f , -8.91995525f , -8.31732368f , -9.97514439f , -13.60401344f , -16.95523643f , -16.28038406f , -19.30029488f , -21.93006134f , -25.31139183f , - -0.42336991f , -0.69359350f , -0.79506743f , -0.19419681f , -0.43531519f , -0.60549897f , -0.57378924f , -0.71198583f , -0.67573565f , -0.92463225f , -0.75932795f , -0.88697869f , -0.09116954f , 0.78057998f , 1.43234348f , 2.25282049f , 1.19868934f , 0.34737879f , 0.56014186f , 0.85799438f , 3.28324819f , 3.73368144f , 2.45774937f , 1.97252631f , - 34.38531113f , 33.28102493f , 22.44291687f , 21.71539307f , 14.89051437f , 12.06779766f , 11.31605339f , 6.32059956f , 6.47309685f , 2.75739145f , -0.72276920f , -4.60511971f , -2.12165952f , -3.55129719f , -10.11487579f , -14.52775002f , -18.18198204f , -20.44789314f , -21.58519745f , -22.53190994f , -22.04618073f , -22.58295822f , -22.41326904f , -22.20569420f , - 28.00102234f , 14.65698147f , 10.06700230f , 6.12028360f , 4.52054358f , 2.66990614f , 2.51413369f , 1.24868000f , 1.04878569f , 0.22633910f , -1.12691772f , -1.15263200f , -0.74640560f , -1.10290110f , -2.06341290f , -2.48550367f , -3.55061507f , -4.52637577f , -6.00973654f , -8.38346672f , -7.37356853f , -8.63987446f , -9.06530762f , -8.95927715f , - 9.00067616f , 10.26587391f , 11.45584679f , 11.44188595f , 10.68400574f , 8.38729477f , 5.69343138f , 1.98902297f , 0.07958379f , -0.50896430f , -0.83697474f , -1.44278872f , -2.87292027f , -4.73982143f , -4.71389008f , -5.85515070f , -5.86282825f , -7.65532827f , -9.99789906f , -11.01864147f , -10.61325741f , -9.58348751f , -12.15856743f , -21.34374619f , - 21.37445641f , 22.85872078f , 20.62342262f , 13.71718597f , 8.38479900f , 4.66404533f , 2.74082160f , 0.35184097f , -0.49886125f , -0.66627383f , -0.80947453f , -1.35072243f , -1.72979438f , -2.81121135f , -2.55301118f , -3.12950158f , -2.59265637f , -3.53384900f , -4.62459230f , -8.21864986f , -9.64109135f , -9.61122894f , -11.18858528f , -17.21859741f , - 52.95914078f , 32.75603485f , 30.16634941f , 25.88944244f , 19.02377129f , 16.02350807f , 11.37754154f , 4.71347761f , 3.22399068f , 0.38588712f , -2.36943150f , -3.03161478f , -6.27093697f , -9.42517185f , -9.90064812f , -11.53384590f , -12.21652794f , -12.39763260f , -12.44114876f , -12.50287819f , -12.35077858f , -12.41636753f , -12.45803928f , -12.50715065f , - 28.04634666f , 16.86526871f , 13.82318878f , 9.40035915f , 8.49054623f , 4.69572687f , 4.31990623f , 2.24289536f , 1.52588129f , -0.15709598f , -1.59520829f , -0.06550518f , -1.94989491f , -3.66548038f , -4.27683449f , -4.56677961f , -4.99815702f , -5.49210978f , -5.61179161f , -6.72458935f , -5.75457907f , -5.41288614f , -5.03387022f , -3.80432510f , - 25.75157547f , 17.28746796f , 13.10127354f , 10.33002377f , 8.27671814f , 6.59895802f , 5.40835238f , 3.63577080f , 2.23206282f , 1.08383977f , -0.28453460f , -1.38477814f , -2.64369345f , -3.91356444f , -5.05506754f , -6.35320854f , -7.60085487f , -8.91501999f , -10.29950809f , -12.61900711f , -13.07838917f , -14.44057560f , -15.59240627f , -16.55293274f , - 24.60115242f , 11.35327435f , 6.30881643f , 4.50763512f , 0.50214702f , -0.71103203f , 2.54261613f , -0.67276359f , -1.09342635f , 1.93361044f , 1.37798584f , 1.15170944f , 1.77881491f , -0.16942300f , -3.11068201f , -2.93669724f , -0.59286201f , 1.04607284f , 4.16106987f , 6.48291349f , 11.32464409f , 15.29464436f , 15.33285236f , 7.41661787f , -}; -#endif const float cdk_37bits_1[3072] = { @@ -6936,11 +6801,7 @@ const float cdk_37bits_6[1536] = const float * const cdk_37bits[] = { cdk_37bits_1, cdk_37bits_2, cdk_37bits_3, cdk_37bits_4, cdk_37bits_5, cdk_37bits_6 }; -#ifdef ERI_FDCNGVQ_LOW_ROM const float * const cdk_37bits_ivas[] = { NULL, cdk_37bits_2, cdk_37bits_3, cdk_37bits_4, cdk_37bits_5, cdk_37bits_6 }; -#else -const float * const cdk_37bits_ivas[] = { cdk_37bits_1_ivas, cdk_37bits_2, cdk_37bits_3, cdk_37bits_4, cdk_37bits_5, cdk_37bits_6 }; -#endif diff --git a/lib_com/rom_com.h b/lib_com/rom_com.h index 477431c4d00e87955cb5fc73648089f82029efb1..3ea7a7f4c31c44b1f880993fba2ae854ebff83ae 100644 --- a/lib_com/rom_com.h +++ b/lib_com/rom_com.h @@ -1141,7 +1141,6 @@ extern const float olapWinSyn320[320]; extern const float *const cdk_37bits_ivas_orig[]; #endif -#ifdef ERI_FDCNGVQ_LOW_ROM extern const Word8 cdk1_ivas_dct_s0_W8[]; extern const Word8 cdk1_ivas_dct_s1_W8[]; extern const Word8 cdk1_ivas_dct_s2_W8[]; @@ -1173,7 +1172,6 @@ extern const Word16 cdk1_ivas_cum_entries_per_segment[]; /* circular mse ordered list fwd/rev directions for candidate evaluations */ extern const Word8 cdk1_ivas_segm_neighbour_fwd[]; extern const Word8 cdk1_ivas_segm_neighbour_rev[]; -#endif extern const float cdk_37bits_1[]; diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index c89c5f53b02b45c5072ffdba125e670866f3307a..f7b7465028a3f9a29da82a35dd02fa27be3c8500 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -45,9 +45,7 @@ #include "prot.h" #include "ivas_cnst.h" #include "ivas_prot.h" -#ifdef LSF_RE_USE_SECONDARY_CHANNEL #include "ivas_rom_com.h" -#endif #include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -627,19 +625,11 @@ ivas_error acelp_core_dec( nb_bits = -1; } -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif if ( st->coder_type == TRANSITION && tc_subfr < L_SUBFR && st->L_frame == L_FRAME ) /* ISfm: why is this called again after above */ { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } } @@ -671,17 +661,12 @@ ivas_error acelp_core_dec( if ( !tdm_lp_reuse_flag ) { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL lsf_dec( st, tc_subfr, Aq, &LSF_Q_prediction, lsf_new, lsp_new, lsp_mid, tdm_low_rate_mode, tdm_lsfQ_PCh ); -#else - lsf_dec( st, tc_subfr, Aq, &LSF_Q_prediction, lsf_new, lsp_new, lsp_mid, tdm_low_rate_mode ); -#endif } else { const float *pt_interp_2; -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE if ( st->active_cnt != 1 ) { int16_t beta_index; @@ -694,10 +679,6 @@ ivas_error acelp_core_dec( mvr2r( tdm_lspQ_PCh, lsp_new, M ); mvr2r( tdm_lsfQ_PCh, lsf_new, M ); } -#else - mvr2r( tdm_lspQ_PCh, lsp_new, M ); - mvr2r( tdm_lsfQ_PCh, lsf_new, M ); -#endif if ( st->rate_switching_reset ) { diff --git a/lib_dec/acelp_core_switch_dec.c b/lib_dec/acelp_core_switch_dec.c index 4a49d6b2dbb4b28f770cd78295097411c487e372..51d459b205e980505dd12a2d5c87795b95244c8b 100644 --- a/lib_dec/acelp_core_switch_dec.c +++ b/lib_dec/acelp_core_switch_dec.c @@ -158,11 +158,7 @@ ivas_error acelp_core_switch_dec( * Excitation decoding *----------------------------------------------------------------*/ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, st->active_cnt, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); -#else - config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); -#endif decod_gen_voic_core_switch( st, L_frame_for_cs, 0, Aq, exc, cbrate ); diff --git a/lib_dec/cng_dec.c b/lib_dec/cng_dec.c index 6d02f18309f06303674cf359a0204913808a4f05..64403736c43fae6a323f248a586792506f0bac99 100644 --- a/lib_dec/cng_dec.c +++ b/lib_dec/cng_dec.c @@ -109,13 +109,8 @@ void CNG_dec( } else { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL lsf_dec( st, 0, Aq, &LSF_Q_prediction, lsf_new, lsp_new, 0, 0, NULL ); } -#else - lsf_dec( st, 0, Aq, &LSF_Q_prediction, lsf_new, lsp_new, 0, 0 ); - } -#endif } else { diff --git a/lib_dec/dlpc_stoch.c b/lib_dec/dlpc_stoch.c index 9a86d06224f17615a6e4720f96004d7327becfae..22a1cda26cef68a9207dd93e0a80742a8304283d 100644 --- a/lib_dec/dlpc_stoch.c +++ b/lib_dec/dlpc_stoch.c @@ -81,31 +81,17 @@ void lpc_unquantize( { if ( st->sr_core == INT_FS_16k && coder_type == UNVOICED ) { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL lsf_end_dec( st, GENERIC, 1 - st->narrowBand /* st->bwidth */, ENDLSF_NBITS, &lsf[M], param_lpc, LSF_Q_prediction, &nb_indices, NULL ); -#else - lsf_end_dec( st, GENERIC, 1 - st->narrowBand /* st->bwidth */, ENDLSF_NBITS, &lsf[M], param_lpc, LSF_Q_prediction, &nb_indices ); -#endif } else { if ( st->core == TCX_20_CORE ) { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL lsf_end_dec( st, AUDIO, 1 - st->narrowBand /* st->bwidth */, ENDLSF_NBITS, &lsf[M], param_lpc, LSF_Q_prediction, &nb_indices, NULL ); -#else - lsf_end_dec( st, AUDIO, 1 - st->narrowBand /* st->bwidth */, ENDLSF_NBITS, &lsf[M], param_lpc, LSF_Q_prediction, &nb_indices ); -#endif } else { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL lsf_end_dec( st, coder_type, 1 - st->narrowBand /* st->bwidth */, ENDLSF_NBITS, &lsf[M], param_lpc, LSF_Q_prediction, &nb_indices, NULL ); -#else - lsf_end_dec( st, coder_type, 1 - st->narrowBand /* st->bwidth */, ENDLSF_NBITS, &lsf[M], param_lpc, LSF_Q_prediction, &nb_indices - - ); -#endif } } diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 8a76717541df64d1bbcd7e08841c8cc55d2ed20d..38495a681acd2ffbcc3d2893fc42c45aab9b3a46 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -971,19 +971,12 @@ void FdCng_decodeSID( float v[32]; int16_t indices[32]; HANDLE_FD_CNG_COM hFdCngCom; -#ifdef ERI_FDCNGVQ_LOW_ROM float *invTrfMatrix; float tmpRAM[FDCNG_VQ_MAX_LEN][FDCNG_VQ_DCT_MAXTRUNC]; -#endif -#ifndef ERI_FDCNGVQ_LOW_ROM - const float *const *codebooks = ( st->element_mode == EVS_MONO ) ? cdk_37bits : cdk_37bits_ivas; -#endif const float gain_q_offset = ( st->element_mode == EVS_MONO ) ? GAIN_Q_OFFSET_EVS : GAIN_Q_OFFSET_IVAS; -#ifdef ERI_FDCNGVQ_LOW_ROM invTrfMatrix = (float *) tmpRAM; -#endif hFdCngCom = ( st->hFdCngDec )->hFdCngCom; @@ -1003,7 +996,6 @@ void FdCng_decodeSID( /* MSVQ decoder */ -#ifdef ERI_FDCNGVQ_LOW_ROM if ( st->element_mode != EVS_MONO ) { create_IDCT_N_Matrix( invTrfMatrix, FDCNG_VQ_MAX_LEN, FDCNG_VQ_DCT_MAXTRUNC, sizeof( tmpRAM ) / ( sizeof( float ) ) ); @@ -1014,9 +1006,6 @@ void FdCng_decodeSID( msvq_dec( cdk_37bits, NULL, NULL, FD_CNG_stages_37bits, N, FD_CNG_maxN_37bits, indices, 0, NULL, v, NULL ); } -#else - msvq_dec( codebooks, NULL, NULL, FD_CNG_stages_37bits, N, FD_CNG_maxN_37bits, indices, v, NULL ); -#endif /* Decode gain */ gain = ( (float) index - gain_q_offset ) / 1.5f; @@ -2021,16 +2010,12 @@ void FdCngDecodeMDCTStereoSID( int16_t indices[FD_CNG_stages_37bits]; int16_t N, i, ch, p, stages; int16_t is_out_ms; -#ifdef ERI_FDCNGVQ_LOW_ROM float *invTrfMatrix; float tmpRAM[FDCNG_VQ_MAX_LEN][FDCNG_VQ_DCT_MAXTRUNC]; -#endif -#ifdef ERI_FDCNGVQ_LOW_ROM invTrfMatrix = (float *) tmpRAM; create_IDCT_N_Matrix( invTrfMatrix, FDCNG_VQ_MAX_LEN, FDCNG_VQ_DCT_MAXTRUNC, sizeof( tmpRAM ) / ( sizeof( float ) ) ); -#endif is_out_ms = 0; if ( hCPE->hCoreCoder[0]->cng_sba_flag ) @@ -2074,11 +2059,7 @@ void FdCngDecodeMDCTStereoSID( } /* MSVQ decoder */ -#ifdef ERI_FDCNGVQ_LOW_ROM msvq_dec( cdk_37bits_ivas, NULL, NULL, stages, N, FD_CNG_maxN_37bits, indices, 1, invTrfMatrix, ms_ptr[ch], NULL ); -#else - msvq_dec( cdk_37bits_ivas, NULL, NULL, stages, N, FD_CNG_maxN_37bits, indices, ms_ptr[ch], NULL ); -#endif } dtx_read_padding_bits( sts[1], ( IVAS_SID_5k2 - 4400 ) / FRAMES_PER_SEC ); @@ -2137,16 +2118,12 @@ void FdCngDecodeDiracMDCTStereoSID( float gain[CPE_CHANNELS]; int16_t indices[FD_CNG_stages_37bits]; int16_t N, i, ch, p; -#ifdef ERI_FDCNGVQ_LOW_ROM float *invTrfMatrix; float tmpRAM[FDCNG_VQ_MAX_LEN][FDCNG_VQ_DCT_MAXTRUNC]; -#endif -#ifdef ERI_FDCNGVQ_LOW_ROM invTrfMatrix = (float *) tmpRAM; /* dynamically filled */ create_IDCT_N_Matrix( invTrfMatrix, FDCNG_VQ_MAX_LEN, FDCNG_VQ_DCT_MAXTRUNC, sizeof( tmpRAM ) / ( sizeof( float ) ) ); -#endif for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { @@ -2169,11 +2146,7 @@ void FdCngDecodeDiracMDCTStereoSID( gain[1] = gain[0]; /* MSVQ decoder */ -#ifdef ERI_FDCNGVQ_LOW_ROM msvq_dec( cdk_37bits_ivas, NULL, NULL, FD_CNG_stages_37bits, N, FD_CNG_maxN_37bits, indices, 1, invTrfMatrix, ms_ptr[0], NULL ); -#else - msvq_dec( cdk_37bits_ivas, NULL, NULL, FD_CNG_stages_37bits, N, FD_CNG_maxN_37bits, indices, ms_ptr[0], NULL ); -#endif mvr2r( ms_ptr[0], ms_ptr[1], N ); /*inverseMS( N, ms_ptr[0], ms_ptr[1], 1.f );*/ diff --git a/lib_dec/gs_dec.c b/lib_dec/gs_dec.c index 29e134db2530b5629657fce5aa8ef7f02de51cd1..2e7fb267ab9cc29bcbf59c8dcaded51a698907b5 100644 --- a/lib_dec/gs_dec.c +++ b/lib_dec/gs_dec.c @@ -111,11 +111,7 @@ void decod_audio( } /* set bit-allocation */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif /*---------------------------------------------------------------* * Decode energy dynamics diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e50a0ff809ed0aee2dca5b4d3b5f975cf5119408..a193ac282337c7ac7d18deead2e03ab4c6aa0720 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -258,14 +258,7 @@ ivas_error ivas_dec_setup( { int16_t nchan_transport_old, nchan_transport; SBA_MODE sba_mode_old; -#ifndef LBR_SBA - int32_t last_ivas_total_brate; - - last_ivas_total_brate = st_ivas->last_active_ivas_total_brate; - sba_mode_old = ivas_sba_mode_select( last_ivas_total_brate ); -#else sba_mode_old = ivas_sba_mode_select(); -#endif nchan_transport_old = st_ivas->nchan_transport; nchan_transport = ( st_ivas->sid_format == SID_SBA_2TC ) ? 2 : 1; @@ -387,11 +380,7 @@ static ivas_error ivas_read_format( else { st_ivas->ivas_format = SBA_FORMAT; -#ifndef LBR_SBA - st_ivas->sba_mode = ivas_sba_mode_select( ivas_total_brate ); -#else st_ivas->sba_mode = ivas_sba_mode_select(); -#endif } ( *num_bits_read )++; break; diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 6fb6deab7183ebd15a532dadfcf955c14028304e..ec47273c64dab60414b5bbc9028af72b87581a10 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -108,30 +108,14 @@ ivas_error ivas_sba_dec_reconfigure( AUDIO_CONFIG intern_config_old; int16_t numCldfbAnalyses_old, numCldfbSyntheses_old; int16_t sba_dirac_stereo_flag_old; -#ifndef LBR_SBA_BR_SWITCHING - SBA_MODE sba_mode_old; - int32_t last_ivas_total_brate; -#endif int32_t ivas_total_brate; RENDERER_TYPE old_renderer_type; DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; -#ifndef LBR_SBA_BR_SWITCHING - int16_t band_grouping[IVAS_MAX_NUM_BANDS + 1]; -#endif error = IVAS_ERR_OK; hDecoderConfig = st_ivas->hDecoderConfig; ivas_total_brate = hDecoderConfig->ivas_total_brate; -#ifndef LBR_SBA_BR_SWITCHING - last_ivas_total_brate = st_ivas->last_active_ivas_total_brate; -#ifndef LBR_SBA - sba_mode_old = ivas_sba_mode_select( last_ivas_total_brate ); -#else - sba_mode_old = ivas_sba_mode_select(); -#endif - st_ivas->sba_mode = sba_mode_old; -#endif /*-----------------------------------------------------------------* * Set SBA high-level parameters * Save old SBA high-level parameters @@ -145,71 +129,46 @@ ivas_error ivas_sba_dec_reconfigure( sba_dirac_stereo_flag_old = st_ivas->sba_dirac_stereo_flag; st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->sba_order ); -#ifndef LBR_SBA_BR_SWITCHING -#ifndef LBR_SBA - st_ivas->sba_mode = ivas_sba_mode_select( ivas_total_brate ); -#else - st_ivas->sba_mode = ivas_sba_mode_select(); -#endif -#endif /*-----------------------------------------------------------------* * Allocate, initialize, and configure SBA handles *-----------------------------------------------------------------*/ -#ifndef LBR_SBA_BR_SWITCHING - if ( st_ivas->sba_mode != SBA_MODE_SPAR ) - { - ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 0 ); + int16_t sba_order_internal; + SPAR_DEC_HANDLE hSpar; + hSpar = st_ivas->hSpar; - if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, -1 ) ) != IVAS_ERR_OK ) - { - return error; - } + sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); - st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); - } - else + if ( hSpar != NULL ) { -#endif - int16_t sba_order_internal; - SPAR_DEC_HANDLE hSpar; - hSpar = st_ivas->hSpar; - - sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); - - if ( hSpar != NULL ) + if ( ( hSpar->hPCA != NULL ) && ( ( hDecoderConfig->ivas_total_brate != PCA_BRATE ) || ( sba_order_internal != 1 ) ) ) { - if ( ( hSpar->hPCA != NULL ) && ( ( hDecoderConfig->ivas_total_brate != PCA_BRATE ) || ( sba_order_internal != 1 ) ) ) - { - free( st_ivas->hSpar->hPCA ); - hSpar->hPCA = NULL; - } + free( st_ivas->hSpar->hPCA ); + hSpar->hPCA = NULL; + } - if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) ) - { + if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) ) + { - ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 1 ); + ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 1 ); - if ( ( error = ivas_spar_dec_open( st_ivas, 1 ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - ivas_spar_config( ivas_total_brate, sba_order_internal, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &hSpar->core_nominal_brate, st_ivas->sid_format ); - } - else - { - if ( ( error = ivas_spar_dec_open( st_ivas, 0 ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_spar_dec_open( st_ivas, 1 ) ) != IVAS_ERR_OK ) { return error; } } - hSpar = st_ivas->hSpar; - st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); -#ifndef LBR_SBA_BR_SWITCHING + ivas_spar_config( ivas_total_brate, sba_order_internal, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &hSpar->core_nominal_brate, st_ivas->sid_format ); } -#endif + else + { + if ( ( error = ivas_spar_dec_open( st_ivas, 0 ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + hSpar = st_ivas->hSpar; + st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); if ( st_ivas->nchan_transport == 1 ) { st_ivas->element_mode_init = IVAS_SCE; @@ -273,11 +232,7 @@ ivas_error ivas_sba_dec_reconfigure( { ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); } -#ifndef LBR_SBA_BR_SWITCHING - if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( sba_mode_old != st_ivas->sba_mode ) || ( ( st_ivas->sba_mode == SBA_MODE_SPAR ) && ( ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) ) ) ) -#else if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) ) ) -#endif { DIRAC_CONFIG_FLAG flag_config; @@ -285,12 +240,6 @@ ivas_error ivas_sba_dec_reconfigure( if ( st_ivas->hDirAC != NULL ) { flag_config = DIRAC_RECONFIGURE_MODE; -#ifndef LBR_SBA_BR_SWITCHING - if ( ( sba_mode_old == st_ivas->sba_mode ) && ( st_ivas->sba_mode != SBA_MODE_SPAR ) ) - { - flag_config = DIRAC_RECONFIGURE; - } -#endif } if ( ( error = ivas_dirac_dec_config( st_ivas, flag_config ) ) != IVAS_ERR_OK ) @@ -298,43 +247,17 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } -#ifndef LBR_SBA_BR_SWITCHING - if ( st_ivas->sba_mode == SBA_MODE_SPAR ) - { -#endif - if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifndef LBR_SBA_BR_SWITCHING - } -#endif -#ifndef LBR_SBA_BR_SWITCHING - if ( ( ( hDecoderConfig->output_config == AUDIO_CONFIG_FOA ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) ) && ( ( sba_mode_old != st_ivas->sba_mode ) && ( st_ivas->sba_mode == SBA_MODE_SPAR ) ) ) + if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) != IVAS_ERR_OK ) { - ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); - - st_ivas->hSpar->enc_param_start_band = min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND ); - - ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), - st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); + return error; } -#endif -#ifndef LBR_SBA_BR_SWITCHING - else if ( st_ivas->renderer_type == RENDERER_DISABLE || ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC && st_ivas->sba_mode != SBA_MODE_SPAR ) ) -#else if ( st_ivas->renderer_type == RENDERER_DISABLE ) -#endif { ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); vbap_free_data( &( st_ivas->hVBAPdata ) ); } -#ifndef LBR_SBA_BR_SWITCHING - if ( st_ivas->hDirAC != NULL && st_ivas->sba_mode == SBA_MODE_SPAR ) -#else if ( st_ivas->hDirAC != NULL ) -#endif { mvs2s( st_ivas->hDirAC->dirac_to_spar_md_bands, st_ivas->hSpar->dirac_to_spar_md_bands, DIRAC_MAX_NBANDS ); st_ivas->hSpar->enc_param_start_band = st_ivas->hDirAC->hConfig->enc_param_start_band; diff --git a/lib_dec/ivas_sns_dec.c b/lib_dec/ivas_sns_dec.c index 6cf80ec0d1f0efdfae5d2f98f7ca770746d31a56..5e3c38843742139fe76bf21d5344643ce3d54b0c 100644 --- a/lib_dec/ivas_sns_dec.c +++ b/lib_dec/ivas_sns_dec.c @@ -283,21 +283,13 @@ void dequantize_sns( nStages = SNS_MSVQ_NSTAGES_SIDE; means = ( st->core == TCX_20_CORE ) ? ivas_sns_means_side_tcx20 : ivas_sns_means_side_tcx10; -#ifdef ERI_FDCNGVQ_LOW_ROM msvq_dec( side_cdbks, NULL, NULL, nStages, M, M, &indices[ch][idxIndices + SNS_STEREO_MODE_OFFSET_INDICES], 0, NULL, snsQ, NULL ); -#else - msvq_dec( side_cdbks, NULL, NULL, nStages, M, M, &indices[ch][idxIndices + SNS_STEREO_MODE_OFFSET_INDICES], snsQ, NULL ); -#endif v_add( snsQ, means, snsQ, M ); } else { -#ifdef ERI_FDCNGVQ_LOW_ROM msvq_dec( cdbks, NULL, NULL, nStages, M, M, &indices[ch][idxIndices + SNS_STEREO_MODE_OFFSET_INDICES], 0, NULL, snsQ, NULL ); -#else - msvq_dec( cdbks, NULL, NULL, nStages, M, M, &indices[ch][idxIndices + SNS_STEREO_MODE_OFFSET_INDICES], snsQ, NULL ); -#endif } idxIndices += nStages; } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index c5d25392ac2269cdf50d9f494163fa3fd57a2d7d..f0588ae30311554f1ff41efb8ceebba678bb02b1 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -41,9 +41,7 @@ #include "ivas_prot.h" #include "ivas_prot_rend.h" #include "ivas_rom_com.h" -#ifdef LBR_ADAP_SMOOTHING #include "ivas_rom_dec.h" -#endif #include "ivas_stat_com.h" #include #include @@ -895,7 +893,6 @@ static void ivas_spar_get_skip_mat( } -#ifdef LBR_ADAP_SMOOTHING static void ivas_spar_calc_smooth_facs( float *cldfb_in_ts_re[CLDFB_NO_COL_MAX], float *cldfb_in_ts_im[CLDFB_NO_COL_MAX], @@ -973,7 +970,6 @@ static void ivas_spar_calc_smooth_facs( return; } -#endif /*-------------------------------------------------------------------* @@ -1178,7 +1174,6 @@ void ivas_spar_dec_upmixer( } } -#ifdef LBR_ADAP_SMOOTHING if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA3 ) ) ) { for ( in_ch = 0; in_ch < numch_in; in_ch++ ) @@ -1186,14 +1181,12 @@ void ivas_spar_dec_upmixer( ivas_spar_calc_smooth_facs( cldfb_in_ts_re[in_ch], cldfb_in_ts_im[in_ch], num_spar_bands, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac[in_ch], hSpar->hMdDec->smooth_buf[in_ch] ); } } -#endif for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) { /* determine SPAR parameters for this time slots */ ivas_spar_get_parameters( hSpar, hDecoderConfig, ts + i_sf * MAX_PARAM_SPATIAL_SUBFRAMES, numch_out, numch_in, num_spar_bands, mixer_mat ); -#ifdef LBR_ADAP_SMOOTHING if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA3 ) ) ) { for ( spar_band = 0; spar_band < num_spar_bands; spar_band++ ) @@ -1208,7 +1201,6 @@ void ivas_spar_dec_upmixer( } } } -#endif for ( cldfb_band = 0; cldfb_band < num_cldfb_bands; cldfb_band++ ) { diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 5e50f42b768c3107cd10860d5b60f7a3bb9f36ec..1552734434d0da8cd218315ed3c92fb59ddd855e 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -63,27 +63,11 @@ static const int16_t ivas_spar_dec_plc_spatial_target[IVAS_SPAR_MAX_CH] = { 1, 0 * Static functions declaration *------------------------------------------------------------------------------------------*/ -static void ivas_get_spar_matrices( ivas_spar_md_dec_state_t *hMdDec, const int16_t num_bands_out, const int16_t n_ts, const int16_t bw, const int16_t dtx_vad, const int16_t nB, const int16_t sba_order -#ifdef LBR_SBA - , - const int16_t active_w_vlbr -#endif -); +static void ivas_get_spar_matrices( ivas_spar_md_dec_state_t *hMdDec, const int16_t num_bands_out, const int16_t n_ts, const int16_t bw, const int16_t dtx_vad, const int16_t nB, const int16_t sba_order, const int16_t active_w_vlbr ); -static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, const int16_t planarCP -#ifdef LBR_SBA - , - const int16_t strat, - const int32_t ivas_total_brate -#endif -); +static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, const int16_t planarCP, const int16_t strat, const int32_t ivas_total_brate ); -static void ivas_decode_huffman_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, const int16_t planarCP -#ifdef LBR_SBA_PLANAR - , - const int32_t ivas_total_brate -#endif -); +static void ivas_decode_huffman_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, const int16_t planarCP ); static void ivas_fill_band_coeffs_idx( ivas_band_coeffs_ind_t *pBands_idx, const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, ivas_coeffs_type_t coeff_type, const int16_t planarCP ); @@ -552,7 +536,6 @@ ivas_error ivas_spar_md_dec_init( set_f( hMdDec->spar_md.en_ratio_slow, 0.0f, IVAS_MAX_NUM_BANDS ); set_f( hMdDec->spar_md.ref_pow_slow, 0.0f, IVAS_MAX_NUM_BANDS ); -#ifdef LBR_ADAP_SMOOTHING for ( i = 0; i < IVAS_SPAR_MAX_CH; i++ ) { set_zero( hMdDec->smooth_fac[i], IVAS_MAX_NUM_BANDS ); @@ -571,7 +554,6 @@ ivas_error ivas_spar_md_dec_init( set_zero( hMdDec->mixer_mat_prev2[i][j], IVAS_MAX_NUM_BANDS ); } } -#endif return IVAS_ERR_OK; } @@ -657,10 +639,8 @@ void ivas_spar_md_dec_process( ivas_spar_md_dec_state_t *hMdDec; hMdDec = st_ivas->hSpar->hMdDec; -#ifdef LBR_SBA int16_t active_w_vlbr; active_w_vlbr = ( st_ivas->hDecoderConfig->ivas_total_brate < IVAS_24k4 ) ? 1 : 0; -#endif ivas_spar_dec_parse_md_bs( hMdDec, st0, &nB, &bw, &dtx_vad, st_ivas->hDecoderConfig->ivas_total_brate, ivas_spar_br_table_consts[hMdDec->table_idx].usePlanarCoeff, st_ivas->hQMetaData->sba_inactive_mode ); @@ -802,12 +782,8 @@ void ivas_spar_md_dec_process( }*/ #endif /* SPAR to DirAC conversion */ - ivas_spar_to_dirac( st_ivas, hMdDec, dtx_vad, num_bands_out -#ifdef LBR_SBA - , - bw -#endif - ); + ivas_spar_to_dirac( st_ivas, hMdDec, dtx_vad, num_bands_out, + bw ); /* set correct number of bands*/ nB = IVAS_MAX_NUM_BANDS; @@ -963,12 +939,8 @@ void ivas_spar_md_dec_process( } } - ivas_get_spar_matrices( hMdDec, num_bands_out, MAX_PARAM_SPATIAL_SUBFRAMES, bw, dtx_vad, nB, sba_order -#ifdef LBR_SBA - , - active_w_vlbr -#endif - ); + ivas_get_spar_matrices( hMdDec, num_bands_out, MAX_PARAM_SPATIAL_SUBFRAMES, bw, dtx_vad, nB, sba_order, + active_w_vlbr ); #ifdef DEBUG_SPAR_DIRAC_WRITE_OUT_PRED_PARS { @@ -981,12 +953,10 @@ void ivas_spar_md_dec_process( fprintf( fid, "%.6f\n", hMdDec->mixer_mat[1][0][band] ); } #endif -#ifdef LBR_SBA if ( bw == IVAS_RED_BAND_FACT ) { nB = nB << 1; } -#endif for ( b = nB; b < num_bands_out; b++ ) { hMdDec->valid_bands[b] = 1; @@ -1218,12 +1188,8 @@ static void ivas_get_spar_matrices( const int16_t bw, const int16_t dtx_vad, const int16_t nB, - const int16_t sba_order -#ifdef LBR_SBA - , - const int16_t active_w_vlbr -#endif -) + const int16_t sba_order, + const int16_t active_w_vlbr ) { int16_t numch_out, num_bands, dmx_ch, split_band; int16_t i, j, k, m, b, i_ts, active_w; @@ -1265,18 +1231,12 @@ static void ivas_get_spar_matrices( } }*/ #endif -#ifdef LBR_SBA if ( bw == IVAS_RED_BAND_FACT ) { num_bands = num_bands >> 1; } -#endif active_w = hMdDec->spar_md_cfg.active_w; -#ifdef LBR_SBA active_w_dm_fac = ( dtx_vad == 0 ) ? IVAS_ACTIVEW_DM_F_SCALE_DTX : ( ( active_w_vlbr ) ? IVAS_ACTIVEW_DM_F_SCALE_VLBR : IVAS_ACTIVEW_DM_F_SCALE ); -#else - active_w_dm_fac = ( dtx_vad == 0 ) ? IVAS_ACTIVEW_DM_F_SCALE_DTX : IVAS_ACTIVEW_DM_F_SCALE; -#endif for ( i_ts = 0; i_ts < n_ts; i_ts++ ) { for ( i = 0; i < numch_out; i++ ) @@ -1287,12 +1247,6 @@ static void ivas_get_spar_matrices( set_zero( &hMdDec->spar_coeffs.P_re[i][j][i_ts * IVAS_MAX_NUM_BANDS], IVAS_MAX_NUM_BANDS ); } } -#ifndef LBR_SBA - if ( bw == IVAS_RED_BAND_FACT ) - { - num_bands = num_bands >> 1; - } -#endif num_bands = min( num_bands, nB ); for ( b = 0; b < num_bands; b++ ) @@ -1718,9 +1672,7 @@ static void ivas_spar_dec_parse_md_bs( int16_t do_diff[IVAS_MAX_NUM_BANDS]; int16_t planarCP; float quant[IVAS_SPAR_MAX_C_COEFF]; -#ifdef LBR_SBA int16_t do_repeat[IVAS_MAX_NUM_BANDS]; -#endif *dtx_vad = 1; *bands_bw = 1; @@ -1843,9 +1795,7 @@ static void ivas_spar_dec_parse_md_bs( for ( i = 0; i < *nB; i++ ) { do_diff[i] = 0; -#ifdef LBR_SBA do_repeat[i] = 0; -#endif } } else if ( strat < 4 ) @@ -1855,15 +1805,11 @@ static void ivas_spar_dec_parse_md_bs( for ( i = 0; i < *nB; i++ ) { do_diff[i] = 0; -#ifdef LBR_SBA do_repeat[i] = 0; -#endif } no_ec = 1; } - else -#ifdef LBR_SBA - if ( ivas_total_brate < IVAS_24k4 ) + else if ( ivas_total_brate < IVAS_24k4 ) { *bands_bw = 2; *nB = num_bands / *bands_bw; @@ -1887,19 +1833,6 @@ static void ivas_spar_dec_parse_md_bs( ivas_map_prior_coeffs_quant( &hMdDec->spar_md_prev, &hMdDec->spar_md_cfg, qsi, *nB ); } -#else - { - *bands_bw = 1; - *nB = num_bands; - - for ( i = 0; i < *nB; i++ ) - { - do_diff[i] = ( ( ( i + 1 ) & 3 ) != strat - 4 ); - } - - ivas_map_prior_coeffs_quant( &hMdDec->spar_md_prev, &hMdDec->spar_md_cfg, qsi, *nB ); - } -#endif #ifdef SPAR_HOA_DBG fprintf( stdout, "\n\n no_ec = %d, strat = %d\n", no_ec, strat ); #endif @@ -1907,21 +1840,12 @@ static void ivas_spar_dec_parse_md_bs( if ( no_ec == 0 ) { - ivas_decode_arith_bs( hMdDec, st0, qsi, *nB, *bands_bw, do_diff, freq_diff, planarCP -#ifdef LBR_SBA - , - strat, ivas_total_brate -#endif - ); + ivas_decode_arith_bs( hMdDec, st0, qsi, *nB, *bands_bw, do_diff, freq_diff, planarCP, + strat, ivas_total_brate ); } else { - ivas_decode_huffman_bs( hMdDec, st0, qsi, *nB, *bands_bw, planarCP -#ifdef LBR_SBA_PLANAR - , - ivas_total_brate -#endif - ); + ivas_decode_huffman_bs( hMdDec, st0, qsi, *nB, *bands_bw, planarCP ); } for ( i = 0; i < *nB; i++ ) @@ -1968,15 +1892,11 @@ static void ivas_spar_dec_parse_md_bs( { hMdDec->spar_md_prev.band_coeffs_idx[i].decd_index_re[j] = hMdDec->spar_md.band_coeffs_idx[i].decd_index_re[j]; } -#ifdef LBR_SBA hMdDec->valid_bands[*bands_bw * i] |= ( do_diff[i] == 0 && do_repeat[i] == 0 ) ? 1 : 0; for ( j = 1; j < *bands_bw; j++ ) { hMdDec->valid_bands[*bands_bw * i + j] = hMdDec->valid_bands[*bands_bw * i]; } -#else - hMdDec->valid_bands[i] |= ( do_diff[i] == 0 ) ? 1 : 0; -#endif } #ifdef SPAR_HOA_DBG int16_t b; @@ -2068,13 +1988,9 @@ static void ivas_decode_arith_bs( const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, - const int16_t planarCP -#ifdef LBR_SBA - , + const int16_t planarCP, const int16_t strat, - const int32_t ivas_total_brate -#endif -) + const int32_t ivas_total_brate ) { int16_t i, j, ndm, ndec; ivas_cell_dim_t pred_cell_dims[IVAS_MAX_NUM_BANDS]; @@ -2089,7 +2005,6 @@ static void ivas_decode_arith_bs( { ndm = hMdDec->spar_md_cfg.num_dmx_chans_per_band[bands_bw * i]; ndec = hMdDec->spar_md_cfg.num_decorr_per_band[bands_bw * i]; -#ifdef LBR_SBA if ( ( ivas_total_brate < IVAS_24k4 ) && ( strat > 3 ) && ( ( ( i % 2 == 1 ) && ( strat % 2 == 0 ) ) || ( ( i % 2 == 0 ) && ( strat % 2 == 1 ) ) ) ) { pred_cell_dims[i].dim1 = 0; @@ -2103,7 +2018,6 @@ static void ivas_decode_arith_bs( } else { -#endif pred_cell_dims[i].dim1 = ndm + ndec - 1; if ( hMdDec->spar_hoa_md_flag ) { @@ -2119,16 +2033,7 @@ static void ivas_decode_arith_bs( decd_cell_dims[i].dim2 = 1; decx_cell_dims[i].dim1 = ( ndec * ( ndec - 1 ) ) >> 1; decx_cell_dims[i].dim2 = 1; -#ifdef LBR_SBA_PLANAR - if ( ivas_total_brate < IVAS_24k4 ) - { - pred_cell_dims[i].dim1 -= 1; - decd_cell_dims[i].dim1 -= 1; - } -#endif -#ifdef LBR_SBA } -#endif } any_diff = 0; @@ -2237,20 +2142,6 @@ static void ivas_decode_arith_bs( ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->P_r.q_levels, 1, nB, DECD_COEFF ); ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->P_c.q_levels, 0, nB, DECX_COEFF ); } -#ifdef LBR_SBA_PLANAR - if ( ivas_total_brate < IVAS_24k4 ) - { - for ( i = 0; i < nB; i++ ) /* restore X PR index, force Z PR, P indices to be zero.*/ - { - if ( ( strat < 3 ) || ( ( strat > 3 ) && ( ( ( i % 2 == 0 ) && ( strat % 2 == 0 ) ) || ( ( i % 2 == 1 ) && ( strat % 2 == 1 ) ) ) ) ) - { - hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[2] = hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[1]; - hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[1] = 0; - } - hMdDec->spar_md.band_coeffs_idx[i].decd_index_re[2] = 0; /* shouldn't be needed */ - } - } -#endif return; } @@ -2429,12 +2320,7 @@ static void ivas_decode_huffman_bs( const uint16_t qsi, const int16_t nB, const int16_t bands_bw, - const int16_t planarCP -#ifdef LBR_SBA_PLANAR - , - const int32_t ivas_total_brate -#endif -) + const int16_t planarCP ) { int16_t i, j; int16_t ndm, ndec; @@ -2459,19 +2345,8 @@ static void ivas_decode_huffman_bs( for ( j = pred_offset; j < pred_dim; j++ ) { -#ifdef LBR_SBA_PLANAR - if ( ( j == 1 ) && ( ivas_total_brate < IVAS_24k4 ) ) - { - hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[j] = 0; - } - else - { -#endif - ivas_huffman_decode( &hMdDec->huff_coeffs.pred_huff_re[qsi], st0, - &hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[j] ); -#ifdef LBR_SBA_PLANAR - } -#endif + ivas_huffman_decode( &hMdDec->huff_coeffs.pred_huff_re[qsi], st0, + &hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[j] ); } if ( hMdDec->spar_hoa_md_flag ) @@ -2487,11 +2362,7 @@ static void ivas_decode_huffman_bs( for ( j = 0; j < drct_dim; j++ ) { -#ifdef LBR_SBA_PLANAR - if ( ( planarCP && !keep_planar[(int16_t) floor( j / ( ndm - 1 ) )] ) || ( ( j == 2 ) && ( ivas_total_brate < IVAS_24k4 ) ) ) -#else if ( planarCP && !keep_planar[(int16_t) floor( j / ( ndm - 1 ) )] ) -#endif { hMdDec->spar_md.band_coeffs_idx[i].drct_index_re[j] = 0; } @@ -2927,10 +2798,8 @@ void ivas_spar_to_dirac( ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ const int16_t dtx_vad, /* i : DTX frame flag */ const int16_t num_bands_out /* i : number of output bands */ -#ifdef LBR_SBA , const int16_t bw /* i : band joining factor */ -#endif ) { DIRAC_DEC_HANDLE hDirAC; @@ -2959,7 +2828,6 @@ void ivas_spar_to_dirac( sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); start_band = 0; -#ifdef LBR_SBA end_band = min( num_bands_out, SPAR_DIRAC_SPLIT_START_BAND ) / bw; hDirAC = st_ivas->hDirAC; @@ -2967,13 +2835,6 @@ void ivas_spar_to_dirac( enc_param_start_band = st_ivas->hSpar->enc_param_start_band / bw; int16_t active_w_vlbr; active_w_vlbr = ( st_ivas->hDecoderConfig->ivas_total_brate < IVAS_24k4 ) ? 1 : 0; -#else - end_band = min( num_bands_out, SPAR_DIRAC_SPLIT_START_BAND ); - - hDirAC = st_ivas->hDirAC; - dirac_to_spar_md_bands = st_ivas->hSpar->dirac_to_spar_md_bands; - enc_param_start_band = st_ivas->hSpar->enc_param_start_band; -#endif if ( hDirAC != NULL ) { band_grouping = hDirAC->band_grouping; @@ -3021,11 +2882,7 @@ void ivas_spar_to_dirac( } else { -#ifdef LBR_SBA f_scale = ( active_w_vlbr ) ? IVAS_ACTIVEW_DM_F_SCALE_VLBR : IVAS_ACTIVEW_DM_F_SCALE; -#else - f_scale = IVAS_ACTIVEW_DM_F_SCALE; -#endif } } else @@ -3133,17 +2990,12 @@ void ivas_spar_to_dirac( } /*read DirAC metadata, convert DirAC to SPAR*/ -#ifdef LBR_SBA for ( ; band < num_bands_out / bw; band++ ) -#else - for ( ; band < num_bands_out; band++ ) -#endif { int16_t dirac_band_idx; dirac_band_idx = dirac_to_spar_md_bands[band] - enc_param_start_band; -#ifdef LBR_SBA int16_t num_subframes; num_subframes = MAX_PARAM_SPATIAL_SUBFRAMES; if ( st_ivas->hQMetaData->useLowerRes ) @@ -3152,9 +3004,6 @@ void ivas_spar_to_dirac( } for ( block = 0; block < num_subframes; block++ ) -#else - for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) -#endif { if ( st_ivas->hQMetaData->q_direction->band_data[dirac_band_idx].azimuth[block] < 0.f ) { @@ -3170,12 +3019,8 @@ void ivas_spar_to_dirac( /* DirAC MD averaged over 4 subframes and converted to SPAR format similar to encoder processing */ if ( hMdDec->spar_md_cfg.nchan_transport > 1 ) { - ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, 1, NULL, &hMdDec->spar_md, &hMdDec->spar_md_cfg, end_band, num_bands_out, ( hMdDec->spar_hoa_md_flag ) ? 1 : sba_order_internal, dtx_vad, NULL -#ifdef LBR_SBA - , - st_ivas->hQMetaData->useLowerRes, active_w_vlbr -#endif - ); + ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, 1, NULL, &hMdDec->spar_md, &hMdDec->spar_md_cfg, end_band, num_bands_out, ( hMdDec->spar_hoa_md_flag ) ? 1 : sba_order_internal, dtx_vad, NULL, + st_ivas->hQMetaData->useLowerRes, active_w_vlbr ); /* temporarily copy frame-wise prediction coefficients in DirAC bands*/ for ( pred_idx = 0; pred_idx < FOA_CHANNELS - 1; pred_idx++ ) @@ -3186,7 +3031,6 @@ void ivas_spar_to_dirac( } } } -#ifdef LBR_SBA int16_t num_subframes; num_subframes = MAX_PARAM_SPATIAL_SUBFRAMES; if ( st_ivas->hQMetaData->useLowerRes ) @@ -3213,9 +3057,6 @@ void ivas_spar_to_dirac( } } } -#else - ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, MAX_PARAM_SPATIAL_SUBFRAMES, NULL, &hMdDec->spar_md, &hMdDec->spar_md_cfg, end_band, num_bands_out, ( hMdDec->spar_hoa_md_flag ) ? 1 : sba_order_internal, dtx_vad, NULL ); -#endif /* expand DirAC TC 20ms MD for residual channels to all subframes*/ for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { @@ -3232,11 +3073,7 @@ void ivas_spar_to_dirac( } } -#ifdef LBR_SBA for ( b = end_band * bw; b < num_bands_out; b++ ) -#else - for ( b = end_band; b < num_bands_out; b++ ) -#endif { hMdDec->valid_bands[b] = 1; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 1756161bacfa3b93c73f94dd45d335bd0e17b527..ad453cd5bdf92aed36d256cbe7482f39cf1a0d27 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -806,11 +806,9 @@ typedef struct ivas_spar_md_dec_state_t int16_t table_idx; int16_t dtx_vad; int16_t spar_hoa_md_flag; -#ifdef LBR_ADAP_SMOOTHING float smooth_buf[IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1]; float smooth_fac[IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; float mixer_mat_prev2[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; -#endif } ivas_spar_md_dec_state_t; diff --git a/lib_dec/lsf_dec.c b/lib_dec/lsf_dec.c index 6aa31243afba5544f4bb95eb4680109814eb57b9..73f8933daff76c16e4c0117877280bd95a8be8d7 100644 --- a/lib_dec/lsf_dec.c +++ b/lib_dec/lsf_dec.c @@ -43,10 +43,8 @@ #include "rom_com.h" #include "prot.h" #include "basop_proto_func.h" -#ifdef LSF_RE_USE_SECONDARY_CHANNEL #include "ivas_prot.h" #include "ivas_rom_com.h" -#endif #include "wmc_auto.h" @@ -74,10 +72,8 @@ void lsf_dec( float *lsp_new, /* o : de-quantized LSP vector */ float *lsp_mid, /* o : de-quantized mid-frame LSP vector */ const int16_t tdm_low_rate_mode /* i : secondary channel low rate mode flag */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL , const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ -#endif ) { int16_t i, nBits, coder_type, no_param_lpc; @@ -132,12 +128,8 @@ void lsf_dec( } /* LSF de-quantization */ - lsf_end_dec( st, coder_type, st->bwidth, nBits, lsf_new, param_lpc, LSF_Q_prediction, &no_param_lpc -#ifdef LSF_RE_USE_SECONDARY_CHANNEL - , - tdm_lsfQ_PCh -#endif - ); + lsf_end_dec( st, coder_type, st->bwidth, nBits, lsf_new, param_lpc, LSF_Q_prediction, &no_param_lpc, + tdm_lsfQ_PCh ); /* convert quantized LSFs to LSPs */ lsf2lsp( lsf_new, lsp_new, M, st->sr_core ); @@ -267,10 +259,8 @@ void lsf_end_dec( int16_t *lpc_param, /* i : LPC parameters */ int16_t *LSF_Q_prediction, /* o : LSF prediction mode */ int16_t *nb_indices /* o : number of indices */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL , const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ -#endif ) { float pred0[M]; /* Prediction for the safety-net quantizer (usually mean)*/ @@ -292,18 +282,13 @@ void lsf_end_dec( int16_t nBits; int16_t coder_type; int16_t flag_1bit_gran; -#ifdef LSF_RE_USE_SECONDARY_CHANNEL float pred3[M]; -#endif flag_1bit_gran = ( st->element_mode > EVS_MONO ); nBits = nBits_in; *nb_indices = 0; - if ( coder_type_org == GENERIC && st->sr_core == INT_FS_16k && st->codec_mode == MODE1 -#ifdef LSF_RE_USE_SECONDARY_CHANNEL - && ( st->idchan == 0 ) /* this bit is used only for primary channel or mono */ -#endif + if ( coder_type_org == GENERIC && st->sr_core == INT_FS_16k && st->codec_mode == MODE1 && ( st->idchan == 0 ) /* this bit is used only for primary channel or mono */ ) { coder_type = get_next_indice( st, 1 ); @@ -346,13 +331,11 @@ void lsf_end_dec( p_lpc_param = lpc_param; -#ifdef LSF_RE_USE_SECONDARY_CHANNEL if ( st->tdm_LRTD_flag == 0 && st->idchan == 1 && tdm_lsfQ_PCh != NULL ) { /* if secondary channel predmode is set to be > 2 */ predmode += 3; } -#endif if ( predmode == 0 ) { @@ -380,7 +363,6 @@ void lsf_end_dec( st->safety_net = safety_net; -#ifdef LSF_RE_USE_SECONDARY_CHANNEL /* Make sure there are the correct bit allocations */ if ( st->idchan == 1 && predmode > 2 ) { @@ -390,7 +372,6 @@ void lsf_end_dec( mvs2s( levels1, levels0, stages0 ); mvs2s( bits1, bits0, stages0 ); } -#endif /*--------------------------------------------------------------------------* * Read indices from array @@ -535,18 +516,15 @@ void lsf_end_dec( pred1[i] = pred0[i] + MU_MA * st->mem_MA[i]; } -#ifdef LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo SCh: perform intra-frame prediction with pulling-to-mean */ if ( st->tdm_LRTD_flag == 0 && st->idchan == 1 && tdm_lsfQ_PCh != NULL ) { tdm_SCh_LSF_intra_pred( st->element_brate, tdm_lsfQ_PCh, pred3 ); } -#endif if ( safety_net ) { /* LVQ */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL if ( st->tdm_LRTD_flag == 0 && st->idchan == 1 && tdm_lsfQ_PCh != NULL ) { @@ -559,33 +537,24 @@ void lsf_end_dec( } else { -#endif st->BER_detect = st->BER_detect | vq_dec_lvq( 1, qlsf, &lindice[1], stages0, M, mode_lvq, levels0[stages0 - 1] ); v_add( qlsf, pred0, qlsf, M ); v_sub( qlsf, pred1, st->mem_MA, M ); -#ifdef LSF_RE_USE_SECONDARY_CHANNEL } -#endif } else { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL if ( predmode == 4 ) { mode_lvq_p = 9; predmode = 2; } -#endif st->BER_detect = st->BER_detect | vq_dec_lvq( 0, qlsf, &lindice[1], stages1, M, mode_lvq_p, levels1[stages1 - 1] ); -#ifdef LSF_RE_USE_SECONDARY_CHANNEL if ( predmode == 1 || ( predmode == 4 ) ) /* MA only */ -#else - if ( predmode == 1 ) /* MA only */ -#endif { mvr2r( qlsf, st->mem_MA, M ); v_add( qlsf, pred1, qlsf, M ); diff --git a/lib_dec/lsf_msvq_ma_dec.c b/lib_dec/lsf_msvq_ma_dec.c index ede93bb1623ccdb68fb963356947701764e81522..9c911ab5f6f82be803ce483aced3d5e9948bbfe0 100644 --- a/lib_dec/lsf_msvq_ma_dec.c +++ b/lib_dec/lsf_msvq_ma_dec.c @@ -187,11 +187,7 @@ int16_t D_lsf_tcxlpc( NumIndices = 1; -#ifdef ERI_FDCNGVQ_LOW_ROM msvq_dec( lsf_codebook[narrowband][cdk], lsf_dims, lsf_offs, TCXLPC_NUMSTAGES, M, M, indices + NumIndices, 0, NULL, lsf_q, lsf_q_ind ); -#else - msvq_dec( lsf_codebook[narrowband][cdk], lsf_dims, lsf_offs, TCXLPC_NUMSTAGES, M, M, indices + NumIndices, lsf_q, lsf_q_ind ); -#endif NumIndices += TCXLPC_NUMSTAGES; @@ -200,11 +196,7 @@ int16_t D_lsf_tcxlpc( /* Only add contribution if flag is enabled */ -#ifdef ERI_FDCNGVQ_LOW_ROM msvq_dec( lsf_ind_codebook[narrowband][cdk], lsf_ind_dims, lsf_ind_offs, TCXLPC_IND_NUMSTAGES, M, M, indices + NumIndices, 0, NULL, lsf_rem_q, lsf_rem_q_ind ); -#else - msvq_dec( lsf_ind_codebook[narrowband][cdk], lsf_ind_dims, lsf_ind_offs, TCXLPC_IND_NUMSTAGES, M, M, indices + NumIndices, lsf_rem_q, lsf_rem_q_ind ); -#endif NumIndices += TCXLPC_IND_NUMSTAGES; /* Add to MA-removed vector */ @@ -273,11 +265,7 @@ int16_t dec_lsf_tcxlpc( } /* Decode independent lsf */ -#ifdef ERI_FDCNGVQ_LOW_ROM msvq_dec( lsf_codebook[narrowband][cdk], lsf_dims, lsf_offs, TCXLPC_NUMSTAGES, M, M, flag + 1, 0, NULL, lsf_q_ignored, lsf_q_ind ); -#else - msvq_dec( lsf_codebook[narrowband][cdk], lsf_dims, lsf_offs, TCXLPC_NUMSTAGES, M, M, flag + 1, lsf_q_ignored, lsf_q_ind ); -#endif /* Update flag */ *flag = lsf_ind_is_active( lsf_q_ind, lsf_means[narrowband], narrowband, cdk ); diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 0310a713e318b0d4bfb0d53730304b524aee256c..d78f9bf25888ea73be399e04a4d086a681708366 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -47,9 +47,7 @@ #include "prot.h" #include "ivas_cnst.h" #include "ivas_prot.h" -#ifdef LSF_RE_USE_SECONDARY_CHANNEL #include "ivas_rom_com.h" -#endif #include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -75,10 +73,7 @@ ivas_error acelp_core_enc( float pitch_buf[NB_SUBFR16k], /* o : floating pitch for each subframe */ int16_t *unbits, /* o : number of unused bits */ STEREO_TD_ENC_DATA_HANDLE hStereoTD, /* i/o: TD stereo encoder handle */ -#ifndef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE - const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ -#endif - const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ + const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ ) { int16_t i, nBits; /* reserved bits */ @@ -377,11 +372,7 @@ ivas_error acelp_core_enc( if ( !nelp_mode && !ppp_mode ) { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*-----------------------------------------------------------------* @@ -417,17 +408,12 @@ ivas_error acelp_core_enc( if ( !tdm_lp_reuse_flag ) { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL lsf_enc( st, lsf_new, lsp_new, lsp_mid, Aq, tdm_low_rate_mode, st->GSC_IVAS_mode, tdm_lsfQ_PCh ); -#else - lsf_enc( st, lsf_new, lsp_new, lsp_mid, Aq, tdm_low_rate_mode, st->GSC_IVAS_mode ); -#endif } else { const float *pt_interp_2; -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE if ( st->active_cnt != 1 ) { int16_t beta_index; @@ -442,13 +428,6 @@ ivas_error acelp_core_enc( push_indice( hBstr, IND_IC_LSF_PRED, beta_index, TDM_IC_LSF_PRED_BITS ); } -#else - if ( st->active_cnt != 1 ) - { - mvr2r( tdm_lspQ_PCh, lsp_new, M ); - mvr2r( tdm_lsfQ_PCh, lsf_new, M ); - } -#endif pt_interp_2 = interpol_frac_12k8; if ( tdm_low_rate_mode == 1 && st->coder_type > UNVOICED ) @@ -506,11 +485,7 @@ ivas_error acelp_core_enc( { tc_classif_enc( st->L_frame, &tc_subfr, &position, attack_flag, st->pitch[0], res ); -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*---------------------------------------------------------------* @@ -568,18 +543,10 @@ ivas_error acelp_core_enc( lsf_syn_mem_restore( st, tilt_code_bck, gc_threshold_bck, clip_var_bck, next_force_sf_bck, lsp_new, lsp_mid, clip_var, mem_AR, mem_MA, lsp_new_bck, lsp_mid_bck, Bin_E, Bin_E_old, mem_syn_bck, mem_w0_bck, streaklimit, pstreaklen ); /* Configure ACELP bit allocation */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif /* redo LSF quantization */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL lsf_enc( st, lsf_new, lsp_new, lsp_mid, Aq, tdm_low_rate_mode, 0, NULL ); -#else - lsf_enc( st, lsf_new, lsp_new, lsp_mid, Aq, tdm_low_rate_mode, 0 ); -#endif /* recalculation of LP residual (filtering through A[z] filter) */ calc_residu( inp, res, Aq, st->L_frame ); diff --git a/lib_enc/acelp_core_switch_enc.c b/lib_enc/acelp_core_switch_enc.c index 5813968434cb7d076648e2cead29e47f3deaa254..f573649d3ce1ef95580e7f1a0e438f49e093cd1e 100644 --- a/lib_enc/acelp_core_switch_enc.c +++ b/lib_enc/acelp_core_switch_enc.c @@ -151,11 +151,7 @@ void acelp_core_switch_enc( * Excitation encoding *----------------------------------------------------------------*/ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#endif encod_gen_voic_core_switch( st, st->last_L_frame, inp, Aq, A, T_op, st->voicing, exc, cbrate ); diff --git a/lib_enc/cng_enc.c b/lib_enc/cng_enc.c index 04d9e4116621c977f0ae6a60f4c4adc90d259576..14eef260b465b5b7354e7bb06820257f4c2cd160 100644 --- a/lib_enc/cng_enc.c +++ b/lib_enc/cng_enc.c @@ -263,11 +263,7 @@ void CNG_enc( } else { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL lsf_enc( st, lsf_new, lsp_new, 0, 0, 0, 0, NULL ); -#else - lsf_enc( st, lsf_new, lsp_new, 0, 0, 0, 0 ); -#endif } /* Reset CNG history if CNG frame length is changed */ diff --git a/lib_enc/evs_enc.c b/lib_enc/evs_enc.c index 2e2a379ec9fb521947d35a9136a8adfa266b552a..da0556dd7215497b3c2151a963a9b0569d306435 100644 --- a/lib_enc/evs_enc.c +++ b/lib_enc/evs_enc.c @@ -242,11 +242,7 @@ ivas_error evs_enc( if ( st->core == ACELP_CORE ) { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE if ( ( error = acelp_core_enc( st, inp, ener, A, Aw, epsP, lsp_new, lsp_mid, vad_hover_flag, attack_flag, bwe_exc_extended, voice_factors, old_syn_12k8_16k, pitch_buf, &unbits, NULL, NULL ) ) != IVAS_ERR_OK ) -#else - if ( ( error = acelp_core_enc( st, inp, ener, A, Aw, epsP, lsp_new, lsp_mid, vad_hover_flag, attack_flag, bwe_exc_extended, voice_factors, old_syn_12k8_16k, pitch_buf, &unbits, NULL, NULL, NULL ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_enc/fd_cng_enc.c b/lib_enc/fd_cng_enc.c index a76b741ca41726fa5e553dcdc92ad424749d2762..4d1cfb0a5cf083e32b582825641c9b2c6bf0c9e4 100644 --- a/lib_enc/fd_cng_enc.c +++ b/lib_enc/fd_cng_enc.c @@ -513,23 +513,17 @@ void FdCng_encodeSID( float w[32]; float preemph_fac = st->preemph_fac; -#ifdef ERI_FDCNGVQ_LOW_ROM float *invTrfMatrix; float tmpRAM[FDCNG_VQ_MAX_LEN][FDCNG_VQ_DCT_MAXTRUNC]; float dct_target[FDCNG_VQ_DCT_MAXTRUNC]; float tot_sig_ext[FDCNG_VQ_MAX_LEN]; -#else - const float *const *codebooks = ( st->element_mode == EVS_MONO ) ? cdk_37bits : cdk_37bits_ivas; -#endif const float gain_q_offset = ( st->element_mode == EVS_MONO ) ? GAIN_Q_OFFSET_EVS : GAIN_Q_OFFSET_IVAS; /* Init */ N = hFdCngEnc->npartDec; -#ifdef ERI_FDCNGVQ_LOW_ROM invTrfMatrix = (float *) tmpRAM; /* dynamically filled */ set_zero( v, FDCNG_VQ_MAX_LEN ); -#endif /* Convert to LOG */ e = 0.f; @@ -556,7 +550,6 @@ void FdCng_encodeSID( /* MSVQ encoder */ set_f( w, 1.0f, N ); -#ifdef ERI_FDCNGVQ_LOW_ROM if ( st->element_mode != EVS_MONO ) { /* DCT domain compressed/truncated indices used for first stage */ @@ -582,12 +575,6 @@ void FdCng_encodeSID( msvq_enc( cdk_37bits, NULL, NULL, v, levels_37bits, FD_CNG_maxC_37bits, FD_CNG_stages_37bits, w, N, FD_CNG_maxN_37bits, 0, NULL, indices ); msvq_dec( cdk_37bits, NULL, NULL, FD_CNG_stages_37bits, N, FD_CNG_maxN_37bits, indices, 0, NULL, v, NULL ); } -#else - msvq_enc( codebooks, NULL, NULL, v, levels_37bits, FD_CNG_maxC_37bits, FD_CNG_stages_37bits, w, N, FD_CNG_maxN_37bits, indices ); - - /* MSVQ decoder */ - msvq_dec( codebooks, NULL, NULL, FD_CNG_stages_37bits, N, FD_CNG_maxN_37bits, indices, v, NULL ); -#endif /* Compute gain */ @@ -1014,12 +1001,10 @@ void FdCngEncodeMDCTStereoSID( int16_t no_side_flag; int16_t is_inp_ms; -#ifdef ERI_FDCNGVQ_LOW_ROM float tot_sig_ext[FDCNG_VQ_MAX_LEN], dct_target[CPE_CHANNELS][FDCNG_VQ_DCT_MAXTRUNC]; /* 24 +2*18*/ float *invTrfMatrix; float tmpRAM[FDCNG_VQ_MAX_LEN][FDCNG_VQ_DCT_MAXTRUNC]; /*24*18*/ invTrfMatrix = (float *) tmpRAM; /* dynamically filled */ -#endif is_inp_ms = 0; @@ -1072,11 +1057,7 @@ void FdCngEncodeMDCTStereoSID( /* Quantize noise shapes */ for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { -#ifdef ERI_FDCNGVQ_LOW_ROM /* Normalize MSVQ input */ -#else - /* Normalize MSVW input */ -#endif gain[ch] = 0.f; for ( p = N_GAIN_MIN; p < N_GAIN_MAX; p++ ) { @@ -1088,8 +1069,6 @@ void FdCngEncodeMDCTStereoSID( { ms_ptr[ch][p] -= gain[ch]; } - -#ifdef ERI_FDCNGVQ_LOW_ROM } /* always split channel targetloop */ @@ -1121,7 +1100,6 @@ void FdCngEncodeMDCTStereoSID( /* end split */ for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { -#endif /* MSVQ */ if ( ch ) { @@ -1132,7 +1110,6 @@ void FdCngEncodeMDCTStereoSID( stages = FD_CNG_stages_37bits; } -#ifdef ERI_FDCNGVQ_LOW_ROM /* DCT24 domain compressed/truncated indices used for first stage */ /* mid channel quantization using stages 1 through 6 */ /* & side channel quantization using stages 1 through 4 */ @@ -1141,12 +1118,6 @@ void FdCngEncodeMDCTStereoSID( msvq_enc( cdk_37bits_ivas, NULL, NULL, ms_ptr[ch], levels_37bits, FD_CNG_maxC_37bits, stages, weights, N, FD_CNG_maxN_37bits, 1, invTrfMatrix, indices[ch] ); msvq_dec( cdk_37bits_ivas, NULL, NULL, stages, N, FD_CNG_maxN_37bits, indices[ch], 1, invTrfMatrix, ms_ptr[ch], NULL ); } -#else - msvq_enc( cdk_37bits_ivas, NULL, NULL, ms_ptr[ch], levels_37bits, FD_CNG_maxC_37bits, stages, weights, N, FD_CNG_maxN_37bits, indices[ch] ); - - msvq_dec( cdk_37bits_ivas, NULL, NULL, stages, N, FD_CNG_maxN_37bits, indices[ch], ms_ptr[ch], NULL ); - -#endif } if ( no_side_flag ) @@ -1260,13 +1231,11 @@ void FdCngEncodeDiracMDCTStereoSID( int16_t indices[CPE_CHANNELS][FD_CNG_stages_37bits]; int16_t gain_idx[CPE_CHANNELS]; int16_t ch, p; -#ifdef ERI_FDCNGVQ_LOW_ROM float *invTrfMatrix; float tmpRAM[FDCNG_VQ_MAX_LEN][FDCNG_VQ_DCT_MAXTRUNC]; float dct_target[FDCNG_VQ_DCT_MAXTRUNC]; float tot_sig_ext[FDCNG_VQ_MAX_LEN]; invTrfMatrix = (float *) tmpRAM; /* dynamically filled */ -#endif /* set pointers and initialize */ for ( ch = 0; ch < CPE_CHANNELS; ch++ ) @@ -1283,11 +1252,7 @@ void FdCngEncodeDiracMDCTStereoSID( for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { E[ch] = 0.0f; -#ifdef ERI_FDCNGVQ_LOW_ROM for ( p = 0; p < NPART; p++ ) /* TBD Note: NPART should likely be N[ch] if N[ch] may change */ -#else - for ( p = 0; p < NPART; p++ ) -#endif { ms_ptr[ch][p] = 10.f * log10f( lr_in_ptr[ch][p] + EPSILON ); E[ch] += ms_ptr[ch][p]; @@ -1295,22 +1260,12 @@ void FdCngEncodeDiracMDCTStereoSID( } /* M/S transform on log envelopes */ -#ifdef ERI_FDCNGVQ_LOW_ROM convertToMS( NPART, ms_ptr[0], ms_ptr[1], 0.5f ); /* TBD Note: NPART should likely be N[0] if N[0] may change */ E[0] = sum_f( ms_ptr[0], NPART ); /* TBD Note: NPART should likely be N[0] if N[0] may change */ -#else - convertToMS( NPART, ms_ptr[0], ms_ptr[1], 0.5f ); - - E[0] = sum_f( ms_ptr[0], NPART ); -#endif /* Quantize M noise shape */ -#ifdef ERI_FDCNGVQ_LOW_ROM /* Normalize MSVQ input */ -#else - /* Normalize MSVW input */ -#endif gain[0] = sum_f( ms_ptr[0] + N_GAIN_MIN, N_GAIN_MAX - N_GAIN_MIN ); gain[0] /= (float) ( N_GAIN_MAX - N_GAIN_MIN ); @@ -1320,7 +1275,6 @@ void FdCngEncodeDiracMDCTStereoSID( } /* MSVQ */ -#ifdef ERI_FDCNGVQ_LOW_ROM /* DCT domain compressed/truncated indices used for first stage */ /* mid quantization using stages #1 through 6 */ if ( N[0] == FDCNG_VQ_MAX_LEN_WB ) @@ -1338,20 +1292,12 @@ void FdCngEncodeDiracMDCTStereoSID( msvq_enc( cdk_37bits_ivas, NULL, NULL, ms_ptr[0], levels_37bits, FD_CNG_maxC_37bits, FD_CNG_stages_37bits, weights, N[0], FD_CNG_maxN_37bits, 1, invTrfMatrix, indices[0] ); msvq_dec( cdk_37bits_ivas, NULL, NULL, FD_CNG_stages_37bits, N[0], FD_CNG_maxN_37bits, indices[0], 1, invTrfMatrix, ms_ptr[0], NULL ); -#else - msvq_enc( cdk_37bits_ivas, NULL, NULL, ms_ptr[0], levels_37bits, FD_CNG_maxC_37bits, FD_CNG_stages_37bits, weights, N[0], FD_CNG_maxN_37bits, indices[0] ); - msvq_dec( cdk_37bits_ivas, NULL, NULL, FD_CNG_stages_37bits, N[0], FD_CNG_maxN_37bits, indices[0], ms_ptr[0], NULL ); -#endif /* set S to zero */ set_zero( ms_ptr[1], NPART ); /* compute M gain */ -#ifdef ERI_FDCNGVQ_LOW_ROM gain[0] = sum_f( ms_ptr[0], NPART ); /* TBD Note: NPART should likely be N[0] if N[0] may change */ -#else - gain[0] = sum_f( ms_ptr[0], NPART ); -#endif gain[0] = ( E[0] - gain[0] ) / (float) N[0]; apply_scale( &gain[0], sts[0]->hFdCngEnc->hFdCngCom->CngBandwidth, sts[0]->hDtxEnc->last_active_brate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO ); @@ -1363,11 +1309,7 @@ void FdCngEncodeDiracMDCTStereoSID( gain[1] = gain[0]; /* undo M/S */ -#ifdef ERI_FDCNGVQ_LOW_ROM convertToMS( NPART, ms_ptr[0], ms_ptr[1], 1.0f ); /* TBD Note: NPART should likely be N[0] if N[0] may change */ -#else - convertToMS( NPART, ms_ptr[0], ms_ptr[1], 1.0f ); -#endif /* restore channel noise envelopes */ for ( ch = 0; ch < CPE_CHANNELS; ch++ ) @@ -1375,11 +1317,7 @@ void FdCngEncodeDiracMDCTStereoSID( HANDLE_FD_CNG_ENC hFdCngEnc = sts[ch]->hFdCngEnc; HANDLE_FD_CNG_COM hFdCngCom = hFdCngEnc->hFdCngCom; -#ifdef ERI_FDCNGVQ_LOW_ROM for ( p = 0; p < NPART; p++ ) /* TBD Note: NPART should likely be N[0] if N[0] may change */ -#else - for ( p = 0; p < NPART; p++ ) -#endif { lr_out_ptr[ch][p] = powf( 10.f, ( ms_ptr[ch][p] + gain[ch] ) / 10.f ); } diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index a7c37a79af054306a40f5c352878608bb3284e2d..c2627b923bed0d309efd02e639da02d21a894147 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -219,11 +219,7 @@ ivas_error ivas_core_enc( if ( st->core == ACELP_CORE ) { /* ACELP core encoder */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE if ( ( error = acelp_core_enc( st, inp[n], ener[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], vad_hover_flag[0], attack_flag[n], bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], pitch_buf[n], &unbits[n], hStereoTD, tdm_lsfQ_PCh ) ) != IVAS_ERR_OK ) -#else - if ( ( error = acelp_core_enc( st, inp[n], ener[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], vad_hover_flag[0], attack_flag[n], bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], pitch_buf[n], &unbits[n], hStereoTD, tdm_lspQ_PCh, tdm_lsfQ_PCh ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index f48044d1c78fab00d4953f00a6c267d6d18141e5..45ce09bb151e929cce83036f28bfff8d0ca21dad 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -488,11 +488,7 @@ void ivas_dirac_enc_spar_delay_synchro( int16_t sce_id, cpe_id, i_chan; /* check last sba_mode */ -#ifndef LBR_SBA - if ( ivas_sba_mode_select( st_ivas->hEncoderConfig->last_ivas_total_brate ) == SBA_MODE_SPAR ) -#else if ( ivas_sba_mode_select() == SBA_MODE_SPAR ) -#endif { /* initializations */ i_chan = 0; diff --git a/lib_enc/ivas_enc_cov_handler.c b/lib_enc/ivas_enc_cov_handler.c index a94436ae34c3f30c5062b38327027d6e1f0f57a0..9524fb656fcdf1bcc789b49113b82bd67dd3f45a 100644 --- a/lib_enc/ivas_enc_cov_handler.c +++ b/lib_enc/ivas_enc_cov_handler.c @@ -66,10 +66,8 @@ ivas_error ivas_spar_covar_enc_open( ivas_filterbank_t *pFb, /* i/o: FB handle */ const int32_t input_Fs, /* i : input sampling rate */ const int16_t nchan_inp /* i : number of input channels */ -#ifdef LBR_SBA_EXTRA_COV_SMOOTH , const int32_t ivas_total_brate /* i : IVAS total bitrate */ -#endif ) { ivas_enc_cov_handler_state_t *hCovState; @@ -87,11 +85,7 @@ ivas_error ivas_spar_covar_enc_open( cov_smooth_cfg.max_update_rate = MAX_UPDATE_RATE; cov_smooth_cfg.min_pool_size = MIN_POOL_SIZE; -#ifdef LBR_SBA_EXTRA_COV_SMOOTH if ( ( error = ivas_spar_covar_smooth_enc_open( &hCovState->pCov_state, &cov_smooth_cfg, pFb, nchan_inp, ivas_total_brate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_spar_covar_smooth_enc_open( &hCovState->pCov_state, &cov_smooth_cfg, pFb, nchan_inp ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -99,11 +93,7 @@ ivas_error ivas_spar_covar_enc_open( cov_smooth_cfg.max_update_rate = MAX_UPDATE_RATE_DTX; cov_smooth_cfg.min_pool_size = MIN_POOL_SIZE_DTX; -#ifdef LBR_SBA_EXTRA_COV_SMOOTH if ( ( error = ivas_spar_covar_smooth_enc_open( &hCovState->pCov_dtx_state, &cov_smooth_cfg, pFb, nchan_inp, ivas_total_brate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_spar_covar_smooth_enc_open( &hCovState->pCov_dtx_state, &cov_smooth_cfg, pFb, nchan_inp ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 6171cd000a00fcdede237e4e58e8f3540a589df7..36d476723ce069a4789fa7bcdd80b20e1238bbee 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -339,9 +339,7 @@ ivas_error ivas_init_encoder( /* In IVAS, ensure that minimum coded bandwidth is WB */ hEncoderConfig->max_bwidth = max( hEncoderConfig->max_bwidth, WB ); } -#ifdef LBR_SBA_BR_SWITCHING hEncoderConfig->spar_reconfig_flag = 0; -#endif st_ivas->ism_mode = ISM_MODE_NONE; st_ivas->mc_mode = MC_MODE_NONE; st_ivas->sba_mode = SBA_MODE_NONE; @@ -450,11 +448,7 @@ ivas_error ivas_init_encoder( if ( ivas_format == SBA_FORMAT ) { -#ifndef LBR_SBA - st_ivas->sba_mode = ivas_sba_mode_select( ivas_total_brate ); -#else st_ivas->sba_mode = ivas_sba_mode_select(); -#endif st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->hEncoderConfig->sba_order ); if ( st_ivas->sba_mode == SBA_MODE_SPAR ) diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index 1766351c959347389c32c52b6c0871571cf73bf7..d9fb1fef8347bb3e63131e06481d48c927b1a050 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -119,9 +119,6 @@ ivas_error ivas_sba_enc_reconfigure( { DIRAC_ENC_HANDLE hDirAC = st_ivas->hDirAC; SPAR_ENC_HANDLE hSpar; -#ifndef LBR_SBA_BR_SWITCHING - SBA_MODE sba_mode_old; -#endif int16_t analysis_order_old; int16_t spar_reconfig_flag; @@ -129,17 +126,7 @@ ivas_error ivas_sba_enc_reconfigure( nchan_transport_old = st_ivas->nchan_transport; nCPE_old = st_ivas->nCPE; nSCE_old = st_ivas->nSCE; -#ifndef LBR_SBA_BR_SWITCHING - sba_mode_old = st_ivas->sba_mode; -#endif st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, hEncoderConfig->sba_order ); -#ifndef LBR_SBA_BR_SWITCHING -#ifndef LBR_SBA - st_ivas->sba_mode = ivas_sba_mode_select( ivas_total_brate ); -#else - st_ivas->sba_mode = ivas_sba_mode_select(); -#endif -#endif analysis_order_old = ivas_sba_get_analysis_order( hEncoderConfig->last_ivas_total_brate, hEncoderConfig->sba_order ); if ( analysis_order_old != st_ivas->sba_analysis_order ) @@ -207,36 +194,18 @@ ivas_error ivas_sba_enc_reconfigure( old_mem_hp20_in = NULL; } } -#ifndef LBR_SBA_BR_SWITCHING - if ( st_ivas->sba_mode == SBA_MODE_SPAR ) - { - if ( st_ivas->hSpar == NULL ) - { - if ( ( error = ivas_spar_enc_open( st_ivas, spar_reconfig_flag ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif - ivas_spar_config( ivas_total_brate, min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ), - &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->hSpar->core_nominal_brate, -1 ); + ivas_spar_config( ivas_total_brate, min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ), + &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->hSpar->core_nominal_brate, -1 ); - for ( n = 0; n < DIRAC_MAX_ANA_CHANS; n++ ) + for ( n = 0; n < DIRAC_MAX_ANA_CHANS; n++ ) + { + if ( hDirAC->sba_synchro_buffer[n] != NULL ) { - if ( hDirAC->sba_synchro_buffer[n] != NULL ) - { - free( hDirAC->sba_synchro_buffer[n] ); - hDirAC->sba_synchro_buffer[n] = NULL; - } + free( hDirAC->sba_synchro_buffer[n] ); + hDirAC->sba_synchro_buffer[n] = NULL; } - hDirAC->num_samples_synchro_delay = 0; -#ifndef LBR_SBA_BR_SWITCHING } - else - { - ivas_spar_enc_close( &( st_ivas->hSpar ), hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp, spar_reconfig_flag ); - } -#endif + hDirAC->num_samples_synchro_delay = 0; hSpar = st_ivas->hSpar; if ( st_ivas->nchan_transport == 1 ) @@ -247,90 +216,29 @@ ivas_error ivas_sba_enc_reconfigure( { hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; } -#ifndef LBR_SBA_BR_SWITCHING - if ( ( sba_mode_old != st_ivas->sba_mode ) || ( nchan_transport_old != st_ivas->nchan_transport ) ) -#else if ( nchan_transport_old != st_ivas->nchan_transport ) -#endif { /* FB mixer handle */ -#ifndef LBR_SBA_BR_SWITCHING - if ( st_ivas->sba_mode == SBA_MODE_SPAR ) + if ( hDirAC->hFbMixer != NULL ) { -#endif - if ( hDirAC->hFbMixer != NULL ) - { - ivas_FB_mixer_close( &( hDirAC->hFbMixer ), hEncoderConfig->input_Fs, 0 ); - hDirAC->hFbMixer = NULL; - } -#ifndef LBR_SBA_BR_SWITCHING - if ( sba_mode_old == SBA_MODE_SPAR ) - { -#endif - spar_reconfig_flag = 1; - ivas_spar_enc_close( &( st_ivas->hSpar ), hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp, spar_reconfig_flag ); - - if ( ( error = ivas_spar_enc_open( st_ivas, spar_reconfig_flag ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifndef LBR_SBA_BR_SWITCHING - } + ivas_FB_mixer_close( &( hDirAC->hFbMixer ), hEncoderConfig->input_Fs, 0 ); + hDirAC->hFbMixer = NULL; } - else - { - if ( hDirAC->hFbMixer == NULL ) - { - IVAS_FB_CFG *fb_cfg; - - if ( ( error = ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_DIRAC, DIRAC_MAX_ANA_CHANS, 0, 0, hEncoderConfig->input_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* Allocate and initialize FB mixer handle */ - if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), hEncoderConfig->input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - if ( hDirAC->num_samples_synchro_delay == 0 ) - { - hDirAC->num_samples_synchro_delay = NS2SA( hEncoderConfig->input_Fs, IVAS_FB_ENC_DELAY_NS ); + spar_reconfig_flag = 1; + ivas_spar_enc_close( &( st_ivas->hSpar ), hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp, spar_reconfig_flag ); - for ( n = 0; n < DIRAC_MAX_ANA_CHANS; n++ ) - { - if ( ( hDirAC->sba_synchro_buffer[n] = (float *) malloc( hDirAC->num_samples_synchro_delay * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hDirAC synchro buffer\n" ) ); - } - set_zero( hDirAC->sba_synchro_buffer[n], hDirAC->num_samples_synchro_delay ); - } - for ( ; n < DIRAC_MAX_ANA_CHANS; n++ ) - { - hDirAC->sba_synchro_buffer[n] = NULL; - } - } + if ( ( error = ivas_spar_enc_open( st_ivas, spar_reconfig_flag ) ) != IVAS_ERR_OK ) + { + return error; } -#endif } -#ifdef LBR_SBA_BR_SWITCHING hEncoderConfig->spar_reconfig_flag = spar_reconfig_flag; -#endif if ( ( error = ivas_dirac_enc_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#ifndef LBR_SBA_BR_SWITCHING - if ( st_ivas->sba_mode == SBA_MODE_SPAR ) - { -#endif - mvs2s( hDirAC->dirac_to_spar_md_bands, hSpar->dirac_to_spar_md_bands, DIRAC_MAX_NBANDS ); - hSpar->enc_param_start_band = hDirAC->hConfig->enc_param_start_band; -#ifndef LBR_SBA_BR_SWITCHING - } -#endif + mvs2s( hDirAC->dirac_to_spar_md_bands, hSpar->dirac_to_spar_md_bands, DIRAC_MAX_NBANDS ); + hSpar->enc_param_start_band = hDirAC->hConfig->enc_param_start_band; /*-----------------------------------------------------------------* * Allocate, initialize, and configure SCE/CPE/MCT handles *-----------------------------------------------------------------*/ diff --git a/lib_enc/ivas_sns_enc.c b/lib_enc/ivas_sns_enc.c index 762b0aeb0f0d0d09ccc946f368a1e905e3d3b28e..c4f20841f3b576a3bce569dcefceee33dd928bf5 100644 --- a/lib_enc/ivas_sns_enc.c +++ b/lib_enc/ivas_sns_enc.c @@ -482,24 +482,14 @@ int16_t quantize_sns( means = ( st->core == TCX_20_CORE ) ? ivas_sns_means_side_tcx20 : ivas_sns_means_side_tcx10; v_sub( sns_ptr, means, snsQ, M ); -#ifdef ERI_FDCNGVQ_LOW_ROM msvq_enc( side_cdbks, NULL, NULL, snsQ, side_levels, 3, nStages, weights, M, M, 0, NULL, &indices[idxIndices] ); msvq_dec( side_cdbks, NULL, NULL, nStages, M, M, &indices[idxIndices], 0, NULL, snsQ, NULL ); -#else - msvq_enc( side_cdbks, NULL, NULL, snsQ, side_levels, 3, nStages, weights, M, M, &indices[idxIndices] ); - msvq_dec( side_cdbks, NULL, NULL, nStages, M, M, &indices[idxIndices], snsQ, NULL ); -#endif v_add( snsQ, means, snsQ, M ); } else { -#ifdef ERI_FDCNGVQ_LOW_ROM msvq_enc( cdbks, NULL, NULL, sns_ptr, levels, 3, nStages, weights, M, M, 0, NULL, &indices[idxIndices] ); msvq_dec( cdbks, NULL, NULL, nStages, M, M, &indices[idxIndices], 0, NULL, snsQ, NULL ); -#else - msvq_enc( cdbks, NULL, NULL, sns_ptr, levels, 3, nStages, weights, M, M, &indices[idxIndices] ); - msvq_dec( cdbks, NULL, NULL, nStages, M, M, &indices[idxIndices], snsQ, NULL ); -#endif } idxIndices += nStages; diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index ad7db2ae6afba597c651bc5f80c36beec6c226b6..0484e2fb92dcdec73b6630aeb0b933a494207af7 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -113,11 +113,7 @@ ivas_error ivas_spar_enc_open( } /* Covariance handle */ -#ifdef LBR_SBA_EXTRA_COV_SMOOTH if ( ( error = ivas_spar_covar_enc_open( &( hSpar->hCovEnc ), hSpar->hFbMixer->pFb, input_Fs, nchan_inp, hEncoderConfig->ivas_total_brate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_spar_covar_enc_open( &( hSpar->hCovEnc ), hSpar->hFbMixer->pFb, input_Fs, nchan_inp ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -323,11 +319,7 @@ ivas_error ivas_spar_enc( // VE2DB: can hFbMixer->ppFilterbank_prior_input be replaced by st->input ? /* check last sba_mode */ -#ifndef LBR_SBA - if ( ivas_sba_mode_select( st_ivas->hEncoderConfig->last_ivas_total_brate ) == SBA_MODE_DIRAC ) -#else if ( ivas_sba_mode_select() == SBA_MODE_DIRAC ) -#endif { Encoder_State *sts[MCT_MAX_BLOCKS]; @@ -433,10 +425,8 @@ static ivas_error ivas_spar_enc_process( sba_order = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); nchan_inp = ivas_sba_get_nchan_metadata( sba_order ); assert( nchan_inp <= hEncoderConfig->nchan_inp ); -#ifdef LBR_SBA int16_t active_w_vlbr; active_w_vlbr = ( hEncoderConfig->ivas_total_brate < IVAS_24k4 ) ? 1 : 0; -#endif for ( i = FOA_CHANNELS + 1; i < nchan_inp; i++ ) { mvr2r( data_f[HOA_keep_ind[i]], data_f[i], input_frame ); @@ -451,12 +441,10 @@ static ivas_error ivas_spar_enc_process( { transient_det[1] = transient_det[0]; } -#ifdef LBR_SBA_EXTRA_COV_SMOOTH if ( ivas_total_brate < IVAS_24k4 ) { transient_det[1] = 0; } -#endif /* store previous input samples for W in local buffer */ assert( num_del_samples <= IVAS_FB_1MS_48K_SAMP ); mvr2r( &hSpar->hFbMixer->ppFilterbank_prior_input[0][hSpar->hFbMixer->fb_cfg->prior_input_length - num_del_samples], w_del_buf, num_del_samples ); @@ -520,17 +508,6 @@ static ivas_error ivas_spar_enc_process( { /* WB 4TC mode bit : disable for now*/ push_next_indice( hMetaData, 0, 1 ); -#ifdef LBR_SBA_PLANAR - /* force planar for LBR SPAR+DirAC, then encode parameters */ - if ( hQMetaData->useLowerRes ) - { - for ( i = hQMetaData->q_direction[0].cfg.start_band; i < hQMetaData->q_direction[0].cfg.nbands; i++ ) - { - /* Make sure elevation is really zero */ - set_zero( hQMetaData->q_direction[0].band_data[i].elevation, hQMetaData->q_direction[0].cfg.nblocks ); - } - } -#endif ivas_qmetadata_enc_encode( hMetaData, hQMetaData ); } else @@ -613,11 +590,7 @@ static ivas_error ivas_spar_enc_process( if ( hSpar->hMdEnc->table_idx != table_idx ) { hSpar->hMdEnc->table_idx = table_idx; -#ifdef LBR_SBA_BR_SWITCHING if ( ( ivas_total_brate != hEncoderConfig->last_ivas_total_brate ) && ( !hEncoderConfig->spar_reconfig_flag ) ) -#else - if ( ivas_total_brate != hEncoderConfig->last_ivas_total_brate ) -#endif { if ( ( error = ivas_spar_md_enc_init( hSpar->hMdEnc, hEncoderConfig, sba_order ) ) != IVAS_ERR_OK ) { @@ -651,12 +624,8 @@ static ivas_error ivas_spar_enc_process( if ( hSpar->hMdEnc->spar_hoa_md_flag == 0 ) { - ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order -#ifdef LBR_SBA - , - hSpar->hFbMixer->prior_mixer -#endif - ); + ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order, + hSpar->hFbMixer->prior_mixer ); } { @@ -698,22 +667,14 @@ static ivas_error ivas_spar_enc_process( Wscale_d[b] = min( 2.0f, max( Wscale_d[b], 1.0f ) ); } - ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, 1, hSpar->hMdEnc->mixer_mat, &hSpar->hMdEnc->spar_md, &hSpar->hMdEnc->spar_md_cfg, d_start_band, d_end_band, ( hSpar->hMdEnc->spar_hoa_md_flag ) ? 1 : sba_order, dtx_vad, Wscale_d -#ifdef LBR_SBA - , - hQMetaData->useLowerRes, active_w_vlbr -#endif - ); + ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, 1, hSpar->hMdEnc->mixer_mat, &hSpar->hMdEnc->spar_md, &hSpar->hMdEnc->spar_md_cfg, d_start_band, d_end_band, ( hSpar->hMdEnc->spar_hoa_md_flag ) ? 1 : sba_order, dtx_vad, Wscale_d, + hQMetaData->useLowerRes, active_w_vlbr ); } if ( hSpar->hMdEnc->spar_hoa_md_flag ) { - ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order -#ifdef LBR_SBA - , - hSpar->hFbMixer->prior_mixer -#endif - ); + ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order, + hSpar->hFbMixer->prior_mixer ); } #ifdef DEBUG_LBR_SBA /* Dumping SPAR Coefficients */ diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index b76a831feae201e21887b598eb74af9a865cbb7f..cdfd6050ba872863a211f53c84c258bf1fcbc118 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -72,32 +72,15 @@ static void ivas_band_mixer( float *cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], static void ivas_get_band_differential_index( ivas_band_coeffs_ind_t *pBand_idx, const int16_t q_levels[2], const int16_t one_sided, const int16_t nB, const int16_t complex_cov, const int16_t dim, const ivas_coeffs_type_t coeff_type ); -static void ivas_get_huffman_coded_bs( ivas_spar_md_enc_state_t *hMdEnc, BSTR_ENC_HANDLE hMetaData, const int16_t nB, const int16_t qsi, const int16_t planarCP -#ifdef LBR_SBA - , - const int16_t bands_bw -#endif -); +static void ivas_get_huffman_coded_bs( ivas_spar_md_enc_state_t *hMdEnc, BSTR_ENC_HANDLE hMetaData, const int16_t nB, const int16_t qsi, const int16_t planarCP, const int16_t bands_bw ); -static void ivas_get_arith_coded_bs( ivas_spar_md_enc_state_t *hMdEnc, BSTR_ENC_HANDLE hMetaData, const int16_t *pDo_diff, const int16_t bands_bw, const int16_t nB, const int16_t qsi, const int16_t planarCP -#ifdef LBR_SBA - , - const int16_t strat, - const int32_t ivas_total_brate -#endif -); +static void ivas_get_arith_coded_bs( ivas_spar_md_enc_state_t *hMdEnc, BSTR_ENC_HANDLE hMetaData, const int16_t *pDo_diff, const int16_t bands_bw, const int16_t nB, const int16_t qsi, const int16_t planarCP, const int16_t strat, const int32_t ivas_total_brate ); static ivas_error ivas_spar_set_enc_config( ivas_spar_md_enc_state_t *hMdEnc, int16_t *max_freq_per_chan, const int16_t nchan_transport, float *pFC, const int16_t nchan_inp ); static void ivas_select_next_strat( ivas_strats_t prior_strat, ivas_strats_t cs[MAX_QUANT_STRATS], const int16_t dmx_switch, const int16_t dtx_vad ); -static void ivas_store_prior_coeffs( ivas_spar_md_enc_state_t *hMdEnc, const int16_t num_bands, -#ifndef LBR_SBA - const int16_t bands_bw, -#endif - const int16_t strat, - const int16_t dtx_vad, - const int16_t qsi ); +static void ivas_store_prior_coeffs( ivas_spar_md_enc_state_t *hMdEnc, const int16_t num_bands, const int16_t strat, const int16_t dtx_vad, const int16_t qsi ); static void ivas_write_spar_md_bitstream( ivas_spar_md_enc_state_t *hMdEnc, const int16_t nB, const int16_t bands_bw, BSTR_ENC_HANDLE hMetaData, const int32_t ivas_total_brate, const int16_t strat, const int16_t qsi, const int16_t planarCP ); static void ivas_spar_quant_pred_coeffs_dtx( ivas_spar_md_t *pSpar_md, const float *pValues, const int16_t ndm, int16_t *pIndex, const int16_t dim1, float *pQuant ); @@ -561,10 +544,8 @@ ivas_error ivas_spar_md_enc_process( const int16_t dtx_vad, const int16_t nchan_inp, const int16_t sba_order /* i : Ambisonic (SBA) order */ -#ifdef LBR_SBA , float *prior_mixer[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH] /* i : prior mixer_matrix */ -#endif ) { float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS]; @@ -589,10 +570,8 @@ ivas_error ivas_spar_md_enc_process( bwidth = ivas_get_bw_idx_from_sample_rate( hEncoderConfig->input_Fs ); bwidth = min( bwidth, hEncoderConfig->max_bwidth ); -#ifdef LBR_SBA int16_t active_w_vlbr; active_w_vlbr = ( hEncoderConfig->ivas_total_brate < IVAS_24k4 ) ? 1 : 0; -#endif num_bands = ivas_get_num_bands_from_bw_idx( SPAR_CONFIG_BW ); if ( hMdEnc->spar_hoa_md_flag == 0 ) { @@ -645,7 +624,6 @@ ivas_error ivas_spar_md_enc_process( ivas_band_mixer( cov_real, num_ch, &num_bands, bands_bw ); } -#ifdef LBR_SBA else if ( hEncoderConfig->ivas_total_brate < IVAS_24k4 ) { bands_bw = 2; @@ -653,7 +631,6 @@ ivas_error ivas_spar_md_enc_process( ivas_band_mixer( cov_real, num_ch, &num_bands, bands_bw ); } -#endif else { nB = num_bands; @@ -673,9 +650,7 @@ ivas_error ivas_spar_md_enc_process( ivas_compute_spar_params( cov_real, dm_fv_re, 0, hMdEnc->mixer_mat, 0, nB, dtx_vad, num_ch, bands_bw, active_w, -#ifdef LBR_SBA active_w_vlbr, -#endif &hMdEnc->spar_md_cfg, &hMdEnc->spar_md, Wscale, 0 ); for ( i = 0; i < num_ch; i++ ) @@ -775,32 +750,13 @@ ivas_error ivas_spar_md_enc_process( fprintf(stderr, "\n\n"); */ #endif } -#ifdef LBR_SBA_PLANAR - if ( active_w_vlbr ) /* SPAR PLANAR */ - { - pState->spar_md.band_coeffs[b].P_re[2] = 0.0f; - } -#endif ivas_quant_p_per_band( &hMdEnc->spar_md.band_coeffs[b], &hMdEnc->spar_md.band_coeffs_idx[b], &hMdEnc->spar_md_cfg.quant_strat[qsi], num_ch ); } -#ifdef LBR_SBA_PLANAR - if ( active_w_vlbr ) /* SPAR PLANAR */ - { - pState->spar_md.band_coeffs[b].pred_re[1] = 0.0f; - } -#endif ivas_quant_pred_coeffs_per_band( &hMdEnc->spar_md.band_coeffs[b], &hMdEnc->spar_md.band_coeffs_idx[b], &hMdEnc->spar_md_cfg.quant_strat[qsi], num_ch ); -#ifdef LBR_SBA if ( active_w_vlbr ) { for ( i = 0; i < 3; i++ ) { -#ifdef LBR_SBA_PLANAR - if ( i == 1 ) /* Z prediction coefficients */ - { - continue; - } -#endif int16_t i2; i2 = 0; switch ( i ) /* PRED (Y,Z,X) and DECD (Y,X,Z) coeffs are in different orders */ @@ -834,18 +790,11 @@ ivas_error ivas_spar_md_enc_process( } } } -#endif } else { if ( ndm != num_ch ) { -#ifdef LBR_SBA_PLANAR - if ( active_w_vlbr ) /* SPAR PLANAR */ - { - hMdEnc->spar_md.band_coeffs[b].P_re[2] = 0.0f; - } -#endif ivas_quant_p_per_band_dtx( hMdEnc->spar_md.band_coeffs[b].P_re, ndec, ndm, &hMdEnc->spar_md.band_coeffs_idx[b].decd_index_re[0], hMdEnc->spar_md.band_coeffs[b].P_quant_re, num_ch ); } @@ -853,12 +802,6 @@ ivas_error ivas_spar_md_enc_process( { hMdEnc->spar_md.band_coeffs[b].pred_quant_re[i] = 0; } -#ifdef LBR_SBA_PLANAR - if ( active_w_vlbr ) /* SPAR PLANAR */ - { - hMdEnc->spar_md.band_coeffs[b].pred_re[1] = 0.0f; - } -#endif ivas_spar_quant_pred_coeffs_dtx( &hMdEnc->spar_md, hMdEnc->spar_md.band_coeffs[b].pred_re, ndm, hMdEnc->spar_md.band_coeffs_idx[b].pred_index_re, num_ch - 1, hMdEnc->spar_md.band_coeffs[b].pred_quant_re ); } } @@ -1008,7 +951,6 @@ ivas_error ivas_spar_md_enc_process( { assert( qsi == 0 ); } -#ifdef LBR_SBA /* Reuse mixer matrix values for unsent bands */ if ( ( hEncoderConfig->ivas_total_brate < IVAS_24k4 ) && ( code_strat > 3 ) ) { @@ -1028,7 +970,6 @@ ivas_error ivas_spar_md_enc_process( } } } -#endif #ifdef DEBUG_LBR_SBA char f_name[100]; int16_t nbands = 1; @@ -1244,9 +1185,6 @@ ivas_error ivas_spar_md_enc_process( #endif ivas_store_prior_coeffs( hMdEnc, num_bands, -#ifndef LBR_SBA - bands_bw, -#endif code_strat, dtx_vad, qsi ); hMdEnc->spar_md.dtx_vad = dtx_vad; @@ -1339,7 +1277,6 @@ static void ivas_write_spar_md_bitstream( no_ec = 0; -#ifdef LBR_SBA if ( ivas_total_brate < IVAS_24k4 ) { switch ( strat ) @@ -1366,7 +1303,6 @@ static void ivas_write_spar_md_bitstream( } else { -#endif switch ( strat ) { case BASE: @@ -1417,9 +1353,7 @@ static void ivas_write_spar_md_bitstream( ivas_map_prior_coeffs_quant( &hMdEnc->spar_md_prior, &hMdEnc->spar_md_cfg, qsi, nB ); break; } -#ifdef LBR_SBA } -#endif #ifdef SPAR_HOA_DBG if ( strat < 2 ) @@ -1429,22 +1363,14 @@ static void ivas_write_spar_md_bitstream( #endif if ( no_ec == 1 ) { - ivas_get_huffman_coded_bs( hMdEnc, hMetaData, nB, qsi, planarCP -#ifdef LBR_SBA - , - bands_bw -#endif - ); + ivas_get_huffman_coded_bs( hMdEnc, hMetaData, nB, qsi, planarCP, + bands_bw ); } else { - ivas_get_arith_coded_bs( hMdEnc, hMetaData, do_diff, bands_bw, nB, qsi, planarCP -#ifdef LBR_SBA - , + ivas_get_arith_coded_bs( hMdEnc, hMetaData, do_diff, bands_bw, nB, qsi, planarCP, strat, - ivas_total_brate -#endif - ); + ivas_total_brate ); } return; @@ -1462,12 +1388,8 @@ static void ivas_get_huffman_coded_bs( BSTR_ENC_HANDLE hMetaData, const int16_t nB, const int16_t qsi, - const int16_t planarCP -#ifdef LBR_SBA - , - const int16_t bands_bw -#endif -) + const int16_t planarCP, + const int16_t bands_bw ) { int16_t i, j; int16_t pred_coeff_dim, pred_offset; @@ -1475,15 +1397,9 @@ static void ivas_get_huffman_coded_bs( for ( i = 0; i < nB; i++ ) { int16_t code, len; -#ifdef LBR_SBA int16_t ndm, ndec; ndm = hMdEnc->spar_md_cfg.num_dmx_chans_per_band[i * bands_bw]; ndec = hMdEnc->spar_md_cfg.num_decorr_per_band[i * bands_bw]; -#else - int16_t ndm, ndec; - ndm = hMdEnc->spar_md_cfg.num_dmx_chans_per_band[i]; - ndec = hMdEnc->spar_md_cfg.num_decorr_per_band[i]; -#endif pred_coeff_dim = ndm + ndec - 1; pred_offset = 0; @@ -1525,12 +1441,6 @@ static void ivas_get_huffman_coded_bs( { for ( j = pred_offset; j < pred_coeff_dim; j++ ) { -#ifdef LBR_SBA_PLANAR - if ( ( j == 1 ) && ( bands_bw == IVAS_RED_BAND_FACT ) ) - { - continue; - } -#endif ivas_huffman_encode( &hMdEnc->huff_coeffs.pred_huff_re[qsi], hMdEnc->spar_md.band_coeffs_idx[i].pred_index_re[j], &code, &len ); push_next_indice( hMetaData, code, len ); } @@ -1543,12 +1453,6 @@ static void ivas_get_huffman_coded_bs( for ( j = 0; j < ndec; j++ ) { -#ifdef LBR_SBA_PLANAR - if ( ( j == 2 ) && ( bands_bw == IVAS_RED_BAND_FACT ) ) - { - continue; - } -#endif ivas_huffman_encode( &hMdEnc->huff_coeffs.decd_huff_re[qsi], hMdEnc->spar_md.band_coeffs_idx[i].decd_index_re[j], &code, &len ); push_next_indice( hMetaData, code, len ); } @@ -1572,13 +1476,9 @@ static void ivas_get_arith_coded_bs( const int16_t bands_bw, const int16_t nB, const int16_t qsi, - const int16_t planarCP -#ifdef LBR_SBA - , + const int16_t planarCP, const int16_t strat, - const int32_t ivas_total_brate -#endif -) + const int32_t ivas_total_brate ) { int16_t i, j, any_diff; ivas_cell_dim_t pred_cell_dims[IVAS_MAX_NUM_BANDS]; @@ -1593,7 +1493,6 @@ static void ivas_get_arith_coded_bs( int16_t ndm, ndec; ndm = hMdEnc->spar_md_cfg.num_dmx_chans_per_band[bands_bw * i]; ndec = hMdEnc->spar_md_cfg.num_decorr_per_band[bands_bw * i]; -#ifdef LBR_SBA if ( ( ivas_total_brate < IVAS_24k4 ) && ( strat > 3 ) && ( ( ( i % 2 == 1 ) && ( strat % 2 == 0 ) ) || ( ( i % 2 == 0 ) && ( strat % 2 == 1 ) ) ) ) { pred_cell_dims[i].dim1 = 0; @@ -1607,7 +1506,6 @@ static void ivas_get_arith_coded_bs( } else { -#endif pred_cell_dims[i].dim1 = ndm + ndec - 1; if ( hMdEnc->spar_hoa_md_flag ) { @@ -1623,16 +1521,7 @@ static void ivas_get_arith_coded_bs( decd_cell_dims[i].dim2 = 1; decx_cell_dims[i].dim1 = ( ndec * ( ndec - 1 ) ) >> 1; decx_cell_dims[i].dim2 = 1; -#ifdef LBR_SBA_PLANAR - if ( ivas_total_brate < IVAS_24k4 ) - { - pred_cell_dims[i].dim1 -= 1; - decd_cell_dims[i].dim1 -= 1; - } -#endif -#ifdef LBR_SBA } -#endif } any_diff = 0; @@ -1664,15 +1553,6 @@ static void ivas_get_arith_coded_bs( } } } -#ifdef LBR_SBA_PLANAR - if ( ivas_total_brate < IVAS_24k4 ) - { - for ( int16_t b = 0; b < nB; b++ ) /* swap X and Z PR coefficients, then code fewer */ - { - hMdEnc->spar_md.band_coeffs_idx[b].pred_index_re[1] = hMdEnc->spar_md.band_coeffs_idx[b].pred_index_re[2]; - } - } -#endif ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md.band_coeffs_idx, nB, symbol_arr_re, pred_cell_dims, PRED_COEFF, planarCP ); if ( any_diff == 1 ) @@ -1815,17 +1695,11 @@ static void ivas_select_next_strat( static void ivas_store_prior_coeffs( ivas_spar_md_enc_state_t *hMdEnc, const int16_t num_bands, -#ifndef LBR_SBA - const int16_t bands_bw, -#endif const int16_t strat, const int16_t dtx_vad, const int16_t qsi ) { int16_t i, j, b; -#ifndef LBR_SBA - float one_by_bands_bw = ( 1.0f / bands_bw ); -#endif if ( dtx_vad == 0 ) { hMdEnc->spar_md_cfg.prior_strat = START; @@ -1839,13 +1713,9 @@ static void ivas_store_prior_coeffs( for ( i = 0; i < num_bands; i++ ) { -#ifdef LBR_SBA b = i; /* TODO: Bitrate switching will require dependence on bands_bw, and changes to time differential coding/prior index storage for 6-12 band switching. e.g. b = (int16_t) floor( i * one_by_bands_bw ); */ -#else - b = (int16_t) floor( i * one_by_bands_bw ); -#endif for ( j = 0; j < IVAS_SPAR_MAX_CH - 1; j++ ) { hMdEnc->spar_md_prior.band_coeffs_idx[i].pred_index_re[j] = hMdEnc->spar_md.band_coeffs_idx[b].pred_index_re[j]; diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 68ba7eac5a46ae192fefa06b7f1081b9a1f7597d..9dfafbbc04fba7a832c29c042af618d7703dc179 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -1037,9 +1037,7 @@ typedef struct encoder_config_structure /* temp. development parameters */ int16_t Opt_PCA_ON; /* flag indicating PCA operation in SBA */ -#ifdef LBR_SBA_BR_SWITCHING int16_t spar_reconfig_flag; -#endif #ifdef DEBUGGING /* debugging options */ int16_t stereo_mode_cmdl; /* stereo mode forced from the command-line */ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index e0e70919d7510cede83d088fa87c70c50273a5b4..45d4c856837432451c385ce5b194b79591cb519e 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -888,11 +888,7 @@ static ivas_error configureEncoder( } #ifdef DEBUG_AGC_ENCODER_CMD_OPTION -#ifndef LBR_SBA - if ( hEncoderConfig->Opt_AGC_ON == SBA_AGC_FORCE_ENABLE && !( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_sba_mode_select( hEncoderConfig->ivas_total_brate ) == SBA_MODE_SPAR ) ) -#else if ( hEncoderConfig->Opt_AGC_ON == SBA_AGC_FORCE_ENABLE && !( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_sba_mode_select() == SBA_MODE_SPAR ) ) -#endif { return IVAS_ERROR( IVAS_ERR_NOT_SUPPORTED_OPTION, "AGC supported in SBA format at bitrates >= 24.4 kbps only." ); } diff --git a/lib_enc/lsf_enc.c b/lib_enc/lsf_enc.c index 62e93912ed32c65776a8e22e84fe6bf0ee8d2d07..66f8847608b989e47ec7068d02972d36203383db 100644 --- a/lib_enc/lsf_enc.c +++ b/lib_enc/lsf_enc.c @@ -45,10 +45,8 @@ #include "rom_com.h" #include "prot.h" #include "basop_proto_func.h" -#ifdef LSF_RE_USE_SECONDARY_CHANNEL #include "ivas_prot.h" #include "ivas_rom_com.h" -#endif #include "wmc_auto.h" /*-----------------------------------------------------------------* @@ -85,10 +83,8 @@ void lsf_enc( float *Aq, /* o : quantized A(z) for 4 subframes */ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL , const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ -#endif ) { int16_t i, nBits, force_sf, no_param_lpc; @@ -184,11 +180,7 @@ void lsf_enc( * LSF quantization *-------------------------------------------------------------------------------------*/ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL lsf_end_enc( st, lsf_new, lsf_new, nBits, coder_type, force_sf, param_lpc, &no_param_lpc, NULL, st->coder_type_raw, tdm_lsfQ_PCh ); -#else - lsf_end_enc( st, lsf_new, lsf_new, nBits, coder_type, force_sf, param_lpc, &no_param_lpc, NULL, st->coder_type_raw ); -#endif /* convert quantized LSFs back to LSPs */ lsf2lsp( lsf_new, lsp_new, M, st->sr_core ); @@ -449,11 +441,8 @@ void lsf_end_enc( int16_t *lpc_param, int16_t *no_indices, int16_t *bits_param_lpc, - const int16_t coder_type_raw -#ifdef LSF_RE_USE_SECONDARY_CHANNEL - , + const int16_t coder_type_raw, const float tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ -#endif ) { int16_t i; @@ -485,18 +474,13 @@ void lsf_end_enc( int16_t *TCQIdx; int16_t flag_1bit_gran; BSTR_ENC_HANDLE hBstr = st->hBstr; -#ifdef LSF_RE_USE_SECONDARY_CHANNEL float pred3[M]; int16_t dummy, dummy_v[5]; -#endif flag_1bit_gran = ( st->element_mode > EVS_MONO ); nBits = nBits_in; - if ( coder_type_org == GENERIC && st->sr_core == INT_FS_16k && st->codec_mode == MODE1 -#ifdef LSF_RE_USE_SECONDARY_CHANNEL - && ( st->idchan == 0 ) /* this bit is used only for primary channel or mono */ -#endif + if ( coder_type_org == GENERIC && st->sr_core == INT_FS_16k && st->codec_mode == MODE1 && ( st->idchan == 0 ) /* this bit is used only for primary channel or mono */ ) { if ( coder_type_raw == VOICED ) @@ -570,7 +554,6 @@ void lsf_end_enc( pred1[i] = ModeMeans[mode_lvq][i] + MU_MA * st->mem_MA[i]; } -#ifdef LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo SCh: perform intra-frame prediction with pulling-to-mean */ if ( st->tdm_LRTD_flag == 0 && st->idchan == 1 && tdm_lsfQ_PCh != NULL ) { @@ -579,7 +562,6 @@ void lsf_end_enc( tdm_SCh_LSF_intra_pred( st->element_brate, tdm_lsfQ_PCh, pred3 ); } -#endif if ( predmode == 0 ) /* Safety-net only */ { @@ -600,10 +582,8 @@ void lsf_end_enc( safety_net = 0; } else /* Switched Safety-Net/AR prediction */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL { if ( predmode == 2 ) -#endif { /* Subtract mean and AR prediction */ mvr2r( ModeMeans[mode_lvq], pred0, M ); @@ -683,7 +663,6 @@ void lsf_end_enc( } } } -#ifdef LSF_RE_USE_SECONDARY_CHANNEL else /* of "if (predmode==2)" */ { mvr2r( ModeMeans[mode_lvq], pred0, M ); @@ -748,7 +727,6 @@ void lsf_end_enc( } } } -#endif /*--------------------------------------------------------------------------* * Write indices to array @@ -757,24 +735,16 @@ void lsf_end_enc( if ( st->codec_mode == MODE1 && st->core == ACELP_CORE ) { /* write coder_type bit for VOICED@16kHz or GENERIC@16kHz */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL if ( coder_type_org == GENERIC && st->sr_core == INT_FS_16k && st->idchan == 0 ) -#else - if ( coder_type_org == GENERIC && st->sr_core == INT_FS_16k ) -#endif { /* VOICED =2 and GENERIC=3, so "coder_type-2" means VOICED =0 and GENERIC=1*/ push_indice( hBstr, IND_LSF_PREDICTOR_SELECT_BIT, coder_type - 2, 1 ); } /* write predictor selection bit */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL if ( predmode >= 2 ) -#else - if ( predmode == 2 ) -#endif { push_indice( hBstr, IND_LSF_PREDICTOR_SELECT_BIT, safety_net, 1 ); } @@ -792,11 +762,7 @@ void lsf_end_enc( else { cumleft = nBits; -#ifdef LSF_RE_USE_SECONDARY_CHANNEL if ( predmode >= 2 ) -#else - if ( predmode == 2 ) -#endif { /* subtract predictor selection bit */ cumleft = nBits - 1; @@ -925,7 +891,6 @@ void lsf_end_enc( } else { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL if ( st->tdm_LRTD_flag == 0 && st->idchan == 1 && tdm_lsfQ_PCh != NULL ) { /* intra mode*/ @@ -935,14 +900,11 @@ void lsf_end_enc( } else { -#endif vq_dec_lvq( 1, qlsf, &indice[0], stages0, M, mode_lvq, levels0[stages0 - 1] ); v_add( qlsf, pred0, qlsf, M ); v_sub( qlsf, pred1, st->mem_MA, M ); -#ifdef LSF_RE_USE_SECONDARY_CHANNEL } -#endif } } else diff --git a/lib_enc/lsf_msvq_ma_enc.c b/lib_enc/lsf_msvq_ma_enc.c index 4735b0a6515b2e0af1a428bba014f8a37fb221fc..44844839cd43e94720e99512ef26caff7b46512c 100644 --- a/lib_enc/lsf_msvq_ma_enc.c +++ b/lib_enc/lsf_msvq_ma_enc.c @@ -49,11 +49,8 @@ #define kMaxC 8 -#ifdef ERI_FDCNGVQ_LOW_ROM - #include "ivas_prot.h" void dctT2_N_apply_matrix( const float *input, float *output, const int16_t dct_dim, int16_t fdcngvq_dim, const float *idctT2_24_X_matrixQ16, const int16_t matrix_1st_dim, DCTTYPE dcttype ); -#endif /*--------------------------------------------------------------------------* * msvq_enc() @@ -61,22 +58,20 @@ void dctT2_N_apply_matrix( const float *input, float *output, const int16_t dct_ * MSVQ encoder *--------------------------------------------------------------------------*/ void msvq_enc( - const float *const *cb, /* i : Codebook (indexed cb[*stages][levels][p]) */ - const int16_t dims[], /* i : Dimension of each codebook stage (NULL: full dim.) */ - const int16_t offs[], /* i : Starting dimension of each codebook stage (NULL: 0) */ - const float u[], /* i : Vector to be encoded (prediction and mean removed) */ - const int16_t *levels, /* i : Number of levels in each stage */ - const int16_t maxC, /* i : Tree search size (number of candidates kept from */ - /* one stage to the next == M-best) */ - const int16_t stages, /* i : Number of stages */ - const float w[], /* i : Weights */ - const int16_t N, /* i : Vector dimension */ - const int16_t maxN, /* i : Codebook dimension */ -#ifdef ERI_FDCNGVQ_LOW_ROM + const float *const *cb, /* i : Codebook (indexed cb[*stages][levels][p]) */ + const int16_t dims[], /* i : Dimension of each codebook stage (NULL: full dim.) */ + const int16_t offs[], /* i : Starting dimension of each codebook stage (NULL: 0) */ + const float u[], /* i : Vector to be encoded (prediction and mean removed) */ + const int16_t *levels, /* i : Number of levels in each stage */ + const int16_t maxC, /* i : Tree search size (number of candidates kept from */ + /* one stage to the next == M-best) */ + const int16_t stages, /* i : Number of stages */ + const float w[], /* i : Weights */ + const int16_t N, /* i : Vector dimension */ + const int16_t maxN, /* i : Codebook dimension */ const int16_t applyDCT_flag, /* i : applyDCT flag */ float *invTrfMatrix, /*i/o : synthesis matrix */ -#endif - int16_t Idx[] /* o : Indices */ + int16_t Idx[] /* o : Indices */ ) { float *resid[2], *dist[2]; @@ -89,7 +84,6 @@ void msvq_enc( int16_t n, maxn, start; -#ifdef ERI_FDCNGVQ_LOW_ROM /* buffers */ float dct_target[FDCNG_VQ_DCT_MAXTRUNC]; float u_mr[FDCNG_VQ_MAX_LEN]; @@ -124,7 +118,6 @@ void msvq_enc( st1_syn_vec_ptr = &( resid_buf[1 * LSFMBEST_MAX * M_MAX] ) - FDCNG_VQ_MAX_LEN * maxC; /* reuse top of resid[0] scratch RAM for residual */ dcttype = DCT_T2_24_XX; -#endif /*----------------------------------------------------------------* * Allocate memory for previous (parent) and current nodes. @@ -208,7 +201,6 @@ void msvq_enc( dist[1][j] = FLT_MAX; } -#ifdef ERI_FDCNGVQ_LOW_ROM if ( !s && applyDCT_flag != 0 ) /* means: m==1 */ { /* stage 1 search in truncated dct domain without any weights */ @@ -270,10 +262,8 @@ void msvq_enc( #undef WMC_TOOL_SKIP /* overwrite with a new worst index at p_max */ -#ifdef ERI_FDCNGVQ_LOW_ROM /* The three inner loop if's below are not really properly instrumented by WMC tool */ /* a ptr to worst index will be in use */ -#endif if ( mse < st1_mse_pair[p_max] ) /* L_sub */ { st1_idx_pair[p_max] = j_full; /* simplified */ @@ -371,93 +361,39 @@ void msvq_enc( assert( maxC == maxC_pre ); } else - /* non-DCT Stage #1 code below */ -#endif + /* non-DCT Stage #1 code below */ if ( !s ) /* means: m==1 */ - { - /* This loop is identical to the one below, except, that the inner - loop over c=0..m is hardcoded to c=0, since m=1. */ - /* dist[0][0] */ - for ( j = 0; j < levels[s]; j++ ) { - en = 0.0f; - /* w,Tmp */ - /* Compute weighted codebook element and its energy */ - for ( c2 = 0; c2 < n; c2++ ) - { - Tmp[start + c2] = w[start + c2] * cbp[c2]; - en += cbp[c2] * Tmp[start + c2]; - } - cbp += maxn; /* pointer is incremented */ - - pTmp = &resid[0][0]; - /* Tmp */ - tmp = ( *pTmp++ ) * Tmp[0]; - for ( c2 = 1; c2 < N; c2++ ) - { - tmp += ( *pTmp++ ) * Tmp[c2]; - } - tmp = en - 2.0f * tmp; - tmp += dist[0][0]; - if ( tmp < dist[1][p_max] ) + /* This loop is identical to the one below, except, that the inner + loop over c=0..m is hardcoded to c=0, since m=1. */ + /* dist[0][0] */ + for ( j = 0; j < levels[s]; j++ ) { - /* Replace worst */ - dist[1][p_max] = tmp; - indices[1][p_max * stages] = j; - parents[p_max] = 0; - - p_max = 0; - for ( c2 = 1; c2 < maxC; c2++ ) + en = 0.0f; + /* w,Tmp */ + /* Compute weighted codebook element and its energy */ + for ( c2 = 0; c2 < n; c2++ ) { - if ( dist[1][c2] > dist[1][p_max] ) - { - p_max = c2; - } + Tmp[start + c2] = w[start + c2] * cbp[c2]; + en += cbp[c2] * Tmp[start + c2]; } - } /* if (tmp <= dist[1][p_max]) */ - } /* for (j=0; j dist[1][p_max] ) + { + p_max = c2; + } + } + } /* if (tmp <= dist[1][p_max]) */ + } /* for(c=0; csr_core == INT_FS_16k && coder_type == UNVOICED ) { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL lsf_end_enc( st, lsf, lsf_q, ENDLSF_NBITS, GENERIC, force_sf, param_lpc, no_param_lpc, bits_param_lpc, GENERIC, NULL ); -#else - lsf_end_enc( st, lsf, lsf_q, ENDLSF_NBITS, GENERIC, force_sf, param_lpc, no_param_lpc, bits_param_lpc, GENERIC ); -#endif nb_indices = *no_param_lpc; } else { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL lsf_end_enc( st, lsf, lsf_q, ENDLSF_NBITS, coder_type, force_sf, param_lpc, no_param_lpc, bits_param_lpc, coder_type, NULL ); -#else - lsf_end_enc( st, lsf, lsf_q, ENDLSF_NBITS, coder_type, force_sf, param_lpc, no_param_lpc, bits_param_lpc, coder_type ); -#endif nb_indices = *no_param_lpc; } diff --git a/lib_enc/transition_enc.c b/lib_enc/transition_enc.c index 1ba6c378521bdcbbc2335fb8b606d3c2dcf8493e..925a6f1c322e2582ab7e214c0eade34cfbbdf055 100644 --- a/lib_enc/transition_enc.c +++ b/lib_enc/transition_enc.c @@ -178,11 +178,7 @@ void transition_enc( if ( *tc_subfr == TC_0_0 ) { /* this is called only to compute unused bits */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#endif } *clip_gain = gp_clip( st->element_mode, st->core_brate, st->voicing, i_subfr, TRANSITION, xn, gp_cl ); @@ -278,11 +274,7 @@ void transition_enc( if ( i_subfr - *tc_subfr <= L_SUBFR ) { -#ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#endif } /*-----------------------------------------------------------------*