[xiph-cvs] r6577 - trunk/postfish

xiphmont at xiph.org xiphmont at xiph.org
Tue May 4 21:25:44 PDT 2004



Author: xiphmont
Date: 2004-04-22 07:52:24 -0400 (Thu, 22 Apr 2004)
New Revision: 6577

Modified:
   trunk/postfish/multicompand.c
   trunk/postfish/postfish.h
   trunk/postfish/version.h
Log:
Commit a fix to a bug whose meme stretches back to an arithmetic error
Segher made in a Vorbis optimization years ago.... the error wasn't
backed out of Vorbis because we tuned around it (in the end making no
difference), and removing the bug would undo the tuning.
Unfortunately, other code that borrowed the todB and fromdB
approximations that use IEEE754 float32 bitpatterns borrowed the bug
as well.  This fixes the offset value in fromdB_a and todB_a.

<p><p>Modified: trunk/postfish/multicompand.c
===================================================================
--- trunk/postfish/multicompand.c	2004-04-22 11:20:15 UTC (rev 6576)
+++ trunk/postfish/multicompand.c	2004-04-22 11:52:24 UTC (rev 6577)
@@ -356,7 +356,6 @@
 }
 
 static void multicompand_work(void *vs){
-  return;
   multicompand_state *ms=(multicompand_state *)vs;
   subband_state *ss=&ms->ss;
   int i,j,k,bypass_visible=1;
@@ -406,12 +405,12 @@
                       (i>=w->freq_bands?0:adj));
         
         over_compand(x,  
-		     bc[bank].static_o[i],
-		     &ms->over_attack,
-		     &ms->over_decay,
-		     &ms->over_iir[i][j],
-		     &ms->over_peak[i][j],
-		     (i>=w->freq_bands?0:adj));
+	     bc[bank].static_o[i],
+	     &ms->over_attack,
+	     &ms->over_decay,
+	     &ms->over_iir[i][j],
+	     &ms->over_peak[i][j],
+	     (i>=w->freq_bands?0:adj));
 
       }
 
@@ -448,11 +447,11 @@
       
       if(active){
         base_compand(x,  
-		     &ms->base_attack,
-		     &ms->base_decay,
-		     &ms->base_iir[i][j],
-		     &ms->base_peak[i][j],
-		     (i>=w->freq_bands?0:adj));
+	     &ms->base_attack,
+	     &ms->base_decay,
+	     &ms->base_iir[i][j],
+	     &ms->base_peak[i][j],
+	     (i>=w->freq_bands?0:adj));
         
         if(ss->effect_activeC[j]){
           for(k=0;k<input_size;k++)

Modified: trunk/postfish/postfish.h
===================================================================
--- trunk/postfish/postfish.h	2004-04-22 11:20:15 UTC (rev 6576)
+++ trunk/postfish/postfish.h	2004-04-22 11:52:24 UTC (rev 6577)
@@ -61,11 +61,11 @@
 #ifdef UGLY_IEEE754_FLOAT32_HACK
 
 static inline float todB_a(const float *x){
-  return (float)((*(int32_t *)x)&0x7fffffff) * 7.1771144e-7f -764.27118f;
+  return (float)((*(int32_t *)x)&0x7fffffff) * 7.17711438e-7f -764.6161886f;
 }
 
 static inline float fromdB_a(float x){
-  int y=1.3933e+06f*(x+764.27118f);
+  int y=1.39331762961e+06f*(x+764.6161886f);
   return *(float *)&y;
 }
 

Modified: trunk/postfish/version.h
===================================================================
--- trunk/postfish/version.h	2004-04-22 11:20:15 UTC (rev 6576)
+++ trunk/postfish/version.h	2004-04-22 11:52:24 UTC (rev 6577)
@@ -1,2 +1,2 @@
 #define VERSION "$Id$ "
-/* DO NOT EDIT: Automated versioning hack [Thu Apr 22 07:19:26 EDT 2004] */
+/* DO NOT EDIT: Automated versioning hack [Thu Apr 22 07:48:59 EDT 2004] */

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