Skip to content
Snippets Groups Projects
Commit 37f56593 authored by Gregory Maxwell's avatar Gregory Maxwell
Browse files

Convert some double constants to float.

parent 9621e711
No related branches found
No related tags found
No related merge requests found
......@@ -559,7 +559,7 @@ kiss_fft_state *opus_fft_alloc_twiddles(int nfft,void * mem,size_t * lenmem, co
st->nfft=nfft;
#ifndef FIXED_POINT
st->scale = 1./nfft;
st->scale = 1.f/nfft;
#endif
if (base != NULL)
{
......
......@@ -453,7 +453,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
pcm[i] = SAT16(pcm[i] + pcm_silk[i]);
#else
for (i=0;i<frame_size*st->channels;i++)
pcm[i] = pcm[i] + (opus_val16)((1./32768.)*pcm_silk[i]);
pcm[i] = pcm[i] + (opus_val16)((1.f/32768.f)*pcm_silk[i]);
#endif
}
......
......@@ -307,11 +307,11 @@ void silk_biquad_float(
opus_val32 inval;
opus_val32 A[2], B[3];
A[0] = (opus_val32)(A_Q28[0] * (1./((opus_int32)1<<28)));
A[1] = (opus_val32)(A_Q28[1] * (1./((opus_int32)1<<28)));
B[0] = (opus_val32)(B_Q28[0] * (1./((opus_int32)1<<28)));
B[1] = (opus_val32)(B_Q28[1] * (1./((opus_int32)1<<28)));
B[2] = (opus_val32)(B_Q28[2] * (1./((opus_int32)1<<28)));
A[0] = (opus_val32)(A_Q28[0] * (1.f/((opus_int32)1<<28)));
A[1] = (opus_val32)(A_Q28[1] * (1.f/((opus_int32)1<<28)));
B[0] = (opus_val32)(B_Q28[0] * (1.f/((opus_int32)1<<28)));
B[1] = (opus_val32)(B_Q28[1] * (1.f/((opus_int32)1<<28)));
B[2] = (opus_val32)(B_Q28[2] * (1.f/((opus_int32)1<<28)));
/* Negate A_Q28 values and split in two parts */
......@@ -1079,8 +1079,8 @@ opus_int32 opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_s
g1 = g1==16384 ? Q15ONE : SHL16(g1,1);
g2 = g2==16384 ? Q15ONE : SHL16(g2,1);
#else
g1 *= (1./16384);
g2 *= (1./16384);
g1 *= (1.f/16384);
g2 *= (1.f/16384);
#endif
stereo_fade(pcm_buf, pcm_buf, g1, g2, celt_mode->overlap,
frame_size, st->channels, celt_mode->window, st->Fs);
......
......@@ -348,7 +348,7 @@ int opus_multistream_encode(
ALLOC(in, frame_size*st->layout.nb_channels, float);
for (i=0;i<frame_size*st->layout.nb_channels;i++)
in[i] = (1./32768)*pcm[i];
in[i] = (1.f/32768.f)*pcm[i];
ret = opus_multistream_encode_float(st, in, frame_size, data, max_data_bytes);
RESTORE_STACK;
return ret;
......@@ -733,7 +733,7 @@ int opus_multistream_decode_float(OpusMSDecoder *st, const unsigned char *data,
if (ret > 0)
{
for (i=0;i<ret*st->layout.nb_channels;i++)
pcm[i] = (1./32768.)*(out[i]);
pcm[i] = (1.f/32768.f)*(out[i]);
}
RESTORE_STACK;
return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment