y = 2 * s->mb_y + 1 + ((n & 2) >> 1);
y = 2 * s->mb_y + 1 + (n >> 1);
void mpeg4_pred_ac(MpegEncContext * s, INT16 *block, int n,                   int dir){    int x, y, wrap, i;    INT16 *ac_val, *ac_val1;    /* 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;	ac_val = s->ac_val[0][0];    } else {	x = s->mb_x + 1;	y = s->mb_y + 1;	wrap = s->mb_width + 2;	ac_val = s->ac_val[n - 4 + 1][0];    }    ac_val += ((y) * wrap + (x)) * 16;    ac_val1 = ac_val;    if (s->ac_pred) {        if (dir == 0) {            /* left prediction */            ac_val -= 16;            for(i=1;i<8;i++) {                block[block_permute_op(i*8)] += ac_val[i];            }        } else {            /* top prediction */            ac_val -= 16 * wrap;            for(i=1;i<8;i++) {                block[block_permute_op(i)] += ac_val[i + 8];            }        }    }    /* left copy */    for(i=1;i<8;i++)        ac_val1[i] = block[block_permute_op(i * 8)];    /* top copy */    for(i=1;i<8;i++)        ac_val1[8 + i] = block[block_permute_op(i)];}