Commit fba9772d authored by James Zern's avatar James Zern
Browse files

vp8_first_pass(): avoid floating point div by 0

Change-Id: Id1e6a12db6b0c1d3f64ead8fd8834aadc30fbed2
parent 0ef72720
......@@ -858,7 +858,9 @@ skip_motion_search:
*/
if ((cm->current_video_frame > 0) &&
(cpi->twopass.this_frame_stats.pcnt_inter > 0.20) &&
((cpi->twopass.this_frame_stats.intra_error / cpi->twopass.this_frame_stats.coded_error) > 2.0))
((cpi->twopass.this_frame_stats.intra_error /
DOUBLE_DIVIDE_CHECK(cpi->twopass.this_frame_stats.coded_error)) >
2.0))
{
vp8_yv12_copy_frame(lst_yv12, gld_yv12);
}
......
......@@ -749,7 +749,8 @@ void vp9_first_pass(VP9_COMP *cpi) {
((cm->current_video_frame > 0) &&
(cpi->twopass.this_frame_stats->pcnt_inter > 0.20) &&
((cpi->twopass.this_frame_stats->intra_error /
cpi->twopass.this_frame_stats->coded_error) > 2.0))) {
DOUBLE_DIVIDE_CHECK(cpi->twopass.this_frame_stats->coded_error)) >
2.0))) {
vp8_yv12_copy_frame(lst_yv12, gld_yv12);
cpi->twopass.sr_update_lag = 1;
} else
......
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