[xiph-cvs] cvs commit: vorbis/lib res0.c

Monty xiphmont at xiph.org
Mon Jun 4 18:14:45 PDT 2001



xiphmont    01/06/04 18:14:44

  Modified:    lib      res0.c
  Log:
  A fix to fix the last fix.
  
  Monty

Revision  Changes    Path
1.30      +9 -11     vorbis/lib/res0.c

Index: res0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/res0.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- res0.c	2001/06/04 05:56:42	1.29
+++ res0.c	2001/06/05 01:14:44	1.30
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: residue backend 0 and 1 implementation
- last mod: $Id: res0.c,v 1.29 2001/06/04 05:56:42 xiphmont Exp $
+ last mod: $Id: res0.c,v 1.30 2001/06/05 01:14:44 xiphmont Exp $
 
  ********************************************************************/
 
@@ -65,8 +65,6 @@
   int j;
   if(i){
     vorbis_look_residue0 *look=(vorbis_look_residue0 *)i;
-    long resbitsT=0;
-    long resvalsT=0;
 
     for(j=0;j<look->parts;j++)
       if(look->partbooks[j])_ogg_free(look->partbooks[j]);
@@ -140,9 +138,11 @@
   info->groupbook=oggpack_read(opb,8);
 
   for(j=0;j<info->partitions;j++){
-    int cascade=info->secondstages[j]=oggpack_read(opb,3);
+    int cascade=oggpack_read(opb,3);
     if(oggpack_read(opb,1))
       cascade|=(oggpack_read(opb,5)<<3);
+    info->secondstages[j]=cascade;
+
     acc+=icount(cascade);
   }
   for(j=0;j<acc;j++)
@@ -393,17 +393,17 @@
 
   for(s=0;s<look->stages;s++){
     for(i=info->begin,l=0;i<info->end;){
-
+      
       /* first we encode a partition codeword for each channel */
       if(s==0){
         for(j=0;j<ch;j++){
           long val=partword[j][l];
           for(k=1;k<partitions_per_word;k++)
             val= val*possible_partitions+partword[j][l+k];
-	  look->phrase+=vorbis_book_encode(look->phrasebook,val,&vb->opb);
+	  vorbis_book_encode(look->phrasebook,val,&vb->opb);
         }
       }
-
+      
       /* now we encode interleaved residual values for the partitions */
       for(k=0;k<partitions_per_word;k++,l++,i+=samples_per_partition){
         
@@ -412,16 +412,14 @@
             codebook *statebook=look->partbooks[partword[j][l]][s];
             if(statebook){
               int ret=encode(&vb->opb,in[j]+i,samples_per_partition,
-			       statebook,look);
-	      look->bits[partword[j][l]]+=ret;
-	      if(s==0)look->vals[partword[j][l]]+=samples_per_partition;
+			     statebook,look);
             }
           }
         }
       }
     }
   }
-
+  
   return(0);
 }
 

--- >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