Commit 4d62c947 authored by vaclav's avatar vaclav
Browse files

Merge branch 'discISM_DTX' of https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec into discISM_DTX

parents e9b09282 b6de7037
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -171,6 +171,9 @@

#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 */
#ifdef DISCRETE_ISM_DTX_CNG
#define FORCE_EST                                       /* FhG: force ACELP noise estimation in ISM mode for first 100 frames to prevent all-zero CNG */
#endif


/* ################## End DEVELOPMENT switches ######################### */
+12 −0
Original line number Diff line number Diff line
@@ -413,6 +413,7 @@ void ApplyFdCng(
            hFdCngCom->sid_frame_counter = 0;
            /* set noise estimation inactive during concealment, as no update with noise generated by concealment should be performed. */
            /* set noise estimation inactive when we have bit errors, as no update with noise generated by corrupt frame (biterror) should be performed. */
#ifndef FORCE_EST
            if ( concealWholeFrame == 0 &&
                 ( timeDomainInput == NULL ||
                   ( *timeDomainInput<FLT_MAX && * timeDomainInput>( -FLT_MAX ) &&
@@ -422,6 +423,17 @@ void ApplyFdCng(
                     !( st->cng_type == LP_CNG && hFdCngDec->flag_dtx_mode ) && ( is_music == 0 ) ) ||
                   ( st->element_mode == IVAS_CPE_TD ) ) &&
                 ( !st->BER_detect ) )
#else
            if ( concealWholeFrame == 0 &&
                 ( timeDomainInput == NULL ||
                   ( *timeDomainInput<FLT_MAX && * timeDomainInput>( -FLT_MAX ) &&
                     *( timeDomainInput + hFdCngCom->frameSize - 1 ) < FLT_MAX &&
                     *( timeDomainInput + hFdCngCom->frameSize - 1 ) > ( -FLT_MAX ) ) ) &&
                 ( ( ( ( st->element_mode != IVAS_CPE_TD && st->element_mode != IVAS_CPE_DFT && hFdCngDec->flag_dtx_mode ) || !st->VAD || ( st->ini_frame < 100 && st->is_ism_mode ) ) &&
                     !( st->cng_type == LP_CNG && hFdCngDec->flag_dtx_mode ) && ( is_music == 0 ) ) ||
                   ( st->element_mode == IVAS_CPE_TD ) ) &&
                 ( !st->BER_detect ) )
#endif
            {
                /* Perform noise estimation at the decoder */
                perform_noise_estimation_dec( timeDomainInput, powerSpectrum, hFdCngDec, st->element_mode, st->bwidth, L_frame, last_L_frame, st->last_core_brate, st->VAD );
+3 −0
Original line number Diff line number Diff line
@@ -742,6 +742,9 @@ ivas_error init_decoder(
    st->cng_ism_flag = 0;
    st->read_sid_info = 1; /* by default read the sid info from bitstream */
#endif
#ifdef FORCE_EST
    st->is_ism_mode = 0;
#endif


    return error;
+6 −0
Original line number Diff line number Diff line
@@ -374,6 +374,12 @@ ivas_error create_sce_dec(
    {
        return error;
    }
#ifdef FORCE_EST
    if ( st_ivas->ivas_format == ISM_FORMAT )
    {
        st->is_ism_mode = 1;
    }
#endif

    if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO )
    {
+3 −0
Original line number Diff line number Diff line
@@ -1349,6 +1349,9 @@ typedef struct Decoder_State
    int16_t cng_ism_flag; /* CNG in Param-ISM flag */
    int16_t read_sid_info;     /* For ParamISM, use the transmitted noise */
#endif
#ifdef FORCE_EST
    int16_t is_ism_mode; /* Indicator if codec operates in ISM mode */
#endif

} Decoder_State, *DEC_CORE_HANDLE;