[xiph-cvs] cvs commit: vorbis/lib lsp.c

Jack Moffitt jack at xiph.org
Wed Oct 18 14:27:16 PDT 2000



jack        00/10/18 14:27:16

  Modified:    lib      lsp.c
  Log:
  this fix buys us about 5% faster decodes on a p3, and more on my celeron

Revision  Changes    Path
1.11      +10 -5     vorbis/lib/lsp.c

Index: lsp.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/lsp.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- lsp.c	2000/10/12 03:12:53	1.10
+++ lsp.c	2000/10/18 21:27:15	1.11
@@ -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 @@
 
   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);
+    float *ftmp=lsp;
+    int c=m>>1;
 
-    for(j=0;j<m;j+=2)    p *= lsp[j]-w;
-    for(j=1;j<m;j+=2)    q *= lsp[j]-w;
-
+    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)*

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list