From: Wei-ting Lin Date: Tue, 23 Aug 2016 18:06:56 +0000 (+0000) Subject: Merge "Allow LF_UPDATE type of frames to use BWDREF" into nextgenv2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7fed5044ca31cd89b09856d013a3b2d4d01a370d;p=libvpx Merge "Allow LF_UPDATE type of frames to use BWDREF" into nextgenv2 --- 7fed5044ca31cd89b09856d013a3b2d4d01a370d diff --cc vp10/encoder/firstpass.c index c7838fef8,2b3c85f78..7fe38a15a --- a/vp10/encoder/firstpass.c +++ b/vp10/encoder/firstpass.c @@@ -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;