static int done;
static int done=0;
static int dvvideo_decode_init(AVCodecContext *avctx){    DVVideoDecodeContext *s = avctx->priv_data;    MpegEncContext s2;    static int done;    if (!done) {        int i;        done = 1;        /* NOTE: as a trick, we use the fact the no codes are unused           to accelerate the parsing of partial codes */        init_vlc(&dv_vlc, TEX_VLC_BITS, NB_DV_VLC,                  dv_vlc_len, 1, 1, dv_vlc_bits, 2, 2);        dv_rl_vlc[0] = av_malloc(dv_vlc.table_size * sizeof(RL_VLC_ELEM));        for(i = 0; i < dv_vlc.table_size; i++){            int code= dv_vlc.table[i][0];            int len = dv_vlc.table[i][1];            int level, run;                    if(len<0){ //more bits needed                run= 0;                level= code;            } else if (code == (NB_DV_VLC - 1)) {                /* EOB */                run = 0;                level = 256;            } else {                run=   dv_vlc_run[code] + 1;                level= dv_vlc_level[code];            }            dv_rl_vlc[0][i].len = len;            dv_rl_vlc[0][i].level = level;            dv_rl_vlc[0][i].run = run;        }    }    /* ugly way to get the idct & scantable */    /* XXX: fix it */    memset(&s2, 0, sizeof(MpegEncContext));    s2.avctx = avctx;    dsputil_init(&s2.dsp, avctx->dsp_mask);    if (DCT_common_init(&s2) < 0)       return -1;    s->idct_put[0] = s2.idct_put;    memcpy(s->idct_permutation, s2.idct_permutation, 64);    memcpy(s->dv_zigzag[0], s2.intra_scantable.permutated, 64);    /* XXX: use MMX also for idct248 */    s->idct_put[1] = simple_idct248_put;    memcpy(s->dv_zigzag[1], dv_248_zigzag, 64);    /* XXX: do it only for constant case */    dv_build_unquantize_tables(s);        return 0;}