From: Marco Paniconi Date: Thu, 3 May 2018 01:04:35 +0000 (-0700) Subject: vp9-svc: On key frame update all reference slots for SVC. X-Git-Tag: v1.8.0~714 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d93f58b1ffddaf4d436dd45b0fd2034199d62a7;p=libvpx vp9-svc: On key frame update all reference slots for SVC. Key frame updates the slots corresponding to the 3 references last/golden/altref, but for SVC where more references buffers may be in use, especialy for dynamically swithing up/down in layers, make sure we should update all 8 slots on key frame. Change-Id: Ifcca12608f420d5bae32b92794a3afe9b6369f77 --- diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index b95eb6c59..9ae5dc03d 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -3023,9 +3023,17 @@ void vp9_update_reference_frames(VP9_COMP *cpi) { // Keep track of frame index for each reference frame. SVC *const svc = &cpi->svc; if (cm->frame_type == KEY_FRAME) { + int i; svc->ref_frame_index[cpi->lst_fb_idx] = svc->current_superframe; svc->ref_frame_index[cpi->gld_fb_idx] = svc->current_superframe; svc->ref_frame_index[cpi->alt_fb_idx] = svc->current_superframe; + // On key frame update all reference frame slots. + for (i = 0; i < REF_FRAMES; i++) { + // LAST/GOLDEN/ALTREF is already updated above. + if (i != cpi->lst_fb_idx && i != cpi->gld_fb_idx && + i != cpi->alt_fb_idx) + ref_cnt_fb(pool->frame_bufs, &cm->ref_frame_map[i], cm->new_fb_idx); + } } else { if (cpi->refresh_last_frame) svc->ref_frame_index[cpi->lst_fb_idx] = svc->current_superframe;