diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 556da0d14196131be5b7eb2fb21dde24c2a7236d..949a5ea09f444ddc583e318ddf34c46029134529 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -750,6 +750,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 */ diff --git a/lib_com/options.h b/lib_com/options.h index c7111f22ab1d23e4ce71b989b4ad4934f58f22a4..cc3f12cbf563323a4dfdcbb1b3283355e97ce414 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -178,6 +178,8 @@ #define FIX_920_IGF_INIT_ERROR /* FhG: issue 920: fix bitrate mismatch in initial IGF config to avoid error message in same cases */ #define NONBE_1273_ISM_METADATA_COUNTER /* VA: FLP issue 1273: fix counter overflow in ISM metadata encoder */ #define NONBE_FIX_GSC_BSTR /* VA: issue 1264 FLP (1189 BASOP): Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */ +#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 */ + /* #################### End FIXES switches ############################ */ diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index c1e842e589a35df5626844bfaa2c84fda9d2758a..449678bd0825bab4b263183f39db08a070e63acb 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -65,6 +65,11 @@ #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 +#endif + /*-------------------------------------------------------------------* * Local function prototypes *-------------------------------------------------------------------*/ @@ -92,6 +97,15 @@ void dtx( int16_t last_br_cng_flag, last_br_flag, br_dtx_flag; #ifdef NONBE_1211_DTX_BR_SWITCHING 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; #endif @@ -106,11 +120,19 @@ 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 #ifdef NONBE_1211_DTX_BR_SWITCHING 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 #else last_br_flag = st->last_total_brate <= MAX_BRATE_DTX_EVS || st->lp_noise < 15 || ( st->element_mode == IVAS_SCE && st->last_total_brate <= MAX_BRATE_DTX_IVAS ); br_dtx_flag = 0; @@ -195,7 +217,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 && diff --git a/lib_enc/ivas_ism_dtx_enc.c b/lib_enc/ivas_ism_dtx_enc.c index 1277d0d887fccdf689c89162c3f9469db876ee68..04d656765db0f8b2e91d463ce13b9c24bbf93e3e 100644 --- a/lib_enc/ivas_ism_dtx_enc.c +++ b/lib_enc/ivas_ism_dtx_enc.c @@ -155,7 +155,11 @@ int16_t ivas_ism_dtx_enc( ( nchan_ism == 2 && ivas_total_brate <= IVAS_48k ) || ( nchan_ism == 3 && ivas_total_brate <= IVAS_80k ) || ( nchan_ism == 4 && ivas_total_brate <= IVAS_96k ) || +#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD + lp_noise_max < DTX_THR ) ) +#else lp_noise_max < 15 ) ) +#endif { dtx_flag = 0; }