Commit 6bb8ff81 authored by fotopoulou's avatar fotopoulou
Browse files

Merge branch 'main' into dft_stereo_improvement_for_very_large_itds

parents 1f6f5459 cc3db8fc
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -885,6 +885,9 @@ enum fea_names
#define MDCT_ST_PLC_FADEOUT_MIN_NOISE_NRG       0.001f
#define MDCT_ST_PLC_FADEOUT_MAX_CONC_FRAME      2 * FRAMES_PER_SEC
#define MDCT_ST_PLC_FADEOUT_TO_ZERO_LEN         20
#ifdef FIX_MDCT_ST_PLC_FADEOUT_DELAY
#define MDCT_ST_PLC_FADEOUT_DELAY_4_LSP_FADE    3
#endif

typedef enum {
    EQUAL_CORES,
+4 −0
Original line number Diff line number Diff line
@@ -207,12 +207,16 @@

#define FIX_642											/* FhG: Fix for issue 642, buggy DoA-array access in DirAC head rotation*/

#define FIX_443_FD_CNG_INIT                             /* FhG: correct bitrate value for FD-CNG init */
#define VARIABLE_SPEED_DECODING                         /* FhG: variable speed decoding employing the JBM functioniality */
#define JBM_TSM_ON_TCS                                  /* FhG: run the TSM part of JBM on the TCs instead of the final output pcm waveforms */

#define FIX_DTX_428                                     /* FhG: fix for issue 428, crash with DTX and bitrate switching */

#define FIX_STEREO_474                                  /* FhG fix for issue 574, crash with SBA to stereo output at 512 kbps */
#define FIX_MDCT_ST_PLC_FADEOUT_DELAY

#define FIX_DIRAC_LS_SYNTHESIS_CONFIG_479               /* FhG: fix for issue 479, broken LS output with DirAC at high BRs */

#define HYBRID_ITD_MAX                                 /* FhG: Improvement for DFT-stereo for cases with large ITDs */

+20 −1
Original line number Diff line number Diff line
@@ -551,20 +551,39 @@ void con_tcx(
    mvr2r( synth - M, buf, M );
    mvr2r( buf, mem_syn, M );


    if ( A_cng != NULL )
    {
#ifdef FIX_MDCT_ST_PLC_FADEOUT_DELAY
        float alpha_delayed;

        alpha_delayed = 1.0f;
        if ( st->nbLostCmpt > MDCT_ST_PLC_FADEOUT_DELAY_4_LSP_FADE )
        {
            alpha_delayed = Damping_fact( st->core_ext_mode, st->nbLostCmpt - MDCT_ST_PLC_FADEOUT_DELAY_4_LSP_FADE, st->last_good, st->stab_fac, &( st->lp_gainp ), ACELP_CORE );
        }

        if ( st->plcBackgroundNoiseUpdated && alpha_delayed != 1.0f )
#else
        if ( st->plcBackgroundNoiseUpdated && alpha != 1.0f )
#endif
        {
            float lsp_local[M], lsp_fade[M], alpha_inv;

#ifdef FIX_MDCT_ST_PLC_FADEOUT_DELAY
            alpha_inv = 1.0f - alpha_delayed;
#else
            alpha_inv = 1.0f - alpha;
#endif

            a2lsp_stab( A_local, lsp_local, lsp_local );

            for ( i = 0; i < M; i++ )
            {
#ifdef FIX_MDCT_ST_PLC_FADEOUT_DELAY
                lsp_fade[i] = alpha_delayed * lsp_local[i] + alpha_inv * st->lspold_cng[i];
#else
                lsp_fade[i] = alpha * lsp_local[i] + alpha_inv * st->lspold_cng[i];
#endif
            }

            lsp2a_stab( lsp_fade, A_local, M );
+5 −1
Original line number Diff line number Diff line
@@ -526,7 +526,11 @@ ivas_error ivas_dirac_dec_config(
    }


    if ( nchan_transport_orig > 2 && hDirAC->hOutSetup.is_loudspeaker_setup && st_ivas->renderer_type == RENDERER_DIRAC )
    if ( nchan_transport_orig > 2 && hDirAC->hOutSetup.is_loudspeaker_setup && st_ivas->renderer_type == RENDERER_DIRAC
#ifdef FIX_DIRAC_LS_SYNTHESIS_CONFIG
         && !ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order )
#endif
    )
    {
        hDirAC->synthesisConf = DIRAC_SYNTHESIS_PSD_LS;
        hDirAC->panningConf = DIRAC_PANNING_VBAP;
+7 −0
Original line number Diff line number Diff line
@@ -563,7 +563,14 @@ ivas_error pre_proc_front_ivas(

    if ( st->hFdCngEnc != NULL && ( st->ini_frame == 0 || last_element_brate != element_brate || st->last_bwidth != st->bwidth ) )
    {
#ifdef FIX_443_FD_CNG_INIT
        int32_t total_brate;

        total_brate = ( element_mode == IVAS_SCE ) ? st->total_brate : st->bits_frame_nominal * FRAMES_PER_SEC;
        configureFdCngEnc( st->hFdCngEnc, max( st->input_bwidth, WB ), total_brate );
#else
        configureFdCngEnc( st->hFdCngEnc, max( st->input_bwidth, WB ), st->bits_frame_nominal * FRAMES_PER_SEC );
#endif
        if ( hCPE != NULL )
        {
            st->hFdCngEnc->hFdCngCom->CngBitrate = hCPE->element_brate - 1;