*dc_val = dcdiff * s->y_dc_scale;
block[0] = dcdiff * s->y_dc_scale;
int vc9_decode_block(VC9Context *v, DCTELEM block[64], int n, int coded, int mquant){    GetBitContext *gb = &v->s.gb;    MpegEncContext *s = &v->s;    int ttblk; /* Transform Type per Block */    int subblkpat; /* Sub-block Transform Type Pattern */    int dc_pred_dir; /* Direction of the DC prediction used */    int run_diff, i;    if (s->mb_intra)    {        int dcdiff;        uint16_t *dc_val;        /* Get DC differential */        if (n < 4) {            dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);        } else {            dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);        }        if (dcdiff < 0){            av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n");            return -1;        }        if (dcdiff)        {            if (dcdiff == 119 /* ESC index value */)            {                /* TODO: Optimize */                if (mquant == 1) dcdiff = get_bits(gb, 10);                else if (mquant == 2) dcdiff = get_bits(gb, 9);                else dcdiff = get_bits(gb, 8);            }            else            {                if (mquant == 1)                  dcdiff = (dcdiff<<2) + get_bits(gb, 2) - 3;                else if (mquant == 2)                  dcdiff = (dcdiff<<1) + get_bits(gb, 1) - 1;            }            if (get_bits(gb, 1))              dcdiff = -dcdiff;        }        /* Prediction */        dcdiff += vc9_pred_dc(s, n, &dc_val, &dc_pred_dir);        if (n < 4) {            *dc_val = dcdiff * s->y_dc_scale;        } else {            *dc_val = dcdiff * s->c_dc_scale;        }        if (dcdiff < 0)        {            av_log(s->avctx, AV_LOG_ERROR, "DC=%i<0\n", dcdiff);            return -1;        }        block[0] = dcdiff; //XXX: Must be > 0                /* Skip ? */        run_diff = 0;        i = 0;        if (!coded) {            goto not_coded;        }    }    else    {        mquant = v->pq;        /* Get TTBLK */        if (v->ttmb < 8) /* per block */            ttblk = get_vlc2(gb, vc9_ttblk_vlc[v->tt_index].table, VC9_TTBLK_VLC_BITS, 2);        else /* Per frame */          ttblk = 0; //FIXME, depends on ttfrm        /* Get SUBBLKPAT */        if (ttblk == v->ttblk4x4) /* 4x4 transform for that qp value */            subblkpat = 1+get_vlc2(gb, vc9_subblkpat_vlc[v->tt_index].table,                                   VC9_SUBBLKPAT_VLC_BITS, 2);        else /* All others: 8x8, 4x8, 8x4 */            subblkpat = decode012(gb);    }    //TODO AC Decoding not_coded:    if (s->mb_intra) {        mpeg4_pred_ac(s, block, n, dc_pred_dir);        if (s->ac_pred) {            i = 63; /* XXX: not optimal */        }    }    if(i>0) i=63; //FIXME/XXX optimize    s->block_last_index[n] = i;    return 0;}