]> granicus.if.org Git - libvpx/commitdiff
vp9-svc: Fix on disabling inter_layer prediction.
authorMarco Paniconi <marpan@google.com>
Fri, 18 May 2018 22:09:55 +0000 (15:09 -0700)
committerMarco Paniconi <marpan@google.com>
Sun, 20 May 2018 02:11:42 +0000 (19:11 -0700)
In vp9_svc_constrain_inter_layer_pred() we disable the
inter_layer prediction if anything but only the previous
spatial layer (from same supeframe) is used for inter_layer
prediction. This check and disabling was only allowed when
the control VP9E_SET_SVC_INTER_LAYER_PRED is set to
INTER_LAYER_PRED_ON_CONSTRAINED.

But the control VP9E_SET_SVC_INTER_LAYER_PRED is needed for setting:
INTER_LAYER_PRED_ON/INTER_LAYER_PRED_OFF/INTER_LAYER_PRED_OFF_NONKEY.
So there is a conflict with setting INTER_LAYER_PRED_ON_CONSTRAINED.

Fix for now is to always allow for this disabling check
(disable inter_layer reference if its not previous spatial layer) as
long as inter_layer prediction is used (i.e., not set to _OFF).

A separate fix if needed may be to invoke another control for setting
INTER_LAYER_PRED_ON_CONSTRAINED.

This was causing an issue with enabling spatial layers on the fly
(say spatial layer 2), where since INTER_LAYER_PRED_ON_CONSTRAINED was
not set (default), the inter_layer prediction was then using a reference
from 2 spatial layers below (spatial layer 0).

Change-Id: Ic6434000665f63aab27c509b5eb7b8fc965827bc

vp9/encoder/vp9_svc_layercontext.c

index 00c766b541f0213d871f3de4c95045d00599eb13..6fceb5fd4913de357aa1eeb01c9de1acbc73b941 100644 (file)
@@ -906,12 +906,11 @@ void vp9_svc_constrain_inter_layer_pred(VP9_COMP *const cpi) {
       }
     }
   }
-  // Check for disabling inter-layer prediction if
-  // INTER_LAYER_PRED_ON_CONSTRAINED is enabled.
-  // If the reference for inter-layer prediction (the reference that is scaled)
-  // is not the previous spatial layer from the same superframe, then we
-  // disable inter-layer prediction.
-  if (cpi->svc.disable_inter_layer_pred == INTER_LAYER_PRED_ON_CONSTRAINED) {
+  // Check for disabling inter-layer prediction if the reference for inter-layer
+  // prediction (the reference that is scaled) is not the previous spatial layer
+  // from the same superframe, then we disable inter-layer prediction.
+  // Only need to check when inter_layer prediction is not set to OFF mode.
+  if (cpi->svc.disable_inter_layer_pred != INTER_LAYER_PRED_OFF) {
     // We only use LAST and GOLDEN for prediction in real-time mode, so we
     // check both here.
     MV_REFERENCE_FRAME ref_frame;