int ret;
unsigned int slice_type, tmp, i;
int field_pic_flag, bottom_field_flag;
- int droppable, picture_structure;
+ int first_slice = sl == h->slice_ctx && !h->current_slice;
- int frame_num, picture_structure;
++ int picture_structure;
+
+ if (first_slice)
+ av_assert0(!h->setup_finished);
- sl->first_mb_addr = get_ue_golomb(&sl->gb);
+ sl->first_mb_addr = get_ue_golomb_long(&sl->gb);
slice_type = get_ue_golomb_31(&sl->gb);
if (slice_type > 9) {
}
sps = (const SPS*)h->ps.sps_list[pps->sps_id]->data;
- frame_num = get_bits(&sl->gb, sps->log2_max_frame_num);
+ sl->frame_num = get_bits(&sl->gb, sps->log2_max_frame_num);
+ if (!first_slice) {
- if (h->poc.frame_num != frame_num) {
++ if (h->poc.frame_num != sl->frame_num) {
+ av_log(h->avctx, AV_LOG_ERROR, "Frame num change from %d to %d\n",
- h->poc.frame_num, frame_num);
++ h->poc.frame_num, sl->frame_num);
+ return AVERROR_INVALIDDATA;
+ }
+ }
- if (!h->setup_finished)
- h->poc.frame_num = frame_num;
-
sl->mb_mbaff = 0;
- droppable = nal->ref_idc == 0;
if (sps->frame_mbs_only_flag) {
picture_structure = PICT_FRAME;
} else {
}
if (nal->type == NAL_IDR_SLICE)
- get_ue_golomb(&sl->gb); /* idr_pic_id */
+ get_ue_golomb_long(&sl->gb); /* idr_pic_id */
if (sps->poc_type == 0) {
- int poc_lsb = get_bits(&sl->gb, sps->log2_max_poc_lsb);
+ sl->poc_lsb = get_bits(&sl->gb, sps->log2_max_poc_lsb);
- if (!h->setup_finished)
- h->poc.poc_lsb = poc_lsb;
-
- if (pps->pic_order_present == 1 && picture_structure == PICT_FRAME) {
- int delta_poc_bottom = get_se_golomb(&sl->gb);
- if (!h->setup_finished)
- h->poc.delta_poc_bottom = delta_poc_bottom;
- }
+ if (pps->pic_order_present == 1 && picture_structure == PICT_FRAME)
+ sl->delta_poc_bottom = get_se_golomb(&sl->gb);
}
if (sps->poc_type == 1 && !sps->delta_pic_order_always_zero_flag) {