diff --git a/lib_com/options.h b/lib_com/options.h old mode 100644 new mode 100755 index abd3db83424efd09e89e68c6060916bb97584a7f..6d9a3633600ff18dc1766fd63cfa299d4e574928 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -185,6 +185,7 @@ #define NONBE_FIX_840_PARAMMC_RS /* FhG: Issue #840: Resolve "MC RS ParamMC hoa encoder wrongly set to zero" */ #define NONBE_FIX_826_JBM_MASA_CNA_CNG /* FhG: issue #826: Resolve "JBM MASA: CNA and CNG not in sync with non-JBM decoding" */ #define NONBE_FIX_835_JBM_PARAMUPMIX_HEADROT /* FhG: issue #835: Resolve "JBM: ParamUpmix head rotation broken" */ +#define NONBE_FIX_838_CRASH_24_4_WB /* FhG: Issue 838: fix encoder crashes for Unified Stereo and MASA 2 TC at 24.4 kbps WB due to missing IGF (re-) allocation */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 3ce250c3de3cbfc5c651535cad4b5935dd6d8ef9..b5d9d3cc6ba2f1ef8756560888e125ad27fb21a0 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -110,6 +110,9 @@ ivas_error ivas_cpe_enc( ivas_error error; int32_t cpe_brate; int32_t element_brate_ref; +#ifdef NONBE_FIX_838_CRASH_24_4_WB + int16_t last_bits_frame_nominal; +#endif error = IVAS_ERR_OK; @@ -123,6 +126,9 @@ ivas_error ivas_cpe_enc( input_Fs = hEncoderConfig->input_Fs; ivas_total_brate = hEncoderConfig->ivas_total_brate; element_brate_ref = hCPE->element_brate; +#ifdef NONBE_FIX_838_CRASH_24_4_WB + last_bits_frame_nominal = sts[0]->bits_frame_nominal; +#endif /*------------------------------------------------------------------* * Initialization - general @@ -521,7 +527,11 @@ ivas_error ivas_cpe_enc( /* IGF reconfiguration */ for ( n = 0; n < n_CoreChannels; n++ ) { +#ifdef NONBE_FIX_838_CRASH_24_4_WB + if ( ( hCPE->last_element_brate != hCPE->element_brate || hCPE->element_mode != hCPE->last_element_mode || ( hCPE->element_mode == IVAS_CPE_TD && sts[0]->bits_frame_nominal != last_bits_frame_nominal ) || sts[n]->last_bwidth != sts[n]->bwidth ) && ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) ) +#else if ( ( hCPE->last_element_brate != hCPE->element_brate || sts[n]->last_bwidth != sts[n]->bwidth ) && ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) ) +#endif { int16_t igf; igf = getIgfPresent( sts[n]->element_mode, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, sts[n]->max_bwidth, sts[n]->rf_mode );