History

Avoid dividing by 0 in vp8 gf_group bits compute

BUG=webm:1653

Debargha Mukherjee committed 6 years ago

Commit 5eeabff1 parent 2ba45e81 file · +2 −1Browse files

Unified · Split

vp8/encoder/firstpass.c+2−1
@@ -2072,9 +2072,10 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) { · 2071 unmodified lines
20722072 * score, otherwise it may be worse off than an "un-boosted" frame
20732073 */
20742074 else {
2075+ // Avoid division by 0 by clamping cpi->twopass.kf_group_error_left to 1
20752076 int alt_gf_bits =
20762077 (int)((double)cpi->twopass.kf_group_bits * mod_frame_err /
2077− DOUBLE_DIVIDE_CHECK((double)cpi->twopass.kf_group_error_left));
2078+ (double)VPXMAX(cpi->twopass.kf_group_error_left, 1));
20782079
20792080 if (alt_gf_bits > gf_bits) {
20802081 gf_bits = alt_gf_bits;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t