Commit b5eed8b0 authored by Jan Kiene's avatar Jan Kiene
Browse files

use slower fade for scalefactors

parent e22382ca
Loading
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1116,14 +1116,15 @@ void ivas_mdct_core_tns_ns(
#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
                    if ( !isMCT && st->hTcxDec->cummulative_damping_tcx != 1.f )
                    {
                        float *scf_last;
                        float *scf_bg;
                        float fade_in;
                        float fade_out;
                        float *scf_last, *scf_bg;
                        float fade_in, fade_out;

                        scf_last = &st->hTonalMDCTConc->lastBlockData.scaleFactors[0];
                        scf_bg = &st->hTonalMDCTConc->scaleFactorsBackground[0];
                        fade_out = st->hTcxDec->cummulative_damping_tcx;

                        st->hTonalMDCTConc->scf_fadeout *= 0.95f;

                        fade_out = st->hTonalMDCTConc->scf_fadeout;
                        fade_in = 1 - fade_out;

                        for ( int16_t i = 0; i < st->hTonalMDCTConc->nScaleFactors; i++ )
@@ -1133,6 +1134,7 @@ void ivas_mdct_core_tns_ns(
                    }
                    else
                    {
                        st->hTonalMDCTConc->scf_fadeout = 1.0f;
                        mvr2r( st->hTonalMDCTConc->lastBlockData.scaleFactors, &sns_int_scf[0], st->hTonalMDCTConc->nScaleFactors );
                    }
#else
+1 −0
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ typedef struct

#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
    float scaleFactorsBackground[FDNS_NPTS];
    float scf_fadeout;
    PsychoacousticParameters *psychParams;
    /* could be stored only once, since the same for all channels (always at 16Khz fs) */
    PsychoacousticParameters psychParamsTCX20;
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ ivas_error TonalMDCTConceal_Init(

#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
    set_zero( hTonalMDCTConc->scaleFactorsBackground, FDNS_NPTS );
    hTonalMDCTConc->scf_fadeout = 1.0f;
    PsychoacousticParameters_Init( INT_FS_16k, L_FRAME16k, 64, 1, 1, &hTonalMDCTConc->psychParamsTCX20 );
    PsychoacousticParameters_Init( INT_FS_16k, L_FRAME16k / 2, 64, 0, 1, &hTonalMDCTConc->psychParamsTCX10 );
    hTonalMDCTConc->psychParams = NULL;