Commit 7f797b83 authored by vaclav's avatar vaclav
Browse files

limit the DTX usage in background noise to lower bitrates similarly as in...

limit the DTX usage in background noise to lower bitrates similarly as in other IVAS formats; under FIX_DTX_BRATE_LIMIT
parent 6c87f700
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -923,6 +923,9 @@ ivas_error ivas_ism_dtx_open(
int16_t ivas_ism_dtx_enc(
    ISM_DTX_HANDLE hISMDTX,                                     /* i/o: ISM DTX handle                              */
    SCE_ENC_HANDLE hSCE[MAX_SCE],                               /* i/o: SCE encoder structure                       */
#ifdef FIX_DTX_BRATE_LIMIT
    const int32_t ivas_total_brate,                             /* i  : IVAS total bitrate                          */
#endif
    const int16_t num_obj,                                      /* i  : number of objects                           */
    const int16_t nchan_transport,                              /* i  : number of transport channels                */
    int16_t vad_flag[MAX_NUM_OBJECTS],                          /* i  : VAD flag                                    */
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@


#define DISCRETE_ISM_DTX_CNG                            /* FhG/VA: contribution 15 - DTX/CNG for (discrete) ISM */

#define FIX_DTX_BRATE_LIMIT                             /* VA: limit the DTX usage in background noise to lower bitrates similarly as in other IVAS formats */


/* ################## End DEVELOPMENT switches ######################### */
+23 −2
Original line number Diff line number Diff line
@@ -107,6 +107,9 @@ ivas_error ivas_ism_dtx_open(
int16_t ivas_ism_dtx_enc(
    ISM_DTX_HANDLE hISMDTX,       /* i/o: ISM DTX handle               */
    SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure        */
#ifdef FIX_DTX_BRATE_LIMIT
    const int32_t ivas_total_brate, /* i  : IVAS total bitrate           */
#endif
    const int16_t num_obj,             /* i  : number of objects            */
    const int16_t nchan_transport,     /* i  : number of transport channels */
    int16_t vad_flag[MAX_NUM_OBJECTS], /* i  : VAD flag                     */
@@ -119,6 +122,9 @@ int16_t ivas_ism_dtx_enc(
    int16_t nBits, nBits_MD_max;
    int16_t nBits_azimuth, nBits_elevation, nBits_coh, nBits_sce_id;
    float lp_noise[MAX_NUM_OBJECTS], lp_noise_variation, lp_noise_mean;
#ifdef FIX_DTX_BRATE_LIMIT
    float lp_noise_max;
#endif
    float tmp1, tmp2;

    /* initialization */
@@ -153,6 +159,21 @@ int16_t ivas_ism_dtx_enc(
        dtx_flag = 0;
    }


#ifdef FIX_DTX_BRATE_LIMIT
    /* default DTX is applied at lower bitrates; otherwise DTX is applied only in silence */
    maximum( lp_noise, num_obj, &lp_noise_max );

    if ( !( ( num_obj == 1 && ivas_total_brate <= IVAS_24k4 ) ||
            ( num_obj == 2 && ivas_total_brate <= IVAS_48k ) ||
            ( num_obj == 3 && ivas_total_brate <= IVAS_80k ) ||
            ( num_obj == 4 && ivas_total_brate <= IVAS_96k ) ||
            lp_noise_max < 15 ) )
    {
        dtx_flag = 0;
    }
#endif

    /*------------------------------------------------------------------*
     * Reset the bitstream
     *-----------------------------------------------------------------*/
+4 −0
Original line number Diff line number Diff line
@@ -225,7 +225,11 @@ ivas_error ivas_ism_enc(

        /* analysis and decision about DTX */
#ifdef DISCRETE_ISM_DTX_CNG
#ifdef FIX_DTX_BRATE_LIMIT
        dtx_flag = ivas_ism_dtx_enc( st_ivas->hISMDTX, st_ivas->hSCE, st_ivas->hEncoderConfig->ivas_total_brate, num_obj, st_ivas->nchan_transport, vad_flag, st_ivas->hIsmMetaData, md_diff_flag, &sid_flag );
#else
        dtx_flag = ivas_ism_dtx_enc( st_ivas->hISMDTX, st_ivas->hSCE, num_obj, st_ivas->nchan_transport, vad_flag, st_ivas->hIsmMetaData, md_diff_flag, &sid_flag );
#endif
#else
        dtx_flag = ivas_ism_dtx_enc( st_ivas, &sid_flag );
#endif