h264: move a per-field block from decode_slice_header() to field_start()
authorAnton Khirnov <anton@khirnov.net>
Tue, 17 May 2016 17:00:18 +0000 (19:00 +0200)
committerAnton Khirnov <anton@khirnov.net>
Tue, 21 Jun 2016 09:10:29 +0000 (11:10 +0200)
This is a more appropriate place for it.

libavcodec/h264_slice.c

index 990c85b..ec8a82c 100644 (file)
@@ -1167,6 +1167,13 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl,
         release_unused_pictures(h, 0);
     }
 
+    ff_h264_init_poc(h->cur_pic_ptr->field_poc, &h->cur_pic_ptr->poc,
+                     h->ps.sps, &h->poc, h->picture_structure, nal->ref_idc);
+
+    memcpy(h->mmco, sl->mmco, sl->nb_mmco * sizeof(*h->mmco));
+    h->nb_mmco = sl->nb_mmco;
+    h->explicit_ref_marking = sl->explicit_ref_marking;
+
     return 0;
 }
 
@@ -1437,15 +1444,6 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl,
         sl->resync_mb_y = sl->mb_y = sl->mb_y + 1;
     assert(sl->mb_y < h->mb_height);
 
-    if (!h->setup_finished) {
-        ff_h264_init_poc(h->cur_pic_ptr->field_poc, &h->cur_pic_ptr->poc,
-                         h->ps.sps, &h->poc, h->picture_structure, nal->ref_idc);
-
-        memcpy(h->mmco, sl->mmco, sl->nb_mmco * sizeof(*h->mmco));
-        h->nb_mmco = sl->nb_mmco;
-        h->explicit_ref_marking = sl->explicit_ref_marking;
-    }
-
     ret = ff_h264_build_ref_list(h, sl);
     if (ret < 0)
         return ret;