[FFmpeg-cvslog] Merge commit '7b50d60442af8d9527e9da46818011fe15a5265a'

Clément Bœsch git at videolan.org
Wed Jun 29 15:23:37 CEST 2016


ffmpeg | branch: master | Clément Bœsch <clement at stupeflix.com> | Wed Jun 29 15:17:16 2016 +0200| [527a57932765f493529449f13d0d79ee5c7116e1] | committer: Clément Bœsch

Merge commit '7b50d60442af8d9527e9da46818011fe15a5265a'

* commit '7b50d60442af8d9527e9da46818011fe15a5265a':
  h264: call ff_h264_fill_mbaff_ref_list() when constructing the normal ref list

Merged-by: Clément Bœsch <clement at stupeflix.com>

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

 libavcodec/h264.h       |    1 -
 libavcodec/h264_refs.c  |   53 +++++++++++++++++++++++++----------------------
 libavcodec/h264_slice.c |    2 --
 3 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 133f4b7..50fd45a 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -715,7 +715,6 @@ int ff_h264_get_slice_type(const H264SliceContext *sl);
 int ff_h264_alloc_tables(H264Context *h);
 
 int ff_h264_decode_ref_pic_list_reordering(H264Context *h, H264SliceContext *sl);
-void ff_h264_fill_mbaff_ref_list(H264SliceContext *sl);
 void ff_h264_remove_all_refs(H264Context *h);
 
 /**
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index b6bb8f2..15957a3 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -270,6 +270,31 @@ static int pic_num_extract(const H264Context *h, int pic_num, int *structure)
     return pic_num;
 }
 
+static void h264_fill_mbaff_ref_list(H264SliceContext *sl)
+{
+    int list, i, j;
+    for (list = 0; list < sl->list_count; list++) {
+        for (i = 0; i < sl->ref_count[list]; i++) {
+            H264Ref *frame = &sl->ref_list[list][i];
+            H264Ref *field = &sl->ref_list[list][16 + 2 * i];
+
+            field[0] = *frame;
+
+            for (j = 0; j < 3; j++)
+                field[0].linesize[j] <<= 1;
+            field[0].reference = PICT_TOP_FIELD;
+            field[0].poc       = field[0].parent->field_poc[0];
+
+            field[1] = field[0];
+
+            for (j = 0; j < 3; j++)
+                field[1].data[j] += frame->parent->f->linesize[j];
+            field[1].reference = PICT_BOTTOM_FIELD;
+            field[1].poc       = field[1].parent->field_poc[1];
+        }
+    }
+}
+
 int ff_h264_decode_ref_pic_list_reordering(H264Context *h, H264SliceContext *sl)
 {
     int list, index, pic_structure;
@@ -398,32 +423,10 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h, H264SliceContext *sl)
         }
     }
 
-    return 0;
-}
-
-void ff_h264_fill_mbaff_ref_list(H264SliceContext *sl)
-{
-    int list, i, j;
-    for (list = 0; list < sl->list_count; list++) {
-        for (i = 0; i < sl->ref_count[list]; i++) {
-            H264Ref *frame = &sl->ref_list[list][i];
-            H264Ref *field = &sl->ref_list[list][16 + 2 * i];
-
-            field[0] = *frame;
-
-            for (j = 0; j < 3; j++)
-                field[0].linesize[j] <<= 1;
-            field[0].reference = PICT_TOP_FIELD;
-            field[0].poc       = field[0].parent->field_poc[0];
+    if (FRAME_MBAFF(h))
+        h264_fill_mbaff_ref_list(sl);
 
-            field[1] = field[0];
-
-            for (j = 0; j < 3; j++)
-                field[1].data[j] += frame->parent->f->linesize[j];
-            field[1].reference = PICT_BOTTOM_FIELD;
-            field[1].poc       = field[1].parent->field_poc[1];
-        }
-    }
+    return 0;
 }
 
 /**
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 497a99c..666d99f 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1629,8 +1629,6 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl)
     }
 
     if (FRAME_MBAFF(h)) {
-        ff_h264_fill_mbaff_ref_list(sl);
-
         if (pps->weighted_bipred_idc == 2 && sl->slice_type_nos == AV_PICTURE_TYPE_B) {
             implicit_weight_table(h, sl, 0);
             implicit_weight_table(h, sl, 1);


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

diff --cc libavcodec/h264.h
index 133f4b7,034507d..50fd45a
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@@ -714,8 -656,7 +714,7 @@@ int ff_h264_get_slice_type(const H264Sl
   */
  int ff_h264_alloc_tables(H264Context *h);
  
 -int ff_h264_decode_ref_pic_list_reordering(const H264Context *h, H264SliceContext *sl);
 +int ff_h264_decode_ref_pic_list_reordering(H264Context *h, H264SliceContext *sl);
- void ff_h264_fill_mbaff_ref_list(H264SliceContext *sl);
  void ff_h264_remove_all_refs(H264Context *h);
  
  /**
diff --cc libavcodec/h264_refs.c
index b6bb8f2,b4dfbbc..15957a3
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@@ -270,7 -227,32 +270,32 @@@ static int pic_num_extract(const H264Co
      return pic_num;
  }
  
+ static void h264_fill_mbaff_ref_list(H264SliceContext *sl)
+ {
+     int list, i, j;
+     for (list = 0; list < sl->list_count; list++) {
+         for (i = 0; i < sl->ref_count[list]; i++) {
+             H264Ref *frame = &sl->ref_list[list][i];
+             H264Ref *field = &sl->ref_list[list][16 + 2 * i];
+ 
+             field[0] = *frame;
+ 
+             for (j = 0; j < 3; j++)
+                 field[0].linesize[j] <<= 1;
+             field[0].reference = PICT_TOP_FIELD;
+             field[0].poc       = field[0].parent->field_poc[0];
+ 
+             field[1] = field[0];
+ 
+             for (j = 0; j < 3; j++)
+                 field[1].data[j] += frame->parent->f->linesize[j];
+             field[1].reference = PICT_BOTTOM_FIELD;
+             field[1].poc       = field[1].parent->field_poc[1];
+         }
+     }
+ }
+ 
 -int ff_h264_decode_ref_pic_list_reordering(const H264Context *h, H264SliceContext *sl)
 +int ff_h264_decode_ref_pic_list_reordering(H264Context *h, H264SliceContext *sl)
  {
      int list, index, pic_structure;
  



More information about the ffmpeg-cvslog mailing list