diff options
author | Alexandra Hájková <alexandra@khirnov.net> | 2016-03-21 20:23:36 +0100 |
---|---|---|
committer | Alexandra Hájková <alexandra@khirnov.net> | 2016-05-22 16:47:55 +0200 |
commit | 8345a8ac31ac2ffc95fa2e79f509815bc3498cf1 (patch) | |
tree | 5b5c09959de34149dff4ccd5dbe6c3410a4f938c | |
parent | b6804726972f6cf334abfb912cbcb6d2a697b692 (diff) |
loco: Convert to the new bitstream reader
-rw-r--r-- | libavcodec/loco.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/loco.c b/libavcodec/loco.c index f25ef61f37..fa4c5edb40 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -25,7 +25,7 @@ */ #include "avcodec.h" -#include "get_bits.h" +#include "bitstream.h" #include "golomb.h" #include "internal.h" #include "mathops.h" @@ -50,7 +50,7 @@ typedef struct LOCOContext { } LOCOContext; typedef struct RICEContext { - GetBitContext gb; + BitstreamContext bc; int save, run, run2; /* internal rice decoder state */ int sum, count; /* sum and count for getting rice parameter */ int lossy; @@ -88,11 +88,11 @@ static inline int loco_get_rice(RICEContext *r) loco_update_rice_param(r, 0); return 0; } - v = get_ur_golomb_jpegls(&r->gb, loco_get_rice_param(r), INT_MAX, 0); + v = get_ur_golomb_jpegls(&r->bc, loco_get_rice_param(r), INT_MAX, 0); loco_update_rice_param(r, (v + 1) >> 1); if (!v) { if (r->save >= 0) { - r->run = get_ur_golomb_jpegls(&r->gb, 2, INT_MAX, 0); + r->run = get_ur_golomb_jpegls(&r->bc, 2, INT_MAX, 0); if (r->run > 1) r->save += r->run + 1; else @@ -132,7 +132,7 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh int val; int i, j; - init_get_bits(&rc.gb, buf, buf_size*8); + bitstream_init8(&rc.bc, buf, buf_size); rc.save = 0; rc.run = 0; rc.run2 = 0; @@ -162,7 +162,7 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh data += stride; } - return (get_bits_count(&rc.gb) + 7) >> 3; + return (bitstream_tell(&rc.bc) + 7) >> 3; } static int decode_frame(AVCodecContext *avctx, |