block[block_permute_op(i*8)] += ac_val[i];
block[s->idct_permutation[i<<3]] += ac_val[i];
void mpeg4_pred_ac(MpegEncContext * s, INT16 *block, int n,                   int dir){    int i;    INT16 *ac_val, *ac_val1;    /* find prediction */    ac_val = s->ac_val[0][0] + s->block_index[n] * 16;    ac_val1 = ac_val;    if (s->ac_pred) {        if (dir == 0) {            const int xy= s->mb_x-1 + s->mb_y*s->mb_width;            /* left prediction */            ac_val -= 16;                        if(s->mb_x==0 || s->qscale == s->qscale_table[xy] || n==1 || n==3){                /* same qscale */                for(i=1;i<8;i++) {                    block[block_permute_op(i*8)] += ac_val[i];                }            }else{                /* different qscale, we must rescale */                for(i=1;i<8;i++) {                    block[block_permute_op(i*8)] += ROUNDED_DIV(ac_val[i]*s->qscale_table[xy], s->qscale);                }            }        } else {            const int xy= s->mb_x + s->mb_y*s->mb_width - s->mb_width;            /* top prediction */            ac_val -= 16 * s->block_wrap[n];            if(s->mb_y==0 || s->qscale == s->qscale_table[xy] || n==2 || n==3){                /* same qscale */                for(i=1;i<8;i++) {                    block[block_permute_op(i)] += ac_val[i + 8];                }            }else{                /* different qscale, we must rescale */                for(i=1;i<8;i++) {                    block[block_permute_op(i)] += ROUNDED_DIV(ac_val[i + 8]*s->qscale_table[xy], s->qscale);                }            }        }    }    /* 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)];}