[FFmpeg-cvslog] h264: set mb_aff_frame in frame_start()
Anton Khirnov
git at videolan.org
Wed Jul 27 18:22:28 EEST 2016
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue May 17 15:07:23 2016 +0200| [54dd9b1cdd9e54f1ee39ae25af0324f8aba2831b] | committer: Anton Khirnov
h264: set mb_aff_frame in frame_start()
Avoid unnecessary modification of the decoder-global state in per-slice
code.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=54dd9b1cdd9e54f1ee39ae25af0324f8aba2831b
---
libavcodec/h264_slice.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index c43a0be..4b0adab 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;
More information about the ffmpeg-cvslog
mailing list