diff --git a/lib_com/options.h b/lib_com/options.h index d61b63fcf043335f7c1a328ecbef20bd775041c6..322d0e8fe5497e8bd60102a3a020eb0e900917d5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -111,6 +111,7 @@ #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 */ +#define FIX_1381_BWD /* VA: issue 1381: apply no hysteresis in BWD at higher bitrates also in mono MASA and OMASA */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/bw_detect_fx.c b/lib_enc/bw_detect_fx.c index 33e00aae1d6b6422ac3c30b6b12fb977f629615e..37b79491af007c7ba64d5e1b4da19d3027ece980 100644 --- a/lib_enc/bw_detect_fx.c +++ b/lib_enc/bw_detect_fx.c @@ -16,7 +16,11 @@ /*-------------------------------------------------------------------* * Local constants *-------------------------------------------------------------------*/ + #define BWD_MIN_BRATE_WIDER_BW_MDCT IVAS_48k +#ifdef FIX_1381_BWD +#define BWD_MIN_BRATE_WIDER_BW_MASA IVAS_48k +#endif #define BWD_MIN_BRATE_WIDER_BW_ISM IVAS_32k #define BWD_MAX_BRATE_WIDER_BW_MDCT IVAS_80k #define BWD_MAX_BRATE_WIDER_BW_ISM IVAS_64k @@ -28,8 +32,6 @@ #define BWD_COUNT_WIDER_BW 10 #define BWD_COUNT_WIDER_BW_MDCT 0 -#define BWD_N_BINS_MAX 13 - #define CLDFB_ENER_OFFSET_FX 26214 /* 1.6 in Q14 */ /*-------------------------------------------------------------------* @@ -40,8 +42,8 @@ void bw_detect_fx( Encoder_State *st, /* i/o: Encoder State */ - const Word16 signal_in[], /* i : input signal */ - Word16 *spectrum, /* i : MDCT spectrum Q_spec */ + const Word16 signal_in[], /* i : input signal */ + Word16 *spectrum, /* i : MDCT spectrum Q_spec */ const Word32 *enerBuffer, /* i : CLDFB Energy Q31 */ const Word16 *cldfbBuf_Ener_Exp, /* i : CLDFB Energy Exponent */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ @@ -75,12 +77,22 @@ void bw_detect_fx( test(); test(); test(); +#ifdef FIX_1381_BWD + test(); + test(); +#endif if ( st->ini_frame > 0 && ( ( EQ_16( st->element_mode, IVAS_CPE_MDCT ) && ( GE_32( st->element_brate, BWD_MIN_BRATE_WIDER_BW_MDCT ) || mct_on ) ) || +#ifdef FIX_1381_BWD + ( st->is_ism_format && GE_32( st->element_brate, BWD_MIN_BRATE_WIDER_BW_ISM ) ) || + ( EQ_16( ivas_format, MASA_FORMAT ) && GE_32( st->element_brate, BWD_MIN_BRATE_WIDER_BW_MASA ) ) ) ) +#else ( EQ_16( ivas_format, ISM_FORMAT ) && GE_32( st->element_brate, BWD_MIN_BRATE_WIDER_BW_ISM ) ) ) ) +#endif { bwd_count_wider_bw = BWD_COUNT_WIDER_BW_MDCT; move16(); } + IF( GT_32( st->input_Fs, 8000 ) ) {