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

jm at svn.xiph.org jm at svn.xiph.org
Wed Oct 5 16:38:26 PDT 2005


Author: jm
Date: 2005-10-05 16:38:24 -0700 (Wed, 05 Oct 2005)
New Revision: 10132

Modified:
   trunk/speex/libspeex/curves.c
Log:
kludgy fft init


Modified: trunk/speex/libspeex/curves.c
===================================================================
--- trunk/speex/libspeex/curves.c	2005-10-05 23:21:16 UTC (rev 10131)
+++ trunk/speex/libspeex/curves.c	2005-10-05 23:38:24 UTC (rev 10132)
@@ -29,6 +29,8 @@
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+/*#define VORBIS_PSYCHO*/
+
 #ifdef VORBIS_PSYCHO
 
 
@@ -37,8 +39,20 @@
 
 struct drft_lookup lookup;
 
+/* FIXME: This is an horrible kludge */
+static void fft_init(int size)
+{
+   static initialized = -1;
+   if (size != initialized)
+   {
+      if (initialized != -1)
+         spx_drft_clear(&lookup);
+      spx_drft_init(&lookup, size);
+      initialized = size;
+   }
+}
 /* */
-void curve_to_lpc(float *curve, int len, float *ak, int ord)
+void curve_to_lpc(float *curve, int len, float *awk1, float *awk2, int ord)
 {
    int i;
    float ac[len*2];
@@ -49,9 +63,12 @@
    ac[0] = curve[0];
    ac[2*len-1] = curve[len-1];
    
+   fft_init(2*len);
    spx_drft_backward(&lookup, ac);
-   _spx_lpc(ak, ac, ord);
+   _spx_lpc(awk1, ac, ord);
+   for (i=0;i<ord;i++)
+      awk2[i] = 0;
 }
 
 
-#endif
\ No newline at end of file
+#endif



More information about the commits mailing list