diff options
author | Mike Smith <msmith@xiph.org> | 2002-07-30 09:25:12 +0000 |
---|---|---|
committer | Mike Smith <msmith@xiph.org> | 2002-07-30 09:25:12 +0000 |
commit | fc0cedf8f73300cb8abdb56402b36edcf9c360bd (patch) | |
tree | b23636de3b49c7b9117557452e4ad962a7dff4ea /lib/psy.c | |
parent | c1631ff0de17c0128f78272d499cfa3a0e4a66ad (diff) | |
download | libvorbis-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.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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, |