aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-03 00:28:42 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-03 21:12:43 +0100
commit713654d9d3a6931a9b4cd0cffa4bb61cd1357977 (patch)
treeed1e43ae1ca793702e3f1e9149051f87d0143d91 /libavcodec
parent97c162add7f33f4f8c82b1f873830d96e04ab06a (diff)
downloadffmpeg-713654d9d3a6931a9b4cd0cffa4bb61cd1357977.tar.gz
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')
-rw-r--r--libavcodec/get_bits.h8
-rw-r--r--libavcodec/mpegaudiodec_template.c7
2 files changed, 8 insertions, 7 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;
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index d2420c1386..5e3fe7e986 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -816,13 +816,6 @@ static void exponents_from_scale_factors(MPADecodeContext *s, GranuleDef *g,
}
}
-/* handle n = 0 too */
-static inline int get_bitsz(GetBitContext *s, int n)
-{
- return n ? get_bits(s, n) : 0;
-}
-
-
static void switch_buffer(MPADecodeContext *s, int *pos, int *end_pos,
int *end_pos2)
{