Commit 64ad2033 authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

reserve Q_new headroom for the resampler output transient on the...

reserve Q_new headroom for the resampler output transient on the secondary-channel DFT->TD switch (st->q_mem_decim16k_fx)
parent e1206992
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@
#define FIX_BASOP_2599_TCA_OVERFLOW                     /* VA: issue 2599, Fix TCA overflow */
#define FIX_2588_MISSING_CONDITIONS                     /* VA: Proposed fix to 2588, addition of a condition in lsf_dec */
#define FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI         /* Nokia: BASOP issue 2442: Increase accuracy of computations and add additional gain clamp for low energy decorrelated signal rendering. */
#define FIX_BASOP_2612_RESAMP_OVERSHOOT                 /* FhG: #2612: reserve Q_new headroom for the resampler output transient on the secondary-channel DFT->TD switch (st->q_mem_decim16k_fx) */

/* ##################### End NON-BE switches ########################### */

+12 −0
Original line number Diff line number Diff line
@@ -625,7 +625,19 @@ void pre_proc_front_ivas_fx(
    shift = add( shift, st->q_inp );

    /* Avoid saturation of resampling/delay decimation buffer. */
#ifdef FIX_BASOP_2612_RESAMP_OVERSHOOT
    test();
    IF( EQ_16( element_mode, IVAS_CPE_TD ) && EQ_16( hCPE->last_element_mode, IVAS_CPE_DFT ) && EQ_16( st->idchan, 1 ) )
    {
        shift = s_min( shift, sub( st->q_mem_decim16k_fx, 1 ) );
    }
    ELSE
    {
        shift = s_min( shift, st->q_mem_decim16k_fx );
    }
#else
    shift = s_min( shift, st->q_mem_decim16k_fx );
#endif
    shift = s_min( shift, add( -1, norm_arr( &st->mem_preemph16k_fx, 1 ) ) );

    /* Limit Q_new here to st->q_inp because inside ivas_compute_core_buffers_fx() st->input is rescaled to Q_new */