int ff_wmv2_decode_picture_header(MpegEncContext * s) { Wmv2Context * const w= (Wmv2Context*)s; int code; #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_bits1(&s->gb) + 1; if(s->pict_type == FF_I_TYPE){ code = get_bits(&s->gb, 7); av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code); } s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); if(s->qscale <= 0) return -1; return 0; }
int ff_wmv2_decode_picture_header(MpegEncContext *s) { Wmv2Context *const w = (Wmv2Context *) s; int code; if (s->picture_number == 0) decode_ext_header(w); s->pict_type = get_bits1(&s->gb) + 1; if (s->pict_type == AV_PICTURE_TYPE_I) { code = get_bits(&s->gb, 7); av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code); } s->chroma_qscale = s->qscale = get_bits(&s->gb, 5); if (s->qscale <= 0) return AVERROR_INVALIDDATA; if (s->pict_type != AV_PICTURE_TYPE_I && show_bits(&s->gb, 1)) { GetBitContext gb = s->gb; int skip_type = get_bits(&gb, 2); int run = skip_type == SKIP_TYPE_COL ? s->mb_width : s->mb_height; while (run > 0) { int block = FFMIN(run, 25); if (get_bits(&gb, block) + 1 != 1<<block) break; run -= block; } if (!run) return FRAME_SKIPPED; } return 0; }
int ff_wmv2_decode_picture_header(MpegEncContext * s) { Wmv2Context * const w= (Wmv2Context*)s; int code; if(s->picture_number==0) decode_ext_header(w); s->pict_type = get_bits1(&s->gb) + 1; if(s->pict_type == AV_PICTURE_TYPE_I){ code = get_bits(&s->gb, 7); av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code); } s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); if(s->qscale <= 0) return -1; return 0; }