Loading lib_com/bits_alloc_fx.c +84 −22 Original line number Diff line number Diff line Loading @@ -773,6 +773,9 @@ ivas_error config_acelp1( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signalling_bits, /* i : number of signalling bits */ const Word16 coder_type, /* i : coder type */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ Loading Loading @@ -1075,7 +1078,11 @@ ivas_error config_acelp1( test(); test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( coder_type == INACTIVE && !inactive_coder_type_flag ) ) #else IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( coder_type == INACTIVE && GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) #endif { *nBits_es_Pred = Es_pred_bits_tbl[BIT_ALLOC_IDX_fx( core_brate, coder_type, -1, -1 )]; move16(); Loading Loading @@ -1196,7 +1203,11 @@ ivas_error config_acelp1( { test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ #else IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) /* GSC Inactive @16kHz */ #endif { acelp_cfg->ltf_mode = FULL_BAND; move16(); Loading Loading @@ -1414,7 +1425,11 @@ ivas_error config_acelp1( acelp_cfg->fixed_cdk_index[3] = -1; move16(); } #ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) ) #else ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) ) #endif { /* pitch Q & gain Q bit-budget - part 2*/ FOR( i = 0; i < nb_subfr; i++ ) Loading Loading @@ -1478,7 +1493,11 @@ ivas_error config_acelp1( test(); test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) ) #else IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) #endif { FOR( i = 0; i < nb_subfr; i++ ) { Loading Loading @@ -1587,7 +1606,11 @@ ivas_error config_acelp1( test(); test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) ) #else IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) #endif { FOR( i = 0; i < nb_subfr; i++ ) { Loading Loading @@ -1627,7 +1650,11 @@ ivas_error config_acelp1( } } } #ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && inactive_coder_type_flag ) ) #else ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) #endif { Word32 Local_BR, Pitch_BR; Word16 Pitch_CT; Loading Loading @@ -1768,7 +1795,11 @@ ivas_error config_acelp1( test(); test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */ #else IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */ #endif { acelp_cfg->ubits = 0; move16(); Loading Loading @@ -1888,6 +1919,9 @@ ivas_error config_acelp1_IVAS( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signaling_bits, /* i : number of signaling bits */ const Word16 coder_type, /* i : coder type */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ Loading Loading @@ -2169,7 +2203,11 @@ ivas_error config_acelp1_IVAS( test(); test(); /* gain Q bit-budget - part 1 */ #ifdef NONBE_FIX_GSC_BSTR IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( coder_type == INACTIVE && !inactive_coder_type_flag ) ) #else IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && ( coder_type != INACTIVE ) && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( ( coder_type == INACTIVE ) && GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) #endif { *nBits_es_Pred = Es_pred_bits_tbl[BIT_ALLOC_IDX( core_brate, coder_type, -1, -1 )]; move16(); Loading Loading @@ -2294,7 +2332,11 @@ ivas_error config_acelp1_IVAS( { test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ #else IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) /* GSC Inactive @16kHz */ #endif { acelp_cfg->ltf_mode = FULL_BAND; move16(); Loading Loading @@ -2510,7 +2552,11 @@ ivas_error config_acelp1_IVAS( acelp_cfg->fixed_cdk_index[3] = -1; move16(); } #ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) ) #else ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) ) #endif { /* pitch Q & gain Q bit-budget - part 2*/ FOR( i = 0; i < nb_subfr; i++ ) Loading Loading @@ -2574,7 +2620,11 @@ ivas_error config_acelp1_IVAS( test(); test(); /* algebraic codebook bit-budget */ #ifdef NONBE_FIX_GSC_BSTR IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) ) #else IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) #endif { FOR( i = 0; i < nb_subfr; i++ ) { Loading Loading @@ -2675,7 +2725,11 @@ ivas_error config_acelp1_IVAS( test(); test(); /* AVQ codebook */ #ifdef NONBE_FIX_GSC_BSTR IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) ) #else IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) #endif { FOR( i = 0; i < nb_subfr; i++ ) { Loading Loading @@ -2713,7 +2767,11 @@ ivas_error config_acelp1_IVAS( } } } #ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && inactive_coder_type_flag ) ) #else ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) #endif { Word32 Local_BR, Pitch_BR; Word16 Pitch_CT; Loading Loading @@ -2854,7 +2912,11 @@ ivas_error config_acelp1_IVAS( test(); test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */ #else IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */ #endif { acelp_cfg->ubits = 0; move16(); Loading lib_com/gs_inact_switching_fx.c +15 −9 Original line number Diff line number Diff line Loading @@ -162,15 +162,17 @@ void Inac_switch_ematch_ivas_fx( Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ Word16 lt_ener_per_band[], /* i/o: Long term energy per band Q12 */ const Word16 coder_type, /* i : Coding mode */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 L_frame, /* i : Frame lenght */ #ifndef NONBE_FIX_GSC_BSTR const Word32 total_brate, /* i : total bit rate */ const Word16 Q_exc /* i : input and output format of exc2 */ , const Word16 bfi /* i : frame lost indicator */ , #endif const Word16 Q_exc, /* i : input and output format of exc2 */ const Word16 bfi, /* i : frame lost indicator */ const Word16 last_core, /* i : Last core used */ const Word16 last_codec_mode /* i : Last codec mode */ , const Word16 last_codec_mode, /* i : Last codec mode */ const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ const Word16 element_mode /* i : element mode */ ) Loading Loading @@ -222,7 +224,11 @@ void Inac_switch_ematch_ivas_fx( move16(); } } #ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( coder_type == INACTIVE ) && inactive_coder_type_flag ) #else ELSE IF( ( coder_type == INACTIVE ) && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) #endif { /* Find spectrum and energy per band for inactive frames */ edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode ); Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ #define NONBE_1211_DTX_BR_SWITCHING /* VA: port float issue 1211: fix crash in MASA DTX bitrate switching */ #define FIX_1189_GSC_IVAS_OMASA /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */ #define NONBE_1273_ISM_METADATA_COUNTER /* VA: BASOP issue 1265, FLP issue 1273: fix counter overflow in ISM metadata encoder */ #define NONBE_FIX_GSC_BSTR /* VA: issue 1264 FLP (1189 BASOP): Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */ #define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF /* FhG: fix for issue 1101: complexity of spar dec upmixer */ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_MADD_ADD_WEIGHTS /* FhG: Defines 1.0f-weight variables, uses Madd operation instead of L_add_sat */ Loading lib_com/prot.h +0 −29 Original line number Diff line number Diff line Loading @@ -7461,35 +7461,6 @@ int16_t BITS_ALLOC_config_acelp_IVAS( const int16_t nb_subfr /* i : number of subframes */ ); ivas_error config_acelp1_IVAS( 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 */ ); /*! r: ACELP16k flag */ void FEC_clas_estim( const float *syn, Loading lib_com/prot_fx.h +47 −41 Original line number Diff line number Diff line Loading @@ -4788,6 +4788,9 @@ ivas_error config_acelp1( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signalling_bits, /* i : number of signalling bits */ const Word16 coder_type, /* i : coder type */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ Loading Loading @@ -5770,10 +5773,8 @@ void Inac_swtch_ematch_fx( const Word16 coder_type, /* i : Coding mode */ const Word16 L_frame, /* i : Frame lenght */ const Word32 core_brate, /* i : Core bit rate */ const Word16 Q_exc /* i : i and output format of exc2 */ , const Word16 bfi /* i : frame lost indicator */ , const Word16 Q_exc, /* i : i and output format of exc2 */ const Word16 bfi, /* i : frame lost indicator */ const short last_core, /* i : Last core used */ const short last_codec_mode /* i : Last codec mode */ ); Loading @@ -5783,15 +5784,17 @@ void Inac_switch_ematch_ivas_fx( Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ Word16 lt_ener_per_band[], /* i/o: Long term energy per band Q12 */ const Word16 coder_type, /* i : Coding mode */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 L_frame, /* i : Frame lenght */ #ifndef NONBE_FIX_GSC_BSTR const Word32 core_brate, /* i : Core bit rate */ const Word16 Q_exc /* i : input and output format of exc2 */ , const Word16 bfi /* i : frame lost indicator */ , #endif const Word16 Q_exc, /* i : input and output format of exc2 */ const Word16 bfi, /* i : frame lost indicator */ const Word16 last_core, /* i : Last core used */ const Word16 last_codec_mode /* i : Last codec mode */ , const Word16 last_codec_mode, /* i : Last codec mode */ const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ const Word16 element_mode /* i : element mode */ ); Loading Loading @@ -11001,6 +11004,9 @@ ivas_error config_acelp1_IVAS( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signaling_bits, /* i : number of signaling bits */ const Word16 coder_type, /* i : coder type */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ Loading
lib_com/bits_alloc_fx.c +84 −22 Original line number Diff line number Diff line Loading @@ -773,6 +773,9 @@ ivas_error config_acelp1( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signalling_bits, /* i : number of signalling bits */ const Word16 coder_type, /* i : coder type */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ Loading Loading @@ -1075,7 +1078,11 @@ ivas_error config_acelp1( test(); test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( coder_type == INACTIVE && !inactive_coder_type_flag ) ) #else IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( coder_type == INACTIVE && GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) #endif { *nBits_es_Pred = Es_pred_bits_tbl[BIT_ALLOC_IDX_fx( core_brate, coder_type, -1, -1 )]; move16(); Loading Loading @@ -1196,7 +1203,11 @@ ivas_error config_acelp1( { test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ #else IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) /* GSC Inactive @16kHz */ #endif { acelp_cfg->ltf_mode = FULL_BAND; move16(); Loading Loading @@ -1414,7 +1425,11 @@ ivas_error config_acelp1( acelp_cfg->fixed_cdk_index[3] = -1; move16(); } #ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) ) #else ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) ) #endif { /* pitch Q & gain Q bit-budget - part 2*/ FOR( i = 0; i < nb_subfr; i++ ) Loading Loading @@ -1478,7 +1493,11 @@ ivas_error config_acelp1( test(); test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) ) #else IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) #endif { FOR( i = 0; i < nb_subfr; i++ ) { Loading Loading @@ -1587,7 +1606,11 @@ ivas_error config_acelp1( test(); test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) ) #else IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) #endif { FOR( i = 0; i < nb_subfr; i++ ) { Loading Loading @@ -1627,7 +1650,11 @@ ivas_error config_acelp1( } } } #ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && inactive_coder_type_flag ) ) #else ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) #endif { Word32 Local_BR, Pitch_BR; Word16 Pitch_CT; Loading Loading @@ -1768,7 +1795,11 @@ ivas_error config_acelp1( test(); test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */ #else IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */ #endif { acelp_cfg->ubits = 0; move16(); Loading Loading @@ -1888,6 +1919,9 @@ ivas_error config_acelp1_IVAS( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signaling_bits, /* i : number of signaling bits */ const Word16 coder_type, /* i : coder type */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ Loading Loading @@ -2169,7 +2203,11 @@ ivas_error config_acelp1_IVAS( test(); test(); /* gain Q bit-budget - part 1 */ #ifdef NONBE_FIX_GSC_BSTR IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( coder_type == INACTIVE && !inactive_coder_type_flag ) ) #else IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && ( coder_type != INACTIVE ) && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( ( coder_type == INACTIVE ) && GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) #endif { *nBits_es_Pred = Es_pred_bits_tbl[BIT_ALLOC_IDX( core_brate, coder_type, -1, -1 )]; move16(); Loading Loading @@ -2294,7 +2332,11 @@ ivas_error config_acelp1_IVAS( { test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ #else IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) /* GSC Inactive @16kHz */ #endif { acelp_cfg->ltf_mode = FULL_BAND; move16(); Loading Loading @@ -2510,7 +2552,11 @@ ivas_error config_acelp1_IVAS( acelp_cfg->fixed_cdk_index[3] = -1; move16(); } #ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) ) #else ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) ) #endif { /* pitch Q & gain Q bit-budget - part 2*/ FOR( i = 0; i < nb_subfr; i++ ) Loading Loading @@ -2574,7 +2620,11 @@ ivas_error config_acelp1_IVAS( test(); test(); /* algebraic codebook bit-budget */ #ifdef NONBE_FIX_GSC_BSTR IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) ) #else IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) #endif { FOR( i = 0; i < nb_subfr; i++ ) { Loading Loading @@ -2675,7 +2725,11 @@ ivas_error config_acelp1_IVAS( test(); test(); /* AVQ codebook */ #ifdef NONBE_FIX_GSC_BSTR IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) ) #else IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) #endif { FOR( i = 0; i < nb_subfr; i++ ) { Loading Loading @@ -2713,7 +2767,11 @@ ivas_error config_acelp1_IVAS( } } } #ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && inactive_coder_type_flag ) ) #else ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) #endif { Word32 Local_BR, Pitch_BR; Word16 Pitch_CT; Loading Loading @@ -2854,7 +2912,11 @@ ivas_error config_acelp1_IVAS( test(); test(); test(); #ifdef NONBE_FIX_GSC_BSTR IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */ #else IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */ #endif { acelp_cfg->ubits = 0; move16(); Loading
lib_com/gs_inact_switching_fx.c +15 −9 Original line number Diff line number Diff line Loading @@ -162,15 +162,17 @@ void Inac_switch_ematch_ivas_fx( Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ Word16 lt_ener_per_band[], /* i/o: Long term energy per band Q12 */ const Word16 coder_type, /* i : Coding mode */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 L_frame, /* i : Frame lenght */ #ifndef NONBE_FIX_GSC_BSTR const Word32 total_brate, /* i : total bit rate */ const Word16 Q_exc /* i : input and output format of exc2 */ , const Word16 bfi /* i : frame lost indicator */ , #endif const Word16 Q_exc, /* i : input and output format of exc2 */ const Word16 bfi, /* i : frame lost indicator */ const Word16 last_core, /* i : Last core used */ const Word16 last_codec_mode /* i : Last codec mode */ , const Word16 last_codec_mode, /* i : Last codec mode */ const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ const Word16 element_mode /* i : element mode */ ) Loading Loading @@ -222,7 +224,11 @@ void Inac_switch_ematch_ivas_fx( move16(); } } #ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( coder_type == INACTIVE ) && inactive_coder_type_flag ) #else ELSE IF( ( coder_type == INACTIVE ) && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) #endif { /* Find spectrum and energy per band for inactive frames */ edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode ); Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ #define NONBE_1211_DTX_BR_SWITCHING /* VA: port float issue 1211: fix crash in MASA DTX bitrate switching */ #define FIX_1189_GSC_IVAS_OMASA /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */ #define NONBE_1273_ISM_METADATA_COUNTER /* VA: BASOP issue 1265, FLP issue 1273: fix counter overflow in ISM metadata encoder */ #define NONBE_FIX_GSC_BSTR /* VA: issue 1264 FLP (1189 BASOP): Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */ #define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF /* FhG: fix for issue 1101: complexity of spar dec upmixer */ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_MADD_ADD_WEIGHTS /* FhG: Defines 1.0f-weight variables, uses Madd operation instead of L_add_sat */ Loading
lib_com/prot.h +0 −29 Original line number Diff line number Diff line Loading @@ -7461,35 +7461,6 @@ int16_t BITS_ALLOC_config_acelp_IVAS( const int16_t nb_subfr /* i : number of subframes */ ); ivas_error config_acelp1_IVAS( 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 */ ); /*! r: ACELP16k flag */ void FEC_clas_estim( const float *syn, Loading
lib_com/prot_fx.h +47 −41 Original line number Diff line number Diff line Loading @@ -4788,6 +4788,9 @@ ivas_error config_acelp1( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signalling_bits, /* i : number of signalling bits */ const Word16 coder_type, /* i : coder type */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ Loading Loading @@ -5770,10 +5773,8 @@ void Inac_swtch_ematch_fx( const Word16 coder_type, /* i : Coding mode */ const Word16 L_frame, /* i : Frame lenght */ const Word32 core_brate, /* i : Core bit rate */ const Word16 Q_exc /* i : i and output format of exc2 */ , const Word16 bfi /* i : frame lost indicator */ , const Word16 Q_exc, /* i : i and output format of exc2 */ const Word16 bfi, /* i : frame lost indicator */ const short last_core, /* i : Last core used */ const short last_codec_mode /* i : Last codec mode */ ); Loading @@ -5783,15 +5784,17 @@ void Inac_switch_ematch_ivas_fx( Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ Word16 lt_ener_per_band[], /* i/o: Long term energy per band Q12 */ const Word16 coder_type, /* i : Coding mode */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 L_frame, /* i : Frame lenght */ #ifndef NONBE_FIX_GSC_BSTR const Word32 core_brate, /* i : Core bit rate */ const Word16 Q_exc /* i : input and output format of exc2 */ , const Word16 bfi /* i : frame lost indicator */ , #endif const Word16 Q_exc, /* i : input and output format of exc2 */ const Word16 bfi, /* i : frame lost indicator */ const Word16 last_core, /* i : Last core used */ const Word16 last_codec_mode /* i : Last codec mode */ , const Word16 last_codec_mode, /* i : Last codec mode */ const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ const Word16 element_mode /* i : element mode */ ); Loading Loading @@ -11001,6 +11004,9 @@ ivas_error config_acelp1_IVAS( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signaling_bits, /* i : number of signaling bits */ const Word16 coder_type, /* i : coder type */ #ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ #endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */