this fix buys us about 5% faster decodes on a p3, and more on my celeron
authorJack Moffitt <jack@xiph.org>
Wed, 18 Oct 2000 21:27:15 +0000 (21:27 +0000)
committerJack Moffitt <jack@xiph.org>
Wed, 18 Oct 2000 21:27:15 +0000 (21:27 +0000)
svn path=/trunk/vorbis/; revision=737

lib/lsp.c

index 1adab14..5211cfe 100644 (file)
--- a/lib/lsp.c
+++ b/lib/lsp.c
@@ -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)*