Browse code

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: Michael Niedermayer <michaelni@gmx.at>

Ronald S. Bultje authored on 2013/02/11 09:46:07
Showing 1 changed files
... ...
@@ -415,11 +415,12 @@ static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
415 415
     return init_get_bits(s, buffer, byte_size * 8);
416 416
 }
417 417
 
418
-static inline void align_get_bits(GetBitContext *s)
418
+static inline const uint8_t *align_get_bits(GetBitContext *s)
419 419
 {
420 420
     int n = -get_bits_count(s) & 7;
421 421
     if (n)
422 422
         skip_bits(s, n);
423
+    return s->buffer + (s->index >> 3);
423 424
 }
424 425
 
425 426
 #define init_vlc(vlc, nb_bits, nb_codes,                \