shithub: opus

Download patch

ref: 9a5f3d2e6d6f9ca7278697180d18efdfd685913d
parent: 508de38d228e3412e3cafb7f2890384f8bb424bd
author: Jean-Marc Valin <[email protected]>
date: Tue Feb 26 05:38:17 EST 2008

16-bit fixes and warning fixes

--- a/libcelt/mdct.c
+++ b/libcelt/mdct.c
@@ -89,17 +89,16 @@
 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*/
--- a/libcelt/psy.c
+++ b/libcelt/psy.c
@@ -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 @@
    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 @@
 }
 
 /* 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_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);
--- a/libcelt/psy.h
+++ b/libcelt/psy.h
@@ -39,15 +39,15 @@
 };
 
 /** 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 */
--- a/libcelt/rate.c
+++ b/libcelt/rate.c
@@ -174,9 +174,8 @@
 
 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++)
    {