]> granicus.if.org Git - libvpx/commitdiff
vp9-svc: Remove unneeded call and init some parameters.
authorMarco Paniconi <marpan@google.com>
Fri, 27 Apr 2018 00:32:22 +0000 (17:32 -0700)
committerJerome Jiang <jianj@google.com>
Fri, 27 Apr 2018 01:03:15 +0000 (18:03 -0700)
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

vp9/encoder/vp9_svc_layercontext.c

index 361c9d7376e8793822883eb147b377cca276cc6b..e4caf9c7026a35d307e5d11f95ca7bd67bf3c505 100644 (file)
@@ -665,10 +665,16 @@ int vp9_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) {
 
   // 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 *
@@ -734,8 +740,6 @@ int vp9_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) {
 
   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;