Commit 4efb8dc0 authored by vaclav's avatar vaclav Committed by Sandesh Venkatesh
Browse files

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

port FLP issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP; under NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD
parent c602cc48
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -932,6 +932,10 @@ typedef enum
#define GAIN_PRED_ORDER                     4                       /* Gain quantization - prediction order for gain quantizer (only for AMR-WB IO mode) */
#define MEAN_ENER                           30                      /* Gain quantization - average innovation energy */

#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD
#define DTX_THR                             5                       /* DTX - lp_noise threshold for DTX at higher bitrates */
#endif

#define DTX_HIST_SIZE                       8                       /* CNG & DTX - number of last signal frames used for CNG averaging */
#define CNG_ISF_FACT                        0.9f                    /* CNG & DTX - CNG spectral envelope smoothing factor */
#define STEP_AMR_WB_SID                     2.625f                  /* CNG & DTX - CNG energy quantization step */
+1 −0
Original line number Diff line number Diff line
@@ -170,4 +170,5 @@
#define FIX_1298                                /* VA: fix possible assert in gaus_enc */
#define FIX_1300_ICA_SHIFT_QUANT_IMPROV         /* VA: Fix to 1300 to improve precision of the lag quantizer */
#define FIX_1301_CORRECT_TD_CNST                /* VA: Fix 1301, correct wrong constant in TD stereo */
#define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD      /* VA/Eri: FLP issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */
#endif
+5 −4
Original line number Diff line number Diff line
@@ -30,8 +30,7 @@

#define CNG_TYPE_HO 20 /* hangover for switching between CNG types */

/* _DIFF_FLOAT_FIX_ : lp_noise_fx threshold is different between float (15) and fix (5*256) */
#define LP_NOISE_LV 5 /* LP_NOISE level */
#define LP_NOISE_LV DTX_THR /* LP_NOISE level */


#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 */
@@ -104,7 +103,6 @@ void dtx_ivas_fx(
    }
    ELSE
    {
        /* _DIFF_FLOAT_FIX_ : lp_noise_fx threshold is different between float (15) and fix (5*256) */
        test();
        test();
        test();
@@ -232,7 +230,11 @@ void dtx_ivas_fx(
        test();
        br_dtx_flag = ( ( st_fx->element_mode == EVS_MONO ) && LE_32( st_fx->total_brate, MAX_BRATE_DTX_EVS ) ) ||
                      ( ( st_fx->element_mode != EVS_MONO ) && LE_32( ivas_total_brate, MAX_BRATE_DTX_IVAS ) ) ||
#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD
                      LT_16( st_fx->lp_noise_fx, LP_NOISE_LV * 256 );
#else
                      LT_16( st_fx->lp_noise_fx, 3840 /*15 in Q8*/ );
#endif
    }
    test();
    test();
@@ -674,7 +676,6 @@ void dtx_fx(
    }
    ELSE
    {
        /* _DIFF_FLOAT_FIX_ : lp_noise_fx threshold is different between float (15) and fix (5*256) */
        last_br_cng_flag = LE_32( st_fx->last_total_brate_cng, ACELP_24k40 ) || LT_16( st_fx->lp_noise_fx, LP_NOISE_LV * 256 ) || ( EQ_16( st_fx->element_mode, IVAS_SCE ) && LE_32( st_fx->last_total_brate_cng, ACELP_32k ) );

        last_br_flag = LE_32( st_fx->last_total_brate, ACELP_24k40 ) || LT_16( st_fx->lp_noise_fx, LP_NOISE_LV * 256 ) || ( EQ_16( st_fx->element_mode, IVAS_SCE ) && LE_32( st_fx->last_total_brate, ACELP_32k ) );
+4 −0
Original line number Diff line number Diff line
@@ -177,7 +177,11 @@ Word16 ivas_ism_dtx_enc_fx(
            ( EQ_16( nchan_ism, 2 ) && LE_32( ivas_total_brate, IVAS_48k ) ) ||
            ( EQ_16( nchan_ism, 3 ) && LE_32( ivas_total_brate, IVAS_80k ) ) ||
            ( EQ_16( nchan_ism, 4 ) && LE_32( ivas_total_brate, IVAS_96k ) ) ||
#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD
            LT_16( lp_noise_max_fx, ( DTX_THR << 8 ) ) ) )
#else
            LT_16( lp_noise_max_fx, ( 15 << 8 ) ) ) )
#endif
    {
        dtx_flag = 0;
        move16();