j = zigzag_direct[i];
j = s->scantable.permutated[i];
static int decode_block(MJpegDecodeContext *s, DCTELEM *block,                         int component, int dc_index, int ac_index, int quant_index){    int nbits, code, i, j, level;    int run, val;    VLC *ac_vlc;    INT16 *quant_matrix;    /* DC coef */    val = mjpeg_decode_dc(s, dc_index);    if (val == 0xffff) {        dprintf("error dc\n");        return -1;    }    quant_matrix = s->quant_matrixes[quant_index];    val = val * quant_matrix[0] + s->last_dc[component];    s->last_dc[component] = val;    block[0] = val;    /* AC coefs */    ac_vlc = &s->vlcs[1][ac_index];    i = 1;    for(;;) {        code = get_vlc(&s->gb, ac_vlc);        if (code < 0) {            dprintf("error ac\n");            return -1;        }        /* EOB */        if (code == 0)            break;        if (code == 0xf0) {            i += 16;        } else {            run = code >> 4;            nbits = code & 0xf;            level = get_bits(&s->gb, nbits);            if ((level & (1 << (nbits - 1))) == 0)                 level = (-1 << nbits) | (level + 1);            i += run;            if (i >= 64) {                dprintf("error count: %d\n", i);                return -1;            }            j = zigzag_direct[i];            block[j] = level * quant_matrix[j];            i++;            if (i >= 64)                break;        }    }    return 0;}