Renamed MDCT functions to avoid symbol clashes with Vorbis
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Sun, 22 Nov 2009 02:57:44 +0000 (21:57 -0500)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Sun, 22 Nov 2009 02:57:44 +0000 (21:57 -0500)
libcelt/celt.c
libcelt/mdct.c
libcelt/mdct.h
libcelt/modes.c
tests/mdct-test.c

index 33f8a30..a7079d7 100644 (file)
@@ -333,7 +333,7 @@ static void compute_mdcts(const CELTMode *mode, int shortBlocks, celt_sig * rest
    {
       const mdct_lookup *lookup = MDCT(mode);
       const int overlap = OVERLAP(mode);
-      mdct_forward(lookup, in, out, mode->window, overlap);
+      clt_mdct_forward(lookup, in, out, mode->window, overlap);
    } else {
       const mdct_lookup *lookup = MDCT(mode);
       const int overlap = OVERLAP(mode);
@@ -358,7 +358,7 @@ static void compute_mdcts(const CELTMode *mode, int shortBlocks, celt_sig * rest
             int j;
             for (j=0;j<N+overlap;j++)
                x[j] = in[C*(b*N+j)+c];
-            mdct_forward(lookup, x, tmp, mode->window, overlap);
+            clt_mdct_forward(lookup, x, tmp, mode->window, overlap);
             /* Interleaving the sub-frames */
             for (j=0;j<N;j++)
                out[(j*B+b)+c*N*B] = tmp[j];
@@ -382,7 +382,7 @@ static void compute_inv_mdcts(const CELTMode *mode, int shortBlocks, celt_sig *X
       int j;
       if (transient_shift==0 && C==1 && !shortBlocks) {
          const mdct_lookup *lookup = MDCT(mode);
-         mdct_backward(lookup, X, out_mem+C*(MAX_PERIOD-N-N4), mode->window, overlap);
+         clt_mdct_backward(lookup, X, out_mem+C*(MAX_PERIOD-N-N4), mode->window, overlap);
       } else {
          VARDECL(celt_word32, x);
          VARDECL(celt_word32, tmp);
@@ -411,7 +411,7 @@ static void compute_inv_mdcts(const CELTMode *mode, int shortBlocks, celt_sig *X
             /* De-interleaving the sub-frames */
             for (j=0;j<N2;j++)
                tmp[j] = X[(j*B+b)+c*N2*B];
-            mdct_backward(lookup, tmp, x+n4offset+N2*b, mode->window, overlap);
+            clt_mdct_backward(lookup, tmp, x+n4offset+N2*b, mode->window, overlap);
          }
 
          if (transient_shift > 0)
index c873fed..51afc76 100644 (file)
@@ -58,7 +58,7 @@
 #define M_PI 3.141592653
 #endif
 
-void mdct_init(mdct_lookup *l,int N)
+void clt_mdct_init(mdct_lookup *l,int N)
 {
    int i;
    int N2;
@@ -87,13 +87,13 @@ void mdct_init(mdct_lookup *l,int N)
 #endif
 }
 
-void mdct_clear(mdct_lookup *l)
+void clt_mdct_clear(mdct_lookup *l)
 {
    cpx32_fft_free(l->kfft);
    celt_free(l->trig);
 }
 
-void mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * restrict out, const celt_word16 *window, int overlap)
+void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * restrict out, const celt_word16 *window, int overlap)
 {
    int i;
    int N, N2, N4;
@@ -184,7 +184,7 @@ void mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * r
 }
 
 
-void mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * restrict out, const celt_word16 * restrict window, int overlap)
+void clt_mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * restrict out, const celt_word16 * restrict window, int overlap)
 {
    int i;
    int N, N2, N4;
index f05643f..30c4c02 100644 (file)
@@ -55,14 +55,14 @@ typedef struct {
    kiss_twiddle_scalar * restrict trig;
 } mdct_lookup;
 
-void mdct_init(mdct_lookup *l,int N);
-void mdct_clear(mdct_lookup *l);
+void clt_mdct_init(mdct_lookup *l,int N);
+void clt_mdct_clear(mdct_lookup *l);
 
 /** Compute a forward MDCT and scale by 4/N */
-void mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar *out, const celt_word16 *window, int overlap);
+void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar *out, const celt_word16 *window, int overlap);
 
 /** Compute a backward MDCT (no scaling) and performs weighted overlap-add 
     (scales implicitly by 1/2) */
-void mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar *out, const celt_word16 * restrict window, int overlap);
+void clt_mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar *out, const celt_word16 * restrict window, int overlap);
 
 #endif
index fd1bf61..64cac78 100644 (file)
@@ -369,10 +369,10 @@ CELTMode *celt_mode_create(celt_int32 Fs, int frame_size, int *error)
 
 #endif /* !STATIC_MODES */
 
-   mdct_init(&mode->mdct, 2*mode->mdctSize);
+   clt_mdct_init(&mode->mdct, 2*mode->mdctSize);
 
    mode->shortMdctSize = mode->mdctSize/mode->nbShortMdcts;
-   mdct_init(&mode->shortMdct, 2*mode->shortMdctSize);
+   clt_mdct_init(&mode->shortMdct, 2*mode->shortMdctSize);
    mode->shortWindow = mode->window;
    mode->prob = quant_prob_alloc(mode);
    if ((mode->mdct.trig==NULL) || (mode->shortMdct.trig==NULL)
@@ -436,8 +436,8 @@ void celt_mode_destroy(CELTMode *mode)
    celt_free((celt_word16*)mode->window);
 
 #endif
-   mdct_clear(&mode->mdct);
-   mdct_clear(&mode->shortMdct);
+   clt_mdct_clear(&mode->mdct);
+   clt_mdct_clear(&mode->shortMdct);
    quant_prob_free(mode->prob);
    mode->marker_end = MODEFREED;
    celt_free((CELTMode *)mode);
index 61008c8..d1e5c25 100644 (file)
@@ -89,7 +89,7 @@ void test1d(int nfft,int isinverse)
     celt_word16  * window= (celt_word16*)malloc(sizeof(celt_word16)*nfft/2);
     int k;
 
-    mdct_init(&cfg, nfft);
+    clt_mdct_init(&cfg, nfft);
     for (k=0;k<nfft;++k) {
         in[k] = (rand() % 32768) - 16384;
     }
@@ -116,10 +116,10 @@ void test1d(int nfft,int isinverse)
     {
        for (k=0;k<nfft;++k)
           out[k] = 0;
-       mdct_backward(&cfg,in,out, window, nfft/2);
+       clt_mdct_backward(&cfg,in,out, window, nfft/2);
        check_inv(in,out,nfft,isinverse);
     } else {
-       mdct_forward(&cfg,in,out,window, nfft/2);
+       clt_mdct_forward(&cfg,in,out,window, nfft/2);
        check(in,out,nfft,isinverse);
     }
     /*for (k=0;k<nfft;++k) printf("%d %d ", out[k].r, out[k].i);printf("\n");*/
@@ -127,7 +127,7 @@ void test1d(int nfft,int isinverse)
 
     free(in);
     free(out);
-    mdct_clear(&cfg);
+    clt_mdct_clear(&cfg);
 }
 
 int main(int argc,char ** argv)