]> git.sesse.net Git - ffmpeg/commitdiff
h264: move building the reference list out of h264_slice_header_parse()
authorAnton Khirnov <anton@khirnov.net>
Thu, 14 Apr 2016 18:53:59 +0000 (20:53 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sun, 12 Jun 2016 18:27:52 +0000 (20:27 +0200)
This does not do any bitstream parsing and will allow moving out other
code in later commits.

libavcodec/h264_slice.c

index 2e9587997df8cd9d60bc9a4fc9fa61b892bae79d..0c381218270a4d477d6c5c038896e397868a938a 100644 (file)
@@ -1347,9 +1347,6 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl)
            sl->ref_count[1] = sl->ref_count[0] = 0;
            return ret;
        }
-       ret = ff_h264_build_ref_list(h, sl);
-       if (ret < 0)
-           return ret;
     }
 
     sl->pwt.use_weight = 0;
@@ -1449,6 +1446,10 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
     if (ret < 0)
         return ret;
 
+    ret = ff_h264_build_ref_list(h, sl);
+    if (ret < 0)
+        return ret;
+
     if (h->ps.pps->weighted_bipred_idc == 2 &&
         sl->slice_type_nos == AV_PICTURE_TYPE_B) {
         implicit_weight_table(h, sl, -1);