From: Michael Niedermayer <[email protected]>

Signed-off-by: Michael Niedermayer <[email protected]>
Signed-off-by: Justin Ruggles <[email protected]>
---
 libavcodec/get_bits.h |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index f91441c..00ad68e 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -313,6 +313,24 @@ static inline unsigned int get_bits_long(GetBitContext *s, 
int n)
     }
 }
 
+/*
+ * Read 0-64 bits.
+ */
+static inline uint64_t get_bits_longlong(GetBitContext *s, int n)
+{
+    if (n <= 32) {
+        return get_bits_long(s, n);
+    } else {
+#ifdef BITSTREAM_READER_LE
+        uint64_t ret = get_bits_long(s, 32);
+        return ret | (((uint64_t)get_bits_long(s, n-32)) << 32);
+#else
+        uint64_t ret = ((uint64_t)get_bits_long(s, 32)) << (n-32);
+        return ret | get_bits_long(s, n-32);
+#endif
+    }
+}
+
 /**
  * Read 0-32 bits as a signed integer.
  */
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to