static void apply_tns_filter(float *out, float *in, int order, int direction,

                             float *tns_coefs, int ltp_used, int w, int filt,

                             int start_i, int len)

{

    int i, j, inc, start = start_i;

    float tmp[TNS_MAX_ORDER+1];

    if (direction) {

        inc = -1;

        start = (start + len) - 1;

    } else {

        inc = 1;

    }

    if (!ltp_used) {    /* AR filter */

        for (i = 0; i < len; i++, start += inc)

            out[i] = in[start];

            for (j = 1; j <= FFMIN(i, order); j++)

                out[i] += tns_coefs[j]*in[start - j*inc];

    } else {            /* MA filter */

        for (i = 0; i < len; i++, start += inc) {

            tmp[0] = out[i] = in[start];

            for (j = 1; j <= FFMIN(i, order); j++)

                out[i] += tmp[j]*tns_coefs[j];

            for (j = order; j > 0; j--)

                tmp[j] = tmp[j - 1];

        }

    }

}

static void apply_tns_filter(float *out, float *in, int order, int direction,

                             float *tns_coefs, int ltp_used, int w, int filt,

                             int start_i, int len)

{

    int i, j, inc, start = start_i;

    float tmp[TNS_MAX_ORDER+1];

    if (direction) {

        inc = -1;

        start = (start + len) - 1;

    } else {

        inc = 1;

    }

    if (!ltp_used) {    

        for (i = 0; i < len; i++, start += inc)

            out[i] = in[start];

            for (j = 1; j <= FFMIN(i, order); j++)

                out[i] += tns_coefs[j]*in[start - j*inc];

    } else {            

        for (i = 0; i < len; i++, start += inc) {

            tmp[0] = out[i] = in[start];

            for (j = 1; j <= FFMIN(i, order); j++)

                out[i] += tmp[j]*tns_coefs[j];

            for (j = order; j > 0; j--)

                tmp[j] = tmp[j - 1];

        }

    }

}

static void FUNC_0(float *VAR_0, float *VAR_1, int VAR_2, int VAR_3,

                             float *VAR_4, int VAR_5, int VAR_6, int VAR_7,

                             int VAR_8, int VAR_9)

{

    int VAR_10, VAR_11, VAR_12, VAR_13 = VAR_8;

    float VAR_14[TNS_MAX_ORDER+1];

    if (VAR_3) {

        VAR_12 = -1;

        VAR_13 = (VAR_13 + VAR_9) - 1;

    } else {

        VAR_12 = 1;

    }

    if (!VAR_5) {    

        for (VAR_10 = 0; VAR_10 < VAR_9; VAR_10++, VAR_13 += VAR_12)

            VAR_0[VAR_10] = VAR_1[VAR_13];

            for (VAR_11 = 1; VAR_11 <= FFMIN(VAR_10, VAR_2); VAR_11++)

                VAR_0[VAR_10] += VAR_4[VAR_11]*VAR_1[VAR_13 - VAR_11*VAR_12];

    } else {            

        for (VAR_10 = 0; VAR_10 < VAR_9; VAR_10++, VAR_13 += VAR_12) {

            VAR_14[0] = VAR_0[VAR_10] = VAR_1[VAR_13];

            for (VAR_11 = 1; VAR_11 <= FFMIN(VAR_10, VAR_2); VAR_11++)

                VAR_0[VAR_10] += VAR_14[VAR_11]*VAR_4[VAR_11];

            for (VAR_11 = VAR_2; VAR_11 > 0; VAR_11--)

                VAR_14[VAR_11] = VAR_14[VAR_11 - 1];

        }

    }

}

static void FUNC_0(float *VAR_0, float *VAR_1, int VAR_2, int VAR_3,
float *VAR_4, int VAR_5, int VAR_6, int VAR_7,
int VAR_8, int VAR_9)
{ int VAR_10, VAR_11, VAR_12, VAR_13 = VAR_8; float VAR_14[TNS_MAX_ORDER+1]; if (VAR_3) { VAR_12 = -1; VAR_13 = (VAR_13 + VAR_9) - 1; } else { VAR_12 = 1; } if (!VAR_5) { for (VAR_10 = 0; VAR_10 < VAR_9; VAR_10++, VAR_13 += VAR_12) VAR_0[VAR_10] = VAR_1[VAR_13]; for (VAR_11 = 1; VAR_11 <= FFMIN(VAR_10, VAR_2); VAR_11++) VAR_0[VAR_10] += VAR_4[VAR_11]*VAR_1[VAR_13 - VAR_11*VAR_12]; } else { for (VAR_10 = 0; VAR_10 < VAR_9; VAR_10++, VAR_13 += VAR_12) { VAR_14[0] = VAR_0[VAR_10] = VAR_1[VAR_13]; for (VAR_11 = 1; VAR_11 <= FFMIN(VAR_10, VAR_2); VAR_11++) VAR_0[VAR_10] += VAR_14[VAR_11]*VAR_4[VAR_11]; for (VAR_11 = VAR_2; VAR_11 > 0; VAR_11--) VAR_14[VAR_11] = VAR_14[VAR_11 - 1]; } } }