diff common.c @ 1025:1f9afd8b9131 libavcodec

GetBitContext.size is allways multiplied by 8 -> use size_in_bits to avoid useless *8 in a few inner loops
author michaelni
date Tue, 21 Jan 2003 17:34:12 +0000
parents 1c32039e7215
children 19de1445beb2
line wrap: on
line diff
--- a/common.c	Mon Jan 20 22:50:14 2003 +0000
+++ b/common.c	Tue Jan 21 17:34:12 2003 +0000
@@ -99,10 +99,12 @@
 /* bit input functions */
 
 void init_get_bits(GetBitContext *s,
-                   UINT8 *buffer, int buffer_size)
+                   UINT8 *buffer, int bit_size)
 {
+    const int buffer_size= (bit_size+7)>>3;
+
     s->buffer= buffer;
-    s->size= buffer_size;
+    s->size_in_bits= bit_size;
     s->buffer_end= buffer + buffer_size;
 #ifdef ALT_BITSTREAM_READER
     s->index=0;