Commit 99a8a25b authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

EVS bit exactness issue fix

parent 59e700e7
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1057,7 +1057,7 @@ void open_decoder_LPD_fx(
        st->tonalMDCTconceal.lastBlockData.nSamples = 0;
        move16();

        TonalMDCTConceal_Init_ivas_fx( &st->tonalMDCTconceal, hTcxDec->L_frameTCX, st->L_frame, FDNS_NPTS, st->hTcxCfg );
        TonalMDCTConceal_Init( &st->tonalMDCTconceal, hTcxDec->L_frameTCX, st->L_frame, FDNS_NPTS, st->hTcxCfg );
    }
    st->last_tns_active = 0;
    move16();
+10 −7
Original line number Diff line number Diff line
@@ -83,7 +83,10 @@ ivas_error TonalMDCTConceal_Init(
    hTonalMDCTConc->secondLastBlockData.blockIsConcealed = 0;
    move16();

    hTonalMDCTConc->pTCI = (TonalComponentsInfo *) hTonalMDCTConc->timeDataBuffer;
    move16();


    hTonalMDCTConc->lastPitchLag = L_deposit_l( 0 );

    IF( NE_16( hTonalMDCTConc->nSamples, nSamples ) )
@@ -103,14 +106,14 @@ ivas_error TonalMDCTConceal_Init(
    move16();
#ifdef IVAS_CODE_CNG_FIX185_PLC_FADEOUT
    PMTE()
    set_zero( hTonalMDCTConc->scaleFactorsBackground_flt, FDNS_NPTS );
    set_zero( hTonalMDCTConc->scaleFactorsBackground, FDNS_NPTS );
    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;
    hTonalMDCTConc->scf_fadeout_flt = 1.0f;
    hTonalMDCTConc->last_block_nrg_flt = 0.0f;
    hTonalMDCTConc->curr_noise_nrg_flt = 0.0f;
    hTonalMDCTConc->faded_signal_nrg_flt = 0.0f;
    hTonalMDCTConc->scf_fadeout = 1.0f;
    hTonalMDCTConc->last_block_nrg = 0.0f;
    hTonalMDCTConc->curr_noise_nrg = 0.0f;
    hTonalMDCTConc->faded_signal_nrg = 0.0f;

#endif
    /* Offset the pointer to the end of buffer, so that pTCI is not destroyed when
@@ -118,8 +121,8 @@ ivas_error TonalMDCTConceal_Init(
    move16();
    move16();
    /* just the second half of the second last pcm output is needed */
    hTonalMDCTConc->secondLastPcmOut = &hTonalMDCTConc->timeDataBuffer[( 3 * L_FRAME_MAX ) / 2 - ( 3 * ( min( L_FRAME_MAX, nSamples ) ) / 2 )];
    hTonalMDCTConc->lastPcmOut = &hTonalMDCTConc->timeDataBuffer[( 3 * L_FRAME_MAX ) / 2 - min( L_FRAME_MAX, nSamples )];
    hTonalMDCTConc->secondLastPcmOut = &hTonalMDCTConc->timeDataBuffer[sub( ( 3 * L_FRAME_MAX ) / 2, 3 * ( s_min( L_FRAME_MAX, nSamples ) ) / 2 )];
    hTonalMDCTConc->lastPcmOut = &hTonalMDCTConc->timeDataBuffer[sub( ( 3 * L_FRAME_MAX ) / 2, s_min( L_FRAME_MAX, nSamples ) )];

    /* If the second last frame was lost, we reuse saved TonalComponentsInfo and don't update pcm buffers */
    assert( sizeof( *hTonalMDCTConc->pTCI ) <= ( hTonalMDCTConc->lastPcmOut - hTonalMDCTConc->timeDataBuffer ) * sizeof( hTonalMDCTConc->timeDataBuffer[0] ) );