shithub: libvpx

Download patch

ref: 36b998f2eb5ba0870ea36d3929be1f5f5f729d15
parent: 7b3ee0dfa7d2e9060b5d5adcb8ac9b978a4ae07e
author: Marco Paniconi <marpan@google.com>
date: Fri May 11 11:49:34 EDT 2018

vp9-svc: Fix pattern update for skip enhancement layers.

Use the same logic as for dropped frames to be consistent.

Change-Id: I16fd317e70514fe8516d9eb350c275d1813e943e

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -4485,11 +4485,21 @@
       cpi->oxcf.target_bandwidth == 0) {
     cpi->svc.skip_enhancement_layer = 1;
     vp9_rc_postencode_update_drop_frame(cpi);
-    vp9_inc_frame_in_layer(cpi);
     cpi->ext_refresh_frame_flags_pending = 0;
     cpi->last_frame_dropped = 1;
     cpi->svc.last_layer_dropped[cpi->svc.spatial_layer_id] = 1;
     cpi->svc.drop_spatial_layer[cpi->svc.spatial_layer_id] = 1;
+    if (cpi->svc.framedrop_mode != CONSTRAINED_LAYER_DROP ||
+        cpi->svc.drop_spatial_layer[0] == 0) {
+      // For the case of CONSTRAINED_LAYER_DROP where the base is dropped
+      // (drop_spatial_layer[0] == 1), which means full superframe dropped,
+      // we don't increment the svc frame counters. In particular temporal
+      // layer counter (which is incremented in vp9_inc_frame_in_layer())
+      // won't be incremented, so on a dropped frame we try the same
+      // temporal_layer_id on next incoming frame. This is to avoid an
+      // issue with temporal alignement with full superframe dropping.
+      vp9_inc_frame_in_layer(cpi);
+    }
     return;
   }