shithub: libvpx

Download patch

ref: f0f2ba17d2b6ecef339634d4d8e245e3ab793242
parent: 32f86223ace2cc90c817f5bda197092a75dd4745
author: Paul Wilkins <paulwilkins@google.com>
date: Mon Sep 17 11:41:13 EDT 2018

Remove multi_arf_enabled.

Remove deprecated multi_arf_enabled flag and associated code.

Change-Id: I73f06362a10faa5b3bd91a78eedb201a96434f18

--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -689,7 +689,6 @@
   // Indices are:  max_tx_size-1,  tx_size_ctx,    tx_size
   int tx_size_cost[TX_SIZES - 1][TX_SIZE_CONTEXTS][TX_SIZES];
 
-  int multi_arf_enabled;
   int multi_arf_last_grp_enabled;
 
 #if CONFIG_VP9_TEMPORAL_DENOISING
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2179,7 +2179,6 @@
   int i;
   int frame_index = 0;
   int key_frame;
-  int mid_frame_idx;
   unsigned char arf_buffer_indices[MAX_ACTIVE_ARFS];
   int normal_frames;
 
@@ -2220,17 +2219,6 @@
         arf_buffer_indices[cpi->multi_arf_last_grp_enabled &&
                            rc->source_alt_ref_active];
     ++frame_index;
-
-    if (cpi->multi_arf_enabled) {
-      // Set aside a slot for a level 1 arf.
-      gf_group->update_type[frame_index] = ARF_UPDATE;
-      gf_group->rf_level[frame_index] = GF_ARF_LOW;
-      gf_group->arf_src_offset[frame_index] =
-          (unsigned char)((rc->baseline_gf_interval >> 1) - 1);
-      gf_group->arf_update_idx[frame_index] = arf_buffer_indices[1];
-      gf_group->arf_ref_idx[frame_index] = arf_buffer_indices[0];
-      ++frame_index;
-    }
   }
 
   if (rc->source_alt_ref_pending && cpi->multi_layer_arf) {
@@ -2248,9 +2236,6 @@
     return frame_index;
   }
 
-  // Define middle frame
-  mid_frame_idx = frame_index + (rc->baseline_gf_interval >> 1) - 1;
-
   normal_frames =
       rc->baseline_gf_interval - (key_frame || rc->source_alt_ref_pending);
 
@@ -2258,10 +2243,6 @@
     int arf_idx = 0;
     if (twopass->stats_in >= twopass->stats_in_end) break;
 
-    if (rc->source_alt_ref_pending && cpi->multi_arf_enabled) {
-      if (frame_index <= mid_frame_idx) arf_idx = 1;
-    }
-
     gf_group->arf_update_idx[frame_index] = arf_buffer_indices[arf_idx];
     gf_group->arf_ref_idx[frame_index] = arf_buffer_indices[arf_idx];
 
@@ -2282,10 +2263,6 @@
   if (rc->source_alt_ref_pending) {
     gf_group->update_type[frame_index] = OVERLAY_UPDATE;
     gf_group->rf_level[frame_index] = INTER_NORMAL;
-
-    // Final setup for second arf and its overlay.
-    if (cpi->multi_arf_enabled)
-      gf_group->update_type[mid_frame_idx] = OVERLAY_UPDATE;
   } else {
     gf_group->update_type[frame_index] = GF_UPDATE;
     gf_group->rf_level[frame_index] = GF_ARF_STD;
@@ -2292,7 +2269,7 @@
   }
 
   // Note whether multi-arf was enabled this group for next time.
-  cpi->multi_arf_last_grp_enabled = cpi->multi_arf_enabled;
+  cpi->multi_arf_last_grp_enabled = 0;
 
   return frame_index;
 }
@@ -2310,7 +2287,6 @@
   int key_frame;
   const int max_bits = frame_max_bits(&cpi->rc, oxcf);
   int64_t total_group_bits = gf_group_bits;
-  int mid_boost_bits = 0;
   int mid_frame_idx;
   int normal_frames;
   int normal_frame_bits;
@@ -2344,9 +2320,6 @@
     gf_group->bit_allocation[frame_index] = gf_arf_bits;
 
     ++frame_index;
-
-    // Set aside a slot for a level 1 arf.
-    if (cpi->multi_arf_enabled) ++frame_index;
   }
 
   // Define middle frame
@@ -2436,11 +2409,6 @@
       target_frame_size -= last_frame_reduction;
     }
 
-    if (rc->source_alt_ref_pending && cpi->multi_arf_enabled) {
-      mid_boost_bits += (target_frame_size >> 4);
-      target_frame_size -= (target_frame_size >> 4);
-    }
-
     target_frame_size =
         clamp(target_frame_size, 0, VPXMIN(max_bits, (int)total_group_bits));
 
@@ -2455,15 +2423,6 @@
   // We need to configure the frame at the end of the sequence + 1 that will be
   // the start frame for the next group. Otherwise prior to the call to
   // vp9_rc_get_second_pass_params() the data will be undefined.
-
-  if (rc->source_alt_ref_pending) {
-    // Final setup for second arf and its overlay.
-    if (cpi->multi_arf_enabled) {
-      gf_group->bit_allocation[2] =
-          gf_group->bit_allocation[mid_frame_idx] + mid_boost_bits;
-      gf_group->bit_allocation[mid_frame_idx] = 0;
-    }
-  }
 }
 
 // Adjusts the ARNF filter for a GF group.
@@ -2689,9 +2648,6 @@
     // Calculate the boost for alt ref.
     rc->gfu_boost = calc_arf_boost(cpi, forward_frames, (i - 1));
     rc->source_alt_ref_pending = 1;
-
-    // Test to see if multi arf is appropriate.
-    cpi->multi_arf_enabled = 0;
   } else {
     rc->gfu_boost = VPXMIN(MAX_GF_BOOST, calc_arf_boost(cpi, 0, (i - 1)));
     rc->source_alt_ref_pending = 0;