shithub: opus

Download patch

ref: e3e2c26dfc2b39ddd8c9cd30f3024fe48ef9fd66
parent: 13a7c26654c58cff2aac554921c5e832e549325d
author: Jean-Marc Valin <[email protected]>
date: Wed Jan 26 08:09:53 EST 2011

Removing more unused function params

--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -399,7 +399,7 @@
 
 #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 @@
       {
          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 @@
          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 @@
          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 @@
    } 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 @@
 
 #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 @@
 
 #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 @@
       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 @@
       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);
       }
--- a/libcelt/kiss_fft.c
+++ b/libcelt/kiss_fft.c
@@ -441,7 +441,6 @@
         const celt_int16 * factors,
         const kiss_fft_state *st,
         int N,
-        int s2,
         int m2
         )
 {
@@ -449,7 +448,7 @@
     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 @@
              const celt_int16 * factors,
              const kiss_fft_state *st,
              int N,
-             int s2,
              int m2
             )
 {
@@ -481,7 +479,7 @@
    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 @@
        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 @@
    /* 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)
--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -198,7 +198,7 @@
    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 @@
    /* 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;
    
--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -98,7 +98,8 @@
 }
 
 #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 @@
    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_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;
--- a/libcelt/pitch.h
+++ b/libcelt/pitch.h
@@ -41,10 +41,11 @@
 
 #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);
--- a/libcelt/quant_bands.c
+++ b/libcelt/quant_bands.c
@@ -509,7 +509,7 @@
    }
 }
 
-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);
--- a/libcelt/quant_bands.h
+++ b/libcelt/quant_bands.h
@@ -61,6 +61,6 @@
 
 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 */