From d2495c6f4cf53b0be77ce814e58826a2b27f8a88 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Mon, 20 Jul 2015 20:30:14 +1000 Subject: Fix compiler warnings from -Wall --- libspeex/cb_search.c | 4 ++-- libspeex/lsp.c | 8 +++----- libspeex/nb_celp.c | 8 ++------ libspeex/testenc_uwb.c | 3 --- libspeex/vbr.c | 8 +++----- libspeex/vq_sse.h | 12 ++++++------ src/wav_io.c | 3 --- 7 files changed, 16 insertions(+), 30 deletions(-) diff --git a/libspeex/cb_search.c b/libspeex/cb_search.c index 7f5649e..a170fd6 100644 --- a/libspeex/cb_search.c +++ b/libspeex/cb_search.c @@ -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<shape_bits; + shape_cb = params->shape_cb; have_sign = params->have_sign; diff --git a/libspeex/lsp.c b/libspeex/lsp.c index 77254d4..c862eae 100644 --- a/libspeex/lsp.c +++ b/libspeex/lsp.c @@ -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; diff --git a/libspeex/nb_celp.c b/libspeex/nb_celp.c index 3956cb6..b68d507 100644 --- a/libspeex/nb_celp.c +++ b/libspeex/nb_celp.c @@ -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); diff --git a/libspeex/testenc_uwb.c b/libspeex/testenc_uwb.c index 16da3cc..9c144fd 100644 --- a/libspeex/testenc_uwb.c +++ b/libspeex/testenc_uwb.c @@ -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;iconsec_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; } diff --git a/libspeex/vq_sse.h b/libspeex/vq_sse.h index 00a42ce..2abe880 100644 --- a/libspeex/vq_sse.h +++ b/libspeex/vq_sse.h @@ -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