# HG changeset patch # User jbr # Date 1236045647 0 # Node ID 66f1dba43a01bc6b22294b6b0be3ffd21788442b # Parent b2f29d9da7370fec05c8df2c17aff35803194c45 Add a get_sbits_long() function. diff -r b2f29d9da737 -r 66f1dba43a01 bitstream.h --- a/bitstream.h Tue Mar 03 01:53:54 2009 +0000 +++ b/bitstream.h Tue Mar 03 02:00:47 2009 +0000 @@ -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 @@ } /** + * 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){