Commit 7e20beb0 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_1311_fix' into 'main'

Fix for 3GPP issue 1311: BASOP encoder for 80kbps Stereo does not trigger dtx when it should [allow regression]

See merge request !1192
parents 41ec6b7e 3a1f5fa8
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@
#endif

#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_64k    /* maximum bitrate to which the default DTX is applied in IVAS; 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 */

/*-------------------------------------------------------------------*
 * Local function prototypes
@@ -107,7 +107,7 @@ void dtx_ivas_fx(
        test();
        test();
        test();
        last_br_cng_flag = LE_32( st_fx->last_total_brate_cng, ACELP_24k40 ) || LT_16( st_fx->lp_noise_fx, DTX_THR * 256 ) || ( EQ_16( st_fx->element_mode, IVAS_SCE ) && LE_32( st_fx->last_total_brate_cng, ACELP_32k ) );
        last_br_cng_flag = LE_32( st_fx->last_total_brate_cng, MAX_BRATE_DTX_EVS ) || LT_16( st_fx->lp_noise_fx, DTX_THR * 256 ) || ( EQ_16( st_fx->element_mode, IVAS_SCE ) && LE_32( st_fx->last_total_brate_cng, MAX_BRATE_DTX_IVAS ) );

        test();
        test();
@@ -118,7 +118,7 @@ void dtx_ivas_fx(
                       ( st_fx->element_mode != EVS_MONO && LE_32( last_ivas_total_brate, MAX_BRATE_DTX_IVAS ) ) ||
                       LT_16( st_fx->lp_noise_fx, DTX_THR * 256 );
#else
        last_br_flag = LE_32( st_fx->last_total_brate, ACELP_24k40 ) || LT_16( st_fx->lp_noise_fx, DTX_THR * 256 ) || ( EQ_16( st_fx->element_mode, IVAS_SCE ) && LE_32( st_fx->last_total_brate, ACELP_32k ) );
        last_br_flag = LE_32( st_fx->last_total_brate, MAX_BRATE_DTX_EVS ) || LT_16( st_fx->lp_noise_fx, DTX_THR * 256 ) || ( EQ_16( st_fx->element_mode, IVAS_SCE ) && LE_32( st_fx->last_total_brate, MAX_BRATE_DTX_IVAS ) );
        br_dtx_flag = 0;
        move16();
#endif
@@ -135,7 +135,7 @@ void dtx_ivas_fx(
        test();
        test();
        test();
        if ( ( EQ_16( st_fx->codec_mode, MODE1 ) || st_fx->Opt_AMR_WB ) && EQ_16( st_fx->element_mode, IVAS_SCE ) && EQ_16( st_fx->element_mode, IVAS_CPE_MDCT ) )
        if ( ( EQ_16( st_fx->codec_mode, MODE1 ) || st_fx->Opt_AMR_WB ) && NE_16( st_fx->element_mode, IVAS_SCE ) && NE_16( st_fx->element_mode, IVAS_CPE_MDCT ) )
        {
            st_fx->cng_type = LP_CNG;
            move16();
@@ -254,8 +254,6 @@ void dtx_ivas_fx(
        {
            st_fx->last_total_brate_cng = -1;
            move16();
            st_fx->last_rf_mode_cng = st_fx->rf_mode;
            move16();
        }
        ELSE
        {
@@ -265,6 +263,8 @@ void dtx_ivas_fx(
            move16();
            st_fx->last_codec_mode_cng = st_fx->codec_mode;
            move16();
            st_fx->last_rf_mode_cng = st_fx->rf_mode;
            move16();
        }

        IF( hDtxEnc->cnt_SID == 0 )
@@ -321,7 +321,7 @@ void dtx_ivas_fx(
            test();
            test();
            test();
            IF( ( EQ_16( st_fx->cng_type, FD_CNG ) && ( LE_32( st_fx->total_brate, ACELP_24k40 ) || ( ( st_fx->element_mode != EVS_MONO ) && LE_32( st_fx->total_brate, ACELP_32k ) ) ) ) || ( EQ_16( st_fx->element_mode, IVAS_CPE_MDCT ) ) ) /* at highest bitrates, use exclusively LP_CNG */
            IF( ( EQ_16( st_fx->cng_type, FD_CNG ) && ( 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 ) ) ) ) || ( EQ_16( st_fx->element_mode, IVAS_CPE_MDCT ) ) ) /* at highest bitrates, use exclusively LP_CNG */
            {
                test();
                test();