diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-02-10 16:46:07 -0800 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-11 02:29:43 +0100 |
commit | fd6a021d8e3d63249510ebbecc3fe11ae7771ae8 (patch) | |
tree | 1023d4ecfc96728f377b2a53cc1f00fb32bfb975 | |
parent | 5e74a2b68563f3f15a06dd1a63b90454afe2eef8 (diff) | |
download | ffmpeg-fd6a021d8e3d63249510ebbecc3fe11ae7771ae8.tar.gz |
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>
-rw-r--r-- | libavcodec/get_bits.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index 7129b17daf..f16a5082c5 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -415,11 +415,12 @@ static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer, 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; if (n) skip_bits(s, n); + return s->buffer + (s->index >> 3); } #define init_vlc(vlc, nb_bits, nb_codes, \ |