Commit eed45821 authored by vaclav's avatar vaclav
Browse files

enable DTX for 1ISM; under DISCRETE_ISM_DTX_CNG

parent a128918e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -110,12 +110,14 @@ ivas_error ivas_ism_dtx_dec(

    ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;

#ifndef DISCRETE_ISM_DTX_CNG
    if ( st_ivas->nchan_transport == 1 )
    {
        nb_bits_metadata[0] = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC;

        return IVAS_ERR_OK;
    }
#endif

    if ( st_ivas->ism_mode == ISM_MODE_PARAM )
    {
+2 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ ivas_error ivas_ism_metadata_dec(

    push_wmops( "ism_meta_dec" );

#ifndef DISCRETE_ISM_DTX_CNG
    if ( ism_total_brate == IVAS_SID_5k2 || ism_total_brate == FRAME_NO_DATA )
    {
        /* no metadata decoding in CNG */
@@ -189,6 +190,7 @@ ivas_error ivas_ism_metadata_dec(
        pop_wmops();
        return error;
    }
#endif

    /* initialization */
    st0 = hSCE[0]->hCoreCoder[0];
+6 −6
Original line number Diff line number Diff line
@@ -85,7 +85,9 @@ ivas_error ivas_ism_enc(
    float Etot_LR[1];                                                              /* total energy; correlation shift              */
    float lf_E[1][2 * VOIC_BINS];                                                  /* per bin spectrum energy in lf                */
    int16_t localVAD_HE_SAD[1];                                                    /* local HE VAD */
#ifndef DISCRETE_ISM_DTX_CNG
    int16_t i, nBits;
#endif
#ifdef PARAM_ISM_DTX_CNG
#ifdef DISCRETE_ISM_DTX_CNG
    int16_t num_obj, dtx_flag, sid_flag, flag_noisy_speech;
@@ -213,7 +215,7 @@ ivas_error ivas_ism_enc(
     *-----------------------------------------------------------------*/

#ifdef DISCRETE_ISM_DTX_CNG
    if ( st_ivas->hEncoderConfig->Opt_DTX_ON && num_obj > 1 ) // VE!!!!! keep bitexactness for 1ISM case for now
    if ( st_ivas->hEncoderConfig->Opt_DTX_ON )
#else
    if ( st_ivas->hEncoderConfig->Opt_DTX_ON && st_ivas->ism_mode == ISM_MODE_PARAM )
#endif
@@ -334,19 +336,16 @@ ivas_error ivas_ism_enc(
    st = st_ivas->hSCE[0]->hCoreCoder[0];

#ifdef DISCRETE_ISM_DTX_CNG
    if ( st->core_brate == SID_2k40 || sid_flag ) // VE!!!!! to be simplified
    if ( sid_flag )
#else
    if ( st->core_brate == SID_2k40 )
#endif
    {
        ivas_write_format_sid( st_ivas->hEncoderConfig->ivas_format, IVAS_SCE, st->hBstr );

#ifndef DISCRETE_ISM_DTX_CNG
#ifdef PARAM_ISM_DTX_CNG
#ifdef DISCRETE_ISM_DTX_CNG
        if ( num_obj == 1 ) // VE!!!!! keep bitexactness for 1ISM case for now
#else
        if ( st_ivas->ism_mode != ISM_MODE_PARAM )
#endif
#endif
        {
            /* write unused bits */
@@ -358,6 +357,7 @@ ivas_error ivas_ism_enc(
                nBits -= i;
            }
        }
#endif
    }

    /*------------------------------------------------------------------*
+2 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ ivas_error ivas_ism_metadata_enc(
        return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: incorrect ISM mode" );
    }

#ifndef DISCRETE_ISM_DTX_CNG
    if ( num_obj == 1 && ( hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 || hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA ) && ism_mode == ISM_MODE_DISC )
    {
        /* no metadata encoding in CNG */
@@ -191,6 +192,7 @@ ivas_error ivas_ism_metadata_enc(

        return error;
    }
#endif

    /* initialization */
    ism_metadata_flag_global = 0;