[FFmpeg-cvslog] Merge commit 'e9f884416c76558098fc1f63825b293956e8483c'

Derek Buitenhuis git at videolan.org
Tue May 17 15:50:57 CEST 2016


ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Tue May 17 14:38:08 2016 +0100| [7ab2c036b917ad3ecaf245601aeba4316b6604c2] | committer: Derek Buitenhuis

Merge commit 'e9f884416c76558098fc1f63825b293956e8483c'

* commit 'e9f884416c76558098fc1f63825b293956e8483c':
  h264: move reading direct_spatial_mv_pred out of ff_set_ref_count()

Merged-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ab2c036b917ad3ecaf245601aeba4316b6604c2
---

 libavcodec/h264.c        |    2 --
 libavcodec/h264_parser.c |    3 +++
 libavcodec/h264_slice.c  |    3 +++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 2a522fd..3e29e88 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1010,8 +1010,6 @@ int ff_set_ref_count(H264Context *h, H264SliceContext *sl)
         unsigned max[2];
         max[0] = max[1] = h->picture_structure == PICT_FRAME ? 15 : 31;
 
-        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) {
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 6cf4a23..418fe0a 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -150,6 +150,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;
 
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 4e744ea..0fcb563 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1689,6 +1689,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;


======================================================================

diff --cc libavcodec/h264.c
index 2a522fd,08b0891..3e29e88
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@@ -1007,11 -975,6 +1007,9 @@@ int ff_set_ref_count(H264Context *h, H2
      ref_count[1] = h->pps.ref_count[1];
  
      if (sl->slice_type_nos != AV_PICTURE_TYPE_I) {
 +        unsigned max[2];
 +        max[0] = max[1] = h->picture_structure == PICT_FRAME ? 15 : 31;
 +
-         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) {



More information about the ffmpeg-cvslog mailing list