]> git.sesse.net Git - ffmpeg/commitdiff
h264: move initialising the implicit pred weight table for MBAFF
authorAnton Khirnov <anton@khirnov.net>
Fri, 15 Apr 2016 13:02:33 +0000 (15:02 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sun, 12 Jun 2016 18:27:52 +0000 (20:27 +0200)
Do it where the normal implicit table is initialised.

libavcodec/h264_slice.c

index 33f9f57a3343734e53cb8eff402b591d6f6d6a36..031f8cc7d86c3a76e099d74e0399bf581c697ec1 100644 (file)
@@ -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) {