diff options
author | Gregory Maxwell <greg@xiph.org> | 2012-07-17 17:40:55 -0400 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2012-07-17 17:42:00 -0400 |
commit | 37f56593a20242a08b5315d3b78820f6dc060996 (patch) | |
tree | 8ccc75278b6dc21fde0aedc3530df8baa6329e8b /src | |
parent | 9621e7113d6bfbaee51a91891c307b1e1993168e (diff) | |
download | opus-37f56593a20242a08b5315d3b78820f6dc060996.tar.gz |
Convert some double constants to float.
Diffstat (limited to 'src')
-rw-r--r-- | src/opus_decoder.c | 2 | ||||
-rw-r--r-- | src/opus_encoder.c | 14 | ||||
-rw-r--r-- | src/opus_multistream.c | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/opus_decoder.c b/src/opus_decoder.c index 58f44ac7..966ca872 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -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 } diff --git a/src/opus_encoder.c b/src/opus_encoder.c index a7622f90..25c9c4e4 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -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); diff --git a/src/opus_multistream.c b/src/opus_multistream.c index 5b2519df..e1bd3a8b 100644 --- a/src/opus_multistream.c +++ b/src/opus_multistream.c @@ -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; |