[xiph-cvs] cvs commit: vorbis/lib psy.c
Michael Smith
msmith at xiph.org
Tue Jul 30 02:25:14 PDT 2002
msmith 02/07/30 02:25:13
Modified: lib psy.c
Log:
Fix qsort() function so that it works on solaris, modified slightly
from a contributed patch.
Revision Changes Path
1.75 +6 -3 vorbis/lib/psy.c
Index: psy.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psy.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- psy.c 2002/07/13 10:18:33 1.74
+++ psy.c 2002/07/30 09:25:12 1.75
@@ -11,7 +11,7 @@
********************************************************************
function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.74 2002/07/13 10:18:33 giles Exp $
+ last mod: $Id: psy.c,v 1.75 2002/07/30 09:25:12 msmith Exp $
********************************************************************/
@@ -950,8 +950,11 @@
/* this is for per-channel noise normalization */
static int apsort(const void *a, const void *b){
- if(fabs(**(float **)a)>fabs(**(float **)b))return -1;
- return 1;
+ float f1=fabsf(**(float**)a);
+ float f2=fabsf(**(float**)b);
+ if(f1>f2)return -1;
+ else if(f1==f2)return 0;
+ else return 1;
}
int **_vp_quantize_couple_sort(vorbis_block *vb,
<p><p><p><p>--- >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