shithub: opus

Download patch

ref: e83a365b74bd676a761d7d285451b0e2c68a18cf
parent: 157fd8f948e7834b51e2bc23023baeadfe4ac0d1
author: Jean-Marc Valin <[email protected]>
date: Thu Jun 27 10:45:50 EDT 2013

Fixes more MSVC warnings

--- a/src/analysis.c
+++ b/src/analysis.c
@@ -479,7 +479,7 @@
     frame_probs[0] = .5f*(frame_probs[0]+1);
     /* Curve fitting between the MLP probability and the actual probability */
     frame_probs[0] = .01f + 1.21f*frame_probs[0]*frame_probs[0] - .23f*(float)pow(frame_probs[0], 10);
-    frame_probs[1] = .5*frame_probs[1]+.5;
+    frame_probs[1] = .5f*frame_probs[1]+.5f;
     frame_probs[0] = frame_probs[1]*frame_probs[0] + (1-frame_probs[1])*.5f;
 
     /*printf("%f %f ", frame_probs[0], frame_probs[1]);*/
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -573,7 +573,7 @@
       printf("%f\n", metric);*/
    /*return metric>10 ? 1 : 0;*/
    /*return MAX16(0,1-exp(-.25*(metric-2.)));*/
-   return MIN16(1,sqrt(MAX16(0,.05f*(metric-2))));
+   return MIN16(1,(float)sqrt(MAX16(0,.05f*(metric-2))));
 }
 
 /* Viterbi decoding trying to find the best frame size combination using look-ahead
@@ -772,7 +772,7 @@
    e[i+pos] = e[i+pos-1];
    if (buffering)
       N=IMIN(MAX_DYNAMIC_FRAMESIZE, N+2);
-   bestLM = transient_viterbi(e, e_1, N, (1.f+.5f*tonality)*(60*C+40), bitrate/400);
+   bestLM = transient_viterbi(e, e_1, N, (int)((1.f+.5f*tonality)*(60*C+40)), bitrate/400);
    mem[0] = e[1<<bestLM];
    if (buffering)
    {
@@ -1594,7 +1594,7 @@
                 {
                    bonus = (60*st->stream_channels+40)*(st->Fs/frame_size-50);
                    if (analysis_info->valid)
-                      bonus = bonus*(1.f+.5f*analysis_info->tonality);
+                      bonus = (opus_int32)(bonus*(1.f+.5f*analysis_info->tonality));
                 }
 #endif
                 celt_encoder_ctl(celt_enc, OPUS_SET_VBR(1));