Merge commit 'bec993381cfec72051b0d9f12ac9d9bb9c750983'
authorClément Bœsch <clement@stupeflix.com>
Thu, 30 Jun 2016 08:24:03 +0000 (10:24 +0200)
committerClément Bœsch <clement@stupeflix.com>
Thu, 30 Jun 2016 08:24:03 +0000 (10:24 +0200)
* commit 'bec993381cfec72051b0d9f12ac9d9bb9c750983':
  h264: postpone generating the implicit MMCOs

Merged-by: Clément Bœsch <clement@stupeflix.com>
1  2 
libavcodec/h264.h
libavcodec/h264_picture.c
libavcodec/h264_refs.c
libavcodec/h264_slice.c

Simple merge
Simple merge
@@@ -601,14 -536,15 +601,13 @@@ static int check_opcodes(MMCO *mmco1, M
      return 0;
  }
  
- int ff_generate_sliding_window_mmcos(const H264Context *h,
-                                      H264SliceContext *sl)
+ static void generate_sliding_window_mmcos(H264Context *h)
  {
-     MMCO *mmco = sl->mmco;
-     int nb_mmco = 0, i = 0;
+     MMCO *mmco = h->mmco;
+     int nb_mmco = 0;
  
 -    assert(h->long_ref_count + h->short_ref_count <= h->ps.sps->ref_frame_count);
 -
      if (h->short_ref_count &&
 -        h->long_ref_count + h->short_ref_count == h->ps.sps->ref_frame_count &&
 +        h->long_ref_count + h->short_ref_count >= h->ps.sps->ref_frame_count &&
          !(FIELD_PICTURE(h) && !h->first_field && h->cur_pic_ptr->reference)) {
          mmco[0].opcode        = MMCO_SHORT2UNUSED;
          mmco[0].short_pic_num = h->short_ref[h->short_ref_count - 1]->frame_num;
          }
      }
  
-     sl->nb_mmco = nb_mmco;
-     return 0;
+     h->nb_mmco = nb_mmco;
  }
  
- int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
+ int ff_h264_execute_ref_pic_marking(H264Context *h)
  {
+     MMCO *mmco = h->mmco;
+     int mmco_count;
      int i, av_uninit(j);
 +    int pps_ref_count[2] = {0};
      int current_ref_assigned = 0, err = 0;
      H264Picture *av_uninit(pic);
  
@@@ -1575,8 -1340,9 +1573,9 @@@ static int h264_slice_header_parse(H264
          (pps->weighted_bipred_idc == 1 &&
           sl->slice_type_nos == AV_PICTURE_TYPE_B))
          ff_h264_pred_weight_table(&sl->gb, sps, sl->ref_count,
 -                                  sl->slice_type_nos, &sl->pwt);
 +                                  sl->slice_type_nos, &sl->pwt, h->avctx);
  
+     sl->explicit_ref_marking = 0;
      if (h->nal_ref_idc) {
          ret = ff_h264_decode_ref_pic_marking(h, sl, &sl->gb);
          if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))