diff options
author | Alexandra Hájková <alexandra@khirnov.net> | 2016-04-13 11:53:47 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2016-11-24 11:22:11 +0100 |
commit | 7d8075cf471459dee372595c74b7f28cb4e9a05d (patch) | |
tree | d0cda1a141981bd53fc5c472a424c6a152883b63 /libavcodec | |
parent | 79566ec8c77969d5f9be533de04b1349834cca62 (diff) | |
download | ffmpeg-7d8075cf471459dee372595c74b7f28cb4e9a05d.tar.gz |
ra144: Convert to the new bitstream reader
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ra144dec.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/libavcodec/ra144dec.c b/libavcodec/ra144dec.c index 289535741f..35ee697731 100644 --- a/libavcodec/ra144dec.c +++ b/libavcodec/ra144dec.c @@ -23,8 +23,9 @@ */ #include "libavutil/channel_layout.h" + #include "avcodec.h" -#include "get_bits.h" +#include "bitstream.h" #include "internal.h" #include "ra144.h" @@ -46,12 +47,12 @@ static av_cold int ra144_decode_init(AVCodecContext * avctx) } static void do_output_subblock(RA144Context *ractx, const uint16_t *lpc_coefs, - int gval, GetBitContext *gb) + int gval, BitstreamContext *bc) { - int cba_idx = get_bits(gb, 7); // index of the adaptive CB, 0 if none - int gain = get_bits(gb, 8); - int cb1_idx = get_bits(gb, 7); - int cb2_idx = get_bits(gb, 7); + int cba_idx = bitstream_read(bc, 7); // index of the adaptive CB, 0 if none + int gain = bitstream_read(bc, 8); + int cb1_idx = bitstream_read(bc, 7); + int cb2_idx = bitstream_read(bc, 7); ff_subblock_synthesis(ractx, lpc_coefs, cba_idx, cb1_idx, cb2_idx, gval, gain); @@ -74,7 +75,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data, unsigned int energy; RA144Context *ractx = avctx->priv_data; - GetBitContext gb; + BitstreamContext bc; if (buf_size < FRAMESIZE) { av_log(avctx, AV_LOG_ERROR, @@ -91,15 +92,15 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data, } samples = (int16_t *)frame->data[0]; - init_get_bits(&gb, buf, FRAMESIZE * 8); + bitstream_init(&bc, buf, FRAMESIZE * 8); for (i = 0; i < LPC_ORDER; i++) - lpc_refl[i] = ff_lpc_refl_cb[i][get_bits(&gb, sizes[i])]; + lpc_refl[i] = ff_lpc_refl_cb[i][bitstream_read(&bc, sizes[i])]; ff_eval_coefs(ractx->lpc_coef[0], lpc_refl); ractx->lpc_refl_rms[0] = ff_rms(lpc_refl); - energy = ff_energy_tab[get_bits(&gb, 5)]; + energy = ff_energy_tab[bitstream_read(&bc, 5)]; refl_rms[0] = ff_interp(ractx, block_coefs[0], 1, 1, ractx->old_energy); refl_rms[1] = ff_interp(ractx, block_coefs[1], 2, @@ -111,7 +112,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data, ff_int_to_int16(block_coefs[3], ractx->lpc_coef[0]); for (i=0; i < NBLOCKS; i++) { - do_output_subblock(ractx, block_coefs[i], refl_rms[i], &gb); + do_output_subblock(ractx, block_coefs[i], refl_rms[i], &bc); for (j=0; j < BLOCKSIZE; j++) *samples++ = av_clip_int16(ractx->curr_sblock[j + 10] << 2); |