avoids float to int cast, and is slightly superior in terms of rounding ("Dutch/Gauss rounding").
Signed-off-by: Ganesh Ajjanagadde <gajjanaga...@gmail.com> --- libavcodec/dds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/dds.c b/libavcodec/dds.c index d473fd1..9577b67 100644 --- a/libavcodec/dds.c +++ b/libavcodec/dds.c @@ -28,6 +28,7 @@ #include <stdint.h> +#include "libavutil/libm.h" #include "libavutil/imgutils.h" #include "avcodec.h" @@ -508,7 +509,7 @@ static void run_postproc(AVCodecContext *avctx, AVFrame *frame) int d = (255 * 255 - x * x - y * y) / 2; if (d > 0) - z = rint(sqrtf(d)); + z = lrint(sqrtf(d)); src[0] = x; src[1] = y; -- 2.6.4 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel