if(s->avctx->debug&FF_DEBUG_SKIP){ for(i=0; i<s->mb_num; i++){ if(i%s->mb_width==0) printf("\n"); printf("%d", s->mb_type[i]); } }
int ff_wmv2_decode_picture_header(MpegEncContext * s){    Wmv2Context * const w= (Wmv2Context*)s;    int code, i;#if 0{int i;for(i=0; i<s->gb.size*8; i++)    printf("%d", get_bits1(&s->gb));//    get_bits1(&s->gb);printf("END\n");return -1;}#endif    if(s->picture_number==0)        decode_ext_header(w);    s->pict_type = get_bits(&s->gb, 1) + 1;    if(s->pict_type == I_TYPE){        code = get_bits(&s->gb, 7);        printf("I7:%X/\n", code);    }    s->qscale = get_bits(&s->gb, 5);    if (s->pict_type == I_TYPE) {        if(w->j_type_bit) w->j_type= get_bits1(&s->gb);        else              w->j_type= 0; //FIXME check                if(!w->j_type){            if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);            else                 s->per_mb_rl_table= 0;                    if(!s->per_mb_rl_table){                s->rl_chroma_table_index = decode012(&s->gb);                s->rl_table_index = decode012(&s->gb);            }            s->dc_table_index = get_bits1(&s->gb);        }        s->inter_intra_pred= 0;        s->no_rounding = 1;        if(s->avctx->debug&FF_DEBUG_PICT_INFO){	    printf("qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n", 		s->qscale,		s->rl_chroma_table_index,		s->rl_table_index, 		s->dc_table_index,                s->per_mb_rl_table,                w->j_type);        }    }else{        int cbp_index;        w->j_type=0;        parse_mb_skip(w);        cbp_index= decode012(&s->gb);        if(s->qscale <= 10){            int map[3]= {0,2,1};            w->cbp_table_index= map[cbp_index];        }else if(s->qscale <= 20){            int map[3]= {1,0,2};            w->cbp_table_index= map[cbp_index];        }else{            int map[3]= {2,1,0};            w->cbp_table_index= map[cbp_index];        }        if(w->mspel_bit) s->mspel= get_bits1(&s->gb);        else             s->mspel= 0; //FIXME check            if(w->abt_flag){            w->per_mb_abt= get_bits1(&s->gb)^1;            if(!w->per_mb_abt){                w->abt_type= decode012(&s->gb);            }        }        if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);        else                 s->per_mb_rl_table= 0;                if(!s->per_mb_rl_table){            s->rl_table_index = decode012(&s->gb);            s->rl_chroma_table_index = s->rl_table_index;        }        s->dc_table_index = get_bits1(&s->gb);        s->mv_table_index = get_bits1(&s->gb);            s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);        s->no_rounding ^= 1;                if(s->avctx->debug&FF_DEBUG_PICT_INFO){            printf("rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n", 		s->rl_table_index, 		s->rl_chroma_table_index, 		s->dc_table_index,		s->mv_table_index,                s->per_mb_rl_table,                s->qscale,                s->mspel,                w->per_mb_abt,                w->abt_type,                w->cbp_table_index,                s->inter_intra_pred);        }    }    s->esc3_level_length= 0;    s->esc3_run_length= 0;        if(s->avctx->debug&FF_DEBUG_SKIP){        for(i=0; i<s->mb_num; i++){            if(i%s->mb_width==0) printf("\n");            printf("%d", s->mb_type[i]);        }    }s->picture_number++; //FIXME ?//    if(w->j_type)//        return wmv2_decode_j_picture(w); //FIXME    if(w->j_type){        printf("J-type picture isnt supported\n");        return -1;    }    return 0;}