Commit 68f328fc authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/vf_psnr: avoid 64bit arithmetic in the inner loop

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a11c16a0
...@@ -94,8 +94,10 @@ void compute_images_mse(PSNRContext *s, ...@@ -94,8 +94,10 @@ void compute_images_mse(PSNRContext *s,
uint64_t m = 0; uint64_t m = 0;
for (i = 0; i < outh; i++) { for (i = 0; i < outh; i++) {
int m2 = 0;
for (j = 0; j < outw; j++) 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; ref_line += ref_linesize;
main_line += main_linesize; main_line += main_linesize;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment