]> git.sesse.net Git - ffmpeg/commitdiff
h264: move reading direct_spatial_mv_pred out of ff_set_ref_count()
authorAnton Khirnov <anton@khirnov.net>
Mon, 21 Mar 2016 15:25:29 +0000 (16:25 +0100)
committerAnton Khirnov <anton@khirnov.net>
Sun, 24 Apr 2016 08:06:23 +0000 (10:06 +0200)
It has nothing to do with the reference count and so does not belong in
this function.

libavcodec/h264.c
libavcodec/h264_parser.c
libavcodec/h264_slice.c

index da7f88f66cbbdf4d80c95a949e75ccba999baff4..08b089187dfce21c5f8d1236f7f4ab3c343f47b8 100644 (file)
@@ -975,8 +975,6 @@ int ff_set_ref_count(H264Context *h, H264SliceContext *sl)
     ref_count[1] = h->pps.ref_count[1];
 
     if (sl->slice_type_nos != AV_PICTURE_TYPE_I) {
-        if (sl->slice_type_nos == AV_PICTURE_TYPE_B)
-            sl->direct_spatial_mv_pred = get_bits1(&sl->gb);
         num_ref_idx_active_override_flag = get_bits1(&sl->gb);
 
         if (num_ref_idx_active_override_flag) {
index bcbaf1a2ce146de994e95e908f78e89f93688865..87f6fe6706d291434f2eaaf06c97c4a85d33febb 100644 (file)
@@ -117,6 +117,9 @@ static int scan_mmco_reset(AVCodecParserContext *s)
     if (h->pps.redundant_pic_cnt_present)
         get_ue_golomb(&sl->gb); // redundant_pic_count
 
+    if (sl->slice_type_nos == AV_PICTURE_TYPE_B)
+        get_bits1(&sl->gb); // direct_spatial_mv_pred
+
     if (ff_set_ref_count(h, sl) < 0)
         return AVERROR_INVALIDDATA;
 
index 23824db888023f984e967f653721f234ef803ccb..d2c1f13f5198c13e23d84cac02fa4e5cc5f57132 100644 (file)
@@ -1454,6 +1454,9 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
     if (h->pps.redundant_pic_cnt_present)
         sl->redundant_pic_count = get_ue_golomb(&sl->gb);
 
+    if (sl->slice_type_nos == AV_PICTURE_TYPE_B)
+        sl->direct_spatial_mv_pred = get_bits1(&sl->gb);
+
     ret = ff_set_ref_count(h, sl);
     if (ret < 0)
         return ret;