Merge "Fix unsigned overflow in rd_variance_adjustment."

This commit is contained in:
Alex Converse 2015-11-20 17:41:58 +00:00 коммит произвёл Gerrit Code Review
Родитель e7fc39fdf5 b1fcd1751e
Коммит d37c78819a
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -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;
}