static int truespeech_decode_frame(AVCodecContext *avctx,

                void *data, int *data_size,

                uint8_t *buf, int buf_size)

{

    TSContext *c = avctx->priv_data;



    int i;

    short *samples = data;

    int consumed = 0;

    int16_t out_buf[240];



    if (!buf_size)

        return 0;



    while (consumed < buf_size) {

        truespeech_read_frame(c, buf + consumed);

        consumed += 32;



        truespeech_correlate_filter(c);

        truespeech_filters_merge(c);



        memset(out_buf, 0, 240 * 2);

        for(i = 0; i < 4; i++) {

            truespeech_apply_twopoint_filter(c, i);

            truespeech_place_pulses(c, out_buf + i * 60, i);

            truespeech_update_filters(c, out_buf + i * 60, i);

            truespeech_synth(c, out_buf + i * 60, i);

        }



        truespeech_save_prevvec(c);



        /* finally output decoded frame */

        for(i = 0; i < 240; i++)

            *samples++ = out_buf[i];



    }



    *data_size = consumed * 15;



    return buf_size;

}

static int truespeech_decode_frame(AVCodecContext *avctx,

                void *data, int *data_size,

                uint8_t *buf, int buf_size)

{

    TSContext *c = avctx->priv_data;



    int i;

    short *samples = data;

    int consumed = 0;

    int16_t out_buf[240];



    if (!buf_size)

        return 0;



    while (consumed < buf_size) {

        truespeech_read_frame(c, buf + consumed);

        consumed += 32;



        truespeech_correlate_filter(c);

        truespeech_filters_merge(c);



        memset(out_buf, 0, 240 * 2);

        for(i = 0; i < 4; i++) {

            truespeech_apply_twopoint_filter(c, i);

            truespeech_place_pulses(c, out_buf + i * 60, i);

            truespeech_update_filters(c, out_buf + i * 60, i);

            truespeech_synth(c, out_buf + i * 60, i);

        }



        truespeech_save_prevvec(c);



        

        for(i = 0; i < 240; i++)

            *samples++ = out_buf[i];



    }



    *data_size = consumed * 15;



    return buf_size;

}

static int FUNC_0(AVCodecContext *VAR_0,

                void *VAR_1, int *VAR_2,

                uint8_t *VAR_3, int VAR_4)

{

    TSContext *c = VAR_0->priv_data;



    int VAR_5;

    short *VAR_6 = VAR_1;

    int VAR_7 = 0;

    int16_t out_buf[240];



    if (!VAR_4)

        return 0;



    while (VAR_7 < VAR_4) {

        truespeech_read_frame(c, VAR_3 + VAR_7);

        VAR_7 += 32;



        truespeech_correlate_filter(c);

        truespeech_filters_merge(c);



        memset(out_buf, 0, 240 * 2);

        for(VAR_5 = 0; VAR_5 < 4; VAR_5++) {

            truespeech_apply_twopoint_filter(c, VAR_5);

            truespeech_place_pulses(c, out_buf + VAR_5 * 60, VAR_5);

            truespeech_update_filters(c, out_buf + VAR_5 * 60, VAR_5);

            truespeech_synth(c, out_buf + VAR_5 * 60, VAR_5);

        }



        truespeech_save_prevvec(c);



        

        for(VAR_5 = 0; VAR_5 < 240; VAR_5++)

            *VAR_6++ = out_buf[VAR_5];



    }



    *VAR_2 = VAR_7 * 15;



    return VAR_4;

}

static int FUNC_0(AVCodecContext *VAR_0,
void *VAR_1, int *VAR_2,
uint8_t *VAR_3, int VAR_4)
{ TSContext *c = VAR_0->priv_data; int VAR_5; short *VAR_6 = VAR_1; int VAR_7 = 0; int16_t out_buf[240]; if (!VAR_4)
return 0; while (VAR_7 < VAR_4) { truespeech_read_frame(c, VAR_3 + VAR_7); VAR_7 += 32; truespeech_correlate_filter(c); truespeech_filters_merge(c); memset(out_buf, 0, 240 * 2); for(VAR_5 = 0; VAR_5 < 4; VAR_5++) { truespeech_apply_twopoint_filter(c, VAR_5); truespeech_place_pulses(c, out_buf + VAR_5 * 60, VAR_5); truespeech_update_filters(c, out_buf + VAR_5 * 60, VAR_5); truespeech_synth(c, out_buf + VAR_5 * 60, VAR_5); } truespeech_save_prevvec(c); for(VAR_5 = 0; VAR_5 < 240; VAR_5++) *VAR_6++ = out_buf[VAR_5]; } *VAR_2 = VAR_7 * 15; return VAR_4; }