diff --git a/lib_com/options.h b/lib_com/options.h index 52ae37685e24a3cd62161254e6010b8b5613fd37..ee8c6be3a9aa0af714ecc976f86e5934592bbd16 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -101,6 +101,7 @@ #define FIX_2264_OUT_OF_BOUND_READING_IN_LOG2_NORM_LC /* VA: Fix issue 2264 by adding a proper safeguard in log2 and by adding a missing normalization in swb_pre_proc_ivas_fx()*/ #define FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT /* Dolby: Issue 2250: random vector generation in GenShapedSHBExcitation() */ #define FIX_2254_IMPROV_PRECISION_OR_COMPLEXITY_NON_BE /* VA: Precision improvement without increasing complexity, or complexity reduction that might be not BE on the LSB */ +#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_fx.c b/lib_dec/decision_matrix_dec_fx.c index 1bd406e7a78568ba835ccb8a98d87b0a998fddfd..cddc163147a47c1fed76a5905838b3a80495613c 100644 --- a/lib_dec/decision_matrix_dec_fx.c +++ b/lib_dec/decision_matrix_dec_fx.c @@ -76,10 +76,19 @@ void decision_matrix_dec_fx( move16(); tmp16 = get_next_indice_fx( st, 1 ); // Q0 +#ifdef FIX_2252_TD_CNG_STARTS_SID + IF( EQ_16( tmp16, 1 ) ) +#else if ( EQ_16( tmp16, 1 ) ) +#endif { st->L_frame = L_FRAME16k; move16(); +#ifdef FIX_2252_LP_CNG_STARTS_SID + st->nb_subfr = NB_SUBFR16k; + move16(); + st->bwidth = s_max( st->bwidth, WB ); +#endif } } ELSE diff --git a/lib_dec/init_dec_fx.c b/lib_dec/init_dec_fx.c index 66c49d77699add7903c68ea01f54b65288b38078..baed0184c7db78a367d394b85175e190c88beab3 100644 --- a/lib_dec/init_dec_fx.c +++ b/lib_dec/init_dec_fx.c @@ -91,12 +91,36 @@ ivas_error init_decoder_fx( move16(); st_fx->ini_frame = 0; move16(); +#ifdef FIX_2252_LP_CNG_STARTS_SID + IF( st_fx->element_mode == EVS_MONO ) + { + st_fx->bwidth = NB; + move16(); + st_fx->last_bwidth = NB; + move16(); + } + ELSE + { +#if 0 // keep deactivated for the moment to keep BE + st_fx->bwidth = WB; + move16(); + st_fx->last_bwidth = WB; +#else + st_fx->bwidth = NB; + move16(); + st_fx->last_bwidth = NB; +#endif + move16(); + } +#else st_fx->bwidth = NB; move16(); st_fx->last_bwidth = NB; move16(); +#endif st_fx->extl_brate = 0; move16(); + st_fx->coder_type = GENERIC; /* low-rate mode flag */ move16(); st_fx->last_coder_type = GENERIC; diff --git a/lib_dec/ivas_decision_matrix_dec_fx.c b/lib_dec/ivas_decision_matrix_dec_fx.c index 4ba2a386af868d3e2704f59ad6af93f1bc593e0b..fadd9d008a8a9fede030a54c86ebc8e2b76fce76 100644 --- a/lib_dec/ivas_decision_matrix_dec_fx.c +++ b/lib_dec/ivas_decision_matrix_dec_fx.c @@ -115,6 +115,11 @@ void ivas_decision_matrix_dec_fx( { st->L_frame = L_FRAME16k; move16(); +#ifdef FIX_2252_LP_CNG_STARTS_SID + st->nb_subfr = NB_SUBFR16k; + move16(); + st->bwidth = s_max( st->bwidth, WB ); +#endif } ELSE {