[xiph-commits] r10423 - experimental/derf/theora-exp/lib

tterribe at svn.xiph.org tterribe at svn.xiph.org
Tue Nov 22 23:28:06 PST 2005


Author: tterribe
Date: 2005-11-22 23:28:05 -0800 (Tue, 22 Nov 2005)
New Revision: 10423

Modified:
   experimental/derf/theora-exp/lib/dequant.c
   experimental/derf/theora-exp/lib/enquant.c
Log:
Fix off-by-one error in quant-range size decode.
This accomodates the spec change in r10422.
Our encoder was the only one that would generate files that would trigger this
 bug, however the original libtheora code for decoding it was correct (and
 would break decoding files encoded with this bug).


Modified: experimental/derf/theora-exp/lib/dequant.c
===================================================================
--- experimental/derf/theora-exp/lib/dequant.c	2005-11-23 07:22:49 UTC (rev 10422)
+++ experimental/derf/theora-exp/lib/dequant.c	2005-11-23 07:28:05 UTC (rev 10423)
@@ -83,7 +83,7 @@
     theora_read(_opb,nbits,&val);
     indices[0]=(int)val;
     for(qi=qri=0;qi<63;){
-      theora_read(_opb,oc_ilog(63-qi),&val);
+      theora_read(_opb,oc_ilog(62-qi),&val);
       sizes[qri]=(int)val+1;
       qi+=(int)val+1;
       theora_read(_opb,nbits,&val);

Modified: experimental/derf/theora-exp/lib/enquant.c
===================================================================
--- experimental/derf/theora-exp/lib/enquant.c	2005-11-23 07:22:49 UTC (rev 10422)
+++ experimental/derf/theora-exp/lib/enquant.c	2005-11-23 07:28:05 UTC (rev 10423)
@@ -821,7 +821,7 @@
     }
     oggpackB_write(_opb,indices[qti][pli][0],nbits);
     for(qi=qri=0;qi<63;qri++){
-      oggpackB_write(_opb,qranges->sizes[qri]-1,oc_ilog(63-qi));
+      oggpackB_write(_opb,qranges->sizes[qri]-1,oc_ilog(62-qi));
       qi+=qranges->sizes[qri];
       oggpackB_write(_opb,indices[qti][pli][qri+1],nbits);
     }



More information about the commits mailing list