summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_svc_layercontext.c
diff options
context:
space:
mode:
authorJerome Jiang <jianj@google.com>2019-04-03 12:36:44 -0700
committerJerome Jiang <jianj@google.com>2019-04-03 15:49:58 -0700
commit7b90a88f5456810f75c627f0d43a574c76de8f76 (patch)
tree190ce0d1cf67f232d627df061d2534929835d175 /vp9/encoder/vp9_svc_layercontext.c
parent39ea3d72f5751ff09f7ac0e7b9dfe61b247ddeae (diff)
downloadlibvpx-7b90a88f5456810f75c627f0d43a574c76de8f76.tar
libvpx-7b90a88f5456810f75c627f0d43a574c76de8f76.tar.gz
libvpx-7b90a88f5456810f75c627f0d43a574c76de8f76.tar.bz2
libvpx-7b90a88f5456810f75c627f0d43a574c76de8f76.zip
vp9 svc: point ref to last when not used in KSVC.
Change-Id: Ia648a2221890dae5357ec8e64a8431fb0f77f2fc
Diffstat (limited to 'vp9/encoder/vp9_svc_layercontext.c')
-rw-r--r--vp9/encoder/vp9_svc_layercontext.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_svc_layercontext.c b/vp9/encoder/vp9_svc_layercontext.c
index 311363c79..8ba113bf3 100644
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -1018,6 +1018,7 @@ void vp9_svc_check_reset_layer_rc_flag(VP9_COMP *const cpi) {
void vp9_svc_constrain_inter_layer_pred(VP9_COMP *const cpi) {
VP9_COMMON *const cm = &cpi->common;
SVC *const svc = &cpi->svc;
+ const int sl = svc->spatial_layer_id;
// Check for disabling inter-layer (spatial) prediction, if
// svc.disable_inter_layer_pred is set. If the previous spatial layer was
// dropped then disable the prediction from this (scaled) reference.
@@ -1027,7 +1028,7 @@ void vp9_svc_constrain_inter_layer_pred(VP9_COMP *const cpi) {
!svc->layer_context[svc->temporal_layer_id].is_key_frame &&
!svc->superframe_has_layer_sync) ||
svc->disable_inter_layer_pred == INTER_LAYER_PRED_OFF ||
- svc->drop_spatial_layer[svc->spatial_layer_id - 1]) {
+ svc->drop_spatial_layer[sl - 1]) {
MV_REFERENCE_FRAME ref_frame;
static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
VP9_ALT_FLAG };
@@ -1036,8 +1037,16 @@ void vp9_svc_constrain_inter_layer_pred(VP9_COMP *const cpi) {
if (yv12 != NULL && (cpi->ref_frame_flags & flag_list[ref_frame])) {
const struct scale_factors *const scale_fac =
&cm->frame_refs[ref_frame - 1].sf;
- if (vp9_is_scaled(scale_fac))
+ if (vp9_is_scaled(scale_fac)) {
cpi->ref_frame_flags &= (~flag_list[ref_frame]);
+ // Point golden/altref frame buffer index to last.
+ if (!svc->simulcast_mode) {
+ if (ref_frame == GOLDEN_FRAME)
+ cpi->gld_fb_idx = cpi->lst_fb_idx;
+ else if (ref_frame == ALTREF_FRAME)
+ cpi->alt_fb_idx = cpi->lst_fb_idx;
+ }
+ }
}
}
}
@@ -1065,7 +1074,6 @@ void vp9_svc_constrain_inter_layer_pred(VP9_COMP *const cpi) {
int fb_idx =
ref_frame == LAST_FRAME ? cpi->lst_fb_idx : cpi->gld_fb_idx;
int ref_flag = ref_frame == LAST_FRAME ? VP9_LAST_FLAG : VP9_GOLD_FLAG;
- int sl = svc->spatial_layer_id;
int disable = 1;
if (fb_idx < 0) continue;
if ((fb_idx == svc->lst_fb_idx[sl - 1] &&