From d3f8fe069886a40b41d0033519e64bc6c4cf02d8 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Tue, 18 Dec 2001 01:58:15 +0000 Subject: [PATCH] Some more hypot() removal. svn path=/trunk/vorbis/; revision=2634 --- lib/psy.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/lib/psy.c b/lib/psy.c index 7a312f9..522728f 100644 --- a/lib/psy.c +++ b/lib/psy.c @@ -11,7 +11,7 @@ ******************************************************************** function: psychoacoustics not including preecho - last mod: $Id: psy.c,v 1.57 2001/12/12 09:45:25 xiphmont Exp $ + last mod: $Id: psy.c,v 1.58 2001/12/18 01:58:15 segher Exp $ ********************************************************************/ @@ -925,28 +925,18 @@ static void couple_point(float A, float B, float fA, float fB, float granule,float igranule, float fmag, float *mag, float *ang){ - float origmag=FAST_HYPOT(A*fA,B*fB),corr; + float corr; if(fmag!=0.f){ - //float phase=rint((A-B)*.5/fmag); - if(fabs(A)>fabs(B)){ - *mag=A;//phase=(A>0?phase:-phase); + *mag=A; }else{ - *mag=B;//phase=(B>0?phase:-phase); + *mag=B; } - //switch((int)phase){ - //case 0: - corr=origmag/FAST_HYPOT(fmag*fA,fmag*fB); - *mag=rint(*mag*corr*igranule)*granule; - *ang=0.f; - //break; - //default: - //*mag=0.f; - //*ang=0.f; - //break; - //} + corr=sqrt((A*A*fA*fA+B*B*fB*fB)/(fA*fA+fB*fB))/fmag; + *mag=rint(*mag*corr*igranule)*granule; + *ang=0.f; }else{ *mag=0.f; *ang=0.f; -- 2.34.1