]> granicus.if.org Git - libvpx/commitdiff
vp9-svc: On key frame update all reference slots for SVC.
authorMarco Paniconi <marpan@google.com>
Thu, 3 May 2018 01:04:35 +0000 (18:04 -0700)
committerMarco Paniconi <marpan@google.com>
Thu, 3 May 2018 21:38:08 +0000 (14:38 -0700)
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

vp9/encoder/vp9_encoder.c

index b95eb6c59a532a1001c9ec1cecf7d52564a1a4f8..9ae5dc03da1785427d79881338da32f7aea824c3 100644 (file)
@@ -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;