[FFmpeg-cvslog] lavc/snowenc: replace rint by lrint

Ganesh Ajjanagadde git at videolan.org
Sun Dec 27 05:31:13 CET 2015


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Fri Dec 25 15:56:03 2015 -0800| [c5b3c4c7417170fb0a5da1e64e1c5dee761c4ff5] | committer: Ganesh Ajjanagadde

lavc/snowenc: replace rint by lrint

avoids float to int cast.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c5b3c4c7417170fb0a5da1e64e1c5dee761c4ff5
---

 libavcodec/snowenc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 90b6439..26a8383 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -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
 }
 



More information about the ffmpeg-cvslog mailing list