aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-21 03:02:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-21 03:11:02 +0200
commit68f328fcdd147a56c228abd6794a923f534138fb (patch)
treef7824a2a639995e639c97ea5c9b807431e92b39f
parenta11c16a0b0cadf3a14fa5e7329c2a144a2165bc6 (diff)
downloadffmpeg-68f328fcdd147a56c228abd6794a923f534138fb.tar.gz
avfilter/vf_psnr: avoid 64bit arithmetic in the inner loop
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/vf_psnr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c
index 1bcdd7de5c..bb0dbe0681 100644
--- a/libavfilter/vf_psnr.c
+++ b/libavfilter/vf_psnr.c
@@ -94,8 +94,10 @@ void compute_images_mse(PSNRContext *s,
uint64_t m = 0;
for (i = 0; i < outh; i++) {
+ int m2 = 0;
for (j = 0; j < outw; j++)
- m += pow2(main_line[j] - ref_line[j]);
+ m2 += pow2(main_line[j] - ref_line[j]);
+ m += m2;
ref_line += ref_linesize;
main_line += main_linesize;
}