summaryrefslogtreecommitdiff
path: root/libavfilter/f_select.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-16 02:06:37 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-16 03:44:57 +0200
commit5a8ef3c66b762f265b05aa096105555f1d26879c (patch)
treea4b44091be6dd5e3268629cb9d45850c9630913a /libavfilter/f_select.c
parent1457f3fd90e17745791354fbb87899fc4803085a (diff)
avfilter/f_select: fix loss of precission in SAD calculation
Fixes part of Ticket3466 Found-by: Andrey_Karpov / PVS-Studio Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/f_select.c')
-rw-r--r--libavfilter/f_select.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index ec84da8a84..1ffc00652c 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -279,7 +279,7 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *frame)
p2 += 8 * linesize;
}
emms_c();
- mafd = nb_sad ? sad / nb_sad : 0;
+ mafd = nb_sad ? (double)sad / nb_sad : 0;
diff = fabs(mafd - select->prev_mafd);
ret = av_clipf(FFMIN(mafd, diff) / 100., 0, 1);
select->prev_mafd = mafd;