[FFmpeg-cvslog] adx: Convert to the new bitstream reader
Alexandra Hájková
git at videolan.org
Fri May 5 14:30:10 EEST 2017
ffmpeg | branch: master | Alexandra Hájková <alexandra at khirnov.net> | Tue Apr 12 12:32:06 2016 +0200| [4e2505103146c539c6277b8d9d7e6840f6f1db07] | committer: Diego Biurrun
adx: Convert to the new bitstream reader
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4e2505103146c539c6277b8d9d7e6840f6f1db07
---
libavcodec/adxdec.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index dc587b2733..a3344ae695 100644
--- a/libavcodec/adxdec.c
+++ b/libavcodec/adxdec.c
@@ -20,9 +20,10 @@
*/
#include "libavutil/intreadwrite.h"
+
#include "avcodec.h"
#include "adx.h"
-#include "get_bits.h"
+#include "bitstream.h"
#include "internal.h"
/**
@@ -66,7 +67,7 @@ static int adx_decode(ADXContext *c, int16_t *out, int offset,
const uint8_t *in, int ch)
{
ADXChannelState *prev = &c->prev[ch];
- GetBitContext gb;
+ BitstreamContext bc;
int scale = AV_RB16(in);
int i;
int s0, s1, s2, d;
@@ -75,12 +76,12 @@ static int adx_decode(ADXContext *c, int16_t *out, int offset,
if (scale & 0x8000)
return -1;
- init_get_bits(&gb, in + 2, (BLOCK_SIZE - 2) * 8);
+ bitstream_init(&bc, in + 2, (BLOCK_SIZE - 2) * 8);
out += offset;
s1 = prev->s1;
s2 = prev->s2;
for (i = 0; i < BLOCK_SAMPLES; i++) {
- d = get_sbits(&gb, 4);
+ d = bitstream_read_signed(&bc, 4);
s0 = ((d << COEFF_BITS) * scale + c->coeff[0] * s1 + c->coeff[1] * s2) >> COEFF_BITS;
s2 = s1;
s1 = av_clip_int16(s0);
More information about the ffmpeg-cvslog
mailing list