Commit 76a0d33f authored by korse's avatar korse
Browse files

reintroduce patches to improve DTX/CNG for Param-ISM

parent e8e1bfb6
Loading
Loading
Loading
Loading

lib_com/options.h

100644 → 100755
+9 −2
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@
/*#define DEBUG_MODE_DIRAC*/                    /* output most important DIRAC parameters to the subdirectory "res/" */
/*#define DEBUG_MODE_MDCT*/                     /* output most important MDCT parameters to the subdirectory "res/" */
/*#define DEBUG_MODE_PARAM_MC */                /* output Parametric MC paramters to the subdirectory "res/" */
/*#define DEBUG_MODE_PARAM_ISM*/                /* output Parametric ISM paramters to the subdirectory "res/" */
#define DEBUG_MODE_PARAM_ISM                /* output Parametric ISM paramters to the subdirectory "res/" */
#define DEBUG_MODE_INFO_TWEAK                   /* enable command line switch to specify subdirectory for debug info output inside "./res/" */
/*#define DEBUG_MODE_INFO_PLC */                /* define to output PLC related parameters */
/*#define DEBUG_MODE_INFO_ALLRAD*/              /* define to output generated HOA decoding mtx */
@@ -155,6 +155,13 @@

#define PARAM_ISM_DTX_CNG                               /* Support of DTX/CNG for Param-ISM */ 


#define PARAM_ISM_DTX_CNG                               /* Support of DTX/CNG for Param-ISM */ 
#ifdef PARAM_ISM_DTX_CNG
#define PARAM_ISM_DTX_CNG_STABILIZE_SW_DECISION         /* Patch to stabilize the switching decision */
#define PARAM_ISM_DTX_CNG_EST_RES_SPEC_DEC              /* Patch to estimate noise at decoder */
#endif

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+1 −1
Original line number Diff line number Diff line
@@ -2264,7 +2264,7 @@ ivas_error init_encoder(
    const int16_t interval_SID,      /* i  : interval for SID update                */
    const int16_t vad_only_flag      /* i  : flag to indicate front-VAD structure   */
#ifdef PARAM_ISM_DTX_CNG
    , const IVAS_FORMAT ivas_format
    ,const ISM_MODE ism_mode
#endif
);

+9 −1
Original line number Diff line number Diff line
@@ -512,7 +512,11 @@ ivas_error acelp_core_dec(
            }
            else
            {
#ifdef PARAM_ISM_DTX_CNG_EST_RES_SPEC_DEC
                if( st->core_brate == SID_2k40 && st->element_mode != IVAS_CPE_MDCT && st->read_sid_info)
#else
                if ( st->core_brate == SID_2k40 && st->element_mode != IVAS_CPE_MDCT )
#endif 
                {
                    FdCng_decodeSID( st );
                    *sid_bw = 0;
@@ -1114,7 +1118,11 @@ ivas_error acelp_core_dec(
                st->lp_noise = st->hFdCngDec->lp_noise;
            }

#ifdef PARAM_ISM_DTX_CNG_EST_RES_SPEC_DEC
            if (st->element_mode != IVAS_CPE_TD && !st->cng_paramISM_flag)
#else
            if ( st->element_mode != IVAS_CPE_TD )
#endif 
            {
                /*Noise estimate*/
                ApplyFdCng( syn, NULL, realBuffer, imagBuffer, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) );
+3 −0
Original line number Diff line number Diff line
@@ -743,6 +743,9 @@ ivas_error init_decoder(
    st->cng_sba_flag = 0;
#ifdef PARAM_ISM_DTX_CNG
    st->cng_paramISM_flag = 0;
#ifdef PARAM_ISM_DTX_CNG_EST_RES_SPEC_DEC
    st->read_sid_info = 1;  /* by default read the sid info from bitstream */
#endif 
#endif 


+3 −2
Original line number Diff line number Diff line
@@ -145,15 +145,16 @@ ivas_error ivas_dec(

#ifdef PARAM_ISM_DTX_CNG
            /* read the SID metadata */
            if (ivas_total_brate == IVAS_SID_5k)
            if (ivas_total_brate == IVAS_SID_5k2)
            {
                ivas_param_ism_metadata_dtx_dec(st_ivas);
                nb_bits_metadata[1] = nb_bits_metadata[0];

#ifndef PARAM_ISM_DTX_CNG_EST_RES_SPEC_DEC
                for (n = 0; n < st_ivas->nchan_transport; n++)
                {
                    st_ivas->hSCE[n]->hCoreCoder[0]->cng_paramISM_flag = 1;
                }
#endif 
            }
#endif
        }
Loading