Commit 4b6e411b authored by Jack Moffitt's avatar Jack Moffitt
Browse files

this fix buys us about 5% faster decodes on a p3, and more on my celeron

svn path=/trunk/vorbis/; revision=737
parent 89ae7276
......@@ -12,7 +12,7 @@
********************************************************************
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
......@@ -69,15 +69,20 @@ void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
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)*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment