shithub: opus

Download patch

ref: 9a44cde20587d5ba9195a7542725090bae1ba162
parent: 7353203b81e22be1dff48fa0cb61351b2dfb215e
author: Jean-Marc Valin <[email protected]>
date: Tue Jun 2 16:21:53 EDT 2009

Removed support for band-per-band stereo_mode that was never really used

--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -356,15 +356,6 @@
    }
 }
 
-void stereo_decision(const CELTMode *m, celt_norm_t * restrict X, int *stereo_mode, int len)
-{
-   int i;
-   for (i=0;i<len-5;i++)
-      stereo_mode[i] = 0;
-   for (;i<len;i++)
-      stereo_mode[i] = 0;
-}
-
 void interleave(celt_norm_t *x, int N)
 {
    int i;
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -453,7 +453,6 @@
    VARDECL(celt_norm_t, P);
    VARDECL(celt_ener_t, bandE);
    VARDECL(celt_pgain_t, gains);
-   VARDECL(int, stereo_mode);
    VARDECL(int, fine_quant);
    VARDECL(celt_word16_t, error);
    VARDECL(int, pulses);
@@ -773,10 +772,6 @@
    }
 
    ALLOC(offsets, st->mode->nbEBands, int);
-   ALLOC(stereo_mode, st->mode->nbEBands, int);
-#ifndef DISABLE_STEREO
-   stereo_decision(st->mode, X, stereo_mode, st->mode->nbEBands);
-#endif
 
    for (i=0;i<st->mode->nbEBands;i++)
       offsets[i] = 0;
@@ -784,7 +779,7 @@
    if (has_pitch)
       bits -= st->mode->nbPBands;
 #ifndef STDIN_TUNING
-   compute_allocation(st->mode, offsets, stereo_mode, bits, pulses, fine_quant);
+   compute_allocation(st->mode, offsets, bits, pulses, fine_quant);
 #endif
 
    quant_fine_energy(st->mode, bandE, st->oldBandE, error, fine_quant, &enc);
@@ -1145,7 +1140,6 @@
    VARDECL(celt_norm_t, P);
    VARDECL(celt_ener_t, bandE);
    VARDECL(celt_pgain_t, gains);
-   VARDECL(int, stereo_mode);
    VARDECL(int, fine_quant);
    VARDECL(int, pulses);
    VARDECL(int, offsets);
@@ -1225,10 +1219,6 @@
    
    ALLOC(pulses, st->mode->nbEBands, int);
    ALLOC(offsets, st->mode->nbEBands, int);
-   ALLOC(stereo_mode, st->mode->nbEBands, int);
-#ifndef DISABLE_STEREO
-   stereo_decision(st->mode, X, stereo_mode, st->mode->nbEBands);
-#endif
 
    for (i=0;i<st->mode->nbEBands;i++)
       offsets[i] = 0;
@@ -1236,7 +1226,7 @@
    bits = len*8 - ec_dec_tell(&dec, 0) - 1;
    if (has_pitch)
       bits -= st->mode->nbPBands;
-   compute_allocation(st->mode, offsets, stereo_mode, bits, pulses, fine_quant);
+   compute_allocation(st->mode, offsets, bits, pulses, fine_quant);
    /*bits = ec_dec_tell(&dec, 0);
    compute_fine_allocation(st->mode, fine_quant, (20*C+len*8/5-(ec_dec_tell(&dec, 0)-bits))/C);*/
    
--- a/libcelt/rate.c
+++ b/libcelt/rate.c
@@ -136,7 +136,7 @@
    RESTORE_STACK;
 }
 
-void compute_allocation(const CELTMode *m, int *offsets, const int *stereo_mode, int total, int *pulses, int *ebits)
+void compute_allocation(const CELTMode *m, int *offsets, int total, int *pulses, int *ebits)
 {
    int lo, hi, len, j;
    VARDECL(int, bits1);
--- a/libcelt/rate.h
+++ b/libcelt/rate.h
@@ -138,7 +138,7 @@
  @param pulses Number of pulses per band (returned)
  @return Total number of bits allocated
 */
-void compute_allocation(const CELTMode *m, int *offsets, const int *stereo_mode, int total, int *pulses, int *ebits);
+void compute_allocation(const CELTMode *m, int *offsets, int total, int *pulses, int *ebits);
 
 
 #endif