[xiph-cvs] cvs commit: theora/lib dct_encode.c encoder_internal.h frinit.c

Monty xiphmont at xiph.org
Wed Sep 25 04:11:43 PDT 2002



xiphmont    02/09/25 07:11:43

  Modified:    lib      dct_encode.c encoder_internal.h frinit.c
  Log:
  Fix two more bugs:
  
     /* Look for a zero run.  */
     /* NOTE the use of & instead of && which is faster (and
        equivalent) in this instance. */
     /* NO, NO IT ISN'T --Monty */
  
      while( (i < BLOCK_SIZE) && (!RawData[i]) ){
        run_count++;
        i++;
      }
  
  We have memory protection in real OSes, folks.
  
  Also killed a memory allocation bug left over from when there the
  pointer and allocation code was trying to defeat the C type system.

Revision  Changes    Path
1.6       +3 -2      theora/lib/dct_encode.c

Index: dct_encode.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/dct_encode.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- dct_encode.c	23 Sep 2002 08:31:02 -0000	1.5
+++ dct_encode.c	25 Sep 2002 11:11:42 -0000	1.6
@@ -11,7 +11,7 @@
  ********************************************************************
 
   function: 
-  last mod: $Id: dct_encode.c,v 1.5 2002/09/23 08:31:02 xiphmont Exp $
+  last mod: $Id: dct_encode.c,v 1.6 2002/09/25 11:11:42 xiphmont Exp $
 
  ********************************************************************/
 
@@ -289,7 +289,8 @@
     /* Look for a zero run.  */
     /* NOTE the use of & instead of && which is faster (and
        equivalent) in this instance. */
-    while( (i < BLOCK_SIZE) & (!RawData[i]) ){
+    /* NO, NO IT ISN'T --Monty */
+    while( (i < BLOCK_SIZE) && (!RawData[i]) ){
       run_count++; 
       i++;
     }

<p><p>1.11      +1 -2      theora/lib/encoder_internal.h

Index: encoder_internal.h
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/encoder_internal.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- encoder_internal.h	25 Sep 2002 10:01:52 -0000	1.10
+++ encoder_internal.h	25 Sep 2002 11:11:42 -0000	1.11
@@ -11,7 +11,7 @@
  ********************************************************************
 
   function: 
-  last mod: $Id: encoder_internal.h,v 1.10 2002/09/25 10:01:52 xiphmont Exp $
+  last mod: $Id: encoder_internal.h,v 1.11 2002/09/25 11:11:42 xiphmont Exp $
 
  ********************************************************************/
 
@@ -100,7 +100,6 @@
 typedef MOTION_VECTOR COORDINATE;
 
 typedef ogg_int16_t     Q_LIST_ENTRY;
-typedef Q_LIST_ENTRY    Q_LIST[64];
 
 typedef struct PP_INSTANCE {
   ogg_uint32_t  PrevFrameLimit;

<p><p>1.5       +5 -5      theora/lib/frinit.c

Index: frinit.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/frinit.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- frinit.c	23 Sep 2002 08:31:02 -0000	1.4
+++ frinit.c	25 Sep 2002 11:11:42 -0000	1.5
@@ -11,7 +11,7 @@
  ********************************************************************
 
   function: 
-  last mod: $Id: frinit.c,v 1.4 2002/09/23 08:31:02 xiphmont Exp $
+  last mod: $Id: frinit.c,v 1.5 2002/09/25 11:11:42 xiphmont Exp $
 
  ********************************************************************/
 
@@ -234,10 +234,10 @@
     _ogg_malloc(pbi->UnitFragments * sizeof(*pbi->skipped_display_fragments));
     
   pbi->QFragData = 
-    _ogg_malloc(pbi->UnitFragments * sizeof(*pbi->QFragData) * 64);
+    _ogg_malloc(pbi->UnitFragments * sizeof(*pbi->QFragData));
     
   pbi->TokenList = 
-    _ogg_malloc(pbi->UnitFragments * sizeof(*pbi->TokenList) * 128);
+    _ogg_malloc(pbi->UnitFragments * sizeof(*pbi->TokenList));
     
   pbi->FragCodingMethod = 
     _ogg_malloc(pbi->UnitFragments * sizeof(*pbi->FragCodingMethod));
@@ -249,7 +249,7 @@
     _ogg_malloc(pbi->UnitFragments * sizeof(*pbi->FragQIndex));
 
   pbi->PPCoefBuffer = 
-    _ogg_malloc(pbi->UnitFragments * sizeof(*pbi->PPCoefBuffer) * 64);
+    _ogg_malloc(pbi->UnitFragments * sizeof(*pbi->PPCoefBuffer));
 
   pbi->FragmentVariances = 
     _ogg_malloc(pbi->UnitFragments * sizeof(*pbi->FragmentVariances));
@@ -272,7 +272,7 @@
     _ogg_malloc(pbi->MacroBlocks * sizeof(*pbi->MBFullyFlags));
 
   pbi->BlockMap = 
-    _ogg_malloc(pbi->SuperBlocks * sizeof(*pbi->BlockMap) * 4 * 4);
+    _ogg_malloc(pbi->SuperBlocks * sizeof(*pbi->BlockMap));
 
 }
 

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list