Commit cd40c093 authored by fotopoulou's avatar fotopoulou
Browse files

[fix] for issue 13 under FIX_I13_TCX_TNS_ISSUE

parent 2d6706f3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2005,6 +2005,10 @@ void decoder_tcx_tns(
    const int16_t bfi,                                          /* i  : Bad frame indicator                     */
    const int16_t frame_cnt,                                    /* i  : frame counter in the super frame        */
    const int16_t whitenedDomain 
#ifdef FIX_I13_TCX_TNS_ISSUE
    ,
    const int16_t isEvsMono /*i: EVS mono flag */
#endif
);

void decoder_tcx_imdct(
+0 −1
Original line number Diff line number Diff line
@@ -149,7 +149,6 @@
#define SPAR_SCALING_HARMONIZATION                      /* Issue 80: Changes to harmonize scaling in spar */
#define SBA_INTERN_CONFIG_FIX_HOA2                      /* Issue 99 : Fix for incorrect internal_config when output format is HOA2 or FOA*/
#define FIX_I98_HANDLES_TO_NULL                         /* Issue 98: do the setting of all handles to NULL in one place */

#define FIX_I13_TCX_TNS_ISSUE                           /* Issue 13: Fix reported artifacts. Bug in TNS with TCX5 */


+4 −0
Original line number Diff line number Diff line
@@ -7885,6 +7885,10 @@ void decoder_tcx(
    const int16_t bfi,                  /* i  : Bad frame indicator                   */
    const int16_t frame_cnt,            /* i  : frame counter in the super_frame      */
    const int16_t sba_dirac_stereo_flag /* i  : signal stereo output for SBA DirAC    */
#ifdef FIX_I13_TCX_TNS_ISSUE
    ,
    const int16_t isEvsMono /*i: EVS mono flag */
#endif
);

void decoder_tcx_post(
+12 −2
Original line number Diff line number Diff line
@@ -595,7 +595,12 @@ void decoder_LPD(
        }

        /* TCX decoder */
        decoder_tcx( st, prm, Aq, Aind, &synth[0], &synthFB[0], bfi, 0, 0 );
        decoder_tcx( st, prm, Aq, Aind, &synth[0], &synthFB[0], bfi, 0, 0
#ifdef FIX_I13_TCX_TNS_ISSUE
                     ,
                     1
#endif
        );
    }

    /*--------------------------------------------------------------------------------*
@@ -621,7 +626,12 @@ void decoder_LPD(
            IGFDecRestoreTCX10SubFrameData( st->hIGFDec, k );

            /* TCX decoder */
            decoder_tcx( st, prm, Aq, Aind, &synth[k * L_frame / 2], &synthFB[k * L_frameTCX / 2], bfi, k, 0 );
            decoder_tcx( st, prm, Aq, Aind, &synth[k * L_frame / 2], &synthFB[k * L_frameTCX / 2], bfi, k, 0
#ifdef FIX_I13_TCX_TNS_ISSUE
                         ,
                         1
#endif
            );
        }
    }

+24 −3
Original line number Diff line number Diff line
@@ -68,6 +68,10 @@ void decoder_tcx(
    const int16_t bfi,                  /* i  : Bad frame indicator                    */
    const int16_t frame_cnt,            /* i  : frame counter in the super frame       */
    const int16_t sba_dirac_stereo_flag /* i  : signal stereo output for SBA DirAC     */
#ifdef FIX_I13_TCX_TNS_ISSUE
    ,
    const int16_t isEvsMono /*i: EVS mono flag */
#endif
)
{
    float x[N_MAX];
@@ -112,7 +116,12 @@ void decoder_tcx(

    decoder_tcx_noiseshaping_igf( st, L_spec, L_frame, L_frameTCX, left_rect, &x[0], &gainlpc2[0], &tmp_concealment_method, bfi );

    decoder_tcx_tns( st, L_frame_glob, L_spec, L_frame, L_frameTCX, &x[0], fUseTns, &tnsData, bfi, frame_cnt, 0 );
    decoder_tcx_tns( st, L_frame_glob, L_spec, L_frame, L_frameTCX, &x[0], fUseTns, &tnsData, bfi, frame_cnt, 0
#ifdef FIX_I13_TCX_TNS_ISSUE
                     ,
                     isEvsMono
#endif
    );

    decoder_tcx_imdct( st, L_frame_glob, L_frameTCX_glob, L_spec, tcx_offset, tcx_offsetFB, L_frame, L_frameTCX, left_rect, &x[0], &xn_buf[0], MDCT_IV,
                       fUseTns, &synth[0], &synthFB[0], bfi, frame_cnt, 0, sba_dirac_stereo_flag );
@@ -1486,7 +1495,12 @@ void decoder_tcx_tns(
    STnsData *tnsData,
    const int16_t bfi,       /* i  : Bad frame indicator                     */
    const int16_t frame_cnt, /* i  : frame counter in the super frame        */
    const int16_t whitenedDomain )
    const int16_t whitenedDomain
#ifdef FIX_I13_TCX_TNS_ISSUE
    ,
    const int16_t isEvsMono /*i: EVS mono flag */
#endif
)
{
    int16_t index, isTCX5, L;
    TCX_CONFIG_HANDLE hTcxCfg = st->hTcxCfg;
@@ -1549,7 +1563,14 @@ void decoder_tcx_tns(
#ifndef FIX_I13_TCX_TNS_ISSUE
            tcx5TnsUngrouping( L_frameTCX >> 1, hTcxCfg->tnsConfig[0][0].iFilterBorders[0] >> 1, x, DEC );
#else
            if ( isEvsMono ) /*TODO: this is temporary to maintain EVS BE, this is a bug and should be fixed also for EVS (see issue 13) */
            {
                tcx5TnsUngrouping( L_frameTCX >> 1, hTcxCfg->tnsConfig[0][0].iFilterBorders[0] >> 1, x, DEC );
            }
            else
            {
                tcx5TnsUngrouping( L >> 1, hTcxCfg->tnsConfig[0][0].iFilterBorders[0] >> 1, x, DEC );
            }
#endif
        }
    }
Loading