Commit 92eac658 authored by multrus's avatar multrus
Browse files

few smaller adjustments

parent bdeb2e51
Loading
Loading
Loading
Loading
+8 −17
Original line number Diff line number Diff line
@@ -1200,31 +1200,22 @@ ivas_error init_encoder_fx(
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Transient Detection\n" ) );
    }

#ifdef HARMONIZE_2508_InitTransientDetection
    {
        Word16 nTCXDelay = 0;
        move16();
        Word16 ext_mem_flag = 1;
        move16();

        IF( EQ_16( st->element_mode, EVS_MONO ) )
        {
            nTCXDelay = NS2SA_FX2( st->input_Fs, DELAY_FIR_RESAMPL_NS );
            ext_mem_flag = 0;
        }

        InitTransientDetection_fx( input_frame, nTCXDelay, st->hTranDet, ext_mem_flag, st->element_mode );
    }
#else
    IF( GT_16( st->element_mode, EVS_MONO ) )
    {
#ifdef HARMONIZE_2508_InitTransientDetection
        InitTransientDetection_fx( input_frame, 0, st->hTranDet, 1, 1 /* > EVS_MONO */ );
#else
        InitTransientDetection_ivas_fx( input_frame, 0, st->hTranDet, 1 );
#endif
    }
    ELSE
    {
#ifdef HARMONIZE_2508_InitTransientDetection
        InitTransientDetection_fx( input_frame, NS2SA_FX2( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet, 0, EVS_MONO );
#else
        InitTransientDetection_fx( input_frame, NS2SA_FX2( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet );
    }
#endif
    }

    /*-----------------------------------------------------------------*
     * IVAS parameters
+4 −4
Original line number Diff line number Diff line
@@ -222,18 +222,18 @@ static void GetAttackForTCXDecision_fx(
    FOR( i = 0; i < NSUBBLOCKS; i++ )
    {
#ifdef HARMONIZE_2508_InitTransientDetection
        int condition;
        Word16 condition;
        IF( EQ_16( element_mode, EVS_MONO ) )
        {
            L_tmp2 = L_shr( pSubblockNrg[i], ATTACKTHRESHOLD_E );
            L_tmp1 = Mpy_32_16_1( pAccSubblockNrg[i], attackRatioThreshold );
            condition = GT_32( L_tmp2, L_tmp1 );
            condition = (Word16) GT_32( L_tmp2, L_tmp1 );
        }
        ELSE
        {
            W_tmp2 = W_shr( W_mult_32_16( pAccSubblockNrg[i], attackRatioThreshold ), 1 );
            W_tmp1 = W_shl( pSubblockNrg[i], ( 15 - ATTACKTHRESHOLD_E ) );
            condition = GT_64( W_tmp1, W_tmp2 );
            condition = (Word16) GT_64( W_tmp1, W_tmp2 );
        }
        IF( condition )
#else
@@ -419,7 +419,7 @@ void InitTransientDetection_ivas_fx(

    /* We need two past subblocks for the TCX TD and NSUBBLOCKS+1 for the temporal flatness measure FOR the TCX LTP. */
#ifdef HARMONIZE_2508_InitTransientDetection
    IF( ext_mem_flag && GT_32( element_mode, EVS_MONO ) )
    IF( ext_mem_flag && GT_16( element_mode, EVS_MONO ) )
    {
        hTranDet->transientDetector.pSubblockEnergies->nDelay =
            add( hTranDet->transientDetector.pSubblockEnergies->nDelay, add( ( NSUBBLOCKS + 1 ), ( NSUBBLOCKS_SHIFT + 1 ) ) );