static void render_fragments(Vp3DecodeContext *s,

                             int first_fragment,

                             int fragment_width,

                             int fragment_height,

                             int plane /* 0 = Y, 1 = U, 2 = V */) 

{

    int x, y;

    int m, n;

    int i = first_fragment;

    int j;

    int16_t *dequantizer;

    DCTELEM dequant_block[64];

    unsigned char *output_plane;

    unsigned char *last_plane;

    unsigned char *golden_plane;

    int stride;



    debug_vp3("  vp3: rendering final fragments for %s\n",

        (plane == 0) ? "Y plane" : (plane == 1) ? "U plane" : "V plane");



    /* set up plane-specific parameters */

    if (plane == 0) {

        dequantizer = s->intra_y_dequant;

        output_plane = s->current_frame.data[0];

        last_plane = s->current_frame.data[0];

        golden_plane = s->current_frame.data[0];

        stride = -s->current_frame.linesize[0];

    } else if (plane == 1) {

        dequantizer = s->intra_c_dequant;

        output_plane = s->current_frame.data[1];

        last_plane = s->current_frame.data[1];

        golden_plane = s->current_frame.data[1];

        stride = -s->current_frame.linesize[1];

    } else {

        dequantizer = s->intra_c_dequant;

        output_plane = s->current_frame.data[2];

        last_plane = s->current_frame.data[2];

        golden_plane = s->current_frame.data[2];

        stride = -s->current_frame.linesize[2];

    }



    /* for each fragment row... */

    for (y = 0; y < fragment_height; y++) {



        /* for each fragment in a row... */

        for (x = 0; x < fragment_width; x++, i++) {



            /* transform if this block was coded */

            if (s->all_fragments[i].coding_method == MODE_INTRA) {

                /* dequantize the DCT coefficients */

                for (j = 0; j < 64; j++)

                    dequant_block[dequant_index[j]] =

                        s->all_fragments[i].coeffs[j] *

                        dequantizer[j];

                dequant_block[0] += 1024;



                debug_idct("fragment %d:\n", i);

                debug_idct("dequantized block:\n");

                for (m = 0; m < 8; m++) {

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

                        debug_idct(" %5d", dequant_block[m * 8 + n]);

                    }

                    debug_idct("\n");

                }

                debug_idct("\n");



                /* invert DCT and place in final output */

                s->dsp.idct_put(

                    output_plane + s->all_fragments[i].first_pixel,

                    stride, dequant_block);



/*

                debug_idct("idct block:\n");

                for (m = 0; m < 8; m++) {

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

                        debug_idct(" %3d", pixels[m * 8 + n]);

                    }

                    debug_idct("\n");

                }

                debug_idct("\n");

*/

            } else if (s->all_fragments[i].coding_method == MODE_COPY) {



                /* copy directly from the previous frame */

                for (m = 0; m < 8; m++)

                    memcpy(

                        output_plane + s->all_fragments[i].first_pixel + stride * m,

                        last_plane + s->all_fragments[i].first_pixel + stride * m,

                        8);



            } else {



                /* carry out the motion compensation */



            }

        }

    }



    emms_c();



}

static void render_fragments(Vp3DecodeContext *s,

                             int first_fragment,

                             int fragment_width,

                             int fragment_height,

                             int plane ) 

