shithub: opus

Download patch

ref: c39bb8ab8c4ba99bf18b00b957807b60333dcddc
parent: 4610d183056f5589caee043f598676ffdc1b68ea
author: Jean-Marc Valin <[email protected]>
date: Wed Jan 26 05:50:55 EST 2011

Removes unused function parameters

--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -79,9 +79,8 @@
    int constrained_vbr;      /* If zero, VBR can do whatever it likes with the rate */
 
    /* Everything beyond this point gets cleared on a reset */
-#define ENCODER_RESET_START frame_max
+#define ENCODER_RESET_START rng
 
-   celt_word32 frame_max;
    ec_uint32 rng;
    int spread_decision;
    int delayedIntra;
@@ -202,7 +201,7 @@
 }
 
 static int transient_analysis(const celt_word32 * restrict in, int len, int C,
-                              celt_word32 *frame_max, int overlap)
+                              int overlap)
 {
    int i;
    VARDECL(celt_word16, tmp);
@@ -645,7 +644,7 @@
    /*printf("%d %d ", isTransient, tf_select); for(i=0;i<end;i++)printf("%d ", tf_res[i]);printf("\n");*/
 }
 
-static void tf_decode(int start, int end, int C, int isTransient, int *tf_res, int LM, ec_dec *dec)
+static void tf_decode(int start, int end, int isTransient, int *tf_res, int LM, ec_dec *dec)
 {
    int i, curr, tf_select;
    int tf_select_rsv;
@@ -741,7 +740,7 @@
 }
 
 static int stereo_analysis(const CELTMode *m, const celt_norm *X,
-      int nbEBands, int LM, int C, int N0)
+      int LM, int N0)
 {
    int i;
    int thetas;
@@ -943,8 +942,8 @@
 
          pitch_downsample(pre, pitch_buf, COMBFILTER_MAXPERIOD+N, COMBFILTER_MAXPERIOD+N,
                           C, mem0, mem1);
-         pitch_search(st->mode, pitch_buf+(COMBFILTER_MAXPERIOD>>1), pitch_buf, N,
-               COMBFILTER_MAXPERIOD-COMBFILTER_MINPERIOD, &pitch_index, &tmp, 1<<LM);
+         pitch_search(pitch_buf+(COMBFILTER_MAXPERIOD>>1), pitch_buf, N,
+               COMBFILTER_MAXPERIOD-COMBFILTER_MINPERIOD, &pitch_index, &tmp);
          pitch_index = COMBFILTER_MAXPERIOD-pitch_index;
 
          gain1 = remove_doubling(pitch_buf, COMBFILTER_MAXPERIOD, COMBFILTER_MINPERIOD,
@@ -1049,7 +1048,7 @@
       if (st->complexity > 1)
       {
          isTransient = transient_analysis(in, N+st->overlap, C,
-                  &st->frame_max, st->overlap);
+                  st->overlap);
          if (isTransient)
             shortBlocks = M;
       }
@@ -1247,7 +1246,7 @@
 
       /* Always use MS for 2.5 ms frames until we can do a better analysis */
       if (LM!=0)
-         dual_stereo = stereo_analysis(st->mode, X, st->mode->nbEBands, LM, C, N);
+         dual_stereo = stereo_analysis(st->mode, X, LM, N);
 
       /* Account for coarse energy */
       effectiveRate = (8*effectiveBytes - 80)>>LM;
@@ -1285,7 +1284,7 @@
          fine_priority, C, LM, enc, 1, st->lastCodedBands);
    st->lastCodedBands = codedBands;
 
-   quant_fine_energy(st->mode, st->start, st->end, bandE, oldBandE, error, fine_quant, enc, C);
+   quant_fine_energy(st->mode, st->start, st->end, oldBandE, error, fine_quant, enc, C);
 
 #ifdef MEASURE_NORM_MSE
    float X0[3000];
@@ -1309,7 +1308,7 @@
       anti_collapse_on = st->consec_transient<2;
       ec_enc_bits(enc, anti_collapse_on, 1);
    }
-   quant_energy_finalise(st->mode, st->start, st->end, bandE, oldBandE, error, fine_quant, fine_priority, nbCompressedBytes*8-ec_enc_tell(enc, 0), enc, C);
+   quant_energy_finalise(st->mode, st->start, st->end, oldBandE, error, fine_quant, fine_priority, nbCompressedBytes*8-ec_enc_tell(enc, 0), enc, C);
 
 #ifdef RESYNTH
    /* Re-synthesis of the coded audio if required */
