Commit 9a5f3d2e authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

16-bit fixes and warning fixes

parent 508de38d
......@@ -89,17 +89,16 @@ void mdct_clear(mdct_lookup *l)
void mdct_forward(mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar *out)
{
int i;
int N, N2, N4, N8;
int N, N2, N4;
VARDECL(kiss_fft_scalar *f);
N = l->n;
N2 = N/2;
N4 = N/4;
N8 = N/8;
ALLOC(f, N2, kiss_fft_scalar);
/* Consider the input to be compused of four blocks: [a, b, c, d] */
/* Shuffle, fold, pre-rotate (part 1) */
for(i=0;i<N8;i++)
for(i=0;i<N/8;i++)
{
kiss_fft_scalar re, im;
/* Real part arranged as -d-cR, Imag part arranged as -b+aR*/
......
......@@ -47,7 +47,7 @@
recursive filter. The filter coefficient is frequency dependent and
chosen such that we have a -10dB/Bark slope on the right side and a -25dB/Bark
slope on the left side. */
void psydecay_init(struct PsyDecay *decay, int len, int Fs)
void psydecay_init(struct PsyDecay *decay, int len, celt_int32_t Fs)
{
int i;
decay->decayR = celt_alloc(sizeof(float)*len);
......@@ -76,7 +76,7 @@ void psydecay_clear(struct PsyDecay *decay)
celt_free(decay->decayL);
}
static void spreading_func(struct PsyDecay *d, float *psd, float *mask, int len, int Fs)
static void spreading_func(struct PsyDecay *d, float *psd, float *mask, int len, celt_int32_t Fs)
{
int i;
float mem;
......@@ -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, celt_word32_t *X, float *mask, int len, int Fs)
void compute_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int len, celt_int32_t Fs)
{
int i;
VARDECL(float *psd);
......@@ -137,7 +137,7 @@ void compute_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int
}
void compute_mdct_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int len, int Fs)
void compute_mdct_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int len, celt_int32_t Fs)
{
int i;
VARDECL(float *psd);
......
......@@ -39,15 +39,15 @@ struct PsyDecay {
};
/** Pre-compute the decay of the psycho-acoustic spreading function */
void psydecay_init(struct PsyDecay *decay, int len, int Fs);
void psydecay_init(struct PsyDecay *decay, int len, celt_int32_t Fs);
/** Free the memory allocated for the spreading function */
void psydecay_clear(struct PsyDecay *decay);
/** Compute the masking curve for an input (DFT) spectrum X */
void compute_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int len, int Fs);
void compute_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int len, celt_int32_t Fs);
/** Compute the masking curve for an input (MDCT) spectrum X */
void compute_mdct_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int len, int Fs);
void compute_mdct_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int len, celt_int32_t Fs);
#endif /* PSY_H */
......@@ -174,9 +174,8 @@ int bits2pulses(const CELTMode *m, int band, int bits)
int vec_bits2pulses(const CELTMode *m, const int *bands, int *bits, int *pulses, int len)
{
int i, BC;
int i;
int sum=0;
BC = m->nbMdctBlocks*m->nbChannels;
for (i=0;i<len;i++)
{
......
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