diff options
author | Alexandra Hájková <alexandra@khirnov.net> | 2016-04-12 18:28:14 +0200 |
---|---|---|
committer | Alexandra Hájková <alexandra@khirnov.net> | 2016-05-22 16:47:58 +0200 |
commit | 16709052859fdcfde13e571fe267d70558ebe345 (patch) | |
tree | da4c596971bc8e2564b43b82d1011dc0b7867d09 | |
parent | 3a71f35255584823a3fc477565cfc46dfba767e8 (diff) |
opus: convert to the new bitstream reader
-rw-r--r-- | libavcodec/opus.h | 6 | ||||
-rw-r--r-- | libavcodec/opusdec.c | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/opus.h b/libavcodec/opus.h index 55c91fa012..fbf67c9b9f 100644 --- a/libavcodec/opus.h +++ b/libavcodec/opus.h @@ -32,7 +32,7 @@ #include "libavresample/avresample.h" #include "avcodec.h" -#include "get_bits.h" +#include "bitstream.h" #define MAX_FRAME_SIZE 1275 #define MAX_FRAMES 48 @@ -92,7 +92,7 @@ typedef struct RawBitsContext { } RawBitsContext; typedef struct OpusRangeCoder { - GetBitContext gb; + BitstreamContext bc; RawBitsContext rb; unsigned int range; unsigned int value; @@ -196,7 +196,7 @@ typedef struct OpusContext { static av_always_inline void opus_rc_normalize(OpusRangeCoder *rc) { while (rc->range <= 1<<23) { - rc->value = ((rc->value << 8) | (get_bits(&rc->gb, 8) ^ 0xFF)) & ((1u << 31) - 1); + rc->value = ((rc->value << 8) | (bitstream_read(&rc->bc, 8) ^ 0xFF)) & ((1u << 31) - 1); rc->range <<= 8; rc->total_read_bits += 8; } diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index 92e651c787..8718f26922 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -45,7 +45,6 @@ #include "avcodec.h" #include "celp_filters.h" #include "fft.h" -#include "get_bits.h" #include "internal.h" #include "mathops.h" #include "opus.h" @@ -80,12 +79,12 @@ static int get_silk_samplerate(int config) */ static int opus_rc_init(OpusRangeCoder *rc, const uint8_t *data, int size) { - int ret = init_get_bits8(&rc->gb, data, size); + int ret = bitstream_init8(&rc->bc, data, size); if (ret < 0) return ret; rc->range = 128; - rc->value = 127 - get_bits(&rc->gb, 7); + rc->value = 127 - bitstream_read(&rc->bc, 7); rc->total_read_bits = 9; opus_rc_normalize(rc); |