From 39f41a4f36fae46168312f08f144b5cc22b0c69a Mon Sep 17 00:00:00 2001 From: Jim Bankoski Date: Thu, 14 Oct 2010 16:19:06 -0400 Subject: safety check to avoid divide by 0s --- vp8/encoder/ratectrl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vp8/encoder/ratectrl.c') diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c index 50f4db0b8..dd324f435 100644 --- a/vp8/encoder/ratectrl.c +++ b/vp8/encoder/ratectrl.c @@ -1481,6 +1481,8 @@ void vp8_adjust_key_frame_context(VP8_COMP *cpi) // allocated than those following other gfs. cpi->kf_overspend_bits += (cpi->projected_frame_size - cpi->per_frame_bandwidth) * 7 / 8; cpi->gf_overspend_bits += (cpi->projected_frame_size - cpi->per_frame_bandwidth) * 1 / 8; + if(!av_key_frame_frequency) + av_key_frame_frequency = 60; // Work out how much to try and recover per frame. // For one pass we estimate the number of frames to spread it over based upon past history. -- cgit v1.2.3