Commit d2495c6f authored by Erik de Castro Lopo's avatar Erik de Castro Lopo Committed by Tristan Matthews

Fix compiler warnings from -Wall

parent d9cd0518
......@@ -531,14 +531,14 @@ spx_int32_t *seed
VARDECL(int *ind);
VARDECL(int *signs);
const signed char *shape_cb;
int shape_cb_size, subvect_size, nb_subvect;
int subvect_size, nb_subvect;
const split_cb_params *params;
int have_sign;
params = (const split_cb_params *) par;
subvect_size = params->subvect_size;
nb_subvect = params->nb_subvect;
shape_cb_size = 1<<params->shape_bits;
shape_cb = params->shape_cb;
have_sign = params->have_sign;
......
......@@ -228,7 +228,7 @@ int lpc_to_lsp (spx_coef_t *a,int lpcrdr,spx_lsp_t *freq,int nb,spx_word16_t del
{
spx_word16_t temp_xr,xl,xr,xm=0;
spx_word32_t psuml,psumr,psumm,temp_psumr/*,temp_qsumr*/;
int i,j,m,flag,k;
int i,j,m,k;
VARDECL(spx_word32_t *Q); /* ptrs for memory allocation */
VARDECL(spx_word32_t *P);
VARDECL(spx_word16_t *Q16); /* ptrs for memory allocation */
......@@ -240,8 +240,6 @@ int lpc_to_lsp (spx_coef_t *a,int lpcrdr,spx_lsp_t *freq,int nb,spx_word16_t del
spx_word16_t *pt; /* ptr used for cheb_poly_eval()
whether P' or Q' */
int roots=0; /* DR 8/2/94: number of roots found */
flag = 1; /* program is searching for a root when,
1 else has found one */
m = lpcrdr/2; /* order of P'(z) & Q'(z) polynomials */
/* Allocate memory space for polynomials */
......@@ -324,7 +322,7 @@ int lpc_to_lsp (spx_coef_t *a,int lpcrdr,spx_lsp_t *freq,int nb,spx_word16_t del
pt = P16;
psuml = cheb_poly_eva(pt,xl,m,stack); /* evals poly. at xl */
flag = 1;
while(xr >= -FREQ_SCALE){
spx_word16_t dd;
/* Modified by JMV to provide smaller steps around x=+-1 */
......@@ -377,7 +375,7 @@ int lpc_to_lsp (spx_coef_t *a,int lpcrdr,spx_lsp_t *freq,int nb,spx_word16_t del
/* once zero is found, reset initial interval to xr */
freq[j] = X2ANGLE(xm);
xl = xm;
break; /* reset flag for next search */
break;
}
else{
psuml=temp_psumr;
......
......@@ -1120,10 +1120,10 @@ void *nb_decoder_init(const SpeexMode *m)
void nb_decoder_destroy(void *state)
{
#if !(defined(VAR_ARRAYS) || defined (USE_ALLOCA))
DecState *st;
st=(DecState*)state;
#if !(defined(VAR_ARRAYS) || defined (USE_ALLOCA))
speex_free_scratch(st->stack);
#endif
......@@ -1552,7 +1552,6 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
{
int offset;
spx_word16_t *exc;
spx_word16_t *sp;
spx_word16_t *innov_save = NULL;
spx_word16_t tmp;
......@@ -1561,7 +1560,6 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
/* Excitation */
exc=st->exc+offset;
/* Original signal */
sp=out+offset;
if (st->innov_save)
innov_save = st->innov_save+offset;
......@@ -1754,13 +1752,11 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
{
int offset;
spx_word16_t *sp;
spx_word16_t *exc;
/* Offset relative to start of frame */
offset = NB_SUBFRAME_SIZE*sub;
/* Original signal */
sp=out+offset;
/* Excitation */
exc=st->exc+offset;
/* LSP interpolation (quantized and unquantized) */
lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, NB_ORDER, sub, NB_NB_SUBFRAMES, LSP_MARGIN);
......
......@@ -18,7 +18,6 @@ int main(int argc, char **argv)
FILE *fin, *fout, *fbits=NULL;
short in_short[FRAME_SIZE];
short out_short[FRAME_SIZE];
float in_float[FRAME_SIZE];
float sigpow,errpow,snr, seg_snr=0;
int snr_frames = 0;
char cbits[200];
......@@ -82,8 +81,6 @@ int main(int argc, char **argv)
fread(in_short, sizeof(short), FRAME_SIZE, fin);
if (feof(fin))
break;
for (i=0;i<FRAME_SIZE;i++)
in_float[i]=in_short[i];
speex_bits_reset(&bits);
speex_encode_int(st, in_short, &bits);
......
......@@ -125,7 +125,6 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p
int i;
float ener=0, ener1=0, ener2=0;
float qual=7;
int va;
float log_energy;
float non_st=0;
float voicing;
......@@ -158,7 +157,7 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p
|| (voicing<0 && non_st < .05))
{
float tmp;
va = 0;
vbr->consec_noise++;
if (pow_ener > 3*vbr->noise_level)
tmp = 3*vbr->noise_level;
......@@ -170,7 +169,6 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p
vbr->noise_accum_count = .95*vbr->noise_accum_count + .05;
}
} else {
va = 1;
vbr->consec_noise=0;
}
......@@ -253,7 +251,7 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p
if (qual<-1)
qual=-1;
/*printf ("%f %f %f %f %d\n", qual, voicing, non_st, pow_ener/(.01+vbr->noise_level), va);*/
/*printf ("%f %f %f %f\n", qual, voicing, non_st, pow_ener/(.01+vbr->noise_level));*/
vbr->last_pitch_coef = pitch_coef;
vbr->last_quality = qual;
......@@ -262,7 +260,7 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p
vbr->last_log_energy[i] = vbr->last_log_energy[i-1];
vbr->last_log_energy[0] = log_energy;
/*printf ("VBR: %f %f %f %d %f\n", (float)(log_energy-log(vbr->average_energy+MIN_ENERGY)), non_st, voicing, va, vbr->noise_level);*/
/*printf ("VBR: %f %f %f %f\n", (float)(log_energy-log(vbr->average_energy+MIN_ENERGY)), non_st, voicing, vbr->noise_level);*/
return qual;
}
......
......@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -77,10 +77,10 @@ void vq_nbest_sign(spx_word16_t *_in, const __m128 *codebook, int len, int entri
int i,j,k,used;
VARDECL(float *dist);
VARDECL(__m128 *in);
__m128 half;
used = 0;
ALLOC(dist, entries, float);
half = _mm_set_ps1(.5f);
ALLOC(in, len, __m128);
for (i=0;i<len;i++)
in[i] = _mm_set_ps1(_in[i]);
......
......@@ -188,12 +188,9 @@ int read_wav_header(FILE *file, int *rate, int *channels, int *format, spx_int32
void write_wav_header(FILE *file, int rate, int channels, int format, int size)
{
char ch[5];
spx_int32_t itmp;
spx_int16_t stmp;
ch[4]=0;
fprintf (file, "RIFF");
itmp = 0x7fffffff;
......
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