diff options
author | Alexandra Hájková <alexandra@khirnov.net> | 2016-04-14 11:13:30 +0200 |
---|---|---|
committer | Alexandra Hájková <alexandra@khirnov.net> | 2016-05-22 16:48:00 +0200 |
commit | 8cd219d8a1e57098905aa3261e7f93eab4e9ac87 (patch) | |
tree | 7fb9c02fc9318fa4e183b84c3c47a4f219b6bc6d | |
parent | c7fefd53d2fb8f8c96ed1aaf08e38f45a047e90f (diff) |
vaapi_mpeg2: convert to the new bitstream reader
-rw-r--r-- | libavcodec/vaapi_mpeg2.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c index cb7774581d..73ca95aa91 100644 --- a/libavcodec/vaapi_mpeg2.c +++ b/libavcodec/vaapi_mpeg2.c @@ -103,21 +103,21 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer { MpegEncContext * const s = avctx->priv_data; VASliceParameterBufferMPEG2 *slice_param; - GetBitContext gb; + BitstreamContext bc; uint32_t quantiser_scale_code, intra_slice_flag, macroblock_offset; /* Determine macroblock_offset */ - init_get_bits(&gb, buffer, 8 * size); - if (get_bits_long(&gb, 32) >> 8 != 1) /* start code */ + bitstream_init(&bc, buffer, 8 * size); + if (bitstream_read(&bc, 32) >> 8 != 1) /* start code */ return AVERROR_INVALIDDATA; - quantiser_scale_code = get_bits(&gb, 5); - intra_slice_flag = get_bits1(&gb); + quantiser_scale_code = bitstream_read(&bc, 5); + intra_slice_flag = bitstream_read_bit(&bc); if (intra_slice_flag) { - skip_bits(&gb, 8); - while (get_bits1(&gb) != 0) - skip_bits(&gb, 8); + bitstream_skip(&bc, 8); + while (bitstream_read_bit(&bc) != 0) + bitstream_skip(&bc, 8); } - macroblock_offset = get_bits_count(&gb); + macroblock_offset = bitstream_tell(&bc); /* Fill in VASliceParameterBufferMPEG2 */ slice_param = (VASliceParameterBufferMPEG2 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size); |