********************************************************************
function: LSP (also called LSF) conversion routines
- last mod: $Id: lsp.c,v 1.10 2000/10/12 03:12:53 xiphmont Exp $
+ last mod: $Id: lsp.c,v 1.11 2000/10/18 21:27:15 jack Exp $
The LSP generation code is taken (with minimal modification) from
"On the Computation of the LSP Frequencies" by Joseph Rothweiler
i=0;
while(i<n){
- int j,k=map[i];
+ int j=0,k=map[i];
int qexp;
float p=.7071067812;
float q=.7071067812;
float w=vorbis_coslook(wdel*k);
-
- for(j=0;j<m;j+=2) p *= lsp[j]-w;
- for(j=1;j<m;j+=2) q *= lsp[j]-w;
-
+ float *ftmp=lsp;
+ int c=m>>1;
+
+ do{
+ p*=ftmp[0]-w;
+ q*=ftmp[1]-w;
+ ftmp+=2;
+ }while(--c);
+
q=frexp(p*p*(1.+w)+q*q*(1.-w),&qexp);
q=vorbis_fromdBlook(amp*
vorbis_invsqlook(q)*