vp9-svc: Add memset on the svc fb_idx.
authorMarco Paniconi <marpan@google.com>
Fri, 4 May 2018 02:42:08 +0000 (19:42 -0700)
committerMarco Paniconi <marpan@google.com>
Fri, 4 May 2018 02:44:56 +0000 (19:44 -0700)
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

index 1f4351c..cfe0c84 100644 (file)
@@ -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);