Commit b9ac7db8 authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Exclude EVS_MONO from dynamic scaling of the synthesis buffer in con_tcx_fx()...

Exclude EVS_MONO from dynamic scaling of the synthesis buffer in con_tcx_fx() to preserve evs bit-exactness.
parent fd280466
Loading
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -202,7 +202,10 @@ void con_tcx_fx(
        move16();
        Q_exc = E_UTIL_f_preemph3( &( 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 );
#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE
        if ( NE_32( st->element_mode, EVS_MONO ) ) // to keep evs bit-exactness
        {
            Scale_sig( &( synth[-( ( shr( L_frame, 1 ) + hTcxDec->pit_max_TCX ) + 2 * M )] ), add( add( shr( L_frame, 1 ), hTcxDec->pit_max_TCX ), shl( M, 1 ) ), negate( st->Q_syn_factor ) ); /*Q0, Setting back to Q0, as the following calculations are implemented assuming synth is in Q0 */
        }
#endif
        st->Mode2_lp_gainc = L_deposit_l( 0 );

@@ -250,7 +253,10 @@ void con_tcx_fx(
        move16();
        Q_exc = E_UTIL_f_preemph3( &( synth[-L_frame] ), st->preemph_fac, L_frame, &mem, 1 );
#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE
        if ( NE_32( st->element_mode, EVS_MONO ) ) // to keep evs bit-exactness
        {
            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 */
        }
#endif
        Copy( st->old_Aq_12_8_fx, A_local, M + 1 ); /*Q12*/