Commit 39ad6948 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch '778-msan-error-in-dft-stereo-tns' into 'main'

[non-BE] fix for MSAN issue 778 for TNS in unified stereo

See merge request !1070
parents 881dfae9 18505a9e
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -202,6 +202,7 @@
#define NONBE_FIX_738_SBA_BR_SW_ASAN                          /* FhG: issue 738: fixes bug when switching to an MCT bitrate and previous frame was ACELP */
#define NONBE_CR_FIX_735_SBA_HP20_BRATE_SWITCHING             /* VA: Issue 735: Resolve "HP20 filtering bug in SBA/OSBA bitrate switching" */
#define NONBE_FIX_588_UPDATE_FASTCONV_SD                      /* FhG: issue 588: update FastConv SD HRTFs in CLDFB domain with new conversion method */
#define NONBE_FIX_778_TNS_UNFIED_STEREO_MSAN                  /* FhG: Issue 778: MSAN error due to uninitialized TNS configuration */


/* ##################### End NON-BE switches ########################### */
+1 −2
Original line number Diff line number Diff line
@@ -95,8 +95,7 @@ void stereo_tcx_init_dec(
    hTcxDec->tcx_lpc_shaped_ari = getTcxLpcShapedAri( st->bits_frame_nominal * FRAMES_PER_SEC, st->rf_flag, st->element_mode );
    st->igf = getIgfPresent( st->element_mode, st->bits_frame_nominal * FRAMES_PER_SEC, st->bwidth, st->rf_flag );

    if (
        st->element_mode != EVS_MONO )
    if ( st->element_mode != EVS_MONO )
    {
        st->hTcxCfg->fIsTNSAllowed = getTnsAllowed( st->bits_frame_nominal * FRAMES_PER_SEC, st->igf, st->element_mode );
    }
+14 −0
Original line number Diff line number Diff line
@@ -54,6 +54,9 @@ void stereo_tcx_init_enc(
    Encoder_State *st /* i/o: encoder state structure */
)
{
#ifdef NONBE_FIX_778_TNS_UNFIED_STEREO_MSAN
    int16_t prev_IsTNSAllowed;
#endif
    assert( st->core_brate != SID_2k40 && st->core_brate != FRAME_NO_DATA );

    /* Get the raw coder type from signal analysis*/
@@ -100,16 +103,27 @@ void stereo_tcx_init_enc(
    st->hTcxCfg->resq = getResq( st->bits_frame_nominal * FRAMES_PER_SEC );
    st->hTcxEnc->tcx_lpc_shaped_ari = getTcxLpcShapedAri( st->bits_frame_nominal * FRAMES_PER_SEC, st->rf_mode, st->element_mode );
    st->igf = getIgfPresent( st->element_mode, st->bits_frame_nominal * FRAMES_PER_SEC, st->bwidth, st->rf_mode );
#ifdef NONBE_FIX_778_TNS_UNFIED_STEREO_MSAN
    prev_IsTNSAllowed = st->hTcxCfg->fIsTNSAllowed;
#endif
    if ( st->element_mode != EVS_MONO )
    {
        st->hTcxCfg->fIsTNSAllowed = getTnsAllowed( st->bits_frame_nominal * FRAMES_PER_SEC, st->igf, st->element_mode );
    }
#ifdef NONBE_FIX_778_TNS_UNFIED_STEREO_MSAN
    if ( !prev_IsTNSAllowed && st->hTcxCfg->fIsTNSAllowed && st->element_mode == IVAS_CPE_DFT ) /* may happen in unified stereo when switching stereo technologies */
    {
        InitTnsConfigs( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFEnc->infoStopFrequency, st->bits_frame_nominal * FRAMES_PER_SEC, st->element_mode, 0 );

        SetAllowTnsOnWhite( st->hTcxCfg->tnsConfig, 0 );
    }
#endif
    st->core_brate = st->total_brate;

    return;
}


/*-------------------------------------------------------------------*
 * stereo_tcx_core_enc()
 *