Multi-arf: Change ref buffer for primary arf.
authorPaul Wilkins <paulwilkins@google.com>
Thu, 26 Jun 2014 10:26:25 +0000 (11:26 +0100)
committerPaul Wilkins <paulwilkins@google.com>
Fri, 27 Jun 2014 11:12:21 +0000 (12:12 +0100)
For the primary arf in a group, if multiple arfs
are enabled and we were using arfs in the previous
group, then allow the second arf from the previous
group to be used as an additional reference.

Change-Id: Iaf41706a52f54ef21548026851cd77100d6aebda

vp9/encoder/vp9_firstpass.c

index d0dd18213ad5d33b4ebacb1c1dba0cee957ae8c1..971b159313c0a4bff0418167c366375170838136 100644 (file)
@@ -1360,7 +1360,8 @@ static void allocate_gf_group_bits(VP9_COMP *cpi, int64_t gf_group_bits,
     twopass->gf_group.arf_src_offset[frame_index] =
       (unsigned char)(rc->baseline_gf_interval - 1);
     twopass->gf_group.arf_update_idx[frame_index] = arf_buffer_indices[0];
-    twopass->gf_group.arf_ref_idx[frame_index] = arf_buffer_indices[0];
+    twopass->gf_group.arf_ref_idx[frame_index] =
+      arf_buffer_indices[cpi->multi_arf_enabled && rc->source_alt_ref_active];
     ++frame_index;
 
     if (cpi->multi_arf_enabled) {