summaryrefslogtreecommitdiff
path: root/libavcodec/get_bits.h
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-11 21:05:55 +0100
committerLuca Barbato <lu_zero@gentoo.org>2016-01-11 21:51:11 +0100
commit62825236dba31a2240e25974a3ba41c1303e4edc (patch)
treeabce32b7450336f92b13ec8bdfb8ff9189a89e1a /libavcodec/get_bits.h
parent81737f42c28858dad76a40284a35f7a64faa2fc7 (diff)
lavc: Add get_bitsz()
get_bit variant supporting 0-bits reads. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
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 cb2be4fadf..29e72059d3 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -250,6 +250,14 @@ static inline unsigned int get_bits(GetBitContext *s, int n)
}
/**
+ * Read 0-25 bits.
+ */
+static av_always_inline int get_bitsz(GetBitContext *s, int n)
+{
+ return n ? get_bits(s, n) : 0;
+}
+
+/**
* Show 1-25 bits.
*/
static inline unsigned int show_bits(GetBitContext *s, int n)