ref: 6c5377fd355f7ae76ddea43f0a5732aa4337d31b
parent: 61edec1efbea1c02d71857e2aff9426d9cd2df4e
author: Marco Paniconi <marpan@google.com>
date: Wed Feb 3 05:04:52 EST 2021
Fix to vpx_temporal_svc_encoder Avoid division by zero. Change-Id: Icf3f40aa32fe30f42c46417a1437ebe235e3ac96
--- a/examples/vpx_temporal_svc_encoder.c
+++ b/examples/vpx_temporal_svc_encoder.c
@@ -930,6 +930,7 @@
// Update for short-time encoding bitrate states, for moving window
// of size rc->window, shifted by rc->window / 2.
// Ignore first window segment, due to key frame.
+ if (rc.window_size == 0) rc.window_size = 15;
if (frame_cnt > rc.window_size) {
sum_bitrate += 0.001 * 8.0 * pkt->data.frame.sz * framerate;
if (frame_cnt % rc.window_size == 0) {