Commit 57b44246 authored by vaclav's avatar vaclav
Browse files

issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and...

issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP; under NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD
parent cdcb9078
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -170,6 +170,7 @@

#define NONBE_FIX_GSC_BSTR                              /* VA: issue 1264: Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */
#define NONBE_1273_ISM_METADATA_COUNTER                 /* VA: issue 1273: fix counter overflow in ISM metadata encoder */
#define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD      /* VA/Eri: issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */


/* ##################### End NON-BE switches ########################### */
+28 −0
Original line number Diff line number Diff line
@@ -65,6 +65,13 @@

#define MAX_BRATE_DTX_EVS  ACELP_24k40 /* maximum bitrate to which the default DTX is applied in EVS; otherwise DTX is applied only in silence */
#define MAX_BRATE_DTX_IVAS IVAS_80k    /* maximum bitrate to which the default DTX is applied in IVAS; otherwise DTX is applied only in silence */

#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD
#define DTX_THR_EVS 15 /* lp_noise threshold for DTX at higher bitrates in EVS */ // ToDo: to be removed once EVS is CR fixed
#define DTX_THR     5                                                             /* lp_noise threshold for DTX at higher bitrates */
#endif


/*-------------------------------------------------------------------*
 * Local function prototypes
 *-------------------------------------------------------------------*/
@@ -89,6 +96,15 @@ void dtx(
    DTX_ENC_HANDLE hDtxEnc = st->hDtxEnc;
    int16_t last_br_cng_flag, last_br_flag, br_dtx_flag;
    int32_t total_brate_ref;
#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD
    int16_t dtx_thr;

    dtx_thr = DTX_THR;
    if ( st->element_mode == EVS_MONO )
    {
        dtx_thr = DTX_THR_EVS; // ToDo: to be removed once EVS is CR fixed
    }
#endif

    total_brate_ref = st->total_brate;

@@ -99,10 +115,18 @@ void dtx(
    }
    else
    {
#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD
        last_br_cng_flag = st->last_total_brate_cng <= MAX_BRATE_DTX_EVS || st->lp_noise < dtx_thr || ( st->element_mode == IVAS_SCE && st->last_total_brate_cng <= MAX_BRATE_DTX_IVAS );
#else
        last_br_cng_flag = st->last_total_brate_cng <= MAX_BRATE_DTX_EVS || st->lp_noise < 15 || ( st->element_mode == IVAS_SCE && st->last_total_brate_cng <= MAX_BRATE_DTX_IVAS );
#endif
        last_br_flag = ( st->element_mode == EVS_MONO && st->last_total_brate <= MAX_BRATE_DTX_EVS ) ||
                       ( st->element_mode != EVS_MONO && last_ivas_total_brate <= MAX_BRATE_DTX_IVAS ) ||
#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD
                       st->lp_noise < dtx_thr;
#else
                       st->lp_noise < 15;
#endif
    }

    /* Initialization */
@@ -181,7 +205,11 @@ void dtx(
    {
        br_dtx_flag = ( st->element_mode == EVS_MONO && st->total_brate <= MAX_BRATE_DTX_EVS ) ||
                      ( st->element_mode != EVS_MONO && ivas_total_brate <= MAX_BRATE_DTX_IVAS ) ||
#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD
                      st->lp_noise < dtx_thr;
#else
                      st->lp_noise < 15;
#endif
    }

    if ( st->Opt_DTX_ON && vad == 0 &&