]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Add a get_sbits_long() function.
authorjbr <jbr@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 3 Mar 2009 02:00:47 +0000 (02:00 +0000)
committerjbr <jbr@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 3 Mar 2009 02:00:47 +0000 (02:00 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17740 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/bitstream.h

index 0b336f747f80ef56b46e8f8a5d1900883fca85e6..3670285904a6335f6f63cf714fbd3c8f8950dbbb 100644 (file)
@@ -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
@@ -706,6 +707,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.
  */