changeset 1256:b8e1c17b8d7d libavcodec

some libmpeg2 style bitstream reader fixes (no dv doesnt yet work with it)
author michaelni
date Wed, 14 May 2003 10:54:25 +0000
parents 625ccacd1113
children 6defe392d5d2
files dv.c
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/dv.c	Wed May 14 01:08:02 2003 +0000
+++ b/dv.c	Wed May 14 10:54:25 2003 +0000
@@ -157,7 +157,7 @@
 };
 
 #ifndef ALT_BITSTREAM_READER
-#error only works with ALT_BITSTREAM_READER
+#warning only works with ALT_BITSTREAM_READER
 #endif
 
 /* decode ac coefs */
@@ -171,7 +171,10 @@
     int pos = mb->pos;
     int level, pos1, sign, run;
     int partial_bit_count;
-
+#ifndef ALT_BITSTREAM_READER //FIXME
+    int re_index=0; 
+    int re1_index=0;
+#endif
     OPEN_READER(re, &s->gb);
     
 #ifdef VLC_DEBUG
@@ -364,7 +367,7 @@
 
             /* write the remaining bits  in a new buffer only if the
                block is finished */
-            bits_left = last_index - s->gb.index;
+            bits_left = last_index - get_bits_count(&s->gb);
             if (mb->eob_reached) {
                 mb->partial_bit_count = 0;
                 mb_bit_count += bits_left;
@@ -389,13 +392,13 @@
         mb = mb1;
         init_get_bits(&s->gb, mb_bit_buffer, 80*8);
         for(j = 0;j < 6; j++) {
-            if (!mb->eob_reached && s->gb.index < mb_bit_count) {
+            if (!mb->eob_reached && get_bits_count(&s->gb) < mb_bit_count) {
                 dv_decode_ac(s, mb, block, mb_bit_count);
                 /* if still not finished, no need to parse other blocks */
                 if (!mb->eob_reached) {
                     /* we could not parse the current AC coefficient,
                        so we add the remaining bytes */
-                    bits_left = mb_bit_count - s->gb.index;
+                    bits_left = mb_bit_count - get_bits_count(&s->gb);
                     if (bits_left > 0) {
                         mb->partial_bit_count += bits_left;
                         mb->partial_bit_buffer = 
@@ -410,7 +413,7 @@
         }
         /* all blocks are finished, so the extra bytes can be used at
            the video segment level */
-        bits_left = mb_bit_count - s->gb.index;
+        bits_left = mb_bit_count - get_bits_count(&s->gb);
         vs_bit_count += bits_left;
         bit_copy(&vs_pb, &s->gb, bits_left);
     next_mb: