Commit 01f481d8 authored by Mans Rullgard's avatar Mans Rullgard

bits: add fill_bits_buf() function

parent 35523430
......@@ -60,6 +60,15 @@ void put_byte(struct bitreader *b, int v)
b->bitend += 8;
void fill_bits_buf(struct bitreader *b, int n)
uint8_t *p = b->data;
while (b->bitend < b->bitpos + n)
put_byte(b, *p++);
b->data = p;
static void fill_bits(struct bitreader *b, int n)
......@@ -37,6 +37,7 @@ struct bitreader {
void (*fill_bits)(struct bitreader *, int n);
void (*get_bits_cb)(uint64_t bits, int n);
void (*eof_cb)(void);
void *data;
void init_bits(struct bitreader *b);
......@@ -46,6 +47,7 @@ int64_t get_sbits(struct bitreader *b, int n);
uint32_t peek_bits(struct bitreader *b, unsigned n, unsigned offs);
uint64_t peek_bits64(struct bitreader *b, unsigned n, unsigned offs);
void put_byte(struct bitreader *b, int v);
void fill_bits_buf(struct bitreader *b, int n);
struct bitfield {
int size;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment