From b8e5b1d786822d4a6bcf381c2445805ef603aa74 Mon Sep 17 00:00:00 2001 From: Ganesh Ajjanagadde Date: Wed, 25 Nov 2015 18:08:45 -0500 Subject: [PATCH] lavc/mdct_template: use lrint instead of floor hack Signed-off-by: Ganesh Ajjanagadde --- libavcodec/mdct_template.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/mdct_template.c b/libavcodec/mdct_template.c index e7e5f622f1..04396b46d6 100644 --- a/libavcodec/mdct_template.c +++ b/libavcodec/mdct_template.c @@ -22,6 +22,7 @@ #include #include #include "libavutil/common.h" +#include "libavutil/libm.h" #include "libavutil/mathematics.h" #include "fft.h" #include "fft-internal.h" @@ -82,8 +83,8 @@ av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale) for(i=0;itcos[i*tstep] = (FFTSample)floor(-cos(alpha) * 2147483648.0 + 0.5); - s->tsin[i*tstep] = (FFTSample)floor(-sin(alpha) * 2147483648.0 + 0.5); + s->tcos[i*tstep] = lrint(-cos(alpha) * 2147483648.0); + s->tsin[i*tstep] = lrint(-sin(alpha) * 2147483648.0); #else s->tcos[i*tstep] = FIX15(-cos(alpha) * scale); s->tsin[i*tstep] = FIX15(-sin(alpha) * scale);