From fadeadfe08f73b3f018c48bad97ef094dbcadce3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 19 Feb 2025 16:48:24 +0100 Subject: [PATCH 1/2] Apply DTX_THR in ISM DTX as well. --- lib_com/cnst.h | 4 ++++ lib_enc/dtx.c | 2 -- lib_enc/ivas_ism_dtx_enc.c | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 3787d63b81..eedcddc520 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -742,6 +742,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_enc/dtx.c b/lib_enc/dtx.c index 4efa8e1f63..15b1412d1c 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -68,10 +68,8 @@ #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 *-------------------------------------------------------------------*/ diff --git a/lib_enc/ivas_ism_dtx_enc.c b/lib_enc/ivas_ism_dtx_enc.c index f253e335fc..094c8dbbe9 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; } -- GitLab From 0e21195e206be8c4cf4bd355742d3d51573dca19 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 19 Feb 2025 17:08:56 +0100 Subject: [PATCH 2/2] formatting --- lib_com/cnst.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index eedcddc520..d267362628 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -743,7 +743,7 @@ typedef enum #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 */ +#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 */ -- GitLab