{

    int x, y;

    int m, n;

    int i = first_fragment;

    int j;

    int16_t *dequantizer;

    DCTELEM dequant_block[64];

    unsigned char *output_plane;

    unsigned char *last_plane;

    unsigned char *golden_plane;

    int stride;



    debug_vp3("  vp3: rendering final fragments for %s\n",

        (plane == 0) ? "Y plane" : (plane == 1) ? "U plane" : "V plane");



    

    if (plane == 0) {

        dequantizer = s->intra_y_dequant;

        output_plane = s->current_frame.data[0];

        last_plane = s->current_frame.data[0];

        golden_plane = s->current_frame.data[0];

        stride = -s->current_frame.linesize[0];

    } else if (plane == 1) {

        dequantizer = s->intra_c_dequant;

        output_plane = s->current_frame.data[1];

        last_plane = s->current_frame.data[1];

        golden_plane = s->current_frame.data[1];

        stride = -s->current_frame.linesize[1];

    } else {

        dequantizer = s->intra_c_dequant;

        output_plane = s->current_frame.data[2];

        last_plane = s->current_frame.data[2];

        golden_plane = s->current_frame.data[2];

        stride = -s->current_frame.linesize[2];

    }



    

    for (y = 0; y < fragment_height; y++) {



        

        for (x = 0; x < fragment_width; x++, i++) {



            

            if (s->all_fragments[i].coding_method == MODE_INTRA) {

                

                for (j = 0; j < 64; j++)

                    dequant_block[dequant_index[j]] =

                        s->all_fragments[i].coeffs[j] *

                        dequantizer[j];

                dequant_block[0] += 1024;



                debug_idct("fragment %d:\n", i);

                debug_idct("dequantized block:\n");

                for (m = 0; m < 8; m++) {

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

                        debug_idct(" %5d", dequant_block[m * 8 + n]);

                    }

                    debug_idct("\n");

                }

                debug_idct("\n");



                

                s->dsp.idct_put(

                    output_plane + s->all_fragments[i].first_pixel,

                    stride, dequant_block);























            } else if (s->all_fragments[i].coding_method == MODE_COPY) {



                

                for (m = 0; m < 8; m++)

                    memcpy(

                        output_plane + s->all_fragments[i].first_pixel + stride * m,

                        last_plane + s->all_fragments[i].first_pixel + stride * m,

                        8);



            } else {



                



            }

        }

    }



    emms_c();



}

        last_plane = s->current_frame.data[0];         golden_plane = s->current_frame.data[0];         last_plane = s->current_frame.data[1];         golden_plane = s->current_frame.data[1];         last_plane = s->current_frame.data[2];         golden_plane = s->current_frame.data[2];
static void FUNC_0(Vp3DecodeContext *VAR_0,

                             int VAR_1,

                             int VAR_2,

                             int VAR_3,

                             int VAR_4 ) 

{

    int VAR_5, VAR_6;

    int VAR_7, VAR_8;

    int VAR_9 = VAR_1;

    int VAR_10;

    int16_t *dequantizer;

    DCTELEM dequant_block[64];

    unsigned char *VAR_11;

    unsigned char *VAR_12;

    unsigned char *VAR_13;

    int VAR_14;



    debug_vp3("  vp3: rendering final fragments for %VAR_0\VAR_8",

        (VAR_4 == 0) ? "Y VAR_4" : (VAR_4 == 1) ? "U VAR_4" : "V VAR_4");



    

    if (VAR_4 == 0) {

        dequantizer = VAR_0->intra_y_dequant;

        VAR_11 = VAR_0->current_frame.data[0];

        VAR_12 = VAR_0->current_frame.data[0];

        VAR_13 = VAR_0->current_frame.data[0];

        VAR_14 = -VAR_0->current_frame.linesize[0];

    } else if (VAR_4 == 1) {

        dequantizer = VAR_0->intra_c_dequant;

        VAR_11 = VAR_0->current_frame.data[1];

        VAR_12 = VAR_0->current_frame.data[1];

        VAR_13 = VAR_0->current_frame.data[1];

        VAR_14 = -VAR_0->current_frame.linesize[1];

    } else {

        dequantizer = VAR_0->intra_c_dequant;

        VAR_11 = VAR_0->current_frame.data[2];

        VAR_12 = VAR_0->current_frame.data[2];

        VAR_13 = VAR_0->current_frame.data[2];

        VAR_14 = -VAR_0->current_frame.linesize[2];

    }



    

    for (VAR_6 = 0; VAR_6 < VAR_3; VAR_6++) {



        

        for (VAR_5 = 0; VAR_5 < VAR_2; VAR_5++, VAR_9++) {



            

            if (VAR_0->all_fragments[VAR_9].coding_method == MODE_INTRA) {

                

                for (VAR_10 = 0; VAR_10 < 64; VAR_10++)

                    dequant_block[dequant_index[VAR_10]] =

                        VAR_0->all_fragments[VAR_9].coeffs[VAR_10] *

                        dequantizer[VAR_10];

                dequant_block[0] += 1024;



                debug_idct("fragment %d:\VAR_8", VAR_9);

                debug_idct("dequantized block:\VAR_8");

                for (VAR_7 = 0; VAR_7 < 8; VAR_7++) {

                    for (VAR_8 = 0; VAR_8 < 8; VAR_8++) {

                        debug_idct(" %5d", dequant_block[VAR_7 * 8 + VAR_8]);

                    }

                    debug_idct("\VAR_8");

                }

                debug_idct("\VAR_8");



                

                VAR_0->dsp.idct_put(

                    VAR_11 + VAR_0->all_fragments[VAR_9].first_pixel,

                    VAR_14, dequant_block);























            } else if (VAR_0->all_fragments[VAR_9].coding_method == MODE_COPY) {



                

                for (VAR_7 = 0; VAR_7 < 8; VAR_7++)

                    memcpy(

                        VAR_11 + VAR_0->all_fragments[VAR_9].first_pixel + VAR_14 * VAR_7,

                        VAR_12 + VAR_0->all_fragments[VAR_9].first_pixel + VAR_14 * VAR_7,

                        8);



            } else {



                



            }

        }

    }



    emms_c();



}

