diff --git a/celt/pitch.c b/celt/pitch.c index d9bba1b2b4432093b6077fd56713a3c5aa5df5f2..c5b70e590a81d2706840b13e2234547482484b0f 100644 --- a/celt/pitch.c +++ b/celt/pitch.c @@ -77,7 +77,7 @@ static void find_best_pitch(opus_val32 *xcorr, opus_val16 *y, int len, #ifndef FIXED_POINT /* Considering the range of xcorr16, this should avoid both underflows and overflows (inf) when squaring xcorr16 */ - xcorr16 *= 1e-12; + xcorr16 *= 1e-12f; #endif num = MULT16_16_Q15(xcorr16,xcorr16); if (MULT16_32_Q15(num,best_den[1]) > MULT16_32_Q15(best_num[1],Syy)) @@ -373,13 +373,13 @@ opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod, cont = HALF32(prev_gain); else cont = 0; - thresh = MAX16(QCONST16(.3f,15), MULT16_16_Q15(QCONST16(.7,15),g0)-cont); + thresh = MAX16(QCONST16(.3f,15), MULT16_16_Q15(QCONST16(.7f,15),g0)-cont); /* Bias against very high pitch (very short period) to avoid false-positives due to short-term correlation */ if (T1<3*minperiod) - thresh = MAX16(QCONST16(.4f,15), MULT16_16_Q15(QCONST16(.85,15),g0)-cont); + thresh = MAX16(QCONST16(.4f,15), MULT16_16_Q15(QCONST16(.85f,15),g0)-cont); else if (T1<2*minperiod) - thresh = MAX16(QCONST16(.5f,15), MULT16_16_Q15(QCONST16(.9,15),g0)-cont); + thresh = MAX16(QCONST16(.5f,15), MULT16_16_Q15(QCONST16(.9f,15),g0)-cont); if (g1 > thresh) { best_xy = xy; diff --git a/src/opus_encoder.c b/src/opus_encoder.c index 4a8f9a709467c2185bc6ee38c8d4424681987fc8..6c491b59acaa7e49da89bc48cfef4130ff588e12 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -401,7 +401,7 @@ static void dc_reject(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *ou int c, i; float coef; - coef = 4.*cutoff_Hz/Fs; + coef = 4.0f*cutoff_Hz/Fs; for (c=0;c<channels;c++) { for (i=0;i<len;i++) @@ -978,7 +978,7 @@ opus_int32 opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_s for (i=0;i<nb_analysis_frames;i++) tonality_analysis(&st->analysis, &analysis_info, celt_enc, pcm_buf+i*(st->Fs/100)*st->channels, st->channels); if (st->signal_type == OPUS_AUTO) - st->voice_ratio = floor(.5+100*(1-analysis_info.music_prob)); + st->voice_ratio = (int)floor(.5+100*(1-analysis_info.music_prob)); } else { analysis_info.valid = 0; st->voice_ratio = -1;