@@ -1771,8 +1770,8 @@
          len2 = MAX_PERIOD>>1;
       pitch_downsample(out_mem, pitch_buf, MAX_PERIOD, MAX_PERIOD,
                        C, mem0, mem1);
-      pitch_search(st->mode, pitch_buf+((MAX_PERIOD-len2)>>1), pitch_buf, len2,
-                   MAX_PERIOD-len2-100, &pitch_index, &tmp, 1<<LM);
+      pitch_search(pitch_buf+((MAX_PERIOD-len2)>>1), pitch_buf, len2,
+                   MAX_PERIOD-len2-100, &pitch_index, &tmp);
       pitch_index = MAX_PERIOD-len2-pitch_index;
       st->last_pitch_index = pitch_index;
    } else {
@@ -2079,11 +2078,11 @@
    /* Decode the global flags (first symbols in the stream) */
    intra_ener = tell+3<=total_bits ? ec_dec_bit_logp(dec, 3) : 0;
    /* Get band energies */
-   unquant_coarse_energy(st->mode, st->start, st->end, bandE, oldBandE,
+   unquant_coarse_energy(st->mode, st->start, st->end, oldBandE,
          intra_ener, dec, C, LM);
 
    ALLOC(tf_res, st->mode->nbEBands, int);
-   tf_decode(st->start, st->end, C, isTransient, tf_res, LM, dec);
+   tf_decode(st->start, st->end, isTransient, tf_res, LM, dec);
 
    tell = ec_dec_tell(dec, 0);
    spread_decision = SPREAD_NORMAL;
@@ -2137,7 +2136,7 @@
          alloc_trim, &intensity, &dual_stereo, bits, pulses, fine_quant,
          fine_priority, C, LM, dec, 0, 0);
    
-   unquant_fine_energy(st->mode, st->start, st->end, bandE, oldBandE, fine_quant, dec, C);
+   unquant_fine_energy(st->mode, st->start, st->end, oldBandE, fine_quant, dec, C);
 
    /* Decode fixed codebook */
    ALLOC(collapse_masks, st->mode->nbEBands, unsigned char);
--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -151,8 +151,8 @@
 
 }
 
-void pitch_search(const CELTMode *m, const celt_word16 * restrict x_lp, celt_word16 * restrict y,
-                  int len, int max_pitch, int *pitch, celt_sig *xmem, int M)
+void pitch_search(const celt_word16 * restrict x_lp, celt_word16 * restrict y,
+                  int len, int max_pitch, int *pitch, celt_sig *xmem)
 {
    int i, j;
    int lag;
--- a/libcelt/pitch.h
+++ b/libcelt/pitch.h
@@ -43,8 +43,8 @@
 
 void pitch_downsample(celt_sig * restrict x[], celt_word16 * restrict x_lp, int len, int end, int _C, celt_sig * restrict xmem, celt_word16 * restrict filt_mem);
 
-void pitch_search(const CELTMode *m, const celt_word16 * restrict x_lp, celt_word16 * restrict y,
-                  int len, int max_pitch, int *pitch, celt_sig *xmem, int M);
+void pitch_search(const celt_word16 * restrict x_lp, celt_word16 * restrict y,
+                  int len, int max_pitch, int *pitch, celt_sig *xmem);
 
 celt_word16 remove_doubling(celt_word16 *x, int maxperiod, int minperiod,
       int N, int *T0, int prev_period, celt_word16 prev_gain);
--- a/libcelt/quant_bands.c
+++ b/libcelt/quant_bands.c
@@ -354,7 +354,7 @@
    RESTORE_STACK;
 }
 
-void quant_fine_energy(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, celt_word16 *error, int *fine_quant, ec_enc *enc, int _C)
+void quant_fine_energy(const CELTMode *m, int start, int end, celt_word16 *oldEBands, celt_word16 *error, int *fine_quant, ec_enc *enc, int _C)
 {
    int i, c;
    const int C = CHANNELS(_C);
@@ -392,7 +392,7 @@
    }
 }
 
-void quant_energy_finalise(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, celt_word16 *error, int *fine_quant, int *fine_priority, int bits_left, ec_enc *enc, int _C)
+void quant_energy_finalise(const CELTMode *m, int start, int end, celt_word16 *oldEBands, celt_word16 *error, int *fine_quant, int *fine_priority, int bits_left, ec_enc *enc, int _C)
 {
    int i, prio, c;
    const int C = CHANNELS(_C);
@@ -422,7 +422,7 @@
    }
 }
 
-void unquant_coarse_energy(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, int intra, ec_dec *dec, int _C, int LM)
+void unquant_coarse_energy(const CELTMode *m, int start, int end, celt_word16 *oldEBands, int intra, ec_dec *dec, int _C, int LM)
 {
    const unsigned char *prob_model = e_prob_model[LM][intra];
    int i, c;
@@ -485,7 +485,7 @@
    }
 }
 
-void unquant_fine_energy(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, int *fine_quant, ec_dec *dec, int _C)
+void unquant_fine_energy(const CELTMode *m, int start, int end, celt_word16 *oldEBands, int *fine_quant, ec_dec *dec, int _C)
 {
    int i, c;
    const int C = CHANNELS(_C);
--- a/libcelt/quant_bands.h
+++ b/libcelt/quant_bands.h
@@ -53,13 +53,13 @@
       celt_word16 *error, ec_enc *enc, int _C, int LM,
       int nbAvailableBytes, int force_intra, int *delayedIntra, int two_pass);
 
-void quant_fine_energy(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, celt_word16 *error, int *fine_quant, ec_enc *enc, int _C);
+void quant_fine_energy(const CELTMode *m, int start, int end, celt_word16 *oldEBands, celt_word16 *error, int *fine_quant, ec_enc *enc, int _C);
 
-void quant_energy_finalise(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, celt_word16 *error, int *fine_quant, int *fine_priority, int bits_left, ec_enc *enc, int _C);
+void quant_energy_finalise(const CELTMode *m, int start, int end, celt_word16 *oldEBands, celt_word16 *error, int *fine_quant, int *fine_priority, int bits_left, ec_enc *enc, int _C);
 
-void unquant_coarse_energy(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, int intra, ec_dec *dec, int _C, int LM);
+void unquant_coarse_energy(const CELTMode *m, int start, int end, celt_word16 *oldEBands, int intra, ec_dec *dec, int _C, int LM);
 
-void unquant_fine_energy(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, int *fine_quant, ec_dec *dec, int _C);
+void unquant_fine_energy(const CELTMode *m, int start, int end, celt_word16 *oldEBands, int *fine_quant, ec_dec *dec, int _C);
 
 void unquant_energy_finalise(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, int *fine_quant, int *fine_priority, int bits_left, ec_dec *dec, int _C);
 
--- a/libcelt/rate.c
+++ b/libcelt/rate.c
@@ -151,7 +151,7 @@
 static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int skip_start,
       const int *bits1, const int *bits2, const int *thresh, int total, int skip_rsv,
       int *intensity, int intensity_rsv, int *dual_stereo, int dual_stereo_rsv, int *bits,
-      int *ebits, int *fine_priority, int len, int _C, int LM, void *ec, int encode, int prev)
+      int *ebits, int *fine_priority, int _C, int LM, void *ec, int encode, int prev)
 {
    int psum;
    int lo, hi;
@@ -509,7 +509,7 @@
    }
    codedBands = interp_bits2pulses(m, start, end, skip_start, bits1, bits2, thresh,
          total, skip_rsv, intensity, intensity_rsv, dual_stereo, dual_stereo_rsv,
-         pulses, ebits, fine_priority, len, C, LM, ec, encode, prev);
+         pulses, ebits, fine_priority, C, LM, ec, encode, prev);
    RESTORE_STACK;
    return codedBands;
 }
--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -134,7 +134,7 @@
 /** Takes the pitch vector and the decoded residual vector, computes the gain
     that will give ||p+g*y||=1 and mixes the residual with the pitch. */
 static void normalise_residual(int * restrict iy, celt_norm * restrict X,
-      int N, int K, celt_word32 Ryy, celt_word16 gain)
+      int N, celt_word32 Ryy, celt_word16 gain)
 {
    int i;
 #ifdef FIXED_POINT
@@ -328,7 +328,7 @@
    
    if (resynth)
    {
-      normalise_residual(iy, X, N, K, yy, gain);
+      normalise_residual(iy, X, N, yy, gain);
       exp_rotation(X, N, -1, B, K, spread);
    }
    collapse_mask = extract_collapse_mask(iy, N, B);
@@ -356,7 +356,7 @@
    do {
       Ryy = MAC16_16(Ryy, iy[i], iy[i]);
    } while (++i < N);
-   normalise_residual(iy, X, N, K, Ryy, gain);
+   normalise_residual(iy, X, N, Ryy, gain);
    exp_rotation(X, N, -1, B, K, spread);
    collapse_mask = extract_collapse_mask(iy, N, B);
    RESTORE_STACK;