summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2021-02-03 10:04:52 -0800
committerMarco Paniconi <marpan@google.com>2021-02-03 10:07:27 -0800
commit6c5377fd355f7ae76ddea43f0a5732aa4337d31b (patch)
treeb0ca852e86b79e55268ccfd2904fe87c0baeef12
parent61edec1efbea1c02d71857e2aff9426d9cd2df4e (diff)
downloadlibvpx-6c5377fd355f7ae76ddea43f0a5732aa4337d31b.tar
libvpx-6c5377fd355f7ae76ddea43f0a5732aa4337d31b.tar.gz
libvpx-6c5377fd355f7ae76ddea43f0a5732aa4337d31b.tar.bz2
libvpx-6c5377fd355f7ae76ddea43f0a5732aa4337d31b.zip
Fix to vpx_temporal_svc_encoder
Avoid division by zero. Change-Id: Icf3f40aa32fe30f42c46417a1437ebe235e3ac96
-rw-r--r--examples/vpx_temporal_svc_encoder.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/vpx_temporal_svc_encoder.c b/examples/vpx_temporal_svc_encoder.c
index ffeae2abc..04212e5d7 100644
--- a/examples/vpx_temporal_svc_encoder.c
+++ b/examples/vpx_temporal_svc_encoder.c
@@ -930,6 +930,7 @@ int main(int argc, char **argv) {
// 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) {