]> granicus.if.org Git - libvpx/commitdiff
Remove multi_arf_allowed variable.
authorPaul Wilkins <paulwilkins@google.com>
Mon, 17 Sep 2018 14:28:23 +0000 (15:28 +0100)
committerPaul Wilkins <paulwilkins@google.com>
Mon, 17 Sep 2018 14:28:23 +0000 (15:28 +0100)
Removes deprecated multi_arf_allowed variable and dependent code.

Change-Id: Ic1cf341f807c38207e728c48a4c4442387db93ff

vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_bitstream.h
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.h
vp9/encoder/vp9_firstpass.c
vp9/encoder/vp9_temporal_filter.c
vp9/vp9_cx_iface.c

index 21a68bf398cc396313515fbf6b4d71531cfaf27b..b96f59f0c63d658ea1c21b1504858929334f6940 100644 (file)
@@ -910,10 +910,6 @@ int vp9_get_refresh_mask(VP9_COMP *cpi) {
   } else {
     int arf_idx = cpi->alt_fb_idx;
     GF_GROUP *const gf_group = &cpi->twopass.gf_group;
-    if ((cpi->oxcf.pass == 2) && cpi->multi_arf_allowed) {
-      const GF_GROUP *const gf_group = &cpi->twopass.gf_group;
-      arf_idx = gf_group->arf_update_idx[gf_group->index];
-    }
 
     if (cpi->multi_layer_arf) {
       for (arf_idx = 0; arf_idx < REF_FRAMES; ++arf_idx) {
index b296560b922612294b03dd25866c3892b11c9bb4..1948630dfe6e4361b817e4b00c61baf5fdd27f68 100644 (file)
@@ -38,8 +38,8 @@ void vp9_bitstream_encode_tiles_buffer_dealloc(VP9_COMP *const cpi);
 void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, size_t *size);
 
 static INLINE int vp9_preserve_existing_gf(VP9_COMP *cpi) {
-  return !cpi->multi_arf_allowed && cpi->refresh_golden_frame &&
-         cpi->rc.is_src_frame_alt_ref && !cpi->use_svc;
+  return cpi->refresh_golden_frame && cpi->rc.is_src_frame_alt_ref &&
+         !cpi->use_svc;
 }
 
 #ifdef __cplusplus
index 3241652f2b4557b86dbce739b023a1f7a01e758d..aebb62525c3c2dab51a0bee8a3beac41e646c0b8 100644 (file)
@@ -3017,10 +3017,6 @@ void update_ref_frames(VP9_COMP *cpi) {
   } else { /* For non key/golden frames */
     if (cpi->refresh_alt_ref_frame) {
       int arf_idx = gf_group->top_arf_idx;
-      if ((cpi->oxcf.pass == 2) && cpi->multi_arf_allowed) {
-        const GF_GROUP *const gf_group = &cpi->twopass.gf_group;
-        arf_idx = gf_group->arf_update_idx[gf_group->index];
-      }
 
       // Push new ARF into stack.
       stack_push(gf_group->arf_index_stack, cpi->alt_fb_idx,
@@ -6003,7 +5999,6 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
   // will not work properly with svc.
   // Enable the Jingning's new "multi_layer_arf" code if "enable_auto_arf"
   // is greater than or equal to 2.
-  cpi->multi_arf_allowed = 0;
   if ((oxcf->pass == 2) && !cpi->use_svc && (cpi->oxcf.enable_auto_arf >= 2))
     cpi->multi_layer_arf = 1;
   else
@@ -6166,15 +6161,6 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
 
   cm->cur_frame = &pool->frame_bufs[cm->new_fb_idx];
 
-  if (!cpi->use_svc && cpi->multi_arf_allowed) {
-    if (cm->frame_type == KEY_FRAME) {
-      init_buffer_indices(cpi);
-    } else if (oxcf->pass == 2) {
-      const GF_GROUP *const gf_group = &cpi->twopass.gf_group;
-      cpi->alt_fb_idx = gf_group->arf_ref_idx[gf_group->index];
-    }
-  }
-
   // Start with a 0 size frame.
   *size = 0;
 
index b7f0d0bad88277e16b9788838c5f41c5b0e218ca..2c0635933853b71098a339445a3d29687b8b3803 100644 (file)
@@ -689,7 +689,6 @@ typedef struct VP9_COMP {
   // 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_allowed;
   int multi_arf_enabled;
   int multi_arf_last_grp_enabled;
 
index 6b3cb0757add8fc499644af37564230990c9bd78..43df9b70bc6b72765a01607df5140eab7682bcf0 100644 (file)
@@ -2571,29 +2571,25 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
     active_min_gf_interval =
         VPXMIN(active_min_gf_interval, rc->max_gf_interval + arf_active_or_kf);
 
-    if (cpi->multi_arf_allowed) {
-      active_max_gf_interval = rc->max_gf_interval;
+    // The value chosen depends on the active Q range. At low Q we have
+    // bits to spare and are better with a smaller interval and smaller boost.
+    // At high Q when there are few bits to spare we are better with a longer
+    // interval to spread the cost of the GF.
+    active_max_gf_interval = 12 + arf_active_or_kf + VPXMIN(4, (int_lbq / 6));
+
+    // We have: active_min_gf_interval <=
+    // rc->max_gf_interval + arf_active_or_kf.
+    if (active_max_gf_interval < active_min_gf_interval) {
+      active_max_gf_interval = active_min_gf_interval;
     } else {
-      // The value chosen depends on the active Q range. At low Q we have
-      // bits to spare and are better with a smaller interval and smaller boost.
-      // At high Q when there are few bits to spare we are better with a longer
-      // interval to spread the cost of the GF.
-      active_max_gf_interval = 12 + arf_active_or_kf + VPXMIN(4, (int_lbq / 6));
-
-      // We have: active_min_gf_interval <=
-      // rc->max_gf_interval + arf_active_or_kf.
-      if (active_max_gf_interval < active_min_gf_interval) {
-        active_max_gf_interval = active_min_gf_interval;
-      } else {
-        active_max_gf_interval = VPXMIN(active_max_gf_interval,
-                                        rc->max_gf_interval + arf_active_or_kf);
-      }
-
-      // Would the active max drop us out just before the near the next kf?
-      if ((active_max_gf_interval <= rc->frames_to_key) &&
-          (active_max_gf_interval >= (rc->frames_to_key - rc->min_gf_interval)))
-        active_max_gf_interval = rc->frames_to_key / 2;
+      active_max_gf_interval = VPXMIN(active_max_gf_interval,
+                                      rc->max_gf_interval + arf_active_or_kf);
     }
+
+    // Would the active max drop us out just before the near the next kf?
+    if ((active_max_gf_interval <= rc->frames_to_key) &&
+        (active_max_gf_interval >= (rc->frames_to_key - rc->min_gf_interval)))
+      active_max_gf_interval = rc->frames_to_key / 2;
   }
 
   i = 0;
@@ -2695,11 +2691,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
     rc->source_alt_ref_pending = 1;
 
     // Test to see if multi arf is appropriate.
-    cpi->multi_arf_enabled =
-        (cpi->multi_arf_allowed && (rc->baseline_gf_interval >= 6) &&
-         (zero_motion_accumulator < 0.995))
-            ? 1
-            : 0;
+    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;
index 571ec0f31e8577544c18258b35919c3df1ce77a5..54c65bc3378d6e00bb43c87f28dea3e36340aaf9 100644 (file)
@@ -840,8 +840,10 @@ static void adjust_arnr_filter(VP9_COMP *cpi, int distance, int group_boost,
   }
 
   // Adjustments for second level arf in multi arf case.
-  if (cpi->oxcf.pass == 2 && cpi->multi_arf_allowed)
-    if (gf_group->rf_level[gf_group->index] != GF_ARF_STD) strength >>= 1;
+  // Leave commented out place holder for possible filtering adjustment with
+  // new multi-layer arf code.
+  // if (cpi->oxcf.pass == 2 && cpi->multi_arf_allowed)
+  //   if (gf_group->rf_level[gf_group->index] != GF_ARF_STD) strength >>= 1;
 
   // TODO(jingning): Skip temporal filtering for intermediate frames that will
   // be used as show_existing_frame. Need to further explore the possibility to
index 67dbc507535ebee53c291aeb8f3ea11b5463040e..3b2d9a8661728cfb6e935733d32c35a2b85b2f07 100644 (file)
@@ -1099,7 +1099,7 @@ static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx,
       // There's no codec control for multiple alt-refs so check the encoder
       // instance for its status to determine the compressed data size.
       data_sz = ctx->cfg.g_w * ctx->cfg.g_h * get_image_bps(img) / 8 *
-                (cpi->multi_arf_allowed || cpi->multi_layer_arf ? 8 : 2);
+                (cpi->multi_layer_arf ? 8 : 2);
       if (data_sz < kMinCompressedSize) data_sz = kMinCompressedSize;
       if (ctx->cx_data == NULL || ctx->cx_data_sz < data_sz) {
         ctx->cx_data_sz = data_sz;