ref: 37d13ceebeb7d08f30cb2895f7c1f0ba04c703b0
parent: 18ddc02afd83b3f015c346275f29ac380ad19687
author: Jean-Marc Valin <[email protected]>
date: Fri Feb 22 09:45:58 EST 2008
Adding celt_sig_t where needed
--- a/libcelt/mdct.c
+++ b/libcelt/mdct.c
@@ -76,16 +76,16 @@
celt_free(l->trig);
}
-void mdct_forward(mdct_lookup *l, float *in, float *out)
+void mdct_forward(mdct_lookup *l, celt_sig_t *in, celt_sig_t *out)
{
int i;
int N, N2, N4, N8;
- VARDECL(float *f);
+ VARDECL(celt_sig_t *f);
N = l->n;
N2 = N/2;
N4 = N/4;
N8 = N/8;
- ALLOC(f, N2, float);
+ ALLOC(f, N2, celt_sig_t);
/* Consider the input to be compused of four blocks: [a, b, c, d] */
/* Shuffle, fold, pre-rotate (part 1) */
@@ -120,16 +120,16 @@
}
-void mdct_backward(mdct_lookup *l, float *in, float *out)
+void mdct_backward(mdct_lookup *l, celt_sig_t *in, celt_sig_t *out)
{
int i;
int N, N2, N4, N8;
- VARDECL(float *f);
+ VARDECL(celt_sig_t *f);
N = l->n;
N2 = N/2;
N4 = N/4;
N8 = N/8;
- ALLOC(f, N2, float);
+ ALLOC(f, N2, celt_sig_t);
/* Pre-rotate */
for(i=0;i<N4;i++)
--- a/libcelt/mdct.h
+++ b/libcelt/mdct.h
@@ -55,8 +55,8 @@
void mdct_clear(mdct_lookup *l);
/** Compute a forward MDCT and scale by 2/N */
-void mdct_forward(mdct_lookup *l, float *in, float *out);
+void mdct_forward(mdct_lookup *l, celt_sig_t *in, celt_sig_t *out);
/** Compute a backward MDCT (no scaling) */
-void mdct_backward(mdct_lookup *l, float *in, float *out);
+void mdct_backward(mdct_lookup *l, celt_sig_t *in, celt_sig_t *out);
--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -44,20 +44,20 @@
#include "pitch.h"
#include "psy.h"
-void find_spectral_pitch(kiss_fftr_cfg fft, struct PsyDecay *decay, float *x, float *y, int lag, int len, int C, int *pitch)
+void find_spectral_pitch(kiss_fftr_cfg fft, struct PsyDecay *decay, celt_sig_t *x, celt_sig_t *y, int lag, int len, int C, int *pitch)
{
int c, i;
float max_corr;
- VARDECL(float *xx);
- VARDECL(float *yy);
- VARDECL(float *X);
- VARDECL(float *Y);
+ VARDECL(celt_sig_t *xx);
+ VARDECL(celt_sig_t *yy);
+ VARDECL(celt_sig_t *X);
+ VARDECL(celt_sig_t *Y);
VARDECL(float *curve);
int n2 = lag/2;
- ALLOC(xx, lag*C, float);
- ALLOC(yy, lag*C, float);
- ALLOC(X, lag*C, float);
- ALLOC(Y, lag*C, float);
+ ALLOC(xx, lag*C, celt_sig_t);
+ ALLOC(yy, lag*C, celt_sig_t);
+ ALLOC(X, lag*C, celt_sig_t);
+ ALLOC(Y, lag*C, celt_sig_t);
ALLOC(curve, n2*C, float);
for (i=0;i<C*lag;i++)
--- a/libcelt/pitch.h
+++ b/libcelt/pitch.h
@@ -44,6 +44,6 @@
/** Find the optimal delay for the pitch prediction. Computation is
done in the frequency domain, both to save time and to make it
easier to apply psychoacoustic weighting */
-void find_spectral_pitch(kiss_fftr_cfg fft, struct PsyDecay *decay, float *x, float *y, int lag, int len, int C, int *pitch);
+void find_spectral_pitch(kiss_fftr_cfg fft, struct PsyDecay *decay, celt_sig_t *x, celt_sig_t *y, int lag, int len, int C, int *pitch);
#endif
--- a/libcelt/psy.c
+++ b/libcelt/psy.c
@@ -122,7 +122,7 @@
}
/* Compute a marking threshold from the spectrum X. */
-void compute_masking(struct PsyDecay *decay, float *X, float *mask, int len, int Fs)
+void compute_masking(struct PsyDecay *decay, celt_sig_t *X, float *mask, int len, int Fs)
{
int i;
VARDECL(float *psd);
--- a/libcelt/psy.h
+++ b/libcelt/psy.h
@@ -31,6 +31,8 @@
#ifndef PSY_H
#define PSY_H
+#include "arch.h"
+
struct PsyDecay {
float *decayL;
float *decayR;
@@ -43,7 +45,7 @@
void psydecay_clear(struct PsyDecay *decay);
/** Compute the masking curve for an input (DFT) spectrum X */
-void compute_masking(struct PsyDecay *decay, float *X, float *mask, int len, int Fs);
+void compute_masking(struct PsyDecay *decay, celt_sig_t *X, float *mask, int len, int Fs);
/** Compute the masking curve for an input (MDCT) spectrum X */
void compute_mdct_masking(struct PsyDecay *decay, float *X, float *mask, int len, int Fs);