]> granicus.if.org Git - libvpx/commitdiff
Merge "Allow LF_UPDATE type of frames to use BWDREF" into nextgenv2
authorWei-ting Lin <weitinglin@google.com>
Tue, 23 Aug 2016 18:06:56 +0000 (18:06 +0000)
committerGerrit Code Review <noreply-gerritcodereview@google.com>
Tue, 23 Aug 2016 18:06:56 +0000 (18:06 +0000)
1  2 
vp10/encoder/encoder.c
vp10/encoder/firstpass.c

Simple merge
index c7838fef8edc349eb82d3736e8b8086b21421f5d,2b3c85f783dda90ef6c79c6c9d430f8ef014e70b..7fe38a15a3d88a8b34453df8d2522c05710aa794
@@@ -2576,11 -2575,22 +2576,22 @@@ static void configure_buffer_updates(VP
        break;
  
      case LF_UPDATE:
 -      cpi->refresh_last_frame = 1;
 -      cpi->refresh_golden_frame = 0;
  #if CONFIG_EXT_REFS
-       cpi->refresh_bwd_ref_frame = 0;
+       // If we have extra ALT_REFs, we can use the farthest ALT (ALT0) as
+       // the BWD_REF.
+       if (cpi->num_extra_arfs) {
+         int tmp = cpi->bwd_fb_idx;
+         cpi->rc.is_bwd_ref_frame = 1;
+         cpi->bwd_fb_idx = cpi->alt_fb_idx;
+         cpi->alt_fb_idx = cpi->arf_map[0];;
+         cpi->arf_map[0] = tmp;
+       } else {
+         cpi->rc.is_bwd_ref_frame = 0;
+       }
  #endif  // CONFIG_EXT_REFS
 +      cpi->refresh_last_frame = 1;
 +      cpi->refresh_golden_frame = 0;
        cpi->refresh_alt_ref_frame = 0;
        break;