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

jm at motherfish-iii.xiph.org jm at motherfish-iii.xiph.org
Fri Oct 29 05:22:58 PDT 2004


Author: jm
Date: 2004-10-29 05:22:57 -0700 (Fri, 29 Oct 2004)
New Revision: 8130

Modified:
   trunk/speex/libspeex/mdf.c
   trunk/speex/libspeex/preprocess.c
   trunk/speex/libspeex/smallft.c
   trunk/speex/libspeex/smallft.h
Log:
Renamed the FFT in order to remove the symbol clash with Vorbis.


Modified: trunk/speex/libspeex/mdf.c
===================================================================
--- trunk/speex/libspeex/mdf.c	2004-10-28 19:21:52 UTC (rev 8129)
+++ trunk/speex/libspeex/mdf.c	2004-10-29 12:22:57 UTC (rev 8130)
@@ -60,7 +60,7 @@
    st->adapt_rate = .01f;
 
    st->fft_lookup = (struct drft_lookup*)speex_alloc(sizeof(struct drft_lookup));
-   drft_init(st->fft_lookup, N);
+   spx_drft_init(st->fft_lookup, N);
    
    st->x = (float*)speex_alloc(N*sizeof(float));
    st->d = (float*)speex_alloc(N*sizeof(float));
@@ -100,7 +100,7 @@
 /** Destroys an echo canceller state */
 void speex_echo_state_destroy(SpeexEchoState *st)
 {
-   drft_clear(st->fft_lookup);
+   spx_drft_clear(st->fft_lookup);
    speex_free(st->fft_lookup);
    speex_free(st->x);
    speex_free(st->d);
@@ -151,7 +151,7 @@
       st->X[(M-1)*N+i]=st->x[i];
 
    /* Convert x (echo input) to frequency domain */
-   drft_forward(st->fft_lookup, &st->X[(M-1)*N]);
+   spx_drft_forward(st->fft_lookup, &st->X[(M-1)*N]);
 
    /* Compute filter response Y */
    for (i=1;i<N-1;i+=2)
@@ -174,7 +174,7 @@
    /* Transform d (reference signal) to frequency domain */
    for (i=0;i<N;i++)
       st->D[i]=st->d[i];
-   drft_forward(st->fft_lookup, st->D);
+   spx_drft_forward(st->fft_lookup, st->D);
 
    /* Copy spectrum of Y to Yout for use in an echo post-filter */
    if (Yout)
@@ -192,7 +192,7 @@
       st->y[i] = st->Y[i];
    
    /* Convery Y (filter response) to time domain */
-   drft_backward(st->fft_lookup, st->y);
+   spx_drft_backward(st->fft_lookup, st->y);
    for (i=0;i<N;i++)
       st->y[i] *= scale;
 
@@ -226,7 +226,7 @@
    }
    
    /* Convert error to frequency domain */
-   drft_forward(st->fft_lookup, st->E);
+   spx_drft_forward(st->fft_lookup, st->E);
 
    /* Compute input power in each frequency bin */
    {
@@ -339,14 +339,14 @@
    {
       if (st->cancel_count%M == j)
       {
-         drft_backward(st->fft_lookup, &st->W[j*N]);
+         spx_drft_backward(st->fft_lookup, &st->W[j*N]);
          for (i=0;i<N;i++)
             st->W[j*N+i]*=scale;
          for (i=st->frame_size;i<N;i++)
          {
             st->W[j*N+i]=0;
          }
-         drft_forward(st->fft_lookup, &st->W[j*N]);
+         spx_drft_forward(st->fft_lookup, &st->W[j*N]);
       }
 
    }

Modified: trunk/speex/libspeex/preprocess.c
===================================================================
--- trunk/speex/libspeex/preprocess.c	2004-10-28 19:21:52 UTC (rev 8129)
+++ trunk/speex/libspeex/preprocess.c	2004-10-29 12:22:57 UTC (rev 8130)
@@ -226,7 +226,7 @@
    st->nb_loudness_adapt = 0;
 
    st->fft_lookup = (struct drft_lookup*)speex_alloc(sizeof(struct drft_lookup));
-   drft_init(st->fft_lookup,2*N);
+   spx_drft_init(st->fft_lookup,2*N);
 
    st->nb_adapt=0;
    st->consec_noise=0;
@@ -263,7 +263,7 @@
    speex_free(st->inbuf);
    speex_free(st->outbuf);
 
-   drft_clear(st->fft_lookup);
+   spx_drft_clear(st->fft_lookup);
    speex_free(st->fft_lookup);
 
    speex_free(st);
@@ -570,7 +570,7 @@
       st->frame[i] *= st->window[i];
 
    /* Perform FFT */
-   drft_forward(st->fft_lookup, st->frame);
+   spx_drft_forward(st->fft_lookup, st->frame);
 
    /* Power spectrum */
    ps[0]=1;
@@ -899,7 +899,7 @@
    st->frame[2*N-1]=0;
 
    /* Inverse FFT with 1/N scaling */
-   drft_backward(st->fft_lookup, st->frame);
+   spx_drft_backward(st->fft_lookup, st->frame);
 
    for (i=0;i<2*N;i++)
       st->frame[i] *= scale;

Modified: trunk/speex/libspeex/smallft.c
===================================================================
--- trunk/speex/libspeex/smallft.c	2004-10-28 19:21:52 UTC (rev 8129)
+++ trunk/speex/libspeex/smallft.c	2004-10-29 12:22:57 UTC (rev 8130)
@@ -1230,17 +1230,17 @@
   for(i=0;i<n;i++)c[i]=ch[i];
 }
 
-void drft_forward(struct drft_lookup *l,float *data){
+void spx_drft_forward(struct drft_lookup *l,float *data){
   if(l->n==1)return;
   drftf1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache);
 }
 
-void drft_backward(struct drft_lookup *l,float *data){
+void spx_drft_backward(struct drft_lookup *l,float *data){
   if (l->n==1)return;
   drftb1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache);
 }
 
-void drft_init(struct drft_lookup *l,int n)
+void spx_drft_init(struct drft_lookup *l,int n)
 {
   l->n=n;
   l->trigcache=(float*)speex_alloc(3*n*sizeof(*l->trigcache));
@@ -1248,7 +1248,7 @@
   fdrffti(n, l->trigcache, l->splitcache);
 }
 
-void drft_clear(struct drft_lookup *l)
+void spx_drft_clear(struct drft_lookup *l)
 {
   if(l)
   {

Modified: trunk/speex/libspeex/smallft.h
===================================================================
--- trunk/speex/libspeex/smallft.h	2004-10-28 19:21:52 UTC (rev 8129)
+++ trunk/speex/libspeex/smallft.h	2004-10-29 12:22:57 UTC (rev 8130)
@@ -30,10 +30,10 @@
   int *splitcache;
 };
 
-extern void drft_forward(struct drft_lookup *l,float *data);
-extern void drft_backward(struct drft_lookup *l,float *data);
-extern void drft_init(struct drft_lookup *l,int n);
-extern void drft_clear(struct drft_lookup *l);
+extern void spx_drft_forward(struct drft_lookup *l,float *data);
+extern void spx_drft_backward(struct drft_lookup *l,float *data);
+extern void spx_drft_init(struct drft_lookup *l,int n);
+extern void spx_drft_clear(struct drft_lookup *l);
 
 #ifdef __cplusplus
 }



More information about the commits mailing list