diff common.h @ 144:cb5dabd00ba2 libavcodec

- Bug fix on inter MCBPC table for inter+q. - H.263/H.263+ decoder now knows GOB start codes. - H.263/H.263+ decoder now returns the size of the stream on the first call. - Added show_bits() functions to see the buffer without loosing the bits. - TODO: H.263v1 UMV parsing is buggy.
author pulento
date Sat, 03 Nov 2001 00:49:53 +0000
parents bec00a2f18e2
children ae0516eadae2
line wrap: on
line diff
--- a/common.h	Wed Oct 31 19:40:53 2001 +0000
+++ b/common.h	Sat Nov 03 00:49:53 2001 +0000
@@ -196,6 +196,7 @@
                    UINT8 *buffer, int buffer_size);
 
 unsigned int get_bits_long(GetBitContext *s, int n);
+unsigned int show_bits_long(GetBitContext *s, int n);
 
 static inline unsigned int get_bits(GetBitContext *s, int n){
     if(s->bit_cnt>=n){
@@ -225,6 +226,19 @@
     return get_bits_long(s,1);
 }
 
+/* This function is identical to get_bits(), the only */
+/* diference is that it doesn't touch the buffer      */
+/* it is usefull to see the buffer.                   */
+static inline unsigned int show_bits(GetBitContext *s, int n)
+{
+    if(s->bit_cnt>=n) {
+        /* most common case here */
+        unsigned int val = s->bit_buf >> (32 - n);
+        return val;
+    }
+    return show_bits_long(s,n);
+}
+
 static inline void skip_bits(GetBitContext *s, int n){
     if(s->bit_cnt>=n){
         /* most common case here */