svn path=/trunk/vorbis/; revision=3993
********************************************************************
function: LSP (also called LSF) conversion routines
********************************************************************
function: LSP (also called LSF) conversion routines
- last mod: $Id: lsp.c,v 1.22 2002/07/17 21:28:37 xiphmont Exp $
+ last mod: $Id: lsp.c,v 1.23 2002/10/11 07:44:28 xiphmont Exp $
The LSP generation code is taken (with minimal modification and a
few bugfixes) from "On the Computation of the LSP Frequencies" by
The LSP generation code is taken (with minimal modification and a
few bugfixes) from "On the Computation of the LSP Frequencies" by
}
static int comp(const void *a,const void *b){
}
static int comp(const void *a,const void *b){
- if(*(float *)a<*(float *)b)
- return(1);
- else
- return(-1);
+ return (*(float *)a<*(float *)b)-(*(float *)a>*(float *)b);
}
/* Newton-Raphson-Maehly actually functioned as a decent root finder,
}
/* Newton-Raphson-Maehly actually functioned as a decent root finder,
********************************************************************
function: psychoacoustics not including preecho
********************************************************************
function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.76 2002/07/30 10:43:07 msmith Exp $
+ last mod: $Id: psy.c,v 1.77 2002/10/11 07:44:28 xiphmont Exp $
********************************************************************/
********************************************************************/
static int apsort(const void *a, const void *b){
float f1=fabs(**(float**)a);
float f2=fabs(**(float**)b);
static int apsort(const void *a, const void *b){
float f1=fabs(**(float**)a);
float f2=fabs(**(float**)b);
- if(f1>f2)return -1;
- else if(f1==f2)return 0;
- else return 1;
+ return (f1<f2)-(f1>f2);
}
int **_vp_quantize_couple_sort(vorbis_block *vb,
}
int **_vp_quantize_couple_sort(vorbis_block *vb,
********************************************************************
function: basic shared codebook operations
********************************************************************
function: basic shared codebook operations
- last mod: $Id: sharedbook.c,v 1.28 2002/06/28 22:19:37 xiphmont Exp $
+ last mod: $Id: sharedbook.c,v 1.29 2002/10/11 07:44:28 xiphmont Exp $
********************************************************************/
********************************************************************/
}
static int sort32a(const void *a,const void *b){
}
static int sort32a(const void *a,const void *b){
- return ( (**(ogg_uint32_t **)a>**(ogg_uint32_t **)b)<<1)-1;
+ return ( **(ogg_uint32_t **)a>**(ogg_uint32_t **)b)-
+ ( **(ogg_uint32_t **)a<**(ogg_uint32_t **)b);
}
/* decode codebook arrangement is more heavily optimized than encode */
}
/* decode codebook arrangement is more heavily optimized than encode */
********************************************************************
function: train a VQ codebook
********************************************************************
function: train a VQ codebook
- last mod: $Id: vqgen.c,v 1.40 2001/12/20 01:00:40 segher Exp $
+ last mod: $Id: vqgen.c,v 1.41 2002/10/11 07:44:28 xiphmont Exp $
********************************************************************/
********************************************************************/
int directdsort(const void *a, const void *b){
float av=*((float *)a);
float bv=*((float *)b);
int directdsort(const void *a, const void *b){
float av=*((float *)a);
float bv=*((float *)b);
- if(av>bv)return(-1);
- return(1);
+ return (av<bv)-(av>bv);
}
void vqgen_cellmetric(vqgen *v){
}
void vqgen_cellmetric(vqgen *v){