[xiph-commits] r11076 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Sat Apr 1 05:56:16 PST 2006


Author: jm
Date: 2006-04-01 05:56:13 -0800 (Sat, 01 Apr 2006)
New Revision: 11076

Modified:
   trunk/speex/libspeex/ltp.c
Log:
bit of cleaning up. More to come.


Modified: trunk/speex/libspeex/ltp.c
===================================================================
--- trunk/speex/libspeex/ltp.c	2006-04-01 12:07:33 UTC (rev 11075)
+++ trunk/speex/libspeex/ltp.c	2006-04-01 13:56:13 UTC (rev 11076)
@@ -759,46 +759,25 @@
       for (i=0;i<3;i++)
       {
          int j;
+         int tmp1, tmp3;
          int pp=pitch+1-i;
-#if 0
-         for (j=0;j<nsf;j++)
-         {
-            if (j-pp<0)
-               e[i][j]=exc[j-pp];
-            else if (j-pp-pitch<0)
-               e[i][j]=exc[j-pp-pitch];
-            else
-               e[i][j]=0;
-         }
-#else
-         {
-            int tmp1, tmp3;
-            tmp1=nsf;
-            if (tmp1>pp)
-               tmp1=pp;
-            for (j=0;j<tmp1;j++)
-               e[i][j]=exc[j-pp];
-            tmp3=nsf;
-            if (tmp3>pp+pitch)
-               tmp3=pp+pitch;
-            for (j=tmp1;j<tmp3;j++)
-               e[i][j]=exc[j-pp-pitch];
-            for (j=tmp3;j<nsf;j++)
-               e[i][j]=0;
-         }
-#endif
+         tmp1=nsf;
+         if (tmp1>pp)
+            tmp1=pp;
+         for (j=0;j<tmp1;j++)
+            e[i][j]=exc[j-pp];
+         tmp3=nsf;
+         if (tmp3>pp+pitch)
+            tmp3=pp+pitch;
+         for (j=tmp1;j<tmp3;j++)
+            e[i][j]=exc[j-pp-pitch];
+         for (j=tmp3;j<nsf;j++)
+            e[i][j]=0;
       }
 
-#ifdef FIXED_POINT
-      {
-         for (i=0;i<nsf;i++)
-            exc[i]=SHL32(ADD32(ADD32(MULT16_32_Q15(SHL16(gain[0],7),e[2][i]), MULT16_32_Q15(SHL16(gain[1],7),e[1][i])),
-                               MULT16_32_Q15(SHL16(gain[2],7),e[0][i])), 2);
-      }
-#else
       for (i=0;i<nsf;i++)
-         exc[i]=VERY_SMALL+gain[0]*e[2][i]+gain[1]*e[1][i]+gain[2]*e[0][i];
-#endif
+         exc[i]=SHL32(ADD32(ADD32(MULT16_32_Q15(SHL16(gain[0],7),e[2][i]), MULT16_32_Q15(SHL16(gain[1],7),e[1][i])),
+                      MULT16_32_Q15(SHL16(gain[2],7),e[0][i])), 2);
    }
 }
 



More information about the commits mailing list