UINT16 *dc_val;
INT16 *dc_val;
static int msmpeg4_pred_dc(MpegEncContext * s, int n,                            UINT16 **dc_val_ptr, int *dir_ptr){    int a, b, c, x, y, wrap, pred, scale;    UINT16 *dc_val;    /* find prediction */    if (n < 4) {	x = 2 * s->mb_x + 1 + (n & 1);	y = 2 * s->mb_y + 1 + ((n & 2) >> 1);	wrap = s->mb_width * 2 + 2;	dc_val = s->dc_val[0];	scale = s->y_dc_scale;    } else {	x = s->mb_x + 1;	y = s->mb_y + 1;	wrap = s->mb_width + 2;	dc_val = s->dc_val[n - 4 + 1];	scale = s->c_dc_scale;    }    /* B C     * A X      */    a = dc_val[(x - 1) + (y) * wrap];    b = dc_val[(x - 1) + (y - 1) * wrap];    c = dc_val[(x) + (y - 1) * wrap];    /* XXX: the following solution consumes divisions, but it does not       necessitate to modify mpegvideo.c. The problem comes from the       fact they decided to store the quantized DC (which would lead       to problems if Q could vary !) */    a = (a + (scale >> 1)) / scale;    b = (b + (scale >> 1)) / scale;    c = (c + (scale >> 1)) / scale;    /* XXX: WARNING: they did not choose the same test as MPEG4. This       is very important ! */    if (abs(a - b) <= abs(b - c)) {	pred = c;        *dir_ptr = 1;    } else {	pred = a;        *dir_ptr = 0;    }    /* update predictor */    *dc_val_ptr = &dc_val[(x) + (y) * wrap];    return pred;}