shithub: libvpx

Download patch

ref: 7ef20bf0519ef12d653fb70304970419cf4cdda1
parent: 6f594bb8c81f9c863495f0dbb3a4d7d78ffa8409
parent: a9d70ee2fa73179701bd39166305a7b3478c8327
author: Jerome Jiang <jianj@google.com>
date: Tue Apr 16 21:51:41 EDT 2019

Merge "vp9: refactor condtions for model rd for large blocks."

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1694,6 +1694,18 @@
   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);
 
@@ -2227,14 +2239,6 @@
                         reuse_inter_pred, &this_mode_pred, &var_y, &sse_y,
                         force_smooth_filter);
     } else {
-      // 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;
       mi->interp_filter = (filter_ref == SWITCHABLE) ? EIGHTTAP : filter_ref;
 
       if (cpi->use_svc && ref_frame == GOLDEN_FRAME &&
@@ -2244,9 +2248,8 @@
       vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize);
 
       // For large partition blocks, extra testing is done.
-      if (cpi->oxcf.rc_mode == VPX_CBR && large_block &&
-          !cyclic_refresh_segment_id_boosted(xd->mi[0]->segment_id) &&
-          cm->base_qindex) {
+      if (use_model_yrd_large) {
+        rd_computed = 1;
         model_rd_for_sb_y_large(cpi, bsize, x, xd, &this_rdc.rate,
                                 &this_rdc.dist, &var_y, &sse_y, mi_row, mi_col,
                                 &this_early_term, flag_preduv_computed);