Merge commit 'debca90863e4ee53447efd02483c500f89766384'
authorClément Bœsch <u@pkh.me>
Wed, 27 Jul 2016 16:07:30 +0000 (18:07 +0200)
committerClément Bœsch <u@pkh.me>
Wed, 27 Jul 2016 16:07:30 +0000 (18:07 +0200)
* commit 'debca90863e4ee53447efd02483c500f89766384':
  h264: store {curr,max}_pic_num in the per-slice context

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

@@@ -588,17 -567,6 +590,7 @@@ typedef struct H264Context 
  
      H264POCContext poc;
  
-     /**
-      * frame_num for frames or 2 * frame_num + 1 for field pics.
-      */
-     int curr_pic_num;
-     /**
-      * max_frame_num or 2 * max_frame_num for field pics.
-      */
-     int max_pic_num;
 +    H264Ref default_ref[2];
      H264Picture *short_ref[32];
      H264Picture *long_ref[32];
      H264Picture *delayed_pic[MAX_DELAYED_PIC_COUNT + 2]; // FIXME size?
@@@ -844,8 -751,8 +844,8 @@@ int ff_h264_decode_ref_pic_marking(cons
                  mmco[i].opcode = opcode;
                  if (opcode == MMCO_SHORT2UNUSED || opcode == MMCO_SHORT2LONG) {
                      mmco[i].short_pic_num =
-                         (h->curr_pic_num - get_ue_golomb_long(gb) - 1) &
-                             (h->max_pic_num - 1);
 -                        (sl->curr_pic_num - get_ue_golomb(gb) - 1) &
++                        (sl->curr_pic_num - get_ue_golomb_long(gb) - 1) &
+                             (sl->max_pic_num - 1);
  #if 0
                      if (mmco[i].short_pic_num >= h->short_ref_count ||
                          !h->short_ref[mmco[i].short_pic_num]) {
@@@ -418,10 -405,6 +418,7 @@@ int ff_h264_update_thread_context(AVCod
  
      memcpy(&h->poc,        &h1->poc,        sizeof(h->poc));
  
-     h->curr_pic_num      = h1->curr_pic_num;
-     h->max_pic_num       = h1->max_pic_num;
 +    memcpy(h->default_ref, h1->default_ref, sizeof(h->default_ref));
      memcpy(h->short_ref,   h1->short_ref,   sizeof(h->short_ref));
      memcpy(h->long_ref,    h1->long_ref,    sizeof(h->long_ref));
      memcpy(h->delayed_pic, h1->delayed_pic, sizeof(h->delayed_pic));