23 #ifndef ALTERH264_BITS_READER_H 24 #define ALTERH264_BITS_READER_H 25 #include <sys/types.h> 49 static inline uint32_t
52 uint8_t val[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
56 while (--buf >= br->
buffer)
58 for (bit = 7; bit > -1; bit--)
94 static inline uint32_t
97 uint8_t val[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
102 res = (res << 1) + ((*br->
buffer & val[br->
offbits]) ? 1 : 0);
128 static inline uint32_t
134 for (b = 0; !b; leading++)
137 return (1 << leading) - 1 +
read_bits (br, leading);
142 static inline int32_t
146 return (res & 0x01) ? (res + 1) / 2 : -(res / 2);
static uint32_t read_exp_ue(bits_reader_t *br)
Definition: alterh264_bits_reader.h:129
int length
Definition: alterh264_bits_reader.h:33
const uint8_t * start
Definition: alterh264_bits_reader.h:32
static uint8_t bits_reader_shift(bits_reader_t *br)
Definition: alterh264_bits_reader.h:68
const uint8_t * buffer
Definition: alterh264_bits_reader.h:32
static void bits_reader_set(bits_reader_t *br, const uint8_t *buf, int len)
Definition: alterh264_bits_reader.h:39
Definition: alterh264_bits_reader.h:31
static uint32_t read_bits(bits_reader_t *br, int nbits)
Definition: alterh264_bits_reader.h:95
static int32_t read_exp_se(bits_reader_t *br)
Definition: alterh264_bits_reader.h:143
static void skip_bits(bits_reader_t *br, int nbits)
Definition: alterh264_bits_reader.h:115
int oflow
Definition: alterh264_bits_reader.h:33
int offbits
Definition: alterh264_bits_reader.h:33
static uint32_t more_rbsp_data(bits_reader_t *br)
Definition: alterh264_bits_reader.h:50