summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2018-11-28 02:58:59 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-11-28 02:58:59 +0000
commit615922dfb53103aa3d1620790b97d2ba3b4c76ad (patch)
tree3911651aa334238fcff6be71bcf06fd5148843ec
parent3861eb6d02fc43d2ed794f6f9e4ad6460404cb7b (diff)
parent2fc5eabcde3c29e7461b50a3c8e542705e18c09f (diff)
downloadlibvpx-615922dfb53103aa3d1620790b97d2ba3b4c76ad.tar.gz
Merge "vp9-svc: Add check/reset for long term reference."
-rw-r--r--vp9/encoder/vp9_svc_layercontext.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/vp9/encoder/vp9_svc_layercontext.c b/vp9/encoder/vp9_svc_layercontext.c
index c4c5b5a9f..0296d03d8 100644
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -1092,13 +1092,16 @@ void vp9_svc_assert_constraints_pattern(VP9_COMP *const cpi) {
}
} else if (svc->use_gf_temporal_ref_current_layer &&
!svc->layer_context[svc->temporal_layer_id].is_key_frame) {
- // If the usage of golden as second long term reference is enabled for this
- // layer, then temporal_layer_id of that reference must be base temporal
- // layer 0, and spatial_layer_id of that reference must be same as current
- // spatial_layer_id.
- assert(svc->fb_idx_spatial_layer_id[cpi->gld_fb_idx] ==
- svc->spatial_layer_id);
- assert(svc->fb_idx_temporal_layer_id[cpi->gld_fb_idx] == 0);
+ // For the usage of golden as second long term reference: the
+ // temporal_layer_id of that reference must be base temporal layer 0, and
+ // spatial_layer_id of that reference must be same as current
+ // spatial_layer_id. If not, disable feature.
+ // TODO(marpan): Investigate when this can happen, and maybe put this check
+ // and reset in a different place.
+ if (svc->fb_idx_spatial_layer_id[cpi->gld_fb_idx] !=
+ svc->spatial_layer_id ||
+ svc->fb_idx_temporal_layer_id[cpi->gld_fb_idx] != 0)
+ svc->use_gf_temporal_ref_current_layer = 0;
}
}