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

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-03 02:28:42 +0300
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-03 23:12:43 +0300
commit713654d9d3a6931a9b4cd0cffa4bb61cd1357977 (patch)
treeed1e43ae1ca793702e3f1e9149051f87d0143d91 /libavcodec/get_bits.h
parent97c162add7f33f4f8c82b1f873830d96e04ab06a (diff)
get_bits: add get_bitsz for reading 0-25 bits
This can be used to simplify code in a couple of places. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec/get_bits.h')
-rw-r--r--libavcodec/get_bits.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index 0a61c805b7..4cf61d6f1b 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -269,6 +269,14 @@ static inline unsigned int get_bits(GetBitContext *s, int n)
return tmp;
}
+/**
+ * Read 0-25 bits.
+ */
+static av_always_inline int get_bitsz(GetBitContext *s, int n)
+{
+ return n ? get_bits(s, n) : 0;
+}
+
static inline unsigned int get_bits_le(GetBitContext *s, int n)
{
register int tmp;