diff options
Diffstat (limited to 'libavcodec/vima.c')
-rw-r--r-- | libavcodec/vima.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libavcodec/vima.c b/libavcodec/vima.c index 0db1897..b4620ac 100644 --- a/libavcodec/vima.c +++ b/libavcodec/vima.c @@ -2,20 +2,20 @@ * LucasArts VIMA decoder * Copyright (c) 2012 Paul B Mahol * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -29,7 +29,7 @@ #include "adpcm_data.h" #include "avcodec.h" -#include "bitstream.h" +#include "get_bits.h" #include "internal.h" static int predict_table_init = 0; @@ -118,7 +118,7 @@ static av_cold int decode_init(AVCodecContext *avctx) static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt) { - BitstreamContext bc; + GetBitContext gb; AVFrame *frame = data; int16_t pcm_data[2]; uint32_t samples; @@ -129,19 +129,19 @@ static int decode_frame(AVCodecContext *avctx, void *data, if (pkt->size < 13) return AVERROR_INVALIDDATA; - if ((ret = bitstream_init8(&bc, pkt->data, pkt->size)) < 0) + if ((ret = init_get_bits8(&gb, pkt->data, pkt->size)) < 0) return ret; - samples = bitstream_read(&bc, 32); + samples = get_bits_long(&gb, 32); if (samples == 0xffffffff) { - bitstream_skip(&bc, 32); - samples = bitstream_read(&bc, 32); + skip_bits_long(&gb, 32); + samples = get_bits_long(&gb, 32); } if (samples > pkt->size * 2) return AVERROR_INVALIDDATA; - channel_hint[0] = bitstream_read_signed(&bc, 8); + channel_hint[0] = get_sbits(&gb, 8); if (channel_hint[0] & 0x80) { channel_hint[0] = ~channel_hint[0]; channels = 2; @@ -149,10 +149,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, avctx->channels = channels; avctx->channel_layout = (channels == 2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; - pcm_data[0] = bitstream_read_signed(&bc, 16); + pcm_data[0] = get_sbits(&gb, 16); if (channels > 1) { - channel_hint[1] = bitstream_read_signed(&bc, 8); - pcm_data[1] = bitstream_read_signed(&bc, 16); + channel_hint[1] = get_sbits(&gb, 8); + pcm_data[1] = get_sbits(&gb, 16); } frame->nb_samples = samples; @@ -170,7 +170,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, step_index = av_clip(step_index, 0, 88); lookup_size = size_table[step_index]; - lookup = bitstream_read(&bc, lookup_size); + lookup = get_bits(&gb, lookup_size); highbit = 1 << (lookup_size - 1); lowbits = highbit - 1; @@ -180,7 +180,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, highbit = 0; if (lookup == lowbits) { - output = bitstream_read_signed(&bc, 16); + output = get_sbits(&gb, 16); } else { int predict_index, diff; |