static void FUNC_0(Vp3DecodeContext *VAR_0,
int VAR_1,
int VAR_2,
int VAR_3,
int VAR_4 )
{ int VAR_5, VAR_6; int VAR_7, VAR_8; int VAR_9 = VAR_1; int VAR_10; int16_t *dequantizer; DCTELEM dequant_block[64]; unsigned char *VAR_11; unsigned char *VAR_12; unsigned char *VAR_13; int VAR_14; debug_vp3("  vp3: rendering final fragments for %VAR_0\VAR_8",
(VAR_4 == 0) ? "Y VAR_4" : (VAR_4 == 1) ? "U VAR_4" : "V VAR_4"); if (VAR_4 == 0) { dequantizer = VAR_0->intra_y_dequant; VAR_11 = VAR_0->current_frame.data[0]; VAR_12 = VAR_0->current_frame.data[0]; VAR_13 = VAR_0->current_frame.data[0]; VAR_14 = -VAR_0->current_frame.linesize[0]; } else if (VAR_4 == 1) { dequantizer = VAR_0->intra_c_dequant; VAR_11 = VAR_0->current_frame.data[1]; VAR_12 = VAR_0->current_frame.data[1]; VAR_13 = VAR_0->current_frame.data[1]; VAR_14 = -VAR_0->current_frame.linesize[1]; } else { dequantizer = VAR_0->intra_c_dequant; VAR_11 = VAR_0->current_frame.data[2]; VAR_12 = VAR_0->current_frame.data[2]; VAR_13 = VAR_0->current_frame.data[2]; VAR_14 = -VAR_0->current_frame.linesize[2]; } for (VAR_6 = 0; VAR_6 < VAR_3; VAR_6++) { for (VAR_5 = 0; VAR_5 < VAR_2; VAR_5++, VAR_9++) { if (VAR_0->all_fragments[VAR_9].coding_method == MODE_INTRA) { for (VAR_10 = 0; VAR_10 < 64; VAR_10++) dequant_block[dequant_index[VAR_10]] =
VAR_0->all_fragments[VAR_9].coeffs[VAR_10] *
dequantizer[VAR_10]; dequant_block[0] += 1024; debug_idct("fragment %d:\VAR_8", VAR_9); debug_idct("dequantized block:\VAR_8"); for (VAR_7 = 0; VAR_7 < 8; VAR_7++) { for (VAR_8 = 0; VAR_8 < 8; VAR_8++) { debug_idct(" %5d", dequant_block[VAR_7 * 8 + VAR_8]); } debug_idct("\VAR_8"); } debug_idct("\VAR_8"); VAR_0->dsp.idct_put(
VAR_11 + VAR_0->all_fragments[VAR_9].first_pixel,
VAR_14, dequant_block); } else if (VAR_0->all_fragments[VAR_9].coding_method == MODE_COPY) { for (VAR_7 = 0; VAR_7 < 8; VAR_7++) memcpy(
VAR_11 + VAR_0->all_fragments[VAR_9].first_pixel + VAR_14 * VAR_7,
VAR_12 + VAR_0->all_fragments[VAR_9].first_pixel + VAR_14 * VAR_7,
8); } else { } } } emms_c(); }