diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2009-03-03 02:00:47 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2009-03-03 02:00:47 +0000 |
commit | 017c0811a1f6a0395f38842fbb4b9acf61ff0016 (patch) | |
tree | 6a156e30c930df4f98d8085114fcdda8e1906769 /libavcodec/bitstream.h | |
parent | 8858990f0731ed8826902fbb0aeb2d89c6690f79 (diff) | |
download | ffmpeg-017c0811a1f6a0395f38842fbb4b9acf61ff0016.tar.gz |
Add a get_sbits_long() function.
Originally committed as revision 17740 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/bitstream.h')
-rw-r--r-- | libavcodec/bitstream.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h index 0b336f747f..3670285904 100644 --- a/libavcodec/bitstream.h +++ b/libavcodec/bitstream.h @@ -33,6 +33,7 @@ #include "libavutil/common.h" #include "libavutil/intreadwrite.h" #include "libavutil/log.h" +#include "mathops.h" #if defined(ALT_BITSTREAM_READER_LE) && !defined(ALT_BITSTREAM_READER) # define ALT_BITSTREAM_READER @@ -707,6 +708,13 @@ static inline unsigned int get_bits_long(GetBitContext *s, int n){ } /** + * reads 0-32 bits as a signed integer. + */ +static inline int get_sbits_long(GetBitContext *s, int n) { + return sign_extend(get_bits_long(s, n), n); +} + +/** * shows 0-32 bits. */ static inline unsigned int show_bits_long(GetBitContext *s, int n){ |