summaryrefslogtreecommitdiff
path: root/lib/psy.c
diff options
context:
space:
mode:
authorMike Smith <msmith@xiph.org>2002-07-30 09:25:12 +0000
committerMike Smith <msmith@xiph.org>2002-07-30 09:25:12 +0000
commitfc0cedf8f73300cb8abdb56402b36edcf9c360bd (patch)
treeb23636de3b49c7b9117557452e4ad962a7dff4ea /lib/psy.c
parentc1631ff0de17c0128f78272d499cfa3a0e4a66ad (diff)
downloadlibvorbis-git-fc0cedf8f73300cb8abdb56402b36edcf9c360bd.tar.gz
Fix qsort() function so that it works on solaris, modified slightly
from a contributed patch. svn path=/trunk/vorbis/; revision=3732
Diffstat (limited to 'lib/psy.c')
-rw-r--r--lib/psy.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/psy.c b/lib/psy.c
index 05228bd0..9493b18c 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.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 @@ float **_vp_quantize_couple_memo(vorbis_block *vb,
/* 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,