aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2016-04-02 16:48:53 +0100
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-05-08 16:46:04 +0100
commit617cd45ddc9b0fed4e3b4bcb8a51b37fc8565ee8 (patch)
tree1603b8a3b05f83a3bf65bfeed0607f55f68ad944
parentcaee88d193fe4e066251cb541e360d98b2f152ae (diff)
downloadffmpeg-617cd45ddc9b0fed4e3b4bcb8a51b37fc8565ee8.tar.gz
vaapi_h264: Fix bit offset of slice data.
Commit ca2f19b9cc37be509d85f05c8f902860475905f8 modified the meaning of H264SliceContext.gb: it is now initialised at the start of the NAL unit header, rather than at the start of the slice header. The VAAPI slice decoder uses the offset after parsing to determine the offset of the slice data in the bitstream, so with the changed meaning we no longer need to add the extra byte to account for the NAL unit header because it is now included directly. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r--libavcodec/vaapi_h264.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
index b02473851e..7470a1603c 100644
--- a/libavcodec/vaapi_h264.c
+++ b/libavcodec/vaapi_h264.c
@@ -330,7 +330,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx,
slice_param = (VASliceParameterBufferH264 *)ff_vaapi_alloc_slice(vactx, buffer, size);
if (!slice_param)
return -1;
- slice_param->slice_data_bit_offset = get_bits_count(&sl->gb) + 8; /* bit buffer started beyond nal_unit_type */
+ slice_param->slice_data_bit_offset = get_bits_count(&sl->gb);
slice_param->first_mb_in_slice = (sl->mb_y >> FIELD_OR_MBAFF_PICTURE(h)) * h->mb_width + sl->mb_x;
slice_param->slice_type = ff_h264_get_slice_type(sl);
slice_param->direct_spatial_mv_pred_flag = sl->slice_type == AV_PICTURE_TYPE_B ? sl->direct_spatial_mv_pred : 0;