[FFmpeg-devel] [PATCH 6/9] avcodec/kbdwin: use lrint instead of floor hack

Ganesh Ajjanagadde gajjanagadde at gmail.com
Wed Dec 2 01:27:55 CET 2015


Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 libavcodec/kbdwin.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/kbdwin.c b/libavcodec/kbdwin.c
index bf32aeb..77d5e2b 100644
--- a/libavcodec/kbdwin.c
+++ b/libavcodec/kbdwin.c
@@ -17,6 +17,7 @@
  */
 
 #include "libavutil/avassert.h"
+#include "libavutil/libm.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/attributes.h"
 #include "kbdwin.h"
@@ -53,5 +54,5 @@ av_cold void ff_kbd_window_init_fixed(int32_t *window, float alpha, int n)
 
     ff_kbd_window_init(local_window, alpha, n);
     for (i = 0; i < n; i++)
-        window[i] = (int)floor(2147483647.0 * local_window[i] + 0.5);
+        window[i] = lrint(2147483647.0 * local_window[i]);
 }
-- 
2.6.2



More information about the ffmpeg-devel mailing list