diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index 281e0640e317624cb040c36f3ec33e24735d7a72..7f7e34b3f510d1ad02a8f6f34642ce3e9bb25093 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -531,33 +531,31 @@ 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 */ -#ifdef NONBE_FIX_GSC_BSTR + 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 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ -#endif - 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 */ + 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 */ ) { int16_t i, bits, nb_subfr; @@ -778,13 +776,9 @@ ivas_error config_acelp1( } /* gain Q bit-budget - part 1: 'Es_pred' of memory-less gain Q */ -#ifdef NONBE_FIX_GSC_BSTR if ( ( coder_type != UNVOICED && coder_type != AUDIO && coder_type != INACTIVE && !( core_brate <= ACELP_8k00 && coder_type != TRANSITION ) ) /* mid bitrates in GC and VC, low+mid bitrates in TC */ || ( coder_type == INACTIVE && !inactive_coder_type_flag ) /* AVQ inactive */ ) -#else - 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 ) ) -#endif { *nBits_es_Pred = Es_pred_bits_tbl[BIT_ALLOC_IDX( core_brate, coder_type, -1, -1 )]; bits -= *nBits_es_Pred; @@ -877,11 +871,7 @@ ivas_error config_acelp1( } else if ( core_brate >= ACELP_11k60 && ( coder_type != AUDIO && !( coder_type == INACTIVE && L_frame == L_FRAME ) ) ) { -#ifdef NONBE_FIX_GSC_BSTR if ( coder_type == INACTIVE && L_frame == L_FRAME16k && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ -#else - if ( coder_type == INACTIVE && L_frame == L_FRAME16k && total_brate <= MAX_GSC_INACTIVE_BRATE ) /* GSC Inactive @16kHz */ -#endif { acelp_cfg->ltf_mode = FULL_BAND; } @@ -1065,13 +1055,9 @@ ivas_error config_acelp1( acelp_cfg->fixed_cdk_index[2] = -1; acelp_cfg->fixed_cdk_index[3] = -1; } -#ifdef NONBE_FIX_GSC_BSTR else if ( ( coder_type != INACTIVE && nb_subfr == NB_SUBFR && coder_type != AUDIO ) || /* @12.8kHz core except of GSC */ ( nb_subfr == NB_SUBFR16k && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) /* @16kHz core GC, TC, AVQ inactive */ || core == HQ_CORE /* ACELP -> HQ switching in EVS */ ) -#else - else if ( ( coder_type != INACTIVE && nb_subfr == NB_SUBFR && coder_type != AUDIO ) || ( nb_subfr == NB_SUBFR16k && ( total_brate > MAX_GSC_INACTIVE_BRATE || coder_type != INACTIVE ) ) || core == HQ_CORE ) -#endif { /* pitch Q & gain Q bit-budget - part 2*/ for ( i = 0; i < nb_subfr; i++ ) @@ -1119,13 +1105,9 @@ ivas_error config_acelp1( } /* algebraic codebook bit-budget */ -#ifdef NONBE_FIX_GSC_BSTR if ( flag_hardcoded || /* EVS */ ( core_brate_inp >= MIN_BRATE_AVQ_EXC && coder_type != INACTIVE ) /* high-birate ACELP except IC */ || ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ ) -#else - if ( flag_hardcoded || ( core_brate_inp >= MIN_BRATE_AVQ_EXC && coder_type != INACTIVE ) || ( total_brate > MAX_GSC_INACTIVE_BRATE && coder_type == INACTIVE ) ) -#endif { for ( i = 0; i < nb_subfr; i++ ) { @@ -1212,12 +1194,8 @@ ivas_error config_acelp1( } /* AVQ codebook */ -#ifdef NONBE_FIX_GSC_BSTR if ( ( core_brate_inp >= MIN_BRATE_AVQ_EXC && coder_type != INACTIVE ) /* high-birate ACELP except IC */ || ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ ) -#else - if ( ( core_brate_inp >= MIN_BRATE_AVQ_EXC && coder_type != INACTIVE ) || ( total_brate > MAX_GSC_INACTIVE_BRATE && coder_type == INACTIVE ) ) -#endif { for ( i = 0; i < nb_subfr; i++ ) { @@ -1252,13 +1230,9 @@ ivas_error config_acelp1( } } } -#ifdef NONBE_FIX_GSC_BSTR else if ( ( coder_type == UNVOICED && tdm_low_rate_mode == 1 && element_mode == IVAS_CPE_TD ) /* LBR secondary channel in TD stereo */ || ( ( coder_type == INACTIVE || coder_type == AUDIO ) && nb_subfr == NB_SUBFR ) /* GSC @12.8kHz */ || ( coder_type == INACTIVE && inactive_coder_type_flag ) /* AVQ inactive */ ) -#else - else if ( ( coder_type == UNVOICED && tdm_low_rate_mode == 1 && element_mode == IVAS_CPE_TD ) || ( ( coder_type == INACTIVE || coder_type == AUDIO ) && nb_subfr == NB_SUBFR ) || ( coder_type == INACTIVE && total_brate <= MAX_GSC_INACTIVE_BRATE ) ) -#endif { int32_t Local_BR, Pitch_BR; int16_t Pitch_CT; @@ -1351,12 +1325,8 @@ ivas_error config_acelp1( /* sanity check */ if ( ( coder_type != INACTIVE && nb_subfr == NB_SUBFR && coder_type != AUDIO ) || nb_subfr == NB_SUBFR16k ) { -#ifdef NONBE_FIX_GSC_BSTR if ( ( L_frame == L_FRAME16k && coder_type == INACTIVE && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ || ( GSC_IVAS_mode > 0 && L_frame == L_FRAME16k ) ) /* IVAS GSC @16kHz */ -#else - if ( ( L_frame == L_FRAME16k && coder_type == INACTIVE && total_brate <= MAX_GSC_INACTIVE_BRATE ) || ( GSC_IVAS_mode > 0 && L_frame == L_FRAME16k ) ) /* GSC Inactive @16kHz */ -#endif { acelp_cfg->ubits = 0; } diff --git a/lib_com/cnst.h b/lib_com/cnst.h index f751ae32349947aa9b015e1b9ab1e1bc2ac0724d..2108ab81c6b86ef43cd49a7d33ac46e17cf19375 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -742,9 +742,7 @@ typedef enum #define GAIN_PRED_ORDER 4 /* Gain quantization - prediction order for gain quantizer (only for AMR-WB IO mode) */ #define MEAN_ENER 30 /* Gain quantization - average innovation energy */ -#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD #define DTX_THR 5 /* DTX - lp_noise threshold for DTX at higher bitrates */ -#endif #define DTX_HIST_SIZE 8 /* CNG & DTX - number of last signal frames used for CNG averaging */ #define CNG_ISF_FACT 0.9f /* CNG & DTX - CNG spectral envelope smoothing factor */ diff --git a/lib_com/gs_inact_switching.c b/lib_com/gs_inact_switching.c index e7cb216da42671427f60f7b21b3d6b08f2a5fc0b..1d6d06525f18f3c31d546cbc3acd16dede9f9842 100644 --- a/lib_com/gs_inact_switching.c +++ b/lib_com/gs_inact_switching.c @@ -59,22 +59,17 @@ *-------------------------------------------------------------------*/ void inact_switch_ematch( - float exc2[], /* i/o: CELP/GSC excitation buffer */ - float dct_exc_tmp[], /* i : GSC excitation in DCT domain */ - float lt_ener_per_band[], /* i/o: Long term energy per band */ - const int16_t coder_type, /* i : Coder type */ -#ifdef NONBE_FIX_GSC_BSTR + float exc2[], /* i/o: CELP/GSC excitation buffer */ + float dct_exc_tmp[], /* i : GSC excitation in DCT domain */ + float lt_ener_per_band[], /* i/o: Long term energy per band */ + const int16_t coder_type, /* i : Coder type */ const int16_t inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ -#endif - const int16_t L_frame, /* i : Frame length */ -#ifndef NONBE_FIX_GSC_BSTR - const int32_t total_brate, /* i : Total bitrate */ -#endif - const int16_t bfi, /* i : frame lost indicator */ - const int16_t last_core, /* i : Last core used */ - const int16_t last_codec_mode, /* i : Last codec mode */ - const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ - const int16_t element_mode /* i : element mode */ + const int16_t L_frame, /* i : Frame length */ + const int16_t bfi, /* i : frame lost indicator */ + const int16_t last_core, /* i : Last core used */ + const int16_t last_codec_mode, /* i : Last codec mode */ + const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ + const int16_t element_mode /* i : element mode */ ) { float Ener_per_bd[MBANDS_GN16k]; @@ -110,11 +105,7 @@ void inact_switch_ematch( lt_ener_per_band[i] = Ener_per_bd[i]; } } -#ifdef NONBE_FIX_GSC_BSTR else if ( coder_type == INACTIVE && inactive_coder_type_flag ) -#else - else if ( coder_type == INACTIVE && total_brate <= MAX_GSC_INACTIVE_BRATE ) -#endif { /* Find spectrum and energy per band for inactive frames */ edct( exc2, dct_exc_tmp, L_frame, element_mode ); diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 1931b48b367a2474b2fa107a972328e5605efe77..8a9e8dea1924480f48ec57f3d0555b274c4e373b 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1145,9 +1145,7 @@ enum #define BITS_MASA2TOTTAL_DCT0 6 #define STEP_M2T 0.1f -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL #define STEP_M2T_FX 214748365 // Q31 -#endif #define MASA_HEADER_BITS 2 #define MASA_SUBFRAME_BITS 1 #define MASA_LOWBITRATE_MODE_BITS 1 diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 102e67effa076965e5ed27e52557e18055ec1ca7..ad871926d001f44a3bea01b9766aeedc512c44ec 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -756,7 +756,6 @@ int16_t get_igf_startline( float rand_triangular_signed( int16_t *seed ); -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL Word16 matrix_product_fx( const Word32 *X_fx, /* i : left hand matrix Qx*/ const Word16 rowsX, /* i : number of rows of the left hand matrix Q0*/ @@ -780,7 +779,6 @@ Word16 matrix_product_q30_fx( const Word16 transpY, /* i : flag indicating the transposition of the right hand matrix prior to the multiplication Q0*/ Word32 *Z_fx /* o : resulting matrix after the matrix multiplication Q30*/ ); -#endif void dtx_read_padding_bits( diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index e3b99178994416869c0f09a3091f2cef4dc819ef..7d84b0a739b693fa261eb70795f245ac8097c545 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2778,7 +2778,6 @@ const int32_t sep_object_brate[][MAX_NUM_OBJECTS] = }; /* column wise DCT matrices for 4 5, and 8 dim */ -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL const Word32 dct4_fx[4 * 4] = { // Q31 1073741824, 1402951040, 1073741824, 581109056, 1073741824, 581109056, -1073741824, -1402951040, @@ -2819,7 +2818,6 @@ const Word32 dct12_fx[12 * 12] = { // Q31 619978560, -335436960, 0, 335436960, -619978560, 810030848, -876602816, 810030848, -619978560, 335436960, 619978560, -869301376, 846752832, -810030848, 759350208, -695569984, 619978560, -533649696, 438301408, -335436960, 226989024, -114460880 }; -#endif const float dct4[4*4] = { 0.5000f, 0.6533f, 0.5000f, 0.2706f, diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index fe51dbdf3b219673414033d0e275ea33655e3005..3bf30289b6e030df649a25d4c8d91e10ef8bf17c 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -325,12 +325,10 @@ extern const float McMASA_LFEGain_vectors[64]; *----------------------------------------------------------------------------------*/ extern const int32_t sep_object_brate[][MAX_NUM_OBJECTS]; -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL extern const Word32 dct4_fx[]; extern const Word32 dct5_fx[]; extern const Word32 dct8_fx[]; extern const Word32 dct12_fx[]; -#endif extern const float dct4[]; extern const float dct5[]; extern const float dct8[]; diff --git a/lib_com/ivas_tools.c b/lib_com/ivas_tools.c index ed41a0638f0fed813aed8a40bf56ce26a8443050..36c626daa74a4f5b7d9338bc76f34ec45f1662c9 100644 --- a/lib_com/ivas_tools.c +++ b/lib_com/ivas_tools.c @@ -41,9 +41,7 @@ #include "ivas_prot.h" #include "wmc_auto.h" #include "ivas_rom_com.h" -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL #include "basop_settings.h" -#endif /*--------------------------------------------------------------- * sumAbs() @@ -1277,7 +1275,6 @@ float rand_triangular_signed( return 0.5f - 0.5f * sqrtf( 1.0f - rand_val ); } } -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL Word16 matrix_product_fx( const Word32 *X_fx, /* i : left hand matrix Qx*/ const Word16 rowsX, /* i : number of rows of the left hand matrix Q0*/ @@ -1515,4 +1512,3 @@ Word16 matrix_product_q30_fx( return EXIT_SUCCESS; } -#endif diff --git a/lib_com/options.h b/lib_com/options.h index 6dea2ea9d7bfba2b2ffc7b720c8e6266146cdb1a..f2fe9b93f2f65345a7a7b276811a02e099be25ae 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -169,14 +169,9 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_GSC_BSTR /* VA: issue 1264: Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */ -#define NONBE_1273_ISM_METADATA_COUNTER /* VA: issue 1273: fix counter overflow in ISM metadata encoder */ -#define NONBE_1279_COUNTER_OVERFLOW /* VA: issue 1279: Avoid possible overflow of counter st->Nb_ACELP_frames */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms in PhECU-PLC */ -#define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD /* VA/Eri: issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */ -#define NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL /* Nokia: add fix for precision limitation in comparison with masa2total energy ratio threshold to be aligned with BASOP*/ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 9716a8926406a62ff9f3ef3c94eb54f73fccfe10..96a1297f08cab32497319bff0252d48fb8b95458 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -3564,22 +3564,17 @@ void highband_exc_dct_in( ); void inact_switch_ematch( - float exc2[], /* i/o: CELP/GSC excitation buffer */ - float dct_exc_tmp[], /* i : GSC excitation in DCT domain */ - float lt_ener_per_band[], /* i/o: long-term energy per band */ - const int16_t coder_type, /* i : coder type */ -#ifdef NONBE_FIX_GSC_BSTR + float exc2[], /* i/o: CELP/GSC excitation buffer */ + float dct_exc_tmp[], /* i : GSC excitation in DCT domain */ + float lt_ener_per_band[], /* i/o: long-term energy per band */ + const int16_t coder_type, /* i : coder type */ const int16_t inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ -#endif - const int16_t L_frame, /* i : frame length */ -#ifndef NONBE_FIX_GSC_BSTR - const int32_t total_brate, /* i : Total bitrate */ -#endif - const int16_t bfi, /* i : frame lost indicator */ - const int16_t last_core, /* i : Last core used */ - const int16_t last_codec_mode, /* i : Last codec mode */ - const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ - const int16_t element_mode /* i : element mode */ + const int16_t L_frame, /* i : frame length */ + const int16_t bfi, /* i : frame lost indicator */ + const int16_t last_core, /* i : Last core used */ + const int16_t last_codec_mode, /* i : Last codec mode */ + const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ + const int16_t element_mode /* i : element mode */ ); void music_postfilt_init( @@ -9098,33 +9093,31 @@ 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 */ -#ifdef NONBE_FIX_GSC_BSTR + 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 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ -#endif - 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 */ + 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 */ ); /*! r: ACELP16k flag */ diff --git a/lib_dec/FEC.c b/lib_dec/FEC.c index b4742e576504bdd94b4b8037d47d4a5cc740585c..7c81376368be694f50b01dca2f3faebe96f3b5c1 100644 --- a/lib_dec/FEC.c +++ b/lib_dec/FEC.c @@ -332,11 +332,7 @@ void FEC_exc_estim( * Replicate the last spectrum in case the last good frame was coded by GSC *-----------------------------------------------------------------*/ -#ifdef NONBE_FIX_GSC_BSTR if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->inactive_coder_type_flag && !st->Opt_AMR_WB ) -#else - if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= MAX_GSC_INACTIVE_BRATE && !st->Opt_AMR_WB ) -#endif { /* Replication of the last spectrum, with a slight downscaling of its dynamic */ st->GSC_noisy_speech = st->Last_GSC_noisy_speech_flag; @@ -409,11 +405,7 @@ void FEC_exc_estim( * Total excitation *-----------------------------------------------------------------*/ -#ifdef NONBE_FIX_GSC_BSTR if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->inactive_coder_type_flag && !st->Opt_AMR_WB ) -#else - if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= MAX_GSC_INACTIVE_BRATE && !st->Opt_AMR_WB ) -#endif { /* For GSC - the excitation is already computed */ mvr2r( exc, exc2, st->L_frame ); diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index d002403eb912f828ccb7dec0cfd27e6d8fa975f0..46a3ec30142fe5b653d1fdd4109129df8df1c79f 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -613,19 +613,11 @@ ivas_error acelp_core_dec( nb_bits = -1; } -#ifdef NONBE_FIX_GSC_BSTR 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, st->inactive_coder_type_flag, 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, st->active_cnt, 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 ) { -#ifdef NONBE_FIX_GSC_BSTR 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, TRANSITION, -1, 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, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } } @@ -847,11 +839,7 @@ ivas_error acelp_core_dec( * Apply energy matching when switching to inactive frames *-----------------------------------------------------------------*/ -#ifdef NONBE_FIX_GSC_BSTR inact_switch_ematch( exc2, dct_exc_tmp, st->hGSCDec->lt_ener_per_band, st->coder_type, st->inactive_coder_type_flag, st->L_frame, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); -#else - inact_switch_ematch( exc2, dct_exc_tmp, st->hGSCDec->lt_ener_per_band, st->coder_type, st->L_frame, st->total_brate, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); -#endif /*------------------------------------------------------------* * Decode information and modify the excitation signal of stationary unvoiced frames @@ -987,11 +975,7 @@ ivas_error acelp_core_dec( } /* Apply energy matching when switching to inactive frames */ -#ifdef NONBE_FIX_GSC_BSTR inact_switch_ematch( exc2, dct_exc_tmp, st->hGSCDec->lt_ener_per_band, st->coder_type, st->inactive_coder_type_flag, st->L_frame, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); -#else - inact_switch_ematch( exc2, dct_exc_tmp, st->hGSCDec->lt_ener_per_band, st->coder_type, st->L_frame, st->total_brate, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); -#endif /* update past excitation signals for LD music post-filter */ if ( st->hMusicPF != NULL ) { diff --git a/lib_dec/acelp_core_switch_dec.c b/lib_dec/acelp_core_switch_dec.c index 16a3c5be2e82c67fefeceb43e10965a732818f94..cedc755794b31f49007bbf96e6b590901b2b811c 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 NONBE_FIX_GSC_BSTR config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, st->inactive_coder_type_flag, -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, st->active_cnt, 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/dec_gen_voic.c b/lib_dec/dec_gen_voic.c index 978b7c036a58a82559c88d97ecd057fcc5f40fa0..06dd4f2f055d9d7d6e51dda1a828fb46ffab8f6d 100644 --- a/lib_dec/dec_gen_voic.c +++ b/lib_dec/dec_gen_voic.c @@ -174,11 +174,7 @@ ivas_error decod_gen_voic( * Transform-domain contribution decoding (inactive frames) *-----------------------------------------------------------------*/ -#ifdef NONBE_FIX_GSC_BSTR if ( !st->inactive_coder_type_flag && st->coder_type == INACTIVE ) -#else - if ( st->total_brate >= MAX_GSC_INACTIVE_BRATE && st->coder_type == INACTIVE ) -#endif { transf_cdbk_dec( st, 0, i_subfr, Es_pred, gain_code, &gain_preQ, &norm_gain_preQ, code_preQ, unbits ); } diff --git a/lib_dec/gs_dec.c b/lib_dec/gs_dec.c index 4d019f80a0172bdfb67bf9e1058cbb9e22bf8805..a04a8c6837f196f0d06fea3cb2bf330b8904361f 100644 --- a/lib_dec/gs_dec.c +++ b/lib_dec/gs_dec.c @@ -111,11 +111,7 @@ void decod_audio( } /* set bit-allocation */ -#ifdef NONBE_FIX_GSC_BSTR 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, st->inactive_coder_type_flag, -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, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif /*---------------------------------------------------------------* * Decode energy dynamics diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 975e39a6f610b76f0cdfc7af093a3a4b5da10c8f..acb094019f76d5bc8497d42d854c9f3a2831a88e 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -40,9 +40,7 @@ #include "ivas_rom_dec.h" #include "wmc_auto.h" #include "prot.h" -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL #include "basop_settings.h" -#endif /*-----------------------------------------------------------------------* @@ -102,11 +100,7 @@ static int16_t read_surround_coherence_hr( uint16_t *bitstream, int16_t *p_bit_p static int16_t read_coherence_data_hr_512( uint16_t *bitstream, int16_t *p_bit_pos, IVAS_QMETADATA *hQMetaData, const int16_t idx_dir, const int16_t nbits_coh ); static void read_stream_dct_coeffs_omasa( int16_t *q_idx, -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL Word32 *q_dct_data_fx, -#else - float *q_dct_data, -#endif const int16_t len_stream, uint16_t *bit_stream, int16_t *index, @@ -4261,11 +4255,7 @@ static void decode_combined_index( static void read_stream_dct_coeffs_omasa( int16_t *q_idx, -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL Word32 *q_dct_data_fx, -#else - float *q_dct_data, -#endif const int16_t len_stream, uint16_t *bit_stream, int16_t *index, @@ -4273,16 +4263,9 @@ static void read_stream_dct_coeffs_omasa( { int16_t sign; int16_t i, j, i_min; -#ifndef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL - float step; -#endif int16_t GR1, GR2; -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL int64_t step_fx; step_fx = STEP_M2T_FX; -#else - step = STEP_M2T; -#endif sign = 1; if ( first_line == 0 ) { @@ -4347,7 +4330,6 @@ static void read_stream_dct_coeffs_omasa( } /* deindex */ -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL q_dct_data_fx[0] = (Word32) ( ( step_fx * q_idx[0] ) >> 6 ); /* Q25 */ for ( i = 1; i < len_stream; i++ ) { @@ -4360,20 +4342,6 @@ static void read_stream_dct_coeffs_omasa( q_dct_data_fx[i] = (Word32) ( ( step_fx * ( q_idx[i] + 1 ) ) >> 7 ); /* Q25 */ } } -#else - q_dct_data[0] = q_idx[0] * step; - for ( i = 1; i < len_stream; i++ ) - { - if ( ( q_idx[i] % 2 ) == 0 ) - { - q_dct_data[i] = -( q_idx[i] >> 1 ) * step; - } - else - { - q_dct_data[i] = ( ( q_idx[i] + 1 ) >> 1 ) * step; - } - } -#endif return; } @@ -4392,13 +4360,8 @@ void ivas_omasa_decode_masa_to_total( { int16_t i, j, k; int16_t q_idx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL Word32 q_dct_data_fx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS], dct_data_tmp_fx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; -#else - float q_dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS], - dct_data_tmp[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; -#endif int16_t n_streams, len_stream; /* Setup coding parameters */ @@ -4414,16 +4377,11 @@ void ivas_omasa_decode_masa_to_total( for ( i = 0; i < n_streams; i++ ) { read_stream_dct_coeffs_omasa( &q_idx[i * len_stream], -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL &q_dct_data_fx[i * len_stream], -#else - &q_dct_data[i * len_stream], -#endif len_stream, bit_stream, index, i == 0 ); } /* inverse DCT2 transform */ -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL SWITCH( len_stream ) { case 4: @@ -4501,70 +4459,5 @@ void ivas_omasa_decode_masa_to_total( } } -#else - switch ( len_stream ) - { - case 4: - matrix_product( dct4, nblocks, nblocks, 1, q_dct_data, nblocks, 1, 0, dct_data_tmp ); - mvr2r( dct_data_tmp, q_dct_data, nblocks ); - break; - case 5: - matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); - mvr2r( dct_data_tmp, q_dct_data, nbands ); - break; - case 8: - matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); - mvr2r( dct_data_tmp, q_dct_data, nbands ); - break; - case 12: - matrix_product( dct12, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); - mvr2r( dct_data_tmp, q_dct_data, nbands ); - break; - case 20: - matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, nblocks, 0, dct_data_tmp ); - matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); /* reuse of variable*/ - break; - case 32: - matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, nblocks, 0, dct_data_tmp ); - matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); - break; - default: - printf( "Incorrect number of coefficients for OMASA.\n" ); - break; - } - - k = 0; - for ( i = 0; i < nblocks; i++ ) - { - for ( j = 0; j < nbands; j++ ) - { - masa_to_total_energy_ratio[i][j] = max( 0.0f, q_dct_data[k] ); - masa_to_total_energy_ratio[i][j] = min( 1.0f, masa_to_total_energy_ratio[i][j] ); - k++; - } - } - - if ( nblocks == 1 ) - { - for ( i = 1; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) - { - for ( j = 0; j < nbands; j++ ) - { - masa_to_total_energy_ratio[i][j] = masa_to_total_energy_ratio[0][j]; - } - } - } - - if ( nbands == 1 ) - { - for ( j = 1; j < 5; j++ ) - { - for ( i = 0; i < nblocks; i++ ) - { - masa_to_total_energy_ratio[i][j] = masa_to_total_energy_ratio[i][0]; - } - } - } -#endif return; } diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 23a43e306102be2939afb7a1084d1889b8391396..cf43042ce0088936e8529e9e0857e51eef3d49f9 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -167,14 +167,10 @@ ivas_error acelp_core_enc( { st->Nb_ACELP_frames = 0; } -#ifdef NONBE_1279_COUNTER_OVERFLOW if ( st->Nb_ACELP_frames < MAX16B ) { st->Nb_ACELP_frames++; } -#else - st->Nb_ACELP_frames++; -#endif if ( st->L_frame == L_FRAME ) { @@ -379,11 +375,7 @@ ivas_error acelp_core_enc( if ( !nelp_mode && !ppp_mode ) { -#ifdef NONBE_FIX_GSC_BSTR 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, st->inactive_coder_type_flag, 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, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*-----------------------------------------------------------------* @@ -503,11 +495,7 @@ ivas_error acelp_core_enc( { tc_classif_enc( st->L_frame, &tc_subfr, &position, attack_flag, st->pitch[0], res ); -#ifdef NONBE_FIX_GSC_BSTR 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, st->inactive_coder_type_flag, 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, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*---------------------------------------------------------------* @@ -565,11 +553,7 @@ 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 NONBE_FIX_GSC_BSTR 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, st->inactive_coder_type_flag, 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, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif /* redo LSF quantization */ lsf_enc( st, lsf_new, lsp_new, lsp_mid, Aq, tdm_low_rate_mode, 0, NULL ); diff --git a/lib_enc/acelp_core_switch_enc.c b/lib_enc/acelp_core_switch_enc.c index d06d6cef55b1c7c3e92f0dc74aad80885235671c..b169adc8fb11f9f39e5a74217385f73831f2a6f2 100644 --- a/lib_enc/acelp_core_switch_enc.c +++ b/lib_enc/acelp_core_switch_enc.c @@ -153,11 +153,7 @@ void acelp_core_switch_enc( * Excitation encoding *----------------------------------------------------------------*/ -#ifdef NONBE_FIX_GSC_BSTR config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, st->inactive_coder_type_flag, -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, st->active_cnt, 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/dtx.c b/lib_enc/dtx.c index bc777daf6697bb15d4740c77ebddd0f17c4bbe86..8c2ec5f7ab818ffecf670560c2be72ca43d58f4f 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -66,9 +66,7 @@ #define MAX_BRATE_DTX_EVS ACELP_24k40 /* maximum bitrate to which the default DTX is applied in EVS; otherwise DTX is applied only in silence */ #define MAX_BRATE_DTX_IVAS IVAS_80k /* maximum bitrate to which the default DTX is applied in IVAS; otherwise DTX is applied only in silence */ -#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD #define DTX_THR_EVS 15 /* lp_noise threshold for DTX at higher bitrates in EVS */ // ToDo: to be removed once EVS is CR fixed -#endif /*-------------------------------------------------------------------* * Local function prototypes @@ -94,7 +92,6 @@ void dtx( DTX_ENC_HANDLE hDtxEnc = st->hDtxEnc; int16_t last_br_cng_flag, last_br_flag, br_dtx_flag; int32_t total_brate_ref; -#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD int16_t dtx_thr; dtx_thr = DTX_THR; @@ -102,7 +99,6 @@ void dtx( { dtx_thr = DTX_THR_EVS; // ToDo: to be removed once EVS is CR fixed } -#endif total_brate_ref = st->total_brate; @@ -113,18 +109,10 @@ void dtx( } else { -#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD last_br_cng_flag = st->last_total_brate_cng <= MAX_BRATE_DTX_EVS || st->lp_noise < dtx_thr || ( st->element_mode == IVAS_SCE && st->last_total_brate_cng <= MAX_BRATE_DTX_IVAS ); -#else - last_br_cng_flag = st->last_total_brate_cng <= MAX_BRATE_DTX_EVS || st->lp_noise < 15 || ( st->element_mode == IVAS_SCE && st->last_total_brate_cng <= MAX_BRATE_DTX_IVAS ); -#endif last_br_flag = ( st->element_mode == EVS_MONO && st->last_total_brate <= MAX_BRATE_DTX_EVS ) || ( st->element_mode != EVS_MONO && last_ivas_total_brate <= MAX_BRATE_DTX_IVAS ) || -#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD st->lp_noise < dtx_thr; -#else - st->lp_noise < 15; -#endif } /* Initialization */ @@ -203,11 +191,7 @@ void dtx( { br_dtx_flag = ( st->element_mode == EVS_MONO && st->total_brate <= MAX_BRATE_DTX_EVS ) || ( st->element_mode != EVS_MONO && ivas_total_brate <= MAX_BRATE_DTX_IVAS ) || -#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD st->lp_noise < dtx_thr; -#else - st->lp_noise < 15; -#endif } if ( st->Opt_DTX_ON && vad == 0 && diff --git a/lib_enc/enc_gen_voic.c b/lib_enc/enc_gen_voic.c index 0d2713b0f9fb9c4990355e0e11035c14707109e3..f05f1a87c8582f151c819db193fc59dda9b5a818 100644 --- a/lib_enc/enc_gen_voic.c +++ b/lib_enc/enc_gen_voic.c @@ -255,11 +255,7 @@ void encod_gen_voic( * Transform-domain contribution (inactive frames) *-----------------------------------------------------------------*/ -#ifdef NONBE_FIX_GSC_BSTR if ( !st->inactive_coder_type_flag && st->coder_type == INACTIVE ) -#else - if ( st->total_brate >= MAX_GSC_INACTIVE_BRATE && st->coder_type == INACTIVE ) -#endif { transf_cdbk_enc( st, 0, i_subfr, cn, exc, p_Aq, p_Aw, h1, xn, xn2, y1, y2, Es_pred, &gain_pit, gain_code, g_corr, clip_gain, &gain_preQ, code_preQ, unbits ); } diff --git a/lib_enc/ivas_core_pre_proc.c b/lib_enc/ivas_core_pre_proc.c index 026a9ff3fade05c39989e28e3bbe0189a6994b70..969e02235acb7b56bdb56cd074123ce6f470da02 100644 --- a/lib_enc/ivas_core_pre_proc.c +++ b/lib_enc/ivas_core_pre_proc.c @@ -209,11 +209,7 @@ ivas_error pre_proc_ivas( } else if ( st->total_brate > MAX_GSC_INACTIVE_BRATE && ( ( st->vad_flag == 0 && st->bwidth >= SWB && st->max_bwidth >= SWB ) || ( st->localVAD == 0 && ( st->bwidth <= WB || st->max_bwidth <= WB ) ) ) ) { -#ifdef NONBE_FIX_GSC_BSTR /* inactive frames will be coded by AVQ technology (exceptionally it can be later rewritten to GSC technology in ivas_combined_format_brate_sanity()) */ -#else - /* inactive frames will be coded by AVQ technology */ -#endif st->coder_type = INACTIVE; } diff --git a/lib_enc/ivas_ism_dtx_enc.c b/lib_enc/ivas_ism_dtx_enc.c index 7c7114d6ea7f6391a0e286d78dab317fa637f9af..77bdd62711fdb7684233175adb5d10ad188b6f90 100644 --- a/lib_enc/ivas_ism_dtx_enc.c +++ b/lib_enc/ivas_ism_dtx_enc.c @@ -155,11 +155,7 @@ int16_t ivas_ism_dtx_enc( ( nchan_ism == 2 && ivas_total_brate <= IVAS_48k ) || ( nchan_ism == 3 && ivas_total_brate <= IVAS_80k ) || ( nchan_ism == 4 && ivas_total_brate <= IVAS_96k ) || -#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD lp_noise_max < DTX_THR ) ) -#else - lp_noise_max < 15 ) ) -#endif { dtx_flag = 0; } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index cb2a743885a38af35e7859daf4441a4856c5f970..a8c224d1768aabfe47aa0117aa0a9393e1181c01 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -276,9 +276,7 @@ ivas_error ivas_ism_metadata_enc( } else if ( hIsmMeta[ch]->ism_md_fec_cnt_enc == ISM_MD_FEC_CNT_MAX ) { -#ifdef NONBE_1273_ISM_METADATA_COUNTER hIsmMeta[ch]->ism_md_fec_cnt_enc = 0; -#endif lowrate_metadata_flag[ch] = 1; hIsmMeta[ch]->position_angle.angle1_diff_cnt = ISM_FEC_MAX; @@ -558,9 +556,7 @@ ivas_error ivas_ism_metadata_enc( if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { hIsmMeta[ch]->ism_md_fec_cnt_enc++; -#ifdef NONBE_1273_ISM_METADATA_COUNTER hIsmMeta[ch]->ism_md_fec_cnt_enc = min( hIsmMeta[ch]->ism_md_fec_cnt_enc, ISM_MD_FEC_CNT_MAX ); -#endif } else { @@ -705,9 +701,7 @@ ivas_error ivas_ism_metadata_enc( if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { hIsmMeta[ch]->ism_md_fec_cnt_enc++; -#ifdef NONBE_1273_ISM_METADATA_COUNTER hIsmMeta[ch]->ism_md_fec_cnt_enc = min( hIsmMeta[ch]->ism_md_fec_cnt_enc, ISM_MD_FEC_CNT_MAX ); -#endif } else { diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 87a921b69ba6b7571cb32c964f2dab76d0d501bf..7d0b44f5996134c1b2da080085b36b5e040ea635 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -41,9 +41,7 @@ #include "ivas_stat_enc.h" #include "wmc_auto.h" #include "prot.h" -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL #include "basop_settings.h" -#endif /*-----------------------------------------------------------------------* * Local function prototypes @@ -6040,13 +6038,11 @@ void ivas_omasa_encode_masa_to_total( int16_t bits_pos, nb_bits; int16_t n_streams, len_stream; -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL Word32 q_dct_data_fx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS], dct_data_tmp_fx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; int64_t step_fx; step_fx = STEP_M2T_FX; -#endif #ifdef DEBUG_MODE_QMETADATA static FILE *pF = NULL; static FILE *pF_ratio = NULL; @@ -6155,7 +6151,6 @@ void ivas_omasa_encode_masa_to_total( } /* reconstruct masa2total */ -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL q_dct_data_fx[0] = (Word32) ( ( step_fx * q_idx[0] ) >> 6 ); // Q25 for ( i = 1; i < len_stream; i++ ) { @@ -6245,67 +6240,6 @@ void ivas_omasa_encode_masa_to_total( } } -#else - q_dct_data[0] = q_idx[0] * step; - for ( i = 1; i < len_stream; i++ ) - { - if ( ( q_idx[i] % 2 ) == 0 ) - { - q_dct_data[i] = -( q_idx[i] >> 1 ) * step; - } - else - { - q_dct_data[i] = ( ( q_idx[i] + 1 ) >> 1 ) * step; - } - } - - /* inverse DCT2 transform */ - switch ( len_stream ) - { - case 4: - matrix_product( dct4, nblocks, nblocks, 1, q_dct_data, nblocks, 1, 0, dct_data_tmp ); - mvr2r( dct_data_tmp, q_dct_data, nblocks ); - break; - case 5: - matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); - mvr2r( dct_data_tmp, q_dct_data, nbands ); - break; - case 8: - matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); - mvr2r( dct_data_tmp, q_dct_data, nbands ); - break; - case 12: - matrix_product( dct12, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); - mvr2r( dct_data_tmp, q_dct_data, nbands ); - break; - case 20: - matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, nblocks, 0, dct_data_tmp ); - matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); /* reuse of variable*/ - break; - case 32: - matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, nblocks, 0, dct_data_tmp ); - matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); - break; - default: - printf( "Incorrect number of coefficients for OMASA.\n" ); - break; - } - - k = 0; - for ( i = 0; i < nblocks; i++ ) - { - for ( j = 0; j < nbands; j++ ) - { - masa_to_total_energy_ratio[i][j] = max( 0.0f, q_dct_data[k] ); - masa_to_total_energy_ratio[i][j] = min( 1.0f, masa_to_total_energy_ratio[i][j] ); -#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL - int_tmp = (int32_t) ( MASA_SUR_COH_PRECISION * masa_to_total_energy_ratio[i][j] ); - masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA_SUR_COH_THRESHOLD ); -#endif - k++; - } - } -#endif assert( nb_bits == ( hMetaData->nb_bits_tot - bits_pos ) ); #ifdef DEBUG_MODE_QMETADATA diff --git a/lib_enc/transition_enc.c b/lib_enc/transition_enc.c index e2be62f565689bca3203d0a89c7fb25542169dcc..016f5ba0fa970a193b91f59be5016f43b16dd019 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 NONBE_FIX_GSC_BSTR 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, -1, 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, st->active_cnt, 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 NONBE_FIX_GSC_BSTR 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, -1, *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, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#endif } /*-----------------------------------------------------------------*