]> granicus.if.org Git - libvpx/commitdiff
vp9-svc: Fix to first_spatial_to_encode for pattern constraint.
authorMarco Paniconi <marpan@google.com>
Tue, 4 Sep 2018 16:08:49 +0000 (09:08 -0700)
committerMarco Paniconi <marpan@google.com>
Tue, 4 Sep 2018 17:18:37 +0000 (10:18 -0700)
Change-Id: I876f69acf9420b3b013cb3048bbfa8ff059e2e50

vp9/encoder/vp9_svc_layercontext.c

index efe647611fc7316a75b24178efc2c793a565bb51..3713ff3689a71f8e3df72bb628239d012e799c90 100644 (file)
@@ -1047,7 +1047,7 @@ void vp9_svc_constrain_inter_layer_pred(VP9_COMP *const cpi) {
 
 void vp9_svc_assert_constraints_pattern(VP9_COMP *const cpi) {
   SVC *const svc = &cpi->svc;
-  // For fixed/non-flexible mode, the folllowing constraint are expected,
+  // For fixed/non-flexible mode, the following constraint are expected,
   // when inter-layer prediciton is on (default).
   if (svc->temporal_layering_mode != VP9E_TEMPORAL_LAYERING_MODE_BYPASS &&
       svc->disable_inter_layer_pred == INTER_LAYER_PRED_ON &&
@@ -1063,7 +1063,7 @@ void vp9_svc_assert_constraints_pattern(VP9_COMP *const cpi) {
         assert(svc->fb_idx_temporal_layer_id[cpi->lst_fb_idx] <
                svc->temporal_layer_id);
       if (svc->spatial_layer_id > 0 && cpi->ref_frame_flags & VP9_GOLD_FLAG &&
-          svc->first_spatial_layer_to_encode >= svc->spatial_layer_id - 1) {
+          svc->spatial_layer_id > svc->first_spatial_layer_to_encode) {
         // Non-base spatial only predicts from lower spatial layer with same
         // temporal_id.
         assert(svc->fb_idx_spatial_layer_id[cpi->gld_fb_idx] ==
@@ -1071,7 +1071,8 @@ void vp9_svc_assert_constraints_pattern(VP9_COMP *const cpi) {
         assert(svc->fb_idx_temporal_layer_id[cpi->gld_fb_idx] ==
                svc->temporal_layer_id);
       }
-    } else if (svc->spatial_layer_id > 0) {
+    } else if (svc->spatial_layer_id > 0 &&
+               svc->spatial_layer_id > svc->first_spatial_layer_to_encode) {
       // Only 1 reference for frame whose base is key; reference may be LAST
       // or GOLDEN, so we check both.
       if (cpi->ref_frame_flags & VP9_LAST_FLAG) {