Commit 6d584acd authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Renamed MDCT functions to avoid symbol clashes with Vorbis

parent 9319e3e6
......@@ -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)
......
......@@ -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;
......
......@@ -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
......@@ -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);
......
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment