diff options
author | Alexandra Hájková <alexandra@khirnov.net> | 2016-04-09 14:47:04 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-11-18 10:33:59 +0100 |
commit | edd4c19a781124cbdb3598f94ec3a0d9ff7058cd (patch) | |
tree | 71f8636b7e554d6e68eafffccabcf6068591e47c /libavcodec/atrac3plusdec.c | |
parent | 027211920222b2b63ca07d712b3771a14add9aab (diff) | |
download | ffmpeg-edd4c19a781124cbdb3598f94ec3a0d9ff7058cd.tar.gz |
atrac3plus: Convert to the new bitstream reader
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/atrac3plusdec.c')
-rw-r--r-- | libavcodec/atrac3plusdec.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c index 4a742c159e..17774d5657 100644 --- a/libavcodec/atrac3plusdec.c +++ b/libavcodec/atrac3plusdec.c @@ -39,14 +39,15 @@ #include "libavutil/channel_layout.h" #include "libavutil/float_dsp.h" + #include "avcodec.h" -#include "get_bits.h" +#include "bitstream.h" #include "internal.h" #include "atrac.h" #include "atrac3plus.h" typedef struct ATRAC3PContext { - GetBitContext gb; + BitstreamContext bc; AVFloatDSPContext fdsp; DECLARE_ALIGNED(32, float, samples)[2][ATRAC3P_FRAME_SAMPLES]; ///< quantized MDCT spectrum @@ -334,16 +335,16 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void *data, return ret; } - if ((ret = init_get_bits8(&ctx->gb, avpkt->data, avpkt->size)) < 0) + if ((ret = bitstream_init8(&ctx->bc, avpkt->data, avpkt->size)) < 0) return ret; - if (get_bits1(&ctx->gb)) { + if (bitstream_read_bit(&ctx->bc)) { av_log(avctx, AV_LOG_ERROR, "Invalid start bit!\n"); return AVERROR_INVALIDDATA; } - while (get_bits_left(&ctx->gb) >= 2 && - (ch_unit_id = get_bits(&ctx->gb, 2)) != CH_UNIT_TERMINATOR) { + while (bitstream_bits_left(&ctx->bc) >= 2 && + (ch_unit_id = bitstream_read(&ctx->bc, 2)) != CH_UNIT_TERMINATOR) { if (ch_unit_id == CH_UNIT_EXTENSION) { avpriv_report_missing_feature(avctx, "Channel unit extension"); return AVERROR_PATCHWELCOME; @@ -358,7 +359,7 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void *data, ctx->ch_units[ch_block].unit_type = ch_unit_id; channels_to_process = ch_unit_id + 1; - if ((ret = ff_atrac3p_decode_channel_unit(&ctx->gb, + if ((ret = ff_atrac3p_decode_channel_unit(&ctx->bc, &ctx->ch_units[ch_block], channels_to_process, avctx)) < 0) |