Commit 5edd8368 authored by jm's avatar jm
Browse files

Removed some gcc warnings


git-svn-id: http://svn.xiph.org/trunk/speex@4463 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent c152710b
......@@ -120,7 +120,7 @@ void speex_bits_read_from(SpeexBits *bits, char *bytes, int len)
bits->overflow=0;
}
void speex_bits_flush(SpeexBits *bits)
static void speex_bits_flush(SpeexBits *bits)
{
int i;
if (bits->bytePtr>0)
......
......@@ -257,10 +257,10 @@ int complexity
/*update old-new data*/
/* just swap pointers instead of a long copy */
{
float **tmp;
tmp=ot;
float **tmp2;
tmp2=ot;
ot=nt;
nt=tmp;
nt=tmp2;
}
for (j=0;j<N;j++)
for (m=0;m<nb_subvect;m++)
......
......@@ -271,53 +271,6 @@ int *cdbk_index
*cdbk_index=best_cdbk;
}
/* Calculate gains by matrix inversion... (unquantized) */
if (0) {
float tmp;
float B[3][3];
A[0][0]+=1;
A[1][1]+=1;
A[2][2]+=1;
for (i=0;i<3;i++)
for (j=0;j<3;j++)
B[i][j]=A[i][j];
tmp=A[1][0]/A[0][0];
for (i=0;i<3;i++)
A[1][i] -= tmp*A[0][i];
corr[1] -= tmp*corr[0];
tmp=A[2][0]/A[0][0];
for (i=0;i<3;i++)
A[2][i] -= tmp*A[0][i];
corr[2] -= tmp*corr[0];
tmp=A[2][1]/A[1][1];
A[2][2] -= tmp*A[1][2];
corr[2] -= tmp*corr[1];
corr[2] /= A[2][2];
corr[1] = (corr[1] - A[1][2]*corr[2])/A[1][1];
corr[0] = (corr[0] - A[0][2]*corr[2] - A[0][1]*corr[1])/A[0][0];
/*printf ("\n%f %f %f\n", best_corr[0], best_corr[1], best_corr[2]);*/
/* Put gains in right order */
gain[0]=corr[2];gain[1]=corr[1];gain[2]=corr[0];
{
float gain_sum = gain[0]+gain[1]+gain[2];
if (fabs(gain_sum)>2.5)
{
float fact = 2.5/gain_sum;
for (i=0;i<3;i++)
gain[i]*=fact;
}
}
}
for (i=0;i<nsf;i++)
exc[i]=gain[0]*e[2][i]+gain[1]*e[1][i]+gain[2]*e[0][i];
......@@ -512,18 +465,18 @@ float last_pitch_gain)
}
#else
{
int tmp1, tmp2;
int tmp1, tmp3;
tmp1=nsf;
if (tmp1>pp)
tmp1=pp;
for (j=0;j<tmp1;j++)
e[i][j]=exc[j-pp];
tmp2=nsf;
if (tmp2>pp+pitch)
tmp2=pp+pitch;
for (j=tmp1;j<tmp2;j++)
tmp3=nsf;
if (tmp3>pp+pitch)
tmp3=pp+pitch;
for (j=tmp1;j<tmp3;j++)
e[i][j]=exc[j-pp-pitch];
for (j=tmp2;j<nsf;j++)
for (j=tmp3;j<nsf;j++)
e[i][j]=0;
}
#endif
......
......@@ -31,6 +31,7 @@
*/
#include <math.h>
#include "math_approx.h"
float cos_sin[102] = {
1.00000000, 0.00000000,
......
......@@ -40,7 +40,7 @@
#endif
/*Disable some warnings on VC++*/
#if _MSC_VER
#ifdef _MSC_VER
#pragma warning(disable : 4244)
#pragma warning(disable : 4305)
#endif
......
......@@ -1055,8 +1055,6 @@ int nb_decode(void *state, SpeexBits *bits, float *out)
wideband = speex_bits_unpack_unsigned(bits, 1);
if (wideband)
{
int submode;
int advance;
advance = submode = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS);
speex_mode_query(&speex_wb_mode, SPEEX_SUBMODE_BITS_PER_FRAME, &advance);
if (advance < 0)
......@@ -1118,9 +1116,9 @@ int nb_decode(void *state, SpeexBits *bits, float *out)
st->exc[i]=0;*/
{
float innov_gain=0;
float pitch_gain=st->last_pitch_gain;
if (pitch_gain>.6)
pitch_gain=.6;
float pgain=st->last_pitch_gain;
if (pgain>.6)
pgain=.6;
for (i=0;i<st->frameSize;i++)
innov_gain += st->innov[i]*st->innov[i];
innov_gain=sqrt(innov_gain/st->frameSize);
......@@ -1391,9 +1389,9 @@ int nb_decode(void *state, SpeexBits *bits, float *out)
g=1;
for (i=0;i<st->subframeSize;i++)
{
float tmp=exc[i];
float exci=exc[i];
exc[i]=.8*g*exc[i]*ol_gain + .6*g*st->voc_m1*ol_gain + .5*g*innov[i] - .5*g*st->voc_m2 + (1-g)*innov[i];
st->voc_m1 = tmp;
st->voc_m1 = exci;
st->voc_m2=innov[i];
st->voc_mean = .95*st->voc_mean + .05*exc[i];
exc[i]-=st->voc_mean;
......
......@@ -108,6 +108,18 @@ int speex_std_char_handler(SpeexBits *bits, void *state, void *data);
/** Default handler for user-defined requests: in this case, just ignore */
int speex_default_user_handler(SpeexBits *bits, void *state, void *data);
int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data);
int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data);
int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data);
int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data);
#ifdef __cplusplus
}
#endif
......
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