aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/g722dec.c
diff options
context:
space:
mode:
authorAlexandra Hájková <alexandra@khirnov.net>2016-04-18 10:38:43 +0200
committerAnton Khirnov <anton@khirnov.net>2016-11-18 10:35:33 +0100
commit2188d53906015ea5dd5b2e446f8e5374beacbffe (patch)
treef09e4b3405baf1de13337dc6e5ebaf3d95732659 /libavcodec/g722dec.c
parent799703c3ea3d20c2bdf0f7d8b5015bd3069b2801 (diff)
downloadffmpeg-2188d53906015ea5dd5b2e446f8e5374beacbffe.tar.gz
g72x: Convert to the new bitstream reader
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/g722dec.c')
-rw-r--r--libavcodec/g722dec.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c
index c4c0ec8fee..bfd4b420b2 100644
--- a/libavcodec/g722dec.c
+++ b/libavcodec/g722dec.c
@@ -36,8 +36,9 @@
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
+
#include "avcodec.h"
-#include "get_bits.h"
+#include "bitstream.h"
#include "g722.h"
#include "internal.h"
@@ -92,7 +93,7 @@ static int g722_decode_frame(AVCodecContext *avctx, void *data,
int j, ret;
const int skip = 8 - c->bits_per_codeword;
const int16_t *quantizer_table = low_inv_quants[skip];
- GetBitContext gb;
+ BitstreamContext bc;
/* get output buffer */
frame->nb_samples = avpkt->size * 2;
@@ -102,15 +103,15 @@ static int g722_decode_frame(AVCodecContext *avctx, void *data,
}
out_buf = (int16_t *)frame->data[0];
- init_get_bits(&gb, avpkt->data, avpkt->size * 8);
+ bitstream_init(&bc, avpkt->data, avpkt->size * 8);
for (j = 0; j < avpkt->size; j++) {
int ilow, ihigh, rlow, rhigh, dhigh;
int xout[2];
- ihigh = get_bits(&gb, 2);
- ilow = get_bits(&gb, 6 - skip);
- skip_bits(&gb, skip);
+ ihigh = bitstream_read(&bc, 2);
+ ilow = bitstream_read(&bc, 6 - skip);
+ bitstream_skip(&bc, skip);
rlow = av_clip_intp2((c->band[0].scale_factor * quantizer_table[ilow] >> 10)
+ c->band[0].s_predictor, 14);