op_qpix= qpel_mc_no_rnd_tab;
op_qpix= put_no_rnd_qpel_pixels_tab;
void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64]){    int mb_x, mb_y;    const int mb_xy = s->mb_y * s->mb_width + s->mb_x;    mb_x = s->mb_x;    mb_y = s->mb_y;#ifdef FF_POSTPROCESS    /* Obsolete. Exists for compatibility with mplayer only. */    quant_store[mb_y][mb_x]=s->qscale;    //printf("[%02d][%02d] %d\n",mb_x,mb_y,s->qscale);#else    /* even more obsolete, exists for mplayer xp only */    if(s->avctx->quant_store) s->avctx->quant_store[mb_y*s->avctx->qstride+mb_x] = s->qscale;#endif    s->qscale_table[mb_xy]= s->qscale;    /* update DC predictors for P macroblocks */    if (!s->mb_intra) {        if (s->h263_pred || s->h263_aic) {            if(s->mbintra_table[mb_xy])                ff_clean_intra_table_entries(s);        } else {            s->last_dc[0] =            s->last_dc[1] =            s->last_dc[2] = 128 << s->intra_dc_precision;        }    }    else if (s->h263_pred || s->h263_aic)        s->mbintra_table[mb_xy]=1;    /* update motion predictor, not for B-frames as they need the motion_val from the last P/S-Frame */    if (s->out_format == FMT_H263 && s->pict_type!=B_TYPE) { //FIXME move into h263.c if possible, format specific stuff shouldnt be here                const int wrap = s->block_wrap[0];        const int xy = s->block_index[0];        if(s->mv_type == MV_TYPE_8X8){            s->non_b_mv4_table[xy]=1;        } else {            int motion_x, motion_y;            if (s->mb_intra) {                motion_x = 0;                motion_y = 0;            } else if (s->mv_type == MV_TYPE_16X16) {                motion_x = s->mv[0][0][0];                motion_y = s->mv[0][0][1];            } else /*if (s->mv_type == MV_TYPE_FIELD)*/ {                motion_x = s->mv[0][0][0] + s->mv[0][1][0];                motion_y = s->mv[0][0][1] + s->mv[0][1][1];                motion_x = (motion_x>>1) | (motion_x&1);                motion_y = (motion_y>>1) | (motion_y&1);            }            /* no update if 8X8 because it has been done during parsing */            s->motion_val[xy][0] = motion_x;            s->motion_val[xy][1] = motion_y;            s->motion_val[xy + 1][0] = motion_x;            s->motion_val[xy + 1][1] = motion_y;            s->motion_val[xy + wrap][0] = motion_x;            s->motion_val[xy + wrap][1] = motion_y;            s->motion_val[xy + 1 + wrap][0] = motion_x;            s->motion_val[xy + 1 + wrap][1] = motion_y;            s->non_b_mv4_table[xy]=0;        }    }        if (!(s->encoding && (s->intra_only || s->pict_type==B_TYPE))) {        UINT8 *dest_y, *dest_cb, *dest_cr;        int dct_linesize, dct_offset;        op_pixels_func *op_pix;        qpel_mc_func *op_qpix;        /* avoid copy if macroblock skipped in last frame too            dont touch it for B-frames as they need the skip info from the next p-frame */        if (s->pict_type != B_TYPE) {            UINT8 *mbskip_ptr = &s->mbskip_table[mb_xy];            if (s->mb_skiped) {                s->mb_skiped = 0;                (*mbskip_ptr) ++; /* indicate that this time we skiped it */                if(*mbskip_ptr >99) *mbskip_ptr= 99;                /* if previous was skipped too, then nothing to do !                    skip only during decoding as we might trash the buffers during encoding a bit */                if (*mbskip_ptr >= s->ip_buffer_count  && !s->encoding)                     goto the_end;            } else {                *mbskip_ptr = 0; /* not skipped */            }        }        dest_y = s->current_picture [0] + (mb_y * 16* s->linesize  ) + mb_x * 16;        dest_cb = s->current_picture[1] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;        dest_cr = s->current_picture[2] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;        if (s->interlaced_dct) {            dct_linesize = s->linesize * 2;            dct_offset = s->linesize;        } else {            dct_linesize = s->linesize;            dct_offset = s->linesize * 8;        }        if (!s->mb_intra) {            /* motion handling */            /* decoding or more than one mb_type (MC was allready done otherwise) */            if((!s->encoding) || (s->mb_type[mb_xy]&(s->mb_type[mb_xy]-1))){                if ((!s->no_rounding) || s->pict_type==B_TYPE){                                    op_pix = put_pixels_tab;                    op_qpix= qpel_mc_rnd_tab;                }else{                    op_pix = put_no_rnd_pixels_tab;                    op_qpix= qpel_mc_no_rnd_tab;                }                if (s->mv_dir & MV_DIR_FORWARD) {                    MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture, op_pix, op_qpix);                    if ((!s->no_rounding) || s->pict_type==B_TYPE)                        op_pix = avg_pixels_tab;                    else                        op_pix = avg_no_rnd_pixels_tab;                }                if (s->mv_dir & MV_DIR_BACKWARD) {                    MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture, op_pix, op_qpix);                }            }            /* skip dequant / idct if we are really late ;) */            if(s->hurry_up>1) goto the_end;            /* add dct residue */            if(s->encoding || !(s->mpeg2 || s->h263_msmpeg4 || (s->codec_id==CODEC_ID_MPEG4 && !s->mpeg_quant))){                add_dequant_dct(s, block[0], 0, dest_y, dct_linesize);                add_dequant_dct(s, block[1], 1, dest_y + 8, dct_linesize);                add_dequant_dct(s, block[2], 2, dest_y + dct_offset, dct_linesize);                add_dequant_dct(s, block[3], 3, dest_y + dct_offset + 8, dct_linesize);                if(!(s->flags&CODEC_FLAG_GRAY)){                    add_dequant_dct(s, block[4], 4, dest_cb, s->uvlinesize);                    add_dequant_dct(s, block[5], 5, dest_cr, s->uvlinesize);                }            } else {                add_dct(s, block[0], 0, dest_y, dct_linesize);                add_dct(s, block[1], 1, dest_y + 8, dct_linesize);                add_dct(s, block[2], 2, dest_y + dct_offset, dct_linesize);                add_dct(s, block[3], 3, dest_y + dct_offset + 8, dct_linesize);                if(!(s->flags&CODEC_FLAG_GRAY)){                    add_dct(s, block[4], 4, dest_cb, s->uvlinesize);                    add_dct(s, block[5], 5, dest_cr, s->uvlinesize);                }            }        } else {            /* dct only in intra block */            put_dct(s, block[0], 0, dest_y, dct_linesize);            put_dct(s, block[1], 1, dest_y + 8, dct_linesize);            put_dct(s, block[2], 2, dest_y + dct_offset, dct_linesize);            put_dct(s, block[3], 3, dest_y + dct_offset + 8, dct_linesize);            if(!(s->flags&CODEC_FLAG_GRAY)){                put_dct(s, block[4], 4, dest_cb, s->uvlinesize);                put_dct(s, block[5], 5, dest_cr, s->uvlinesize);            }        }    } the_end:    emms_c(); //FIXME remove}