Commit 4a4df078 authored by eichenseer's avatar eichenseer
Browse files

Merge branch 'main' into b20220920_ParamISM_DTX_CNG

parents 1ac6d996 f925ad10
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -223,8 +223,12 @@ ivas_error pre_proc_front_ivas(
    const int16_t front_vad_flag,                               /* i  : front-VAD flag to overwrite VAD decision   */
    const int16_t force_front_vad,                              /* i  : flag to force VAD decision                 */
    const int16_t front_vad_dtx_flag,                           /* i  : front-VAD DTX flag to overwrite VAD decision*/
#ifdef LOW_RATE_TRANS_CORE_CODER
    const int32_t ivas_total_brate                             /* i  : IVAS total bitrate                         */
#else
    const int32_t ivas_total_brate,                             /* i  : IVAS total bitrate                         */
    const int16_t ivas_format                                   /* i  : IVAS format                                */
#endif
);

ivas_error pre_proc_ivas(
+5 −1
Original line number Diff line number Diff line
@@ -148,6 +148,8 @@
#endif


#define LOW_RATE_TRANS_CORE_CODER                       /* Eri: Activate low-rate-encoding-of-transients contribution for core coder, affects MC, MASA and SBA */

#define FIX_197_CREND_INTERFACE 

#define FIX_MEMORY_COUNTING_HRTF_BINARY_FILE
@@ -163,7 +165,9 @@

#define FIX_343_TO_UPPER                                /* VA: issue 343: safeguard for function to_upper() */

#define PARAM_ISM_DTX_CNG                               /* Support of DTX/CNG for Param-ISM, includes updates */ 
#define FIX_107_5MS_SUBFRAME_RENDERING

#define PARAM_ISM_DTX_CNG

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+4 −0
Original line number Diff line number Diff line
@@ -138,6 +138,9 @@ ivas_error ivas_dirac_dec_init_binaural_data(
    set_zero( hBinaural->ChCrossImOutPrev, nBins );
    hBinaural->renderStereoOutputInsteadOfBinaural = 0;

#ifdef FIX_107_5MS_SUBFRAME_RENDERING
    hBinaural->useSubframeMode = 1;
#else
    if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR ) /* Use subframe-mode with SPAR, since the metadata is not in sync on a frame level */
    {
        hBinaural->useSubframeMode = 1;
@@ -150,6 +153,7 @@ ivas_error ivas_dirac_dec_init_binaural_data(
        hBinaural->useSubframeMode = 0; /* Default to 20 ms mode. */
#endif
    }
#endif

    hBinaural->useTdDecorr = 0;
    if ( st_ivas->ivas_format == SBA_FORMAT )
+13 −3
Original line number Diff line number Diff line
@@ -107,8 +107,14 @@ ivas_error pre_proc_front_ivas(
    const int16_t front_vad_flag,                              /* i  : front-VAD flag to overwrite VAD decision */
    const int16_t force_front_vad,                             /* i  : flag to force VAD decision               */
    const int16_t front_vad_dtx_flag,                          /* i  : front-VAD DTX flag to overwrite VAD decision*/
#ifdef LOW_RATE_TRANS_CORE_CODER
    const int32_t ivas_total_brate /* i  : IVAS total bitrate - for setting the DTX */
#else
    const int32_t ivas_total_brate, /* i  : IVAS total bitrate - for setting the DTX */
    const int16_t ivas_format )
    const int16_t ivas_format       /* i  : IVAS format                              */
#endif

)
{
    float *inp_12k8, *new_inp_12k8;        /* pointers to current frame and new data       */
    float *wsp;                            /* weighted input signal buffer                 */
@@ -805,7 +811,11 @@ ivas_error pre_proc_front_ivas(
            }
        }
        /* Switch to ACELP for non-harmonic transient signals */
#ifdef LOW_RATE_TRANS_CORE_CODER
        else if ( ( ( element_mode >= IVAS_CPE_DFT && element_brate <= IVAS_16k4 ) || ( element_mode == IVAS_SCE && element_brate < SCE_SMC_THR ) ) && ( loc_harm[0] != 1 ) && smc_dec == MUSIC )
#else
        else if ( ( ( ivas_format == STEREO_FORMAT && element_brate <= IVAS_16k4 ) || ( ivas_format == ISM_FORMAT && element_brate < SCE_SMC_THR ) ) && ( loc_harm[0] != 1 ) && smc_dec == MUSIC )
#endif
        {
            if ( element_mode == IVAS_SCE )
            {
@@ -820,7 +830,7 @@ ivas_error pre_proc_front_ivas(
                {
                    if ( smc_dec != SPEECH && transient_analysis( hCPE->hCoreCoder[i]->hTranDet, st->hNoiseEst->cor_map, st->hNoiseEst->multi_harm_limit ) )
                    {
                        smc_dec = SPEECH; /* overwrite initial music decision, intial SPEECH_MUSIC never changed */
                        smc_dec = SPEECH; /* overwrite initial music decision, initial SPEECH_MUSIC never changed */
                    }
                }
            }
+8 −0
Original line number Diff line number Diff line
@@ -433,11 +433,19 @@ ivas_error ivas_cpe_enc(

    for ( n = 0; n < n_CoreChannels; n++ )
    {
#ifdef LOW_RATE_TRANS_CORE_CODER
        error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n],
                                     &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n],
                                     &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n],
                                     fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0,
                                     ivas_total_brate );
#else
        error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n],
                                     &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n],
                                     &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n],
                                     fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0,
                                     ivas_total_brate, st_ivas->hEncoderConfig->ivas_format );
#endif
        if ( error != IVAS_ERR_OK )
        {
            return error;
Loading