19#include "config-adpcm.h"
21namespace adpcm_ffmpeg {
46 ret = AVERROR_INVALIDDATA;
65 int bitsLeft()
const {
return size_in_bits_ - pos_; }
69 av_assert(
n >= 0 &&
n <= 32);
71 for (
int k = 0; k <
n; k++) {
84 av_assert(
n >= 0 &&
n <= 31);
95 const uint8_t *buffer_ =
nullptr;
96 int size_in_bits_ = 0;
101 int bit(
int index)
const {
102 const int byte = index >> 3;
103 if (
byte >= byte_size_)
return 0;
104 const int shift = msb_ ? 7 - (index & 7) : (index & 7);
105 return (buffer_[
byte] >> shift) & 1;
Vector implementation which provides the most important methods as defined by std::vector....
Definition ADPCMVector.h:16
Reads bits from a buffer. By default bits are taken from the least significant bit of each byte first...
Definition BitReader.h:30
int init(const uint8_t *buffer, int bit_size)
Definition BitReader.h:41
int bitsCount() const
number of bits consumed so far
Definition BitReader.h:62
int initBytes(const uint8_t *buffer, int byte_size)
Initializes the reader for byte_size bytes.
Definition BitReader.h:56
void skip(int n)
Skips n bits.
Definition BitReader.h:92
uint32_t read(int n)
Reads n bits (0 to 32)
Definition BitReader.h:68
int32_t readSigned(int n)
Reads n bits and sign extends them (0 to 31)
Definition BitReader.h:83
int bitsLeft() const
number of bits that are still available
Definition BitReader.h:65
void setMsbFirst(bool msb)
Selects the bit order used by read() and readSigned()
Definition BitReader.h:37