Removing more unused function params
authorJean-Marc Valin <jean-marc.valin@octasic.com>
Wed, 26 Jan 2011 18:09:53 +0000 (13:09 -0500)
committerJean-Marc Valin <jean-marc.valin@octasic.com>
Wed, 26 Jan 2011 18:09:53 +0000 (13:09 -0500)
libcelt/celt.c
libcelt/kiss_fft.c
libcelt/modes.c
libcelt/pitch.c
libcelt/pitch.h
libcelt/quant_bands.c
libcelt/quant_bands.h

index 52ceba5..98d5fd7 100644 (file)
@@ -399,7 +399,7 @@ static void deemphasis(celt_sig *in[], celt_word16 *pcm, int N, int _C, const ce
 
 #ifdef ENABLE_POSTFILTER
 static void comb_filter(celt_word32 *y, celt_word32 *x, int T0, int T1, int N,
-      int C, celt_word16 g0, celt_word16 g1, int tapset0, int tapset1,
+      celt_word16 g0, celt_word16 g1, int tapset0, int tapset1,
       const celt_word16 *window, int overlap)
 {
    int i;
@@ -937,14 +937,10 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
       {
          VARDECL(celt_word16, pitch_buf);
          ALLOC(pitch_buf, (COMBFILTER_MAXPERIOD+N)>>1, celt_word16);
-         celt_word32 tmp=0;
-         celt_word32 mem0[2]={0,0};
-         celt_word16 mem1[2]={0,0};
 
-         pitch_downsample(pre, pitch_buf, COMBFILTER_MAXPERIOD+N, COMBFILTER_MAXPERIOD+N,
-                          C, mem0, mem1);
+         pitch_downsample(pre, pitch_buf, COMBFILTER_MAXPERIOD+N, C);
          pitch_search(pitch_buf+(COMBFILTER_MAXPERIOD>>1), pitch_buf, N,
-               COMBFILTER_MAXPERIOD-COMBFILTER_MINPERIOD, &pitch_index, &tmp);
+               COMBFILTER_MAXPERIOD-COMBFILTER_MINPERIOD, &pitch_index);
          pitch_index = COMBFILTER_MAXPERIOD-pitch_index;
 
          gain1 = remove_doubling(pitch_buf, COMBFILTER_MAXPERIOD, COMBFILTER_MINPERIOD,
@@ -1017,7 +1013,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
          CELT_COPY(in+c*(N+st->overlap), st->in_mem+c*(st->overlap), st->overlap);
 #ifdef ENABLE_POSTFILTER
          comb_filter(in+c*(N+st->overlap)+st->overlap, pre[c]+COMBFILTER_MAXPERIOD,
-               st->prefilter_period, pitch_index, N, C, -st->prefilter_gain, -gain1,
+               st->prefilter_period, pitch_index, N, -st->prefilter_gain, -gain1,
                st->prefilter_tapset, prefilter_tapset, st->mode->window, st->mode->overlap);
 #endif /* ENABLE_POSTFILTER */
          CELT_COPY(st->in_mem+c*(st->overlap), in+c*(N+st->overlap)+N, st->overlap);
@@ -1369,14 +1365,14 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
          st->prefilter_period_old=IMAX(st->prefilter_period_old, COMBFILTER_MINPERIOD);
          if (LM!=0)
          {
-            comb_filter(out_mem[c], out_mem[c], st->prefilter_period, st->prefilter_period, st->overlap, C,
+            comb_filter(out_mem[c], out_mem[c], st->prefilter_period, st->prefilter_period, st->overlap,
                   st->prefilter_gain, st->prefilter_gain, st->prefilter_tapset, st->prefilter_tapset,
                   NULL, 0);
-            comb_filter(out_mem[c]+st->overlap, out_mem[c]+st->overlap, st->prefilter_period, pitch_index, N-st->overlap, C,
+            comb_filter(out_mem[c]+st->overlap, out_mem[c]+st->overlap, st->prefilter_period, pitch_index, N-st->overlap,
                   st->prefilter_gain, gain1, st->prefilter_tapset, prefilter_tapset,
                   st->mode->window, st->mode->overlap);
          } else {
-            comb_filter(out_mem[c], out_mem[c], st->prefilter_period_old, st->prefilter_period, N, C,
+            comb_filter(out_mem[c], out_mem[c], st->prefilter_period_old, st->prefilter_period, N,
                   st->prefilter_gain_old, st->prefilter_gain, st->prefilter_tapset_old, st->prefilter_tapset,
                   st->mode->window, st->mode->overlap);
          }
@@ -1760,17 +1756,13 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p
    } else if (st->loss_count == 0)
    {
       celt_word16 pitch_buf[MAX_PERIOD>>1];
-      celt_word32 tmp=0;
-      celt_word32 mem0[2]={0,0};
-      celt_word16 mem1[2]={0,0};
       int len2 = len;
       /* FIXME: This is a kludge */
       if (len2>MAX_PERIOD>>1)
          len2 = MAX_PERIOD>>1;
-      pitch_downsample(out_mem, pitch_buf, MAX_PERIOD, MAX_PERIOD,
-                       C, mem0, mem1);
+      pitch_downsample(out_mem, pitch_buf, MAX_PERIOD, C);
       pitch_search(pitch_buf+((MAX_PERIOD-len2)>>1), pitch_buf, len2,
-                   MAX_PERIOD-len2-100, &pitch_index, &tmp);
+                   MAX_PERIOD-len2-100, &pitch_index);
       pitch_index = MAX_PERIOD-len2-pitch_index;
       st->last_pitch_index = pitch_index;
    } else {
@@ -1883,7 +1875,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p
 
 #ifdef ENABLE_POSTFILTER
       /* Apply post-filter to the MDCT overlap of the previous frame */
-      comb_filter(out_mem[c]+MAX_PERIOD, out_mem[c]+MAX_PERIOD, st->postfilter_period, st->postfilter_period, st->overlap, C,
+      comb_filter(out_mem[c]+MAX_PERIOD, out_mem[c]+MAX_PERIOD, st->postfilter_period, st->postfilter_period, st->overlap,
                   st->postfilter_gain, st->postfilter_gain, st->postfilter_tapset, st->postfilter_tapset,
                   NULL, 0);
 #endif /* ENABLE_POSTFILTER */
@@ -1906,7 +1898,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p
 
 #ifdef ENABLE_POSTFILTER
       /* Apply pre-filter to the MDCT overlap for the next frame (post-filter will be applied then) */
-      comb_filter(e, out_mem[c]+MAX_PERIOD, st->postfilter_period, st->postfilter_period, st->overlap, C,
+      comb_filter(e, out_mem[c]+MAX_PERIOD, st->postfilter_period, st->postfilter_period, st->overlap,
                   -st->postfilter_gain, -st->postfilter_gain, st->postfilter_tapset, st->postfilter_tapset,
                   NULL, 0);
 #endif /* ENABLE_POSTFILTER */
@@ -2148,7 +2140,7 @@ int celt_decode_with_ec_float(CELTDecoder * restrict st, const unsigned char *da
       anti_collapse_on = ec_dec_bits(dec, 1);
    }
 
-   unquant_energy_finalise(st->mode, st->start, st->end, bandE, oldBandE,
+   unquant_energy_finalise(st->mode, st->start, st->end, oldBandE,
          fine_quant, fine_priority, len*8-ec_dec_tell(dec, 0), dec, C);
 
    if (anti_collapse_on)
@@ -2194,14 +2186,14 @@ int celt_decode_with_ec_float(CELTDecoder * restrict st, const unsigned char *da
       st->postfilter_period_old=IMAX(st->postfilter_period_old, COMBFILTER_MINPERIOD);
       if (LM!=0)
       {
-         comb_filter(out_syn[c], out_syn[c], st->postfilter_period, st->postfilter_period, st->overlap, C,
+         comb_filter(out_syn[c], out_syn[c], st->postfilter_period, st->postfilter_period, st->overlap,
                st->postfilter_gain, st->postfilter_gain, st->postfilter_tapset, st->postfilter_tapset,
                NULL, 0);
-         comb_filter(out_syn[c]+st->overlap, out_syn[c]+st->overlap, st->postfilter_period, postfilter_pitch, N-st->overlap, C,
+         comb_filter(out_syn[c]+st->overlap, out_syn[c]+st->overlap, st->postfilter_period, postfilter_pitch, N-st->overlap,
                st->postfilter_gain, postfilter_gain, st->postfilter_tapset, postfilter_tapset,
                st->mode->window, st->mode->overlap);
       } else {
-         comb_filter(out_syn[c], out_syn[c], st->postfilter_period_old, st->postfilter_period, N-st->overlap, C,
+         comb_filter(out_syn[c], out_syn[c], st->postfilter_period_old, st->postfilter_period, N-st->overlap,
                st->postfilter_gain_old, st->postfilter_gain, st->postfilter_tapset_old, st->postfilter_tapset,
                st->mode->window, st->mode->overlap);
       }
index 138bb4f..390456d 100644 (file)
@@ -441,7 +441,6 @@ static void kf_work(
         const celt_int16 * factors,
         const kiss_fft_state *st,
         int N,
-        int s2,
         int m2
         )
 {
@@ -449,7 +448,7 @@ static void kf_work(
     const int m=*factors++; /* stage's fft length/p */
     /*printf ("fft %d %d %d %d %d %d %d\n", p*m, m, p, s2, fstride*in_stride, N, m2);*/
     if (m!=1) 
-        kf_work( Fout , f, fstride*p, in_stride, factors,st, N*p, fstride*in_stride, m);
+        kf_work( Fout , f, fstride*p, in_stride, factors,st, N*p, m);
 
     /* Compensate for longer twiddles table (when sharing) */
     if (st->shift>0)
@@ -473,7 +472,6 @@ static void ki_work(
              const celt_int16 * factors,
              const kiss_fft_state *st,
              int N,
-             int s2,
              int m2
             )
 {
@@ -481,7 +479,7 @@ static void ki_work(
    const int m=*factors++; /* stage's fft length/p */
    /*printf ("fft %d %d %d %d %d %d %d\n", p*m, m, p, s2, fstride*in_stride, N, m2);*/
    if (m!=1) 
-      ki_work( Fout , f, fstride*p, in_stride, factors,st, N*p, fstride*in_stride, m);
+      ki_work( Fout , f, fstride*p, in_stride, factors,st, N*p, m);
 
    /* Compensate for longer twiddles table (when sharing) */
    if (st->shift>0)
@@ -668,7 +666,7 @@ static void kiss_fft_stride(const kiss_fft_state *st,const kiss_fft_cpx *fin,kis
        fout[st->bitrev[i]].i *= st->scale;
 #endif
     }
-    kf_work( fout, fin, 1,in_stride, st->factors,st, 1, in_stride, 1);
+    kf_work( fout, fin, 1,in_stride, st->factors,st, 1, 1);
 }
 
 void kiss_fft(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)
@@ -683,7 +681,7 @@ static void kiss_ifft_stride(const kiss_fft_state *st,const kiss_fft_cpx *fin,ki
    /* Bit-reverse the input */
    for (i=0;i<st->nfft;i++)
       fout[st->bitrev[i]] = fin[i];
-   ki_work( fout, fin, 1,in_stride, st->factors,st, 1, in_stride, 1);
+   ki_work( fout, fin, 1,in_stride, st->factors,st, 1, 1);
 }
 
 void kiss_ifft(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)
index a0ed46f..25393b2 100644 (file)
@@ -198,7 +198,7 @@ static celt_int16 *compute_ebands(celt_int32 Fs, int frame_size, int res, int *n
    return eBands;
 }
 
-static void compute_allocation_table(CELTMode *mode, int res)
+static void compute_allocation_table(CELTMode *mode)
 {
    int i, j;
    unsigned char *allocVectors;
@@ -370,7 +370,7 @@ CELTMode *celt_mode_create(celt_int32 Fs, int frame_size, int *error)
    /* Overlap must be divisible by 4 */
    mode->overlap = ((mode->shortMdctSize>>2)<<2);
 
-   compute_allocation_table(mode, res);
+   compute_allocation_table(mode);
    if (mode->allocVectors==NULL)
       goto failure;
    
index c7f84eb..e02de3d 100644 (file)
@@ -98,7 +98,8 @@ static void find_best_pitch(celt_word32 *xcorr, celt_word32 maxcorr, celt_word16
 }
 
 #include "plc.h"
-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_downsample(celt_sig * restrict x[], celt_word16 * restrict x_lp,
+      int len, int _C)
 {
    int i;
    celt_word32 ac[5];
@@ -107,14 +108,12 @@ void pitch_downsample(celt_sig * restrict x[], celt_word16 * restrict x_lp, int
    const int C = CHANNELS(_C);
    for (i=1;i<len>>1;i++)
       x_lp[i] = SHR32(HALF32(HALF32(x[0][(2*i-1)]+x[0][(2*i+1)])+x[0][2*i]), SIG_SHIFT+2);
-   x_lp[0] = SHR32(HALF32(HALF32(*xmem+x[0][1])+x[0][0]), SIG_SHIFT+2);
-   *xmem = x[0][end-1];
+   x_lp[0] = SHR32(HALF32(HALF32(x[0][1])+x[0][0]), SIG_SHIFT+2);
    if (C==2)
    {
       for (i=1;i<len>>1;i++)
          x_lp[i] += SHR32(HALF32(HALF32(x[1][(2*i-1)]+x[1][(2*i+1)])+x[1][2*i]), SIG_SHIFT+2);
       x_lp[0] += SHR32(HALF32(HALF32(x[1][1])+x[1][0]), SIG_SHIFT+2);
-      *xmem += x[1][end-1];
    }
 
    _celt_autocorr(x_lp, ac, NULL, 0,
@@ -152,7 +151,7 @@ void pitch_downsample(celt_sig * restrict x[], celt_word16 * restrict x_lp, int
 }
 
 void pitch_search(const celt_word16 * restrict x_lp, celt_word16 * restrict y,
-                  int len, int max_pitch, int *pitch, celt_sig *xmem)
+                  int len, int max_pitch, int *pitch)
 {
    int i, j;
    int lag;
index c8c4f8b..32876e2 100644 (file)
 
 #include "modes.h"
 
-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_downsample(celt_sig * restrict x[], celt_word16 * restrict x_lp,
+      int len, int _C);
 
 void pitch_search(const celt_word16 * restrict x_lp, celt_word16 * restrict y,
-                  int len, int max_pitch, int *pitch, celt_sig *xmem);
+                  int len, int max_pitch, int *pitch);
 
 celt_word16 remove_doubling(celt_word16 *x, int maxperiod, int minperiod,
       int N, int *T0, int prev_period, celt_word16 prev_gain);
index 0f8235f..4d14f46 100644 (file)
@@ -509,7 +509,7 @@ void unquant_fine_energy(const CELTMode *m, int start, int end, celt_word16 *old
    }
 }
 
-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)
+void unquant_energy_finalise(const CELTMode *m, int start, int end, celt_word16 *oldEBands, int *fine_quant,  int *fine_priority, int bits_left, ec_dec *dec, int _C)
 {
    int i, prio, c;
    const int C = CHANNELS(_C);
index f074501..9ee9a91 100644 (file)
@@ -61,6 +61,6 @@ void unquant_coarse_energy(const CELTMode *m, int start, int end, celt_word16 *o
 
 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);
+void unquant_energy_finalise(const CELTMode *m, int start, int end, celt_word16 *oldEBands, int *fine_quant, int *fine_priority, int bits_left, ec_dec *dec, int _C);
 
 #endif /* QUANT_BANDS */