Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-02-11 04:46:07 +0400
committerMartin Storsjö <martin@martin.st>2013-02-20 00:33:52 +0400
commit9918f57dcfc276cc8ecad3705875ca5877980c7a (patch)
tree3856a0f01cb57ea4cb304f08dc2cc605c0e8695d /libavcodec
parent2ed008204d5467be03a0a3af1e293b2f7038d0a0 (diff)
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@martin.st>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/get_bits.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index ddac5d76d5..5a0089add8 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, \