[xiph-cvs] cvs commit: theora/lib quant.c

Ralph Giles giles at xiph.org
Thu Mar 18 21:13:56 PST 2004



giles       04/03/19 00:13:56

  Modified:    lib      quant.c
  Log:
  Return to using a fixed 8 bits for the quantization base matricies. We
  believe 8 bits is a reasonable maximum for these values, and neither the
  VP3 tables nor those in Derf's experimental encoder benifit much from
  variable-sized encoding.
  
  THIS IS AN INCOMPATIBLE BITSTREAM CHANGE.

Revision  Changes    Path
1.20      +5 -10     theora/lib/quant.c

Index: quant.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/quant.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- a/quant.c	18 Mar 2004 02:00:30 -0000	1.19
+++ b/quant.c	19 Mar 2004 05:13:56 -0000	1.20
@@ -11,7 +11,7 @@
  ********************************************************************
 
   function:
-  last mod: $Id: quant.c,v 1.19 2004/03/18 02:00:30 giles Exp $
+  last mod: $Id: quant.c,v 1.20 2004/03/19 05:13:56 giles Exp $
 
  ********************************************************************/
 
@@ -142,18 +142,14 @@
     oggpackB_write(opb, pbi->DcScaleFactorTable[x],bits);
   }
   oggpackB_write(opb, 3 - 1, 9); /* number of base matricies */
-  bits=8;
-  oggpackB_write(opb, bits-1, 4);
   for(x=0; x<64; x++) {
-    oggpackB_write(opb, pbi->Y_coeffs[x],bits);
+    oggpackB_write(opb, pbi->Y_coeffs[x],8);
   }
-  oggpackB_write(opb, bits-1, 4);
   for(x=0; x<64; x++) {
-    oggpackB_write(opb, pbi->UV_coeffs[x],bits);
+    oggpackB_write(opb, pbi->UV_coeffs[x],8);
   }
-  oggpackB_write(opb, bits-1, 4);
   for(x=0; x<64; x++) {
-    oggpackB_write(opb, pbi->Inter_coeffs[x],bits);
+    oggpackB_write(opb, pbi->Inter_coeffs[x],8);
   }
   /* table mapping */
   oggpackB_write(opb, 0, 2);  /* matrix 0 for intra Y */
@@ -218,9 +214,8 @@
   ci->MaxQMatrixIndex = N;
   for(y=0; y<N; y++) {
     //fprintf(stderr," q matrix %d:\n  ", y);
-    theora_read(opb,4,&bits); bits++;
     for(x=0; x<64; x++) {
-      theora_read(opb,bits,&value);
+      theora_read(opb,8,&value);
       if(bits<0)return OC_BADHEADER;
       ci->qmats[(y<<6)+x]=(Q_LIST_ENTRY)value;
       //fprintf(stderr," %03d", (Q_LIST_ENTRY)value);

<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