diff --git a/lib_com/options.h b/lib_com/options.h old mode 100644 new mode 100755 index 94e2ae1529ffa58d53faca3e75596b8c4a7ae178..b127f3a41b5a31e7b86e8e874aa4c2ab076c6278 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,6 +156,7 @@ #define FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO /* VA: Fix the definition of buffers/arrays in DFT and MDCT stereo to satisfy gcc v 11.4.0 */ #define FIX_891_PARAMUPMIX_CLEANUP /* Dlb: issue 891: remove unneeded code from ParamUpmix */ #define FIX_917_LCLD_WARNINGS /* Dlb: issue 917 and 918: fix LCLD codec warnings*/ +#define FIX_920_IGF_INIT_ERROR /* FhG: issue 920: fix bitrate mismatch in initial IGF config to avoid error message in same cases */ /* #################### End BE switches ################################## */ diff --git a/lib_com/prot.h b/lib_com/prot.h index c795d97f2ea3bb299b8f4dc2277d9bffeaa22964..a0a1d8b4a321a6eae3c5899875a9492bc8740b5b 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -6760,7 +6760,10 @@ float correlation_shift( void init_coder_ace_plus( Encoder_State *st, /* i : Encoder state handle */ const int32_t last_total_brate, /* i : last total bitrate */ - const int16_t MCT_flag /* i : hMCT handle allocated (1) or not (0)*/ +#ifdef FIX_920_IGF_INIT_ERROR + const int32_t igf_brate, /* i : IGF configuration bitrate */ +#endif + const int16_t MCT_flag /* i : hMCT handle allocated (1) or not (0)*/ ); void core_coder_reconfig( diff --git a/lib_enc/core_enc_init.c b/lib_enc/core_enc_init.c old mode 100755 new mode 100644 index b307e0361d600db278ef3c98645bd9164670b172..9d61013db7eeba10827aff68b0ae17d9fc3079a3 --- a/lib_enc/core_enc_init.c +++ b/lib_enc/core_enc_init.c @@ -64,7 +64,10 @@ static void init_modes( Encoder_State *st, const int32_t last_total_brate ); void init_coder_ace_plus( Encoder_State *st, /* i : Encoder state */ const int32_t last_total_brate, /* i : last total bitrate */ - const int16_t MCT_flag /* i : hMCT handle allocated (1) or not (0) */ +#ifdef FIX_920_IGF_INIT_ERROR + const int32_t igf_brate, /* i : IGF configuration bitrate */ +#endif + const int16_t MCT_flag /* i : hMCT handle allocated (1) or not (0) */ ) { TCX_ENC_HANDLE hTcxEnc = st->hTcxEnc; @@ -154,7 +157,11 @@ void init_coder_ace_plus( if ( st->igf && st->hIGFEnc != NULL ) { +#ifdef FIX_920_IGF_INIT_ERROR + IGFEncSetMode( st->hIGFEnc, igf_brate, st->bwidth, st->element_mode, st->rf_mode ); +#else IGFEncSetMode( st->hIGFEnc, st->total_brate, st->bwidth, st->element_mode, st->rf_mode ); +#endif } else if ( st->hIGFEnc != NULL ) { diff --git a/lib_enc/core_enc_switch.c b/lib_enc/core_enc_switch.c index 44952cc1daab965d2eea5d3264c8e6889c5ab396..df81980d81c6cf06adecc67f0ef36bd2c634ed0e 100755 --- a/lib_enc/core_enc_switch.c +++ b/lib_enc/core_enc_switch.c @@ -152,7 +152,11 @@ void core_coder_mode_switch( else { st->igf = getIgfPresent( st->element_mode, st->total_brate, st->bwidth, st->rf_mode ); +#ifdef FIX_920_IGF_INIT_ERROR + init_coder_ace_plus( st, last_total_brate, st->total_brate, MCT_flag ); +#else init_coder_ace_plus( st, last_total_brate, MCT_flag ); +#endif } if ( st->igf && st->hBWE_TD != NULL ) diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index e722d835000c205114718aa84c7e05bae70d5b32..b441c2b07abc9c84280853cc5a0c4e9bab534469 100755 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -825,7 +825,11 @@ ivas_error init_encoder( set_f( st->totalNoise_increase_hist, 0.f, TOTALNOISE_HIST_SIZE ); st->totalNoise_increase_len = 0; +#ifdef FIX_920_IGF_INIT_ERROR + init_coder_ace_plus( st, st->last_total_brate, igf_brate, 0 /* initialization value */ ); +#else init_coder_ace_plus( st, st->last_total_brate, 0 /* initialization value */ ); +#endif /*-----------------------------------------------------------------* * FD-CNG encoder