Commit 38280593 authored by multrus's avatar multrus
Browse files

[cleanup] accept HARMONIZE_2427_GETPLC

parent 620de6da
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -1890,11 +1890,6 @@ void TonalMDCTConceal_Detect_ivas_fx(
    Word16 element_mode 
);

#ifndef HARMONIZE_2427_GETPLC
Word16 GetPLCModeDecision_ivas_fx(
    Decoder_State *st                                           /* i/o:    decoder memory state pointer         */
);
#endif // !HARMONIZE_2427_GETPLC

void ivas_DetectTonalComponents_fx(
    Word16 indexOfTonalPeak[],
+0 −1
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define HARMONIZE_2427_GETPLC                           /* FhG: basop issue : 2427 Harmonizing getPLCDecision functions:*/
#define HARM_FD_BWE                                     /* VA: harmonize core-coder FD BWE function duplications */
#define FIX_2429_POST_DECODER
#define FIX_FLOAT_1526_DIRAC_MEM_LEAK                   /* FhG: float issue 1526: potential memory leak in DirAC handles in case of format switching */
+0 −136
Original line number Diff line number Diff line
@@ -366,11 +366,7 @@ void highPassFiltering_fx(
 * PLC: Decide which Concealment to use. Update pitch lags if needed
 *----------------------------------------------------------------------------------*/

#ifndef HARMONIZE_2427_GETPLC
Word16 GetPLCModeDecision_ivas_fx(
#else
Word16 GetPLCModeDecision_fx(
#endif                // !HARMONIZE_2427_GETPLC
    Decoder_State *st /* i/o:    decoder memory state pointer */
)
{
@@ -453,9 +449,6 @@ Word16 GetPLCModeDecision_fx(
                    {
                        pitch = L_add( st->old_fpitch, 0 ); /*Q16*/
                    }
#ifndef HARMONIZE_2427_GETPLC
                    TonalMDCTConceal_Detect_ivas_fx( st->hTonalMDCTConc, pitch, &numIndices, ( EQ_16( st->element_mode, IVAS_CPE_MDCT ) ? &( st->hTcxCfg->psychParamsTCX20 ) : st->hTcxCfg->psychParamsCurrent ), st->element_mode );
#else
                    IF( NE_16( st->element_mode, EVS_MONO ) )
                    {
                        TonalMDCTConceal_Detect_ivas_fx( st->hTonalMDCTConc, pitch, &numIndices, ( EQ_16( st->element_mode, IVAS_CPE_MDCT ) ? &( st->hTcxCfg->psychParamsTCX20 ) : st->hTcxCfg->psychParamsCurrent ), st->element_mode );
@@ -464,7 +457,6 @@ Word16 GetPLCModeDecision_fx(
                    {
                        TonalMDCTConceal_Detect( st->hTonalMDCTConc, pitch, &numIndices, st->element_mode );
                    }
#endif // !HARMONIZE_2427_GETPLC

                    test();
                    test();
@@ -502,131 +494,3 @@ Word16 GetPLCModeDecision_fx(
    return core; /*Q0*/
}
#ifndef HARMONIZE_2427_GETPLC
Word16 GetPLCModeDecision_fx(
    Decoder_State *st /* i/o:    decoder memory state pointer */
)
{
    Word16 /*int*/ core;
    Word16 numIndices;
    TCX_DEC_HANDLE hTcxDec;

    numIndices = 0;
    move16();

    hTcxDec = st->hTcxDec;


    IF( EQ_16( st->flagGuidedAcelp, 1 ) )
    {
        st->old_pitch_buf_fx[( st->nb_subfr * 2 )] = L_deposit_h( st->guidedT0 ); /*Q16*/
        move32();
        st->old_pitch_buf_fx[( ( st->nb_subfr * 2 ) + 1 )] = L_deposit_h( st->guidedT0 ); /*Q16*/
        move32();
        st->mem_pitch_gain[0] = st->mem_pitch_gain[1] = 16384 /*1.f Q14*/; /*Q14*/
        move16();
        move16();
    }
    st->plc_use_future_lag = 0;
    move16();
    test();
    test();
    if ( ( st->last_core > ACELP_CORE && hTcxDec->tcxltp_last_gain_unmodified != 0 ) || ( EQ_16( st->flagGuidedAcelp, 1 ) ) )
    {
        /* no updates needed here, because already updated in last good frame */
        st->plc_use_future_lag = 1;
        move16();
    }

    IF( EQ_16( st->last_core, -1 ) )
    {
        core = TCX_20_CORE;
        move16();
        st->last_core = ACELP_CORE;
        move16();
        if ( st->Opt_AMR_WB )
        {
            core = ACELP_CORE;
            move16();
        }
        st->tonal_mdct_plc_active = 0;
        move16();
    }
    ELSE
    {
        core = ACELP_CORE;
        move16();
        if ( GT_16( st->nbLostCmpt, 1 ) )
        {
            core = st->last_core_bfi;
            move16();
        }

        IF( EQ_16( st->nbLostCmpt, 1 ) )
        {
            st->tonal_mdct_plc_active = 0;
            move16();
            test();
            test();
            test();
            IF( !( st->rf_flag && st->use_partial_copy && ( EQ_16( st->rf_frame_type, RF_TCXTD1 ) || EQ_16( st->rf_frame_type, RF_TCXTD2 ) ) ) )
            {
                test();
                test();
                test();
                test();
                test();
                test();
                IF( ( st->hTonalMDCTConc != NULL && EQ_16( st->last_core, TCX_20_CORE ) ) && ( EQ_16( st->second_last_core, TCX_20_CORE ) ) && ( ( LE_32( st->old_fpitch, L_deposit_h( shr( st->L_frame, 1 ) ) ) ) || ( LE_16( hTcxDec->tcxltp_last_gain_unmodified, 13107 /*0.4f Q15*/ ) ) )
                    /* it is fine to call the detection even if no ltp information
                       is available, meaning that st->old_fpitch ==
                       st->tcxltp_second_last_pitch == st->L_frame */
                    && ( EQ_32( st->old_fpitch, hTcxDec->tcxltp_second_last_pitch ) ) && !st->last_tns_active && !st->second_last_tns_active )
                {
                    Word32 pitch;


                    pitch = L_deposit_h( 0 );
                    if ( hTcxDec->tcxltp_last_gain_unmodified > 0 )
                    {
                        pitch = L_add( st->old_fpitch, 0 ); /*Q16*/
                    }

                    TonalMDCTConceal_Detect( st->hTonalMDCTConc, pitch, &numIndices, st->element_mode );

                    test();
                    test();
                    test();
                    test();
                    test();
                    test();
                    test();
                    IF( ( GT_16( numIndices, 10 ) ) || ( ( GT_16( numIndices, 5 ) ) && ( LT_32( L_abs( L_sub( hTcxDec->tcxltp_third_last_pitch, hTcxDec->tcxltp_second_last_pitch ) ), 32768l /*0.5f Q16*/ ) ) ) || ( ( numIndices > 0 ) && ( ( LE_16( st->last_good, UNVOICED_TRANSITION ) ) || ( LE_16( hTcxDec->tcxltp_last_gain_unmodified, 13107 /*0.4f Q15*/ ) ) ) && ( LT_32( L_abs( L_sub( hTcxDec->tcxltp_third_last_pitch, hTcxDec->tcxltp_second_last_pitch ) ), 32768l /*0.5f Q16*/ ) ) ) )
                    {
                        core = TCX_20_CORE;
                        move16();
                        st->tonal_mdct_plc_active = 1;
                        move16();
                    }
                    ELSE IF( LE_16( st->last_good, UNVOICED_TRANSITION ) || LE_16( hTcxDec->tcxltp_last_gain_unmodified, 13107 /*0.4f Q15*/ ) )
                    {
                        core = TCX_20_CORE;
                        move16();
                    }
                }
                ELSE IF( st->last_core != ACELP_CORE )
                {
                    test();
                    if ( LE_16( st->last_good, UNVOICED_TRANSITION ) || LE_16( hTcxDec->tcxltp_last_gain_unmodified, 13107 /*0.4f Q15*/ ) )
                    {
                        core = st->last_core;
                        move16();
                    }
                }
            }
        }
    }

    return core;
}
#endif // !HARMONIZE_2427_GETPLC
+0 −4
Original line number Diff line number Diff line
@@ -838,11 +838,7 @@ void ivas_mdct_core_invQ_fx(

            /* PLC: [Common: mode decision]
             * PLC: Decide which Concealment to use. Update pitch lags if needed */
#ifndef HARMONIZE_2427_GETPLC
            st->core = GetPLCModeDecision_ivas_fx( st );
#else
            st->core = GetPLCModeDecision_fx( st );
#endif // !HARMONIZE_2427_GETPLC
        }

        test();
+0 −4
Original line number Diff line number Diff line
@@ -323,11 +323,7 @@ void stereo_tcx_core_dec_fx(

        /* PLC: [Common: mode decision]
         * PLC: Decide which Concealment to use. Update pitch lags if needed */
#ifndef HARMONIZE_2427_GETPLC
        st->core = GetPLCModeDecision_ivas_fx( st ); /* Q0 */
#else
        st->core = GetPLCModeDecision_fx( st ); /* Q0 */
#endif // !HARMONIZE_2427_GETPLC

        move16();
    }