Commit 48f8f337 authored by multrus's avatar multrus
Browse files

get rid of leg_flag, rather compare to element_mode

parent 00bfcfc4
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -9015,8 +9015,8 @@ void con_tcx_fx(
    const Word16 coh,       /* i  : coherence of stereo signal  */
    Word16 *noise_seed,     /* i/o: noise seed for stereo       */
    const Word16 only_left, /* i  : TD-PLC only in left channel */
    const Word16 *A_cng,    /* i  : CNG LP filter coefficients  */
    const Word32 leg_flag );
    const Word16 *A_cng     /* i  : CNG LP filter coefficients  */
);
#endif // !HARMONIZE_2446_CON_TCX_FX

void ivas_mdct_core_reconstruct_fx(
+1 −1
Original line number Diff line number Diff line
@@ -573,7 +573,7 @@ void decoder_LPD_fx(
#ifndef HARMONIZE_2446_CON_TCX_FX
            con_tcx_fx( st, &synthFB[0] );
#else
            con_tcx_fx( st, &synthFB[0], -16384, NULL, 0, NULL, EQ_16( st->element_mode, EVS_MONO ) );
            con_tcx_fx( st, &synthFB[0], -16384, NULL, 0, NULL );
#endif
            lerp( synthFB, synth, st->L_frame, hTcxDec->L_frameTCX );
            st->con_tcx = 1;
+17 −21
Original line number Diff line number Diff line
@@ -955,8 +955,8 @@ void con_tcx_fx(
    const Word16 coh,       /* i  : coherence of stereo signal  Q14*/
    Word16 *noise_seed,     /* i/o: noise seed for stereo       Q0 */
    const Word16 only_left, /* i  : TD-PLC only in left channel Q0 */
    const Word16 *A_cng,    /* i  : CNG LP filter coefficients  Q14*/
    const Word32 leg_flag )
    const Word16 *A_cng     /* i  : CNG LP filter coefficients  Q14*/
)
#else
void con_tcx_ivas_fx(
    Decoder_State *st,      /* i/o: coder memory state             */
@@ -1071,7 +1071,7 @@ void con_tcx_ivas_fx(
        Q_exc = E_UTIL_f_preemph3_ivas_fx( &( synth[-( ( ( L_frame / 2 ) + hTcxDec->pit_max_TCX ) + 2 * M )] ), st->preemph_fac, add( add( shr( L_frame, 1 ), hTcxDec->pit_max_TCX ), shl( M, 1 ) ), &mem, 1 );

#else
        IF( !leg_flag )
        IF( NE_16( st->element_mode, EVS_MONO ) )
        {
            Q_exc = E_UTIL_f_preemph3_ivas_fx( &( synth[-( ( ( L_frame / 2 ) + hTcxDec->pit_max_TCX ) + 2 * M )] ), st->preemph_fac, add( add( shr( L_frame, 1 ), hTcxDec->pit_max_TCX ), shl_sat( M, 1 ) ), &mem, 1 );
        }
@@ -1084,7 +1084,7 @@ void con_tcx_ivas_fx(
#ifndef HARMONIZE_2446_CON_TCX_FX
        scale_sig( &( synth[-( ( ( L_frame / 2 ) + hTcxDec->pit_max_TCX ) + 2 * M )] ), add( add( shr( L_frame, 1 ), hTcxDec->pit_max_TCX ), shl_sat( M, 1 ) ), negate( st->Q_syn_factor ) ); /*Q0, Setting back to Q0, as the following calculations are implemented assuming synth is in Q0 */
#else
        IF( !leg_flag )
        IF( NE_16( st->element_mode, EVS_MONO ) )
        {
            scale_sig( &( synth[-( ( ( L_frame / 2 ) + hTcxDec->pit_max_TCX ) + 2 * M )] ), add( add( shr( L_frame, 1 ), hTcxDec->pit_max_TCX ), shl_sat( M, 1 ) ), negate( st->Q_syn_factor ) ); /*Q0, Setting back to Q0, as the following calculations are implemented assuming synth is in Q0 */
        }
@@ -1124,7 +1124,7 @@ void con_tcx_ivas_fx(
        E_LPC_lev_dur_ivas_fx( r_h, r_l, A_local, NULL, M, NULL );

#else
        IF( !leg_flag )
        IF( NE_16( st->element_mode, EVS_MONO ) )
        {
            E_LPC_lev_dur_ivas_fx( r_h, r_l, A_local, NULL, M, NULL );
        }
@@ -1169,7 +1169,7 @@ void con_tcx_ivas_fx(
        scale_sig( &synth[-L_frame], L_frame, negate( st->Q_syn_factor ) ); /*Q0, Setting back to Q0, as the following calculations are implemented assuming synth is in Q0 */

#else
        IF( !leg_flag )
        IF( NE_16( st->element_mode, EVS_MONO ) )
        {
            Q_exc = E_UTIL_f_preemph3_ivas_fx( &( synth[-L_frame] ), st->preemph_fac, L_frame, &mem, 1 );
            scale_sig( &synth[-L_frame], L_frame, negate( st->Q_syn_factor ) ); /*Q0, Setting back to Q0, as the following calculations are implemented assuming synth is in Q0 */
@@ -1531,7 +1531,7 @@ void con_tcx_ivas_fx(
#ifndef HARMONIZE_2446_CON_TCX_FX
    IF( NE_16( coh, -16384 ) )
#else
    IF( NE_16( coh, -16384 ) && !leg_flag )
    IF( NE_16( coh, -16384 ) )
#endif // !HARMONIZE_2446_CON_TCX_FX
    {
        Word16 tmpSeed1;
@@ -1761,7 +1761,7 @@ void con_tcx_ivas_fx(
#ifndef HARMONIZE_2446_CON_TCX_FX
    tmp_e = sub( add( tmp_e, shl( noise_e, 1 ) ), 1 ); // actual multiplier!
#else
    IF( !leg_flag )
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
        tmp_e = sub( add( tmp_e, shl_sat( noise_e, 1 ) ), 1 ); // actual multiplier!
    }
@@ -1781,7 +1781,7 @@ void con_tcx_ivas_fx(
        move16();
    }
#else
    IF( !leg_flag )
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
        tmp_e = add( tmp_e, 31 - 6 ); /*-->Q31*/
        gain_inov = 0;
@@ -1914,7 +1914,7 @@ void con_tcx_ivas_fx(
    new_Q = s_max( new_Q, -1 );
    new_Q = s_min( new_Q, scf );
#else
    IF( !leg_flag || NE_32( st->element_mode, EVS_MONO ) )
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
        scf = norm_s( tmp_deemph );
        new_Q = sub( Q_exc, 4 ); // deemph_fx filter gain can be up to 10 (~2^3.32), so 4 bits of headroom are needed to avoid overflow
@@ -1953,7 +1953,7 @@ void con_tcx_ivas_fx(
    move16();

#else
    IF( !leg_flag )
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {

        if ( GT_16( sub( Q_syn, st->Q_syn_factor ), scf ) )
@@ -1967,7 +1967,7 @@ void con_tcx_ivas_fx(
    }
    ELSE
    {
        IF( NE_32( st->element_mode, EVS_MONO ) ) // to keep evs bit-exactness
        IF( NE_16( st->element_mode, EVS_MONO ) ) // to keep evs bit-exactness
        {
            if ( GT_16( sub( Q_syn, st->Q_syn_factor ), scf ) )
            {
@@ -1987,11 +1987,7 @@ void con_tcx_ivas_fx(
#endif // !HARMONIZE_2446_CON_TCX_FX
    /*buf[OLD_EXC_SIZE_DEC;3/2 L_frame] Q1: exc*/
    /*buf[0;M] Q0: mem_syn*/
#ifndef HARMONIZE_2446_CON_TCX_FX
    IF( A_cng != NULL )
#else
    IF( ( A_cng != NULL ) && !leg_flag )
#endif // !HARMONIZE_2446_CON_TCX_FX
    {
        Word16 alpha_delayed;

@@ -2052,7 +2048,7 @@ void con_tcx_ivas_fx(
    deemph_fx( syn, st->preemph_fac, add( L_frame, shr( L_frame, 1 ) ), &tmp_deemph );

#ifdef HARMONIZE_2446_CON_TCX_FX
    IF( leg_flag )
    IF( EQ_16( st->element_mode, EVS_MONO ) )
    {
        bufferCopyFx( syn + sub( L_frame, M + 1 ), st->syn, 1 + M, Q_syn, 0, 0, 0 ); /*Q_syn*/
    }
@@ -2097,7 +2093,7 @@ void con_tcx_ivas_fx(
    Copy_Scale_sig( syn + L_frame, hTcxDec->syn_OverlFB, shr( L_frame, 1 ), sub( st->Q_syn_factor, Q_syn ) );
    hTcxDec->Q_syn_OverlFB = st->Q_syn_factor;
#else
    IF( !leg_flag )
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
        scf = add( getScaleFactor16( syn, L_frame ), Q_syn );
        IF( LT_16( scf, 0 ) ) // Only avoid left shift in bufferCopyFX when overflow could occur
@@ -2148,7 +2144,7 @@ void con_tcx_ivas_fx(
    hTcxDec->Q_syn_Overl_TDACFB = Q_syn;

#else
    IF( !leg_flag )
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
        Copy( syn + L_frame, hTcxDec->syn_Overl_TDACFB, shr( L_frame, 1 ) );
        hTcxDec->Q_syn_Overl_TDACFB = Q_syn;
@@ -2208,7 +2204,7 @@ void con_tcx_ivas_fx(
#ifndef HARMONIZE_2446_CON_TCX_FX
    st->Q_syn = Q_syn;
#else
    IF( !leg_flag )
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
        st->Q_syn = Q_syn;
    }
@@ -2230,7 +2226,7 @@ void con_tcx_ivas_fx(
#ifndef HARMONIZE_2446_CON_TCX_FX
    st->hHQ_core->Q_old_wtda_LB = Q_syn; // st->hHQ_core->Q_old_wtda
#else
    IF( !leg_flag )
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
        st->hHQ_core->Q_old_wtda_LB = Q_syn; // st->hHQ_core->Q_old_wtda
    }
+3 −3
Original line number Diff line number Diff line
@@ -1300,7 +1300,7 @@ void ivas_mdct_core_reconstruct_fx(
#ifndef HARMONIZE_2446_CON_TCX_FX
                con_tcx_ivas_fx( st, &synthFB_fx[0], -16384, NULL, 0, NULL ); //-1.Q14 = -16384
#else
                con_tcx_fx( st, &synthFB_fx[0], -16384, NULL, 0, NULL, EQ_16( st->element_mode, EVS_MONO ) ); //-1.Q14 = -16384
                con_tcx_fx( st, &synthFB_fx[0], -16384, NULL, 0, NULL ); //-1.Q14 = -16384
#endif // !HARMONIZE_2446_CON_TCX_FX
            }
            ELSE
@@ -1310,7 +1310,7 @@ void ivas_mdct_core_reconstruct_fx(
#ifndef HARMONIZE_2446_CON_TCX_FX
                    con_tcx_ivas_fx( st, &synthFB_fx[0], hCPE->hStereoMdct->lastCoh_fx, &sts[0]->seed_acelp, 1, &st->hFdCngDec->hFdCngCom->A_cng[0] );
#else
                    con_tcx_fx( st, &synthFB_fx[0], hCPE->hStereoMdct->lastCoh_fx, &sts[0]->seed_acelp, 1, &st->hFdCngDec->hFdCngCom->A_cng[0], EQ_16( st->element_mode, EVS_MONO ) );
                    con_tcx_fx( st, &synthFB_fx[0], hCPE->hStereoMdct->lastCoh_fx, &sts[0]->seed_acelp, 1, &st->hFdCngDec->hFdCngCom->A_cng[0] );
#endif // !HARMONIZE_2446_CON_TCX_FX
                }
                ELSE
@@ -1318,7 +1318,7 @@ void ivas_mdct_core_reconstruct_fx(
#ifndef HARMONIZE_2446_CON_TCX_FX
                    con_tcx_ivas_fx( st, &synthFB_fx[0], hCPE->hStereoMdct->lastCoh_fx, &sts[0]->seed_acelp, 0, &st->hFdCngDec->hFdCngCom->A_cng[0] );
#else
                    con_tcx_fx( st, &synthFB_fx[0], hCPE->hStereoMdct->lastCoh_fx, &sts[0]->seed_acelp, 0, &st->hFdCngDec->hFdCngCom->A_cng[0], EQ_16( st->element_mode, EVS_MONO ) );
                    con_tcx_fx( st, &synthFB_fx[0], hCPE->hStereoMdct->lastCoh_fx, &sts[0]->seed_acelp, 0, &st->hFdCngDec->hFdCngCom->A_cng[0] );
#endif // !HARMONIZE_2446_CON_TCX_FX
                }
            }
+1 −1
Original line number Diff line number Diff line
@@ -492,7 +492,7 @@ void stereo_tcx_core_dec_fx(
#ifndef HARMONIZE_2446_CON_TCX_FX
        con_tcx_fx( st, &synthFB_fx[0] /*, -1.f, NULL, 0, NULL */ );
#else
        con_tcx_fx( st, &synthFB_fx[0], -16384, NULL, 0, NULL, EQ_16( st->element_mode, EVS_MONO ) );
        con_tcx_fx( st, &synthFB_fx[0], -16384, NULL, 0, NULL );
#endif // !HARMONIZE_2446_CON_TCX_FX
        test();
        IF( ( EQ_16( st->nbLostCmpt, 1 ) ) || hTcxDec->tcxConceal_recalc_exc )