j = zigzag_direct[i];
j = scantable[i];
static int mpeg1_decode_block(MpegEncContext *s,                                DCTELEM *block,                                int n){    int level, dc, diff, i, j, run;    int code, component;    RLTable *rl = &rl_mpeg1;    if (s->mb_intra) {        /* DC coef */        component = (n <= 3 ? 0 : n - 4 + 1);        diff = decode_dc(s, component);        if (diff >= 0xffff)            return -1;        dc = s->last_dc[component];        dc += diff;        s->last_dc[component] = dc;        block[0] = dc;        dprintf("dc=%d diff=%d\n", dc, diff);        i = 1;    } else {        int v;        OPEN_READER(re, &s->gb);        i = 0;        /* special case for the first coef. no need to add a second vlc table */        UPDATE_CACHE(re, &s->gb);        v= SHOW_UBITS(re, &s->gb, 2);        if (v & 2) {            run = 0;            level = 1 - ((v & 1) << 1);            SKIP_BITS(re, &s->gb, 2);            CLOSE_READER(re, &s->gb);            goto add_coef;        }        CLOSE_READER(re, &s->gb);    }    /* now quantify & encode AC coefs */    for(;;) {        code = get_vlc2(&s->gb, rl->vlc.table, TEX_VLC_BITS, 2);        if (code < 0) {            return -1;        }        if (code == 112) {            break;        } else if (code == 111) {            /* escape */            run = get_bits(&s->gb, 6);            level = get_bits(&s->gb, 8);            level= (level + ((-1)<<7)) ^ ((-1)<<7); //sign extension            if (level == -128) {                level = get_bits(&s->gb, 8) - 256;            } else if (level == 0) {                level = get_bits(&s->gb, 8);            }        } else {            run = rl->table_run[code];            level = rl->table_level[code];            if (get_bits1(&s->gb))                level = -level;        }        i += run;        if (i >= 64)            return -1;    add_coef:        dprintf("%d: run=%d level=%d\n", n, run, level);	j = zigzag_direct[i];        block[j] = level;        i++;    }    s->block_last_index[n] = i-1;    return 0;}