summaryrefslogtreecommitdiff
path: root/libavcodec/h264_slice.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-07-02 16:48:26 +0200
committerAnton Khirnov <anton@khirnov.net>2016-07-11 16:29:57 +0200
commita8cbe5a0ccebf60a8a8b0aba5d5716dd54c1595c (patch)
tree95f33fe4d224c4a718bb204c02dbc25028fc42a8 /libavcodec/h264_slice.c
parent99cf943339a2e5171863c48cd1a73dd43dc243e1 (diff)
h264_ps: export actual height in MBs as SPS.mb_height
Currently, SPS.mb_height is actually what the spec calls PicHeightInMapUnits, which is half the frame height when interlacing is allowed. Calling this 'mb_height' is quite confusing, and there are at least two associated bugs where this field is treated as the actual frame height - in the h264 parser and in the code computing maximum reordering buffer size for a given level. Fix those issues (and avoid possible future ones) by exporting the real frame height in this field.
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index aa53570185..ce8df50834 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -926,11 +926,11 @@ static int h264_init_ps(H264Context *h, const H264SliceContext *sl)
h->avctx->refs = sps->ref_frame_count;
if (h->mb_width != sps->mb_width ||
- h->mb_height != sps->mb_height * (2 - sps->frame_mbs_only_flag))
+ h->mb_height != sps->mb_height)
needs_reinit = 1;
h->mb_width = sps->mb_width;
- h->mb_height = sps->mb_height * (2 - sps->frame_mbs_only_flag);
+ h->mb_height = sps->mb_height;
h->mb_num = h->mb_width * h->mb_height;
h->mb_stride = h->mb_width + 1;