Commit 1972d64f authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Porting fix: Incorrect TNS grouping and TNS5 interleaving in Stereo MDCT core...

Porting fix: Incorrect TNS grouping and TNS5 interleaving in Stereo MDCT core when output_fs != input_fs

ivas-codec-pc/ivas-codec#1348
parent 006def7e
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@
/* ################### Start FIXES switches ########################### */

#define NONBE_FIX_864_JBM_RENDER_FRAMESIZE                    /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */

#define NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT  /* FhG: apply correct TCX5 grouping/interleaving when input_fs != output_fs */

/* #################### End FIXES switches ############################ */

+9 −0
Original line number Diff line number Diff line
@@ -1501,7 +1501,11 @@ void decoder_tcx_tns(
            hTcxCfg->tcx_last_overlap_mode = hTcxCfg->tcx_curr_overlap_mode;
        }

#ifdef NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT
        if ( ( hTcxCfg->fIsTNSAllowed && fUseTns != 0 && bfi != 1 && whitenedDomain ) || ( L_spec > L_frameTCX ) )
#else
        if ( ( hTcxCfg->fIsTNSAllowed && fUseTns != 0 && bfi != 1 ) || ( L_spec > L_frameTCX ) )
#endif
        {
            L = L_spec;
        }
@@ -1543,7 +1547,12 @@ void decoder_tcx_tns(

        if ( ( L_frame == st->L_frame >> 1 ) && st->tcxonly && isTCX5 )
        {

#ifdef NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT
            if ( st->element_mode == EVS_MONO || ( L_spec < L_frameTCX && !whitenedDomain ) ) /* todo: this is temporary to maintain EVS BE, this is a bug and should be fixed also for EVS (see issue 13) */
#else
            if ( st->element_mode == EVS_MONO || L_spec < L_frameTCX ) /* todo: this is temporary to maintain EVS BE, this is a bug and should be fixed also for EVS (see issue 13) */
#endif
            {
                tcx5TnsUngrouping( L_frameTCX >> 1, hTcxCfg->tnsConfig[0][0].iFilterBorders[0] >> 1, x, DEC );
            }