From 04d8700862851885ae5c164dac82d3e0c44965ab Mon Sep 17 00:00:00 2001 From: Marco Paniconi Date: Thu, 3 May 2018 19:42:08 -0700 Subject: [PATCH] vp9-svc: Add memset on the svc fb_idx. The memset is added to better handle frame drops with the GET_SVC_REF_FRAME_CONFIG contro There is an issue with some tests in bypass mode, so condition it on that for now. Change-Id: I2635037143f14ff62a36be7c22b2b604a0c1efc2 --- vp9/encoder/vp9_svc_layercontext.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/vp9_svc_layercontext.c b/vp9/encoder/vp9_svc_layercontext.c index 1f4351c16..cfe0c84a3 100644 --- a/vp9/encoder/vp9_svc_layercontext.c +++ b/vp9/encoder/vp9_svc_layercontext.c @@ -668,8 +668,13 @@ int vp9_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) { vp9_zero(cpi->svc.drop_spatial_layer); // TODO(jianj/marpan): Investigate why setting cpi->svc.lst/gld/alt_fb_idx // causes an issue with frame dropping and temporal layers, when the frame - // flags are passed via the encode call. Issue is that we're resetting - // ext_refresh_frame_flags_pending to 0 on frame drops. + // flags are passed via the encode call (bypass mode). Issue is that we're + // resetting ext_refresh_frame_flags_pending to 0 on frame drops. + if (cpi->svc.temporal_layering_mode != VP9E_TEMPORAL_LAYERING_MODE_BYPASS) { + memset(&cpi->svc.lst_fb_idx, -1, sizeof(cpi->svc.lst_fb_idx)); + memset(&cpi->svc.gld_fb_idx, -1, sizeof(cpi->svc.lst_fb_idx)); + memset(&cpi->svc.alt_fb_idx, -1, sizeof(cpi->svc.lst_fb_idx)); + } vp9_zero(cpi->svc.update_last); vp9_zero(cpi->svc.update_golden); vp9_zero(cpi->svc.update_altref); -- 2.40.0