Commit 37d13cee authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Adding celt_sig_t where needed

parent 18ddc02a
......@@ -76,16 +76,16 @@ void mdct_clear(mdct_lookup *l)
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_forward(mdct_lookup *l, float *in, float *out)
}
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++)
......
......@@ -55,8 +55,8 @@ void mdct_init(mdct_lookup *l,int N);
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);
......@@ -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++)
......
......@@ -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
......@@ -122,7 +122,7 @@ static void spreading_func(struct PsyDecay *d, float *psd, float *mask, int len,
}
/* 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);
......
......@@ -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_init(struct PsyDecay *decay, int len, int Fs);
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);
......
Markdown is supported
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