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

jm at svn.xiph.org jm at svn.xiph.org
Thu Apr 20 08:36:03 PDT 2006


Author: jm
Date: 2006-04-20 08:35:59 -0700 (Thu, 20 Apr 2006)
New Revision: 11181

Modified:
   trunk/speex/libspeex/nb_celp.c
   trunk/speex/libspeex/nb_celp.h
Log:
Vorbis-psy works again


Modified: trunk/speex/libspeex/nb_celp.c
===================================================================
--- trunk/speex/libspeex/nb_celp.c	2006-04-20 15:17:34 UTC (rev 11180)
+++ trunk/speex/libspeex/nb_celp.c	2006-04-20 15:35:59 UTC (rev 11181)
@@ -151,6 +151,7 @@
    st->psy = vorbis_psy_init(8000, 256);
    st->curve = speex_alloc(128*sizeof(float));
    st->old_curve = speex_alloc(128*sizeof(float));
+   st->psy_window = speex_alloc(256*sizeof(float));
 #endif
 
    /* Allocating input buffer */
@@ -261,6 +262,7 @@
    vorbis_psy_destroy(st->psy);
    speex_free (st->curve);
    speex_free (st->old_curve);
+   speex_free (st->psy_window);
 #endif
 
    /*Free state memory... should be last*/
@@ -442,7 +444,11 @@
    }
 
 #ifdef VORBIS_PSYCHO
-   compute_curve(st->psy, st->frame-256+st->windowSize, st->curve);
+   for(i=0;i<256-st->frameSize;i++)
+      st->psy_window[i] = st->psy_window[i+st->frameSize];
+   for(i=0;i<st->frameSize;i++)
+      st->psy_window[256-st->frameSize+i] = in[i];
+   compute_curve(st->psy, st->psy_window, st->curve);
    /*print_vec(st->curve, 128, "curve");*/
    if (st->first)
       for (i=0;i<128;i++)

Modified: trunk/speex/libspeex/nb_celp.h
===================================================================
--- trunk/speex/libspeex/nb_celp.h	2006-04-20 15:17:34 UTC (rev 11180)
+++ trunk/speex/libspeex/nb_celp.h	2006-04-20 15:35:59 UTC (rev 11181)
@@ -70,6 +70,7 @@
 
 #ifdef VORBIS_PSYCHO
    VorbisPsy *psy;
+   float *psy_window;
    float *curve;
    float *old_curve;
 #endif



More information about the commits mailing list