changeset 5458:ebe106e3339e libavcodec

Make MPEG-1/2 decoder work with the libmpeg2-style bitstream reader.
author michael
date Sat, 04 Aug 2007 11:01:11 +0000
parents 0a5849a4858b
children 4f010d49bee1
files mpeg12.c
diffstat 1 files changed, 32 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mpeg12.c	Sat Aug 04 03:27:05 2007 +0000
+++ b/mpeg12.c	Sat Aug 04 11:01:11 2007 +0000
@@ -737,7 +737,9 @@
             if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
                 goto end;
         }
-
+#if MIN_CACHE_BITS < 19
+        UPDATE_CACHE(re, &s->gb);
+#endif
         /* now quantify & encode AC coefs */
         for(;;) {
             GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
@@ -777,9 +779,14 @@
             }
 
             block[j] = level;
+#if MIN_CACHE_BITS < 19
+            UPDATE_CACHE(re, &s->gb);
+#endif
             if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
                 break;
+#if MIN_CACHE_BITS >= 19
             UPDATE_CACHE(re, &s->gb);
+#endif
         }
 end:
         LAST_SKIP_BITS(re, &s->gb, 2);
@@ -812,6 +819,9 @@
             if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
                 goto end;
         }
+#if MIN_CACHE_BITS < 19
+        UPDATE_CACHE(re, &s->gb);
+#endif
 
         /* now quantify & encode AC coefs */
         for(;;) {
@@ -848,9 +858,14 @@
             }
 
             block[j] = level;
+#if MIN_CACHE_BITS < 19
+            UPDATE_CACHE(re, &s->gb);
+#endif
             if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
                 break;
+#if MIN_CACHE_BITS >= 19
             UPDATE_CACHE(re, &s->gb);
+#endif
         }
 end:
         LAST_SKIP_BITS(re, &s->gb, 2);
@@ -895,6 +910,9 @@
             if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
                 goto end;
         }
+#if MIN_CACHE_BITS < 19
+        UPDATE_CACHE(re, &s->gb);
+#endif
 
         /* now quantify & encode AC coefs */
         for(;;) {
@@ -928,9 +946,14 @@
 
             mismatch ^= level;
             block[j] = level;
+#if MIN_CACHE_BITS < 19
+            UPDATE_CACHE(re, &s->gb);
+#endif
             if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
                 break;
+#if MIN_CACHE_BITS >= 19
             UPDATE_CACHE(re, &s->gb);
+#endif
         }
 end:
         LAST_SKIP_BITS(re, &s->gb, 2);
@@ -965,6 +988,9 @@
         if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
             goto end;
     }
+#if MIN_CACHE_BITS < 19
+    UPDATE_CACHE(re, &s->gb);
+#endif
 
     /* now quantify & encode AC coefs */
     for(;;) {
@@ -993,9 +1019,14 @@
         }
 
         block[j] = level;
+#if MIN_CACHE_BITS < 19
+        UPDATE_CACHE(re, &s->gb);
+#endif
         if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
             break;
+#if MIN_CACHE_BITS >=19
         UPDATE_CACHE(re, &s->gb);
+#endif
     }
 end:
     LAST_SKIP_BITS(re, &s->gb, 2);