Commit 6a8654c6 authored by vaclav's avatar vaclav
Browse files

revert change in InitTransientDetection_fx()

parent 2a129274
Loading
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -883,10 +883,10 @@ ivas_error init_encoder_fx(
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Transient Detection\n" ) );
    }
    // PMT("Transient detector init needs review, handle hTranDet is missing")

    InitTransientDetection_fx( extract_l( Mult_32_16( st_fx->input_Fs, 0x0290 ) ),
                               NS2SA_FX2( st_fx->input_Fs, DELAY_FIR_RESAMPL_NS ),
                               st_fx->hTranDet, 0 );
                               st_fx->hTranDet );

    st_fx->Q_syn2 = 0;
    move16();
@@ -2154,9 +2154,7 @@ ivas_error init_encoder_ivas_fx(
    }
    ELSE
    {
        InitTransientDetection_fx( extract_l( Mult_32_16( st->input_Fs, 0x0290 ) ),
                                   NS2SA_FX2( st->input_Fs, DELAY_FIR_RESAMPL_NS ),
                                   st->hTranDet, 0 );
        InitTransientDetection_fx( frame_length, NS2SA_FX2( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet );
    }

    /*-----------------------------------------------------------------*
+1 −2
Original line number Diff line number Diff line
@@ -1073,8 +1073,7 @@ void calculate_hangover_attenuation_gain_fx(
void InitTransientDetection_fx(
    const Word16 nFrameLength,
    const Word16 nTCXDelay,
    TRAN_DET_HANDLE hTranDet,
    const Word16 ext_mem_flag );
    TRAN_DET_HANDLE hTranDet );

void InitTransientDetection_ivas_fx(
    const Word16 nFrameLength,
+4 −14
Original line number Diff line number Diff line
@@ -364,8 +364,7 @@ static void InitTCXTransientDetector(
void InitTransientDetection_fx(
    const Word16 nFrameLength,
    const Word16 nTCXDelay,
    TRAN_DET_HANDLE hTranDet,
    const Word16 ext_mem_flag )
    TRAN_DET_HANDLE hTranDet )
{
    /* Init the delay buffer. */
    InitDelayBuffer( nFrameLength, nTCXDelay, &hTranDet->delayBuffer );
@@ -377,18 +376,9 @@ void InitTransientDetection_fx(
    InitTCXTransientDetector( nTCXDelay, &hTranDet->subblockEnergies, &hTranDet->transientDetector );

    /* We need two past subblocks for the TCX TD and NSUBBLOCKS+1 for the temporal flatness measure FOR the TCX LTP. */
    IF( ext_mem_flag )
    {
        hTranDet->transientDetector.pSubblockEnergies->nDelay =
            add( hTranDet->transientDetector.pSubblockEnergies->nDelay, add( ( NSUBBLOCKS + 1 ), ( NSUBBLOCKS_SHIFT + 1 ) ) );
        move16();
    }
    ELSE
    {
    hTranDet->transientDetector.pSubblockEnergies->nDelay =
        add( hTranDet->transientDetector.pSubblockEnergies->nDelay, NSUBBLOCKS + 1 );
    move16();
    }

    return;
}