static int RENAME(resample_common)(ResampleContext *c,

                                   void *dest, const void *source,

                                   int n, int update_ctx)

{

    DELEM *dst = dest;

    const DELEM *src = source;

    int dst_index;

    int index= c->index;

    int frac= c->frac;

    int sample_index = 0;



    while (index >= c->phase_count) {

        sample_index++;

        index -= c->phase_count;

    }



    for (dst_index = 0; dst_index < n; dst_index++) {

        FELEM *filter = ((FELEM *) c->filter_bank) + c->filter_alloc * index;



        FELEM2 val= FOFFSET;

        int i;

        for (i = 0; i < c->filter_length; i++) {

            val += src[sample_index + i] * (FELEM2)filter[i];

        }

        OUT(dst[dst_index], val);



        frac  += c->dst_incr_mod;

        index += c->dst_incr_div;

        if (frac >= c->src_incr) {

            frac -= c->src_incr;

            index++;

        }



        while (index >= c->phase_count) {

            sample_index++;

            index -= c->phase_count;

        }

    }



    if(update_ctx){

        c->frac= frac;

        c->index= index;

    }



    return sample_index;

}

static int RENAME(resample_common)(ResampleContext *c,

                                   void *dest, const void *source,

                                   int n, int update_ctx)

{

    DELEM *dst = dest;

    const DELEM *src = source;

    int dst_index;

    int index= c->index;

    int frac= c->frac;

    int sample_index = 0;



    while (index >= c->phase_count) {

        sample_index++;

        index -= c->phase_count;

    }



    for (dst_index = 0; dst_index < n; dst_index++) {

        FELEM *filter = ((FELEM *) c->filter_bank) + c->filter_alloc * index;



        FELEM2 val= FOFFSET;

        int i;

        for (i = 0; i < c->filter_length; i++) {

            val += src[sample_index + i] * (FELEM2)filter[i];

        }

        OUT(dst[dst_index], val);



        frac  += c->dst_incr_mod;

        index += c->dst_incr_div;

        if (frac >= c->src_incr) {

            frac -= c->src_incr;

            index++;

        }



        while (index >= c->phase_count) {

            sample_index++;

            index -= c->phase_count;

        }

    }



    if(update_ctx){

        c->frac= frac;

        c->index= index;

    }



    return sample_index;

}

        FELEM2 val= FOFFSET;         for (i = 0; i < c->filter_length; i++) {             val += src[sample_index + i] * (FELEM2)filter[i];         OUT(dst[dst_index], val);
static int FUNC_0(resample_common)(ResampleContext *c,

                                   void *dest, const void *source,

                                   int n, int update_ctx)

{

    DELEM *dst = dest;

    const DELEM *VAR_0 = source;

    int VAR_1;

    int VAR_2= c->VAR_2;

    int VAR_3= c->VAR_3;

    int VAR_4 = 0;



    while (VAR_2 >= c->phase_count) {

        VAR_4++;

        VAR_2 -= c->phase_count;

    }



    for (VAR_1 = 0; VAR_1 < n; VAR_1++) {

        FELEM *filter = ((FELEM *) c->filter_bank) + c->filter_alloc * VAR_2;



        FELEM2 val= FOFFSET;

        int i;

        for (i = 0; i < c->filter_length; i++) {

            val += VAR_0[VAR_4 + i] * (FELEM2)filter[i];

        }

        OUT(dst[VAR_1], val);



        VAR_3  += c->dst_incr_mod;

        VAR_2 += c->dst_incr_div;

        if (VAR_3 >= c->src_incr) {

            VAR_3 -= c->src_incr;

            VAR_2++;

        }



        while (VAR_2 >= c->phase_count) {

            VAR_4++;

            VAR_2 -= c->phase_count;

        }

    }



    if(update_ctx){

        c->VAR_3= VAR_3;

        c->VAR_2= VAR_2;

    }



    return VAR_4;

}

static int FUNC_0(resample_common)(ResampleContext *c,
void *dest, const void *source,
int n, int update_ctx)
{ DELEM *dst = dest; const DELEM *VAR_0 = source; int VAR_1; int VAR_2= c->VAR_2; int VAR_3= c->VAR_3; int VAR_4 = 0; while (VAR_2 >= c->phase_count) { VAR_4++; VAR_2 -= c->phase_count; } for (VAR_1 = 0; VAR_1 < n; VAR_1++) { FELEM *filter = ((FELEM *) c->filter_bank) + c->filter_alloc * VAR_2; FELEM2 val= FOFFSET; int i; for (i = 0; i < c->filter_length; i++) { val += VAR_0[VAR_4 + i] * (FELEM2)filter[i]; } OUT(dst[VAR_1], val); VAR_3  += c->dst_incr_mod; VAR_2 += c->dst_incr_div; if (VAR_3 >= c->src_incr) { VAR_3 -= c->src_incr; VAR_2++; } while (VAR_2 >= c->phase_count) { VAR_4++; VAR_2 -= c->phase_count; } } if(update_ctx){ c->VAR_3= VAR_3; c->VAR_2= VAR_2; } return VAR_4; }