shithub: libvpx

Download patch

ref: 6b1954ee9a3367a09fa20739858e6e2ab73521e5
parent: e718cade1dc7179daede6b695166702dbf6ab8b4
author: Marco Paniconi <marpan@google.com>
date: Thu Apr 18 05:47:55 EDT 2019

vp9-rtc: Move setting for use_model_rd_large

Move the setting to just before the inter-mode loop,
as for screen content the value may change due
to reset of segment.

No change in behavior except for screen-content.

Change-Id: I256795b581ceda352e57b88eba2e86aa18b0fdc4

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1688,6 +1688,8 @@
   int svc_mv_col = 0;
   int svc_mv_row = 0;
   int no_scaling = 0;
+  int large_block = 0;
+  int use_model_yrd_large = 0;
   unsigned int thresh_svc_skip_golden = 500;
   unsigned int thresh_skip_golden = 500;
   int force_smooth_filter = cpi->sf.force_smooth_interpol;
@@ -1694,18 +1696,6 @@
   int scene_change_detected =
       cpi->rc.high_source_sad ||
       (cpi->use_svc && cpi->svc.high_source_sad_superframe);
-  // For low motion content use x->sb_is_skin in addition to VeryHighSad
-  // for setting large_block.
-  const int large_block =
-      (x->content_state_sb == kVeryHighSad ||
-       (x->sb_is_skin && cpi->rc.avg_frame_low_motion > 70) ||
-       cpi->oxcf.speed < 7)
-          ? bsize > BLOCK_32X32
-          : bsize >= BLOCK_32X32;
-  const int use_model_yrd_large =
-      cpi->oxcf.rc_mode == VPX_CBR && large_block &&
-      !cyclic_refresh_segment_id_boosted(xd->mi[0]->segment_id) &&
-      cm->base_qindex;
 
   init_best_pickmode(&best_pickmode);
 
@@ -1960,6 +1950,18 @@
       (cpi->ref_frame_flags & flag_list[GOLDEN_FRAME]) &&
       cm->base_qindex > svc->lower_layer_qindex + 10)
     force_test_gf_zeromv = 1;
+
+  // For low motion content use x->sb_is_skin in addition to VeryHighSad
+  // for setting large_block.
+  large_block = (x->content_state_sb == kVeryHighSad ||
+                 (x->sb_is_skin && cpi->rc.avg_frame_low_motion > 70) ||
+                 cpi->oxcf.speed < 7)
+                    ? bsize > BLOCK_32X32
+                    : bsize >= BLOCK_32X32;
+  use_model_yrd_large =
+      cpi->oxcf.rc_mode == VPX_CBR && large_block &&
+      !cyclic_refresh_segment_id_boosted(xd->mi[0]->segment_id) &&
+      cm->base_qindex;
 
   for (idx = 0; idx < num_inter_modes + comp_modes; ++idx) {
     int rate_mv = 0;