Commit 9918f57d authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Martin Storsjö

get_bits: Return pointer to buffer that is the result of the alignment

This allows more transparent mixing of get_bits and whole-byte access
without having to touch get_bits internals.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 2ed00820
...@@ -413,11 +413,12 @@ static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer, ...@@ -413,11 +413,12 @@ static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
return init_get_bits(s, buffer, byte_size * 8); return init_get_bits(s, buffer, byte_size * 8);
} }
static inline void align_get_bits(GetBitContext *s) static inline const uint8_t *align_get_bits(GetBitContext *s)
{ {
int n = -get_bits_count(s) & 7; int n = -get_bits_count(s) & 7;
if (n) if (n)
skip_bits(s, n); skip_bits(s, n);
return s->buffer + (s->index >> 3);
} }
#define init_vlc(vlc, nb_bits, nb_codes, \ #define init_vlc(vlc, nb_bits, nb_codes, \
......
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