Commit d37c7881 authored by Alex Converse's avatar Alex Converse Committed by Gerrit Code Review

Merge "Fix unsigned overflow in rd_variance_adjustment."

parents e7fc39fd b1fcd175
......@@ -3017,9 +3017,9 @@ static void rd_variance_adjustment(VP10_COMP *cpi,
? (source_variance - recon_variance)
: (recon_variance - source_variance);
var_error = (200 * source_variance * recon_variance) /
((source_variance * source_variance) +
(recon_variance * recon_variance));
var_error = ((int64_t)200 * source_variance * recon_variance) /
(((int64_t)source_variance * source_variance) +
((int64_t)recon_variance * recon_variance));
var_error = 100 - var_error;
}
......
......@@ -2831,9 +2831,9 @@ static void rd_variance_adjustment(VP9_COMP *cpi,
? (source_variance - recon_variance)
: (recon_variance - source_variance);
var_error = (200 * source_variance * recon_variance) /
((source_variance * source_variance) +
(recon_variance * recon_variance));
var_error = ((int64_t)200 * source_variance * recon_variance) /
(((int64_t)source_variance * source_variance) +
((int64_t)recon_variance * recon_variance));
var_error = 100 - var_error;
}
......
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