s->dsp.put_pixels_tab[1][motion_halfpel_index](
s->dsp.put_no_rnd_pixels_tab[1][motion_halfpel_index](
static void render_fragments(Vp3DecodeContext *s,                             int first_fragment,                             int width,                             int height,                             int plane /* 0 = Y, 1 = U, 2 = V */) {    int x, y;    int m, n;    int i = first_fragment;    int16_t *dequantizer;    unsigned char *output_plane;    unsigned char *last_plane;    unsigned char *golden_plane;    int stride;    int motion_x, motion_y;    int upper_motion_limit, lower_motion_limit;    int motion_halfpel_index;    unsigned int motion_source;    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->last_frame.data[0];        golden_plane = s->golden_frame.data[0];        stride = -s->current_frame.linesize[0];        upper_motion_limit = 7 * s->current_frame.linesize[0];        lower_motion_limit = height * s->current_frame.linesize[0] + width - 8;    } else if (plane == 1) {        dequantizer = s->intra_c_dequant;        output_plane = s->current_frame.data[1];        last_plane = s->last_frame.data[1];        golden_plane = s->golden_frame.data[1];        stride = -s->current_frame.linesize[1];        upper_motion_limit = 7 * s->current_frame.linesize[1];        lower_motion_limit = height * s->current_frame.linesize[1] + width - 8;    } else {        dequantizer = s->intra_c_dequant;        output_plane = s->current_frame.data[2];        last_plane = s->last_frame.data[2];        golden_plane = s->golden_frame.data[2];        stride = -s->current_frame.linesize[2];        upper_motion_limit = 7 * s->current_frame.linesize[2];        lower_motion_limit = height * s->current_frame.linesize[2] + width - 8;    }    /* for each fragment row... */    for (y = 0; y < height; y += 8) {        /* for each fragment in a row... */        for (x = 0; x < width; x += 8, i++) {            if ((i < 0) || (i >= s->fragment_count)) {                printf ("  vp3:render_fragments(): bad fragment number (%d)\n", i);                return;            }            /* transform if this block was coded */            if (s->all_fragments[i].coding_method != MODE_COPY) {                motion_source = s->all_fragments[i].first_pixel;                motion_halfpel_index = 0;                /* sort out the motion vector if this fragment is coded                 * using a motion vector method */                if ((s->all_fragments[i].coding_method > MODE_INTRA) &&                    (s->all_fragments[i].coding_method != MODE_USING_GOLDEN)) {                    motion_x = s->all_fragments[i].motion_x;                    motion_y = s->all_fragments[i].motion_y;if ((motion_x == 0xbeef) || (motion_y == 0xbeef))printf (" help! got beefy vector! (%X, %X)\n", motion_x, motion_y);                    if (motion_x >= 0) {                        motion_halfpel_index = motion_x & 0x01;                        motion_source += (motion_x >> 1);                    } else  {                        motion_x = -motion_x;                        motion_halfpel_index = motion_x & 0x01;                        motion_source -= ((motion_x + 1) >> 1);                    }//                    motion_y = -motion_y;                    if (motion_y >= 0) {                        motion_halfpel_index |= (motion_y & 0x01) << 1;                        motion_source += ((motion_y >> 1) * stride);                    } else  {                        motion_y = -motion_y;                        motion_halfpel_index |= (motion_y & 0x01) << 1;                        motion_source -= (((motion_y + 1) >> 1) * stride);                    }                    /* if the are any problems with a motion vector, refuse                     * to render the block */                    if ((motion_source < upper_motion_limit) ||                        (motion_source > lower_motion_limit)) {                        printf ("  vp3: help! motion source (%d) out of range (%d..%d), fragment %d\n",                            motion_source, upper_motion_limit, lower_motion_limit, i);                        continue;                    }                }                /* first, take care of copying a block from either the                 * previous or the golden frame */                if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) ||                    (s->all_fragments[i].coding_method == MODE_GOLDEN_MV)) {                    s->dsp.put_pixels_tab[1][motion_halfpel_index](                        output_plane + s->all_fragments[i].first_pixel,                        golden_plane + motion_source,                        stride, 8);                } else                 if (s->all_fragments[i].coding_method != MODE_INTRA) {                    s->dsp.put_pixels_tab[1][motion_halfpel_index](                        output_plane + s->all_fragments[i].first_pixel,                        last_plane + motion_source,                        stride, 8);                }                /* dequantize the DCT coefficients */                debug_idct("fragment %d, coding mode %d, DC = %d, dequant = %d:\n",                     i, s->all_fragments[i].coding_method,                     s->all_fragments[i].coeffs[0], dequantizer[0]);                /* invert DCT and place (or add) in final output */                if (s->all_fragments[i].coding_method == MODE_INTRA) {                    vp3_idct_put(s->all_fragments[i].coeffs, dequantizer,                        output_plane + s->all_fragments[i].first_pixel,                        stride);                } else {                    vp3_idct_add(s->all_fragments[i].coeffs, dequantizer,                        output_plane + s->all_fragments[i].first_pixel,                        stride);                }                debug_idct("block after idct_%s():\n",                    (s->all_fragments[i].coding_method == MODE_INTRA)?                    "put" : "add");                for (m = 0; m < 8; m++) {                    for (n = 0; n < 8; n++) {                        debug_idct(" %3d", *(output_plane +                             s->all_fragments[i].first_pixel + (m * stride + n)));                    }                    debug_idct("\n");                }                debug_idct("\n");            } else {                /* copy directly from the previous frame */                s->dsp.put_pixels_tab[1][0](                    output_plane + s->all_fragments[i].first_pixel,                    last_plane + s->all_fragments[i].first_pixel,                    stride, 8);            }        }    }    emms_c();}