shithub: opus

Download patch

ref: 5e171490a98701d982720cc2a03802b4b3dac66b
parent: 3ca9b1d29539bf7f79f07c975e5d60ee42883580
author: Jean-Marc Valin <[email protected]>
date: Wed Feb 27 19:07:23 EST 2008

Removed some unused parameters and fixed a couple -W warnings

--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -158,7 +158,7 @@
 
 
 /* Compute the best gain for each "pitch band" */
-void compute_pitch_gain(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_pgain_t *gains, celt_ener_t *bank)
+void compute_pitch_gain(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_pgain_t *gains)
 {
    int i, B;
    const int *pBands = m->pBands;
@@ -198,7 +198,7 @@
 }
 
 /* Apply the (quantised) gain to each "pitch band" */
-void pitch_quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_pgain_t *gains)
+void pitch_quant_bands(const CELTMode *m, celt_norm_t *P, celt_pgain_t *gains)
 {
    int i, B;
    const int *pBands = m->pBands;
--- a/libcelt/bands.h
+++ b/libcelt/bands.h
@@ -74,9 +74,9 @@
  * @param gains Gain computed for each pitch band (returned)
  * @param bank Square root of the energy for each band
  */
-void compute_pitch_gain(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_pgain_t *gains, celt_ener_t *bank);
+void compute_pitch_gain(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_pgain_t *gains);
 
-void pitch_quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_pgain_t *gains);
+void pitch_quant_bands(const CELTMode *m, celt_norm_t *P, celt_pgain_t *gains);
 
 /** Quantisation/encoding of the residual spectrum
  * @param m Mode data 
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -343,7 +343,7 @@
          X[i*C+1] = P[i*C+1] = 0;*/
 
       /* Pitch prediction */
-      compute_pitch_gain(st->mode, X, P, gains, bandE);
+      compute_pitch_gain(st->mode, X, P, gains);
       has_pitch = quant_pitch(gains, st->mode->nbPBands, &st->enc);
       if (has_pitch)
          ec_enc_uint(&st->enc, pitch_index, MAX_PERIOD-(B+1)*N);
@@ -357,7 +357,7 @@
    }
    
 
-   pitch_quant_bands(st->mode, X, P, gains);
+   pitch_quant_bands(st->mode, P, gains);
 
    /*for (i=0;i<B*N;i++) printf("%f ",P[i]);printf("\n");*/
    /* Compute residual that we're going to encode */
@@ -636,7 +636,7 @@
       stereo_mix(st->mode, P, bandE, 1);
 
    /* Apply pitch gains */
-   pitch_quant_bands(st->mode, X, P, gains);
+   pitch_quant_bands(st->mode, P, gains);
 
    /* Decode fixed codebook and merge with pitch */
    unquant_bands(st->mode, X, P, len*8, &dec);
@@ -670,7 +670,7 @@
    }
 
    {
-      int val = 0;
+      unsigned int val = 0;
       while (ec_dec_tell(&dec, 0) < len*8)
       {
          if (ec_dec_uint(&dec, 2) != val)
--- a/libcelt/modes.h
+++ b/libcelt/modes.h
@@ -39,7 +39,7 @@
  @brief Mode definition 
  */
 struct CELTMode {
-   celt_int32_t marker_start;
+   celt_uint32_t marker_start;
    celt_int32_t Fs;
    int          overlap;
    int          mdctSize;
@@ -59,7 +59,7 @@
    const int   *allocVectors;   /**< Number of bits in each band for several rates */
    
    const int * const *bits; /**< Cache for pulses->bits mapping in each band */
-   celt_int32_t marker_end;
+   celt_uint32_t marker_end;
 };
 
 int check_mode(const CELTMode *mode);
--- a/libcelt/rate.c
+++ b/libcelt/rate.c
@@ -172,7 +172,7 @@
       return hi;
 }
 
-int vec_bits2pulses(const CELTMode *m, const int *bands, int *bits, int *pulses, int len)
+int vec_bits2pulses(const CELTMode *m, int *bits, int *pulses, int len)
 {
    int i;
    int sum=0;
@@ -192,7 +192,6 @@
    int j;
    int firstpass;
    VARDECL(int *bits);
-   const int *bands = m->eBands;
    ALLOC(bits, len, int);
    lo = 0;
    hi = 1<<BITRES;
@@ -201,7 +200,7 @@
       int mid = (lo+hi)>>1;
       for (j=0;j<len;j++)
          bits[j] = ((1<<BITRES)-mid)*bits1[j] + mid*bits2[j];
-      if (vec_bits2pulses(m, bands, bits, pulses, len) > total<<BITRES)
+      if (vec_bits2pulses(m, bits, pulses, len) > total<<BITRES)
          hi = mid;
       else
          lo = mid;
@@ -209,7 +208,7 @@
    /*printf ("interp bisection gave %d\n", lo);*/
    for (j=0;j<len;j++)
       bits[j] = ((1<<BITRES)-lo)*bits1[j] + lo*bits2[j];
-   out = vec_bits2pulses(m, bands, bits, pulses, len);
+   out = vec_bits2pulses(m, bits, pulses, len);
    /* Do some refinement to use up all bits. In the first pass, we can only add pulses to 
       bands that are under their allocated budget. In the second pass, anything goes */
    firstpass = 1;
@@ -262,7 +261,7 @@
          /*printf ("%d ", bits[j]);*/
       }
       /*printf ("\n");*/
-      if (vec_bits2pulses(m, m->eBands, bits1, pulses, len) > total<<BITRES)
+      if (vec_bits2pulses(m, bits1, pulses, len) > total<<BITRES)
          hi = mid;
       else
          lo = mid;