Commit eb22204f authored by Sumeyra Demir Kanik's avatar Sumeyra Demir Kanik
Browse files

Change from cosine interpolation to linear interpolation to reduce complexity

parent d101d328
Loading
Loading
Loading
Loading
Loading
+6 −16
Original line number Diff line number Diff line
@@ -37,9 +37,6 @@
#include "ivas_rom_rend.h"
#include "prot.h"
#include "wmc_auto.h"
#ifdef FIX_379_GAININTP
#include "ivas_rom_com.h"
#endif


/*---------------------------------------------------------------------*
@@ -254,15 +251,10 @@ void TDREND_firfilt(
    float tmp;
    int16_t i, j;
#ifdef FIX_379_GAININTP
    float gain_tmp, gain_delta;
    const float *pcos;
    int16_t step;
    float cos_tmp;

    /* Setup pointer for cosine gain transition curve */
    gain_delta = Gain - prevGain;
    pcos = ivas_mdft_coeff_cos_twid_960; /* ivas_mdft_coeff_cos_twid_960 */
    step = 960 / subframe_length;
    float step, gain_tmp, gain_delta;

    gain_delta = ( Gain - prevGain );
    step = gain_delta / ( subframe_length );
    gain_tmp = prevGain;
#endif

@@ -283,10 +275,8 @@ void TDREND_firfilt(
            tmp += ( *p_filter++ ) * ( *p_tmp-- );
        }
#ifdef FIX_379_GAININTP
        /* Apply cosine gain curve in case of abrupt gain changes */
        cos_tmp = *pcos;
        pcos += step;
        gain_tmp = prevGain + gain_delta * ( 1 - cos_tmp * cos_tmp );
        /* Apply linear gain interpolation in case of abrupt gain changes */
        gain_tmp = gain_tmp + step;
        signal[i] = tmp * gain_tmp;
#else
        signal[i] = tmp * Gain;