Commit 5e171490 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Removed some unused parameters and fixed a couple -W warnings

parent 3ca9b1d2
......@@ -158,7 +158,7 @@ void denormalise_bands(const CELTMode *m, celt_norm_t *X, celt_sig_t *freq, celt
/* 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 @@ void compute_pitch_gain(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_
}
/* 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;
......
......@@ -74,9 +74,9 @@ void denormalise_bands(const CELTMode *m, celt_norm_t *X, celt_sig_t *freq, celt
* @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
......
......@@ -343,7 +343,7 @@ int celt_encode(CELTEncoder *st, celt_int16_t *pcm, unsigned char *compressed, i
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 @@ int celt_encode(CELTEncoder *st, celt_int16_t *pcm, unsigned char *compressed, i
}
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 @@ int celt_decode(CELTDecoder *st, unsigned char *data, int len, celt_int16_t *pcm
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 celt_decode(CELTDecoder *st, unsigned char *data, int len, celt_int16_t *pcm
}
{
int val = 0;
unsigned int val = 0;
while (ec_dec_tell(&dec, 0) < len*8)
{
if (ec_dec_uint(&dec, 2) != val)
......
......@@ -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 @@ struct CELTMode {
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);
......
......@@ -172,7 +172,7 @@ int bits2pulses(const CELTMode *m, int band, int bits)
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 interp_bits2pulses(const CELTMode *m, int *bits1, int *bits2, int total, int
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 interp_bits2pulses(const CELTMode *m, int *bits1, int *bits2, int total, int
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 @@ int interp_bits2pulses(const CELTMode *m, int *bits1, int *bits2, int total, int
/*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 @@ int compute_allocation(const CELTMode *m, int *offsets, int total, int *pulses)
/*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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment