[FFmpeg-cvslog] lavc: Add get_bitsz()

Andreas Cadhalpun git at videolan.org
Wed Jan 27 17:53:56 CET 2016


ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Mon Jan 11 21:05:55 2016 +0100| [62825236dba31a2240e25974a3ba41c1303e4edc] | committer: Luca Barbato

lavc: Add get_bitsz()

get_bit variant supporting 0-bits reads.

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=62825236dba31a2240e25974a3ba41c1303e4edc
---

 libavcodec/get_bits.h              |    8 ++++++++
 libavcodec/mpegaudiodec_template.c |    7 -------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index cb2be4f..29e7205 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)
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index 184d67b..820a7ae 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -795,13 +795,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)
 {



More information about the ffmpeg-cvslog mailing list