From e447a1a33426f249f67875bbbf31aac08b82d52a Mon Sep 17 00:00:00 2001 From: Marco Paniconi Date: Fri, 18 May 2018 15:09:55 -0700 Subject: [PATCH] vp9-svc: Fix on disabling inter_layer prediction. 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 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/vp9/encoder/vp9_svc_layercontext.c b/vp9/encoder/vp9_svc_layercontext.c index 00c766b54..6fceb5fd4 100644 --- a/vp9/encoder/vp9_svc_layercontext.c +++ b/vp9/encoder/vp9_svc_layercontext.c @@ -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; -- 2.40.0