shithub: libvpx

Download patch

ref: ede1efa55f59c6fc3a083052393b9aa19a79f5e1
parent: a47376c52d5a6e6e10157b178f49f2ea553df899
author: Marco Paniconi <marpan@google.com>
date: Thu Apr 26 13:32:22 EDT 2018

vp9-svc: Remove unneeded call and init some parameters.

Remove the unneeded vp9_copy_flags_ref_update_idx(cpi),
and initialize the struct parameters needed for the
GET_SVC_REF_FRAME_CONFIG. This init is useful for the case
for spatial layer frame drops.

Change-Id: If89e8349f6246c33720ecbb758d41a932d21e496

--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -665,10 +665,16 @@
 
   // Reset the drop flags for all spatial layers, on the base layer.
   if (cpi->svc.spatial_layer_id == 0) {
-    int i;
-    for (i = 0; i < cpi->svc.number_spatial_layers; i++) {
-      cpi->svc.drop_spatial_layer[i] = 0;
-    }
+    vp9_zero(cpi->svc.drop_spatial_layer);
+    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);
+    vp9_zero(cpi->svc.reference_last);
+    vp9_zero(cpi->svc.reference_golden);
+    vp9_zero(cpi->svc.reference_altref);
   }
 
   lc = &cpi->svc.layer_context[cpi->svc.spatial_layer_id *
@@ -733,8 +739,6 @@
   }
 
   if (cpi->svc.spatial_layer_id == 0) cpi->svc.high_source_sad_superframe = 0;
-
-  vp9_copy_flags_ref_update_idx(cpi);
 
   if (vp9_set_size_literal(cpi, width, height) != 0)
     return VPX_CODEC_INVALID_PARAM;