lavc/snowenc: replace rint by lrint
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>
Fri, 25 Dec 2015 23:56:03 +0000 (15:56 -0800)
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>
Sun, 27 Dec 2015 04:29:22 +0000 (20:29 -0800)
avoids float to int cast.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
libavcodec/snowenc.c

index 90b6439..26a8383 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include "libavutil/intmath.h"
+#include "libavutil/libm.h"
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
@@ -1470,7 +1471,7 @@ static void update_last_header_values(SnowContext *s){
 }
 
 static int qscale2qlog(int qscale){
-    return rint(QROOT*log2(qscale / (float)FF_QP2LAMBDA))
+    return lrint(QROOT*log2(qscale / (float)FF_QP2LAMBDA))
            + 61*QROOT/8; ///< 64 > 60
 }