Merge commit 'f966498e433fead2f5e6b5b66fad2ac062146d22'
authorClément Bœsch <u@pkh.me>
Wed, 27 Jul 2016 15:28:00 +0000 (17:28 +0200)
committerClément Bœsch <u@pkh.me>
Wed, 27 Jul 2016 15:31:18 +0000 (17:31 +0200)
* commit 'f966498e433fead2f5e6b5b66fad2ac062146d22':
  h264: decode the poc values from the slice header into the per-slice context

Merged-by: Clément Bœsch <u@pkh.me>
1  2 
libavcodec/h264.h
libavcodec/h264_slice.c

Simple merge
@@@ -1339,13 -1181,9 +1345,13 @@@ static int h264_slice_header_parse(H264
      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) {