[xiph-cvs] cvs commit: vorbis/lib psy.c

Michael Smith msmith at xiph.org
Thu Sep 7 06:10:37 PDT 2000



msmith      00/09/07 06:10:37

  Modified:    lib      Tag: branch_postbeta2 psy.c
  Log:
  Fix for the sqrt() floating point exception errors that were reported.
  We weren't checking for underflow (due to precision errors) on the final
  iteration of the smoothing loop.

Revision  Changes    Path
No                   revision

No                   revision

1.26.2.4  +2 -1      vorbis/lib/psy.c

Index: psy.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psy.c,v
retrieving revision 1.26.2.3
retrieving revision 1.26.2.4
diff -u -r1.26.2.3 -r1.26.2.4
--- psy.c	2000/09/02 05:19:25	1.26.2.3
+++ psy.c	2000/09/07 13:10:36	1.26.2.4
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.26.2.3 2000/09/02 05:19:25 xiphmont Exp $
+ last mod: $Id: psy.c,v 1.26.2.4 2000/09/07 13:10:36 msmith Exp $
 
  ********************************************************************/
 
@@ -623,6 +623,7 @@
       acc-=prev*prev;
       prev=this;
     }
+    if(acc<0)acc=0; /* in case it happens on the final iteration */
     smooth[n-1]=sqrt(acc);
   }
 

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