[xiph-commits] r16897 - trunk/vorbis/lib

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Sat Feb 13 11:26:42 PST 2010


Author: xiphmont
Date: 2010-02-13 11:26:42 -0800 (Sat, 13 Feb 2010)
New Revision: 16897

Modified:
   trunk/vorbis/lib/sharedbook.c
Log:
The rounding can cause a surprising amount of trouble in book creation.



Modified: trunk/vorbis/lib/sharedbook.c
===================================================================
--- trunk/vorbis/lib/sharedbook.c	2010-02-13 14:55:55 UTC (rev 16896)
+++ trunk/vorbis/lib/sharedbook.c	2010-02-13 19:26:42 UTC (rev 16897)
@@ -52,7 +52,7 @@
     sign=0x80000000;
     val= -val;
   }
-  exp= floor(log(val)/log(2.f));
+  exp= floor(log(val)/log(2.f)+.001); //+epsilon
   mant=rint(ldexp(val,(VQ_FMAN-1)-exp));
   exp=(exp+VQ_FEXP_BIAS)<<VQ_FMAN;
 



More information about the commits mailing list