---
libavcodec/clearvideo.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index 88af1a7..c4fa133 100644
--- a/libavcodec/clearvideo.c
+++ b/libavcodec/clearvideo.c
@@ -25,8 +25,8 @@
*/
#include "avcodec.h"
+#include "bitstream.h"
#include "bytestream.h"
-#include "get_bits.h"
#include "idctdsp.h"
#include "internal.h"
@@ -123,7 +123,7 @@ typedef struct CLVContext {
AVCodecContext *avctx;
IDCTDSPContext idsp;
AVFrame *pic;
- GetBitContext gb;
+ BitstreamContext bc;
int mb_width, mb_height;
VLC dc_vlc, ac_vlc;
int luma_dc_quant, chroma_dc_quant, ac_quant;
@@ -134,11 +134,11 @@ typedef struct CLVContext {
static inline int decode_block(CLVContext *ctx, int16_t *blk, int has_ac,
int ac_quant)
{
- GetBitContext *gb = &ctx->gb;
+ BitstreamContext *bc = &ctx->bc;
int idx = 1, last = 0, val, skip;
memset(blk, 0, sizeof(*blk) * 64);
- blk[0] = get_vlc2(gb, ctx->dc_vlc.table, 9, 3);
+ blk[0] = bitstream_read_vlc(bc, ctx->dc_vlc.table, 9, 3);
if (blk[0] < 0)
return AVERROR_INVALIDDATA;
blk[0] -= 63;
@@ -147,19 +147,19 @@ static inline int decode_block(CLVContext *ctx, int16_t
*blk, int has_ac,
return 0;
while (idx < 64 && !last) {
- val = get_vlc2(gb, ctx->ac_vlc.table, 9, 2);
+ val = bitstream_read_vlc(bc, ctx->ac_vlc.table, 9, 2);
if (val < 0)
return AVERROR_INVALIDDATA;
if (val != 0x1BFF) {
last = val >> 12;
skip = (val >> 4) & 0xFF;
val &= 0xF;
- if (get_bits1(gb))
+ if (bitstream_read_bit(bc))
val = -val;
} else {
- last = get_bits1(gb);
- skip = get_bits(gb, 6);
- val = get_sbits(gb, 8);
+ last = bitstream_read_bit(bc);
+ skip = bitstream_read(bc, 6);
+ val = bitstream_read_signed(bc, 8);
}
if (val) {
int aval = FFABS(val), sign = val < 0;
@@ -228,7 +228,7 @@ static int decode_mb(CLVContext *c, int x, int y)
int i, has_ac[6], off;
for (i = 0; i < 6; i++)
- has_ac[i] = get_bits1(&c->gb);
+ has_ac[i] = bitstream_read_bit(&c->bc);
off = x * 16 + y * 16 * c->pic->linesize[0];
for (i = 0; i < 4; i++) {
@@ -300,8 +300,8 @@ static int clv_decode_frame(AVCodecContext *avctx, void
*data,
c->luma_dc_quant = 32;
c->chroma_dc_quant = 32;
- if ((ret = init_get_bits8(&c->gb, buf + bytestream2_tell(&gb),
- buf_size - bytestream2_tell(&gb))) < 0)
+ if ((ret = bitstream_init8(&c->bc, buf + bytestream2_tell(&gb),
+ buf_size - bytestream2_tell(&gb))) < 0)
return ret;
for (i = 0; i < 3; i++)
--
2.1.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel