[FFmpeg-cvslog] h264: move initialising the implicit pred weight table for MBAFF

Anton Khirnov git at videolan.org
Wed Jun 29 15:32:11 CEST 2016


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Apr 15 15:02:33 2016 +0200| [fa57059079190242517701120cfdccad93c866da] | committer: Anton Khirnov

h264: move initialising the implicit pred weight table for MBAFF

Do it where the normal implicit table is initialised.

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

 libavcodec/h264_slice.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 33f9f57..031f8cc 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1357,6 +1357,10 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl)
     else if (pps->weighted_bipred_idc == 2 &&
              sl->slice_type_nos == AV_PICTURE_TYPE_B) {
         implicit_weight_table(h, sl, -1);
+        if (FRAME_MBAFF(h)) {
+            implicit_weight_table(h, sl, 0);
+            implicit_weight_table(h, sl, 1);
+        }
     } else {
         sl->pwt.use_weight = 0;
         for (i = 0; i < 2; i++) {
@@ -1378,13 +1382,6 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl)
             return AVERROR_INVALIDDATA;
     }
 
-    if (FRAME_MBAFF(h)) {
-        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);
-        }
-    }
-
     if (sl->slice_type_nos != AV_PICTURE_TYPE_I && pps->cabac) {
         tmp = get_ue_golomb_31(&sl->gb);
         if (tmp > 2) {



More information about the ffmpeg-cvslog mailing list