commit | 6c21e036e20a373d5833fbad22799dd5d7a04b34 | [log] [tgz] |
---|---|---|
author | Jerome Jiang <jianj@google.com> | Tue Mar 28 11:35:20 2023 -0400 |
committer | Jerome Jiang <jianj@google.com> | Tue Mar 28 11:35:20 2023 -0400 |
tree | 45bea8b8965713e71a687bd034a6b7e49be0794c | |
parent | d2b68d3b586b38831dfff2bb5f8e632bd44076c2 [diff] |
svc: fix a case when target bandwidth = 0 This is similar to the fix in libvpx: https://chromium-review.googlesource.com/c/webm/libvpx/+/4377298 Change-Id: Ie557db4f068a520e3d62b720001ff526d58a79d4
diff --git a/av1/encoder/svc_layercontext.c b/av1/encoder/svc_layercontext.c index 649e996..a66fb3c 100644 --- a/av1/encoder/svc_layercontext.c +++ b/av1/encoder/svc_layercontext.c
@@ -121,7 +121,9 @@ RATE_CONTROL *const lrc = &lc->rc; PRIMARY_RATE_CONTROL *const lp_rc = &lc->p_rc; lc->spatial_layer_target_bandwidth = spatial_layer_target; - bitrate_alloc = (float)lc->target_bandwidth / target_bandwidth; + if (target_bandwidth != 0) { + bitrate_alloc = (float)lc->target_bandwidth / target_bandwidth; + } lp_rc->starting_buffer_level = (int64_t)(p_rc->starting_buffer_level * bitrate_alloc); lp_rc->optimal_buffer_level =