Segher,
authorMonty <xiphmont@xiph.org>
Tue, 18 Dec 2001 02:57:30 +0000 (02:57 +0000)
committerMonty <xiphmont@xiph.org>
Tue, 18 Dec 2001 02:57:30 +0000 (02:57 +0000)
"You may remove the // comments" != "You may make 'optimizations' that
make your machine slightly faster and everything else slower the night
before a stable release".

Do not cause me extra work during deadlines in the future.

psy.c rolled back to 1.57

Monty

svn path=/trunk/vorbis/; revision=2636

lib/psy.c

index 522728f..1884edf 100644 (file)
--- a/lib/psy.c
+++ b/lib/psy.c
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.58 2001/12/18 01:58:15 segher Exp $
+ last mod: $Id: psy.c,v 1.59 2001/12/18 02:57:30 xiphmont Exp $
 
  ********************************************************************/
 
@@ -925,18 +925,20 @@ static void couple_point(float A, float B, float fA, float fB,
                         float granule,float igranule,
                         float fmag, float *mag, float *ang){
 
-  float corr;
+  float origmag=FAST_HYPOT(A*fA,B*fB),corr;
 
   if(fmag!=0.f){
+    
     if(fabs(A)>fabs(B)){
       *mag=A;
     }else{
       *mag=B;
     }
     
-    corr=sqrt((A*A*fA*fA+B*B*fB*fB)/(fA*fA+fB*fB))/fmag;
+    corr=origmag/FAST_HYPOT(fmag*fA,fmag*fB);
     *mag=rint(*mag*corr*igranule)*granule; 
     *ang=0.f;
+
   }else{
     *mag=0.f;
     *ang=0.f;