diff --git a/lib_com/options.h b/lib_com/options.h index 0e6f20b90ca0886873f9ffd55c56063b7009313d..59daf40a861b119e176179d27d553536838fa14d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,7 +171,7 @@ #define FIX_1435_MOVE_STEREO_PANNING /* VA: issue 1435: do the EVS stereo panning in the renderer */ #define FIX_1454_FIX_STEREO_TO_FOA_JBM /* VA: issue 1454: fix buggy stereo to FOA in JBM */ #define FIX_1461_CNG_BW_SWITCHING /* Eri: issue 1461: Stereo parameters are not updated when SID/NODATA forces BW to stay the same */ - +#define FIX_2252_LP_CNG_STARTS_SID /* VA: issues 2251 and 2252: fix LP CNG uninitialized value in bitstream that starts with an SID */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/decision_matrix_dec.c b/lib_dec/decision_matrix_dec.c index 0cc8b6e57ce58663048f31b02b572a7a4cc93cb8..4329099e62ef5c2157c23877d5fa570458237589 100644 --- a/lib_dec/decision_matrix_dec.c +++ b/lib_dec/decision_matrix_dec.c @@ -101,6 +101,10 @@ void decision_matrix_dec( if ( get_next_indice( st, 1 ) == 1 ) { st->L_frame = L_FRAME16k; +#ifdef FIX_2252_LP_CNG_STARTS_SID + st->nb_subfr = NB_SUBFR16k; + st->bwidth = max( st->bwidth, WB ); +#endif } } else diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index c2582a22d7964ed93fae70515881292cb655cc13..f13748c54b2f6d5df47f9b9a06a42801c521867d 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -79,8 +79,26 @@ ivas_error init_decoder( st->last_total_brate_ber = -1; st->core_brate = ACELP_8k00; st->ini_frame = 0; +#ifdef FIX_2252_LP_CNG_STARTS_SID + if ( st->element_mode == EVS_MONO ) + { + st->bwidth = NB; + st->last_bwidth = NB; + } + else + { +#if 0 // keep deactivated for the moment to keep BE + st->bwidth = WB; + st->last_bwidth = WB; +#else + st->bwidth = NB; + st->last_bwidth = NB; +#endif + } +#else st->bwidth = NB; st->last_bwidth = NB; +#endif st->extl_brate = 0; st->coder_type = GENERIC; diff --git a/lib_dec/ivas_decision_matrix_dec.c b/lib_dec/ivas_decision_matrix_dec.c index 0de93e137040f1f80a626af6d5add91a57547e72..0157823adf7144cff50beb069e32d1fc55c35fbc 100644 --- a/lib_dec/ivas_decision_matrix_dec.c +++ b/lib_dec/ivas_decision_matrix_dec.c @@ -95,6 +95,10 @@ void ivas_decision_matrix_dec( if ( get_next_indice( st, 1 ) ) { st->L_frame = L_FRAME16k; +#ifdef FIX_2252_LP_CNG_STARTS_SID + st->nb_subfr = NB_SUBFR16k; + st->bwidth = max( st->bwidth, WB ); +#endif } else {