summaryrefslogtreecommitdiff
path: root/libavcodec/h264_slice.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-05-17 15:07:23 +0200
committerAnton Khirnov <anton@khirnov.net>2016-06-21 11:08:32 +0200
commit54dd9b1cdd9e54f1ee39ae25af0324f8aba2831b (patch)
tree12dbbe4da4eb450cc2a2beef59a5334c4c26e864 /libavcodec/h264_slice.c
parent8d36932c8d33f93ce1afdd5c1f402e7b6655d5ae (diff)
h264: set mb_aff_frame in frame_start()
Avoid unnecessary modification of the decoder-global state in per-slice code.
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index c43a0beca0..4b0adab110 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -377,6 +377,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
h->coded_picture_number = h1->coded_picture_number;
h->first_field = h1->first_field;
h->picture_structure = h1->picture_structure;
+ h->mb_aff_frame = h1->mb_aff_frame;
h->droppable = h1->droppable;
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) {
@@ -501,6 +502,8 @@ static int h264_frame_start(H264Context *h)
h->postpone_filter = 0;
+ h->mb_aff_frame = h->ps.sps->mb_aff && (h->picture_structure == PICT_FRAME);
+
assert(h->cur_pic_ptr->long_ref == 0);
return 0;
@@ -1173,7 +1176,6 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl,
unsigned int slice_type, tmp, i;
int field_pic_flag, bottom_field_flag;
int frame_num, droppable, picture_structure;
- int mb_aff_frame = 0;
sl->first_mb_addr = get_ue_golomb(&sl->gb);
@@ -1236,12 +1238,8 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl,
picture_structure = PICT_TOP_FIELD + bottom_field_flag;
} else {
picture_structure = PICT_FRAME;
- mb_aff_frame = sps->mb_aff;
}
}
- if (!h->setup_finished) {
- h->mb_aff_frame = mb_aff_frame;
- }
sl->picture_structure = picture_structure;
sl->mb_field_decoding_flag = picture_structure != PICT_FRAME;