summaryrefslogtreecommitdiff
path: root/libavcodec/h264_slice.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-05-09 14:25:56 +0200
committerAnton Khirnov <anton@khirnov.net>2016-06-12 20:27:53 +0200
commitbec993381cfec72051b0d9f12ac9d9bb9c750983 (patch)
tree4f7585caa0abcc3dcede2b8a7320b772094db291 /libavcodec/h264_slice.c
parent2d410ebbaa1e760d6837cb434a6d1d4c3c6f0d85 (diff)
h264: postpone generating the implicit MMCOs
Do it right before the MMCOs are applied to the DPB. This will allow moving the frame_start() call out of the slice header parsing, since generating the implicit MMCOs needs to be done after frame_start().
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 6967edbc85..23f4343514 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -418,6 +418,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
memcpy(h->mmco, h1->mmco, sizeof(h->mmco));
h->nb_mmco = h1->nb_mmco;
h->mmco_reset = h1->mmco_reset;
+ h->explicit_ref_marking = h1->explicit_ref_marking;
h->long_ref_count = h1->long_ref_count;
h->short_ref_count = h1->short_ref_count;
@@ -430,7 +431,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
return 0;
if (!h->droppable) {
- err = ff_h264_execute_ref_pic_marking(h, h->mmco, h->nb_mmco);
+ err = ff_h264_execute_ref_pic_marking(h);
h->poc.prev_poc_msb = h->poc.poc_msb;
h->poc.prev_poc_lsb = h->poc.poc_lsb;
}
@@ -1202,11 +1203,8 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl)
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 0);
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 1);
- ret = ff_generate_sliding_window_mmcos(h, sl);
- if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
- return ret;
-
- ret = ff_h264_execute_ref_pic_marking(h, sl->mmco, sl->nb_mmco);
+ h->explicit_ref_marking = 0;
+ ret = ff_h264_execute_ref_pic_marking(h);
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
return ret;
/* Error concealment: If a ref is missing, copy the previous ref
@@ -1344,6 +1342,7 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl)
ff_h264_pred_weight_table(&sl->gb, sps, sl->ref_count,
sl->slice_type_nos, &sl->pwt);
+ sl->explicit_ref_marking = 0;
if (h->nal_ref_idc) {
ret = ff_h264_decode_ref_pic_marking(h, sl, &sl->gb);
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
@@ -1442,6 +1441,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
memcpy(h->mmco, sl->mmco, sl->nb_mmco * sizeof(*h->mmco));
h->nb_mmco = sl->nb_mmco;
+ h->explicit_ref_marking = sl->explicit_ref_marking;
}
ret = ff_h264_build_ref_list(h, sl);