Commit 8056dfd7 authored by vaclav's avatar vaclav
Browse files

Merge branch 'float-1381-bandwidth-detector-in-mono-MASA' into 'main'

Fix bandwidth detector in mono MASA

See merge request !2665
parents 6c202ef2 c46f275a
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -113,6 +113,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 ########################### */

+16 −4
Original line number Diff line number Diff line
@@ -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 */

/*-------------------------------------------------------------------*
@@ -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 ) )
    {