[FFmpeg-cvslog] get_bits: Return pointer to buffer that is the result of the alignment
Ronald S. Bultje
git at videolan.org
Wed Feb 20 11:49:27 CET 2013
ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Sun Feb 10 16:46:07 2013 -0800| [9918f57dcfc276cc8ecad3705875ca5877980c7a] | committer: 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: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9918f57dcfc276cc8ecad3705875ca5877980c7a
---
libavcodec/get_bits.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index ddac5d7..5a0089a 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -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);
}
-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, \
More information about the ffmpeg-cvslog
mailing list