rtc: Enable noise estimation for high resols

Enable noise estimation for resoln about VGA.

Adjust the threshold increase logic for var_based_partition
based on noise estimation, and remove some split logic
based on noise level. Also remove the duplicate
avg_frame_low_motion computation, and modify the content
state to include low_sumdiff flag, used to increase the
partition thresholds at superblock level.

The increased partition threshold applies only to noisy
content and is targeted to avoid superblocks with motion.
This helps visually to improve background stability for
high noise clips.

bdrate only affects a few of the noisy 720p clip in rtc_set,
and change is neutral, except for dark720 clip which has
bdrate gain ~4% at speed 8.

Change-Id: I42b2e3f71aca5f008034656af6a2fb1d64fd06c6
diff --git a/av1/encoder/aq_cyclicrefresh.c b/av1/encoder/aq_cyclicrefresh.c
index 85fba04..30aeaa1 100644
--- a/av1/encoder/aq_cyclicrefresh.c
+++ b/av1/encoder/aq_cyclicrefresh.c
@@ -37,7 +37,6 @@
   }
   assert(MAXQ <= 255);
   memset(cr->last_coded_q_map, MAXQ, last_coded_q_map_size);
-  cr->avg_frame_low_motion = 0.0;
   return cr;
 }
 
@@ -202,8 +201,10 @@
   AV1_COMMON *const cm = &cpi->common;
   const CommonModeInfoParams *const mi_params = &cm->mi_params;
   CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
+  RATE_CONTROL *const rc = &cpi->rc;
+  SVC *const svc = &cpi->svc;
   unsigned char *const seg_map = cpi->enc_seg.map;
-  cr->cnt_zeromv = 0;
+  int cnt_zeromv = 0;
   cr->actual_num_seg1_blocks = 0;
   cr->actual_num_seg2_blocks = 0;
   // 8X8 blocks are smallest partition used on delta frames.
@@ -223,17 +224,33 @@
           cr->actual_num_seg2_blocks += sh << 1;
       }
       // Accumulate low_content_frame.
-      if (is_inter_block(mi[0]) && abs(mv.row) < 16 && abs(mv.col) < 16)
-        cr->cnt_zeromv += sh << 1;
+      if (is_inter_block(mi[0]) && mi[0]->ref_frame[0] == LAST_FRAME &&
+          abs(mv.row) < 16 && abs(mv.col) < 16)
+        cnt_zeromv += sh << 1;
       if (mi_col + sh < mi_params->mi_cols) {
         mi += sh;
       }
     }
   }
-  cr->cnt_zeromv =
-      100 * cr->cnt_zeromv / (mi_params->mi_rows * mi_params->mi_cols);
-  cr->avg_frame_low_motion =
-      (3 * cr->avg_frame_low_motion + (double)cr->cnt_zeromv) / 4;
+  cnt_zeromv = 100 * cnt_zeromv / (mi_params->mi_rows * mi_params->mi_cols);
+  if (!cpi->use_svc ||
+      (cpi->use_svc &&
+       !cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame &&
+       cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1)) {
+    rc->avg_frame_low_motion = (3 * rc->avg_frame_low_motion + cnt_zeromv) / 4;
+    // For SVC: set avg_frame_low_motion (only computed on top spatial layer)
+    // to all lower spatial layers.
+    if (cpi->use_svc &&
+        svc->spatial_layer_id == svc->number_spatial_layers - 1) {
+      for (int i = 0; i < svc->number_spatial_layers - 1; ++i) {
+        const int layer = LAYER_IDS_TO_IDX(i, svc->temporal_layer_id,
+                                           svc->number_temporal_layers);
+        LAYER_CONTEXT *const lc = &svc->layer_context[layer];
+        RATE_CONTROL *const lrc = &lc->rc;
+        lrc->avg_frame_low_motion = rc->avg_frame_low_motion;
+      }
+    }
+  }
 }
 
 void av1_cyclic_refresh_set_golden_update(AV1_COMP *const cpi) {
@@ -246,7 +263,7 @@
     rc->baseline_gf_interval = AOMMIN(2 * (100 / cr->percent_refresh), 40);
   else
     rc->baseline_gf_interval = 20;
-  if (cr->avg_frame_low_motion < 40) rc->baseline_gf_interval = 8;
+  if (rc->avg_frame_low_motion < 40) rc->baseline_gf_interval = 8;
 }
 
 // Update the segmentation map, and related quantities: cyclic refresh map,
@@ -347,7 +364,7 @@
       rc->avg_frame_qindex[INTER_FRAME] < qp_thresh ||
       (rc->frames_since_key > 20 &&
        rc->avg_frame_qindex[INTER_FRAME] > qp_max_thresh) ||
-      (cr->avg_frame_low_motion < 45 && rc->frames_since_key > 40)) {
+      (rc->avg_frame_low_motion < 45 && rc->frames_since_key > 40)) {
     cr->apply_cyclic_refresh = 0;
     return;
   }
@@ -413,7 +430,6 @@
       cm->prev_frame && (cm->width != cm->prev_frame->width ||
                          cm->height != cm->prev_frame->height);
   if (resolution_change) av1_cyclic_refresh_reset_resize(cpi);
-  if (cm->current_frame.frame_number == 0) cr->low_content_avg = 0.0;
   if (!cr->apply_cyclic_refresh) {
     // Set segmentation map to 0 and disable.
     unsigned char *const seg_map = cpi->enc_seg.map;
diff --git a/av1/encoder/aq_cyclicrefresh.h b/av1/encoder/aq_cyclicrefresh.h
index 82f2b25..23d1f16 100644
--- a/av1/encoder/aq_cyclicrefresh.h
+++ b/av1/encoder/aq_cyclicrefresh.h
@@ -102,12 +102,9 @@
   int rate_boost_fac;
 
   /*!\cond */
-  double low_content_avg;
   int qindex_delta[3];
   double weight_segment;
   int apply_cyclic_refresh;
-  int cnt_zeromv;
-  double avg_frame_low_motion;
   /*!\endcond */
 };
 
diff --git a/av1/encoder/av1_noise_estimate.c b/av1/encoder/av1_noise_estimate.c
index 1da03d7..0e6ee15 100644
--- a/av1/encoder/av1_noise_estimate.c
+++ b/av1/encoder/av1_noise_estimate.c
@@ -120,7 +120,7 @@
   const int low_res = (cm->width <= 352 && cm->height <= 288);
   // Estimate of noise level every frame_period frames.
   int frame_period = 8;
-  int thresh_consec_zeromv = 6;
+  int thresh_consec_zeromv = 2;
   int frame_counter = cm->current_frame.frame_number;
   // Estimate is between current source and last source.
   YV12_BUFFER_CONFIG *last_source = cpi->last_source;
@@ -278,7 +278,6 @@
         max_bin = bin_cnt;
       }
     }
-
     // Scale by 40 to work with existing thresholds
     ne->value = (int)((3 * ne->value + max_bin * 40) >> 2);
     // Quickly increase VNR strength when the noise level increases suddenly.
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index 4e98c71..7b8f5dc 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -797,6 +797,21 @@
   int pts_inref[16];
 } WARP_SAMPLE_INFO;
 
+/*!\cond */
+typedef enum {
+  kInvalid = 0,
+  kLowSad = 1,
+  kMedSad = 2,
+  kHighSad = 3
+} SOURCE_SAD;
+
+typedef struct {
+  SOURCE_SAD source_sad;
+  int lighting_change;
+  int low_sumdiff;
+} CONTENT_STATE_SB;
+/*!\endcond */
+
 /*! \brief Encoder's parameters related to the current coding block.
  *
  * This struct contains most of the information the encoder needs to encode the
@@ -952,7 +967,7 @@
    *  Characteristics like whether the block has high sad, low sad, etc. This is
    *  only used by av1 realtime mode.
    */
-  uint8_t content_state_sb;
+  CONTENT_STATE_SB content_state_sb;
   /**@}*/
 
   /*****************************************************************************
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index f8b113b..8707594 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -821,7 +821,9 @@
     // Reset color coding related parameters
     x->color_sensitivity[0] = 0;
     x->color_sensitivity[1] = 0;
-    x->content_state_sb = 0;
+    x->content_state_sb.source_sad = kMedSad;
+    x->content_state_sb.lighting_change = 0;
+    x->content_state_sb.low_sumdiff = 0;
 
     xd->cur_frame_force_integer_mv = cm->features.cur_frame_force_integer_mv;
     x->source_variance = UINT_MAX;
diff --git a/av1/encoder/encodeframe_utils.c b/av1/encoder/encodeframe_utils.c
index 1ac5f0e..612f06d 100644
--- a/av1/encoder/encodeframe_utils.c
+++ b/av1/encoder/encodeframe_utils.c
@@ -1174,16 +1174,16 @@
   last_src_y += offset;
   tmp_variance = cpi->fn_ptr[bsize].vf(src_y, src_ystride, last_src_y,
                                        last_src_ystride, &tmp_sse);
-
-  x->content_state_sb = kMedSad;
-  // Note: tmp_sse - tmp_variance = ((sum * sum) >> 12)
-  // Detect large lighting change;
-  if (tmp_variance < (tmp_sse >> 1) && (tmp_sse - tmp_variance) > sum_sq_thresh)
-    x->content_state_sb = kLowVarHighSumdiff;
-  else if (tmp_sse < avg_source_sse_threshold)
-    x->content_state_sb = kLowSad;
+  if (tmp_sse < avg_source_sse_threshold)
+    x->content_state_sb.source_sad = kLowSad;
   else if (tmp_sse > avg_source_sse_threshold_high)
-    x->content_state_sb = kHighSad;
+    x->content_state_sb.source_sad = kHighSad;
+  // Detect large lighting change.
+  // Note: tmp_sse - tmp_variance = ((sum * sum) >> 12)
+  if (tmp_variance < (tmp_sse >> 1) && (tmp_sse - tmp_variance) > sum_sq_thresh)
+    x->content_state_sb.lighting_change = 1;
+  if ((tmp_sse - tmp_variance) < (sum_sq_thresh >> 1))
+    x->content_state_sb.low_sumdiff = 1;
 }
 
 // Memset the mbmis at the current superblock to 0
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 07f3072..7b3b6ae 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -3173,15 +3173,6 @@
 
   av1_rc_postencode_update(cpi, *size);
 
-  if (oxcf->pass == 0 && !frame_is_intra_only(cm) &&
-      cpi->sf.rt_sf.use_temporal_noise_estimate &&
-      (!cpi->use_svc ||
-       (cpi->use_svc &&
-        !cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame &&
-        cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1))) {
-    av1_compute_frame_low_motion(cpi);
-  }
-
   // Clear the one shot update flags for segmentation map and mode/ref loop
   // filter deltas.
   cm->seg.update_map = 0;
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 51f8ee4..d9dbc30 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -132,14 +132,6 @@
   RESIZE_MODES
 } UENUM1BYTE(RESIZE_MODE);
 
-typedef enum {
-  kInvalid = 0,
-  kLowSad = 1,
-  kMedSad = 2,
-  kHighSad = 3,
-  kLowVarHighSumdiff = 4,
-} CONTENT_STATE_SB;
-
 enum {
   SS_CFG_SRC = 0,
   SS_CFG_LOOKAHEAD = 1,
diff --git a/av1/encoder/nonrd_pickmode.c b/av1/encoder/nonrd_pickmode.c
index 92d8a67..b9d5cd9 100644
--- a/av1/encoder/nonrd_pickmode.c
+++ b/av1/encoder/nonrd_pickmode.c
@@ -1063,7 +1063,7 @@
 static void newmv_diff_bias(MACROBLOCKD *xd, PREDICTION_MODE this_mode,
                             RD_STATS *this_rdc, BLOCK_SIZE bsize, int mv_row,
                             int mv_col, int speed, uint32_t spatial_variance,
-                            int content_state_sb) {
+                            CONTENT_STATE_SB content_state_sb) {
   // Bias against MVs associated with NEWMV mode that are very different from
   // top/left neighbors.
   if (this_mode == NEWMV) {
@@ -1075,7 +1075,7 @@
     int left_mv_valid = 0;
     int above_row = 0;
     int above_col = 0;
-    if (bsize >= BLOCK_64X64 && content_state_sb != kHighSad &&
+    if (bsize >= BLOCK_64X64 && content_state_sb.source_sad != kHighSad &&
         spatial_variance < 300 &&
         (mv_row > 16 || mv_row < -16 || mv_col > 16 || mv_col < -16)) {
       this_rdc->rdcost = this_rdc->rdcost << 2;
@@ -1746,7 +1746,7 @@
     // even if best_early_term is set.
     if (bsize >= BLOCK_32X32) best_early_term = 0;
   } else if (cpi->sf.rt_sf.source_metrics_sb_nonrd &&
-             x->content_state_sb == kLowSad) {
+             x->content_state_sb.source_sad == kLowSad) {
     perform_intra_pred = 0;
   }
 
@@ -1895,11 +1895,9 @@
   return skip_this_mode;
 }
 
-static AOM_INLINE int skip_mode_by_low_temp(PREDICTION_MODE mode,
-                                            MV_REFERENCE_FRAME ref_frame,
-                                            BLOCK_SIZE bsize,
-                                            int content_state_sb, int_mv mv,
-                                            int force_skip_low_temp_var) {
+static AOM_INLINE int skip_mode_by_low_temp(
+    PREDICTION_MODE mode, MV_REFERENCE_FRAME ref_frame, BLOCK_SIZE bsize,
+    CONTENT_STATE_SB content_state_sb, int_mv mv, int force_skip_low_temp_var) {
   // Skip non-zeromv mode search for non-LAST frame if force_skip_low_temp_var
   // is set. If nearestmv for golden frame is 0, zeromv mode will be skipped
   // later.
@@ -1907,7 +1905,7 @@
     return 1;
   }
 
-  if (content_state_sb != kHighSad && bsize >= BLOCK_64X64 &&
+  if (content_state_sb.source_sad != kHighSad && bsize >= BLOCK_64X64 &&
       force_skip_low_temp_var && mode == NEWMV) {
     return 1;
   }
@@ -2056,8 +2054,8 @@
     else
       use_modeled_non_rd_cost =
           (quant_params->base_qindex > 120 && x->source_variance > 100 &&
-           bsize <= BLOCK_16X16 && x->content_state_sb != kLowVarHighSumdiff &&
-           x->content_state_sb != kHighSad);
+           bsize <= BLOCK_16X16 && !x->content_state_sb.lighting_change &&
+           x->content_state_sb.source_sad != kHighSad);
   }
 
 #if COLLECT_PICK_MODE_STAT
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c
index 0c90794..aaa9dfd 100644
--- a/av1/encoder/ratectrl.c
+++ b/av1/encoder/ratectrl.c
@@ -2696,36 +2696,3 @@
     return 0;
   }
 }
-
-void av1_compute_frame_low_motion(AV1_COMP *const cpi) {
-  AV1_COMMON *const cm = &cpi->common;
-  const CommonModeInfoParams *const mi_params = &cm->mi_params;
-  SVC *const svc = &cpi->svc;
-  MB_MODE_INFO **mi = mi_params->mi_grid_base;
-  RATE_CONTROL *const rc = &cpi->rc;
-  const int rows = mi_params->mi_rows, cols = mi_params->mi_cols;
-  int cnt_zeromv = 0;
-  for (int mi_row = 0; mi_row < rows; mi_row++) {
-    for (int mi_col = 0; mi_col < cols; mi_col++) {
-      if (mi[0]->ref_frame[0] == LAST_FRAME &&
-          abs(mi[0]->mv[0].as_mv.row) < 16 && abs(mi[0]->mv[0].as_mv.col) < 16)
-        cnt_zeromv++;
-      mi++;
-    }
-    mi += mi_params->mi_stride - cols;
-  }
-  cnt_zeromv = 100 * cnt_zeromv / (rows * cols);
-  rc->avg_frame_low_motion = (3 * rc->avg_frame_low_motion + cnt_zeromv) >> 2;
-
-  // For SVC: set avg_frame_low_motion (only computed on top spatial layer)
-  // to all lower spatial layers.
-  if (cpi->use_svc && svc->spatial_layer_id == svc->number_spatial_layers - 1) {
-    for (int i = 0; i < svc->number_spatial_layers - 1; ++i) {
-      const int layer = LAYER_IDS_TO_IDX(i, svc->temporal_layer_id,
-                                         svc->number_temporal_layers);
-      LAYER_CONTEXT *const lc = &svc->layer_context[layer];
-      RATE_CONTROL *const lrc = &lc->rc;
-      lrc->avg_frame_low_motion = rc->avg_frame_low_motion;
-    }
-  }
-}
diff --git a/av1/encoder/ratectrl.h b/av1/encoder/ratectrl.h
index 1ee6413..aefb5b4 100644
--- a/av1/encoder/ratectrl.h
+++ b/av1/encoder/ratectrl.h
@@ -581,11 +581,6 @@
  * \return q is returned, and updates are done to \c cpi->rc.
  */
 int av1_encodedframe_overshoot_cbr(struct AV1_COMP *cpi, int *q);
-/*!\cond */
-
-void av1_compute_frame_low_motion(struct AV1_COMP *const cpi);
-
-/*!\endcond */
 
 #ifdef __cplusplus
 }  // extern "C"
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index cc8cf88..5d6c886 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -943,9 +943,9 @@
     if (cm->current_frame.frame_type != KEY_FRAME &&
         cpi->oxcf.rc_cfg.mode == AOM_CBR)
       sf->rt_sf.overshoot_detection_cbr = FAST_DETECTION_MAXQ;
-    // Keeping this off for now as some clips show ~6% BDRate regression with
-    // moderate speed-up (~20%)
-    sf->rt_sf.use_temporal_noise_estimate = 0;
+    // Enable noise estimation only for high resolutions for now.
+    if (cm->width * cm->height > 640 * 480)
+      sf->rt_sf.use_temporal_noise_estimate = 1;
   }
 
   if (speed >= 6) {
diff --git a/av1/encoder/var_based_part.c b/av1/encoder/var_based_part.c
index 3402b22..aada04d 100644
--- a/av1/encoder/var_based_part.c
+++ b/av1/encoder/var_based_part.c
@@ -328,11 +328,9 @@
 // TODO(kyslov) Bring back threshold adjustment based on content state
 static int64_t scale_part_thresh_content(int64_t threshold_base, int speed,
                                          int width, int height,
-                                         int content_state,
                                          int non_reference_frame) {
   (void)width;
   (void)height;
-  (void)content_state;
   int64_t threshold = threshold_base;
   if (non_reference_frame) threshold = (3 * threshold) >> 1;
   if (speed >= 8) {
@@ -342,7 +340,7 @@
 }
 
 static AOM_INLINE void set_vbp_thresholds(AV1_COMP *cpi, int64_t thresholds[],
-                                          int q, int content_state,
+                                          int q, int content_lowsumdiff,
                                           int segment_id) {
   AV1_COMMON *const cm = &cpi->common;
   const int is_key_frame = frame_is_intra_only(cm);
@@ -359,21 +357,26 @@
     thresholds[3] = threshold_base >> 2;
     thresholds[4] = threshold_base << 2;
   } else {
-    if (cpi->noise_estimate.enabled && cm->width >= 640 && cm->height >= 480) {
+    // Increase partition thresholds for noisy content. Apply it only for
+    // superblocks where sumdiff is low, as we assume the sumdiff of superblock
+    // whose only change is due to noise will be low (i.e, noise will average
+    // out over large block).
+    if (cpi->noise_estimate.enabled && content_lowsumdiff &&
+        (cm->width * cm->height > 640 * 480) &&
+        cm->current_frame.frame_number > 60) {
       NOISE_LEVEL noise_level =
           av1_noise_estimate_extract_level(&cpi->noise_estimate);
       if (noise_level == kHigh)
-        threshold_base = 3 * threshold_base;
-      else if (noise_level == kMedium)
-        threshold_base = threshold_base << 1;
-      else if (noise_level < kLow)
-        threshold_base = (7 * threshold_base) >> 3;
+        threshold_base = (5 * threshold_base) >> 1;
+      else if (noise_level == kMedium &&
+               !cpi->sf.rt_sf.force_large_partition_blocks)
+        threshold_base = (5 * threshold_base) >> 2;
     }
 
     // Increase base variance threshold based on content_state/sum_diff level.
-    threshold_base = scale_part_thresh_content(
-        threshold_base, cpi->oxcf.speed, cm->width, cm->height, content_state,
-        cpi->svc.non_reference_frame);
+    threshold_base =
+        scale_part_thresh_content(threshold_base, cpi->oxcf.speed, cm->width,
+                                  cm->height, cpi->svc.non_reference_frame);
 
     thresholds[0] = threshold_base >> 1;
     thresholds[1] = threshold_base;
@@ -596,12 +599,12 @@
 }
 
 void av1_set_variance_partition_thresholds(AV1_COMP *cpi, int q,
-                                           int content_state) {
+                                           int content_lowsumdiff) {
   SPEED_FEATURES *const sf = &cpi->sf;
   if (sf->part_sf.partition_search_type != VAR_BASED_PARTITION) {
     return;
   } else {
-    set_vbp_thresholds(cpi, cpi->vbp_info.thresholds, q, content_state, 0);
+    set_vbp_thresholds(cpi, cpi->vbp_info.thresholds, q, content_lowsumdiff, 0);
     // The threshold below is not changed locally.
     cpi->vbp_info.threshold_minmax = 15 + (q >> 3);
   }
@@ -840,7 +843,6 @@
   int maxvar_16x16[4][4];
   int minvar_16x16[4][4];
   int64_t threshold_4x4avg;
-  int content_state = 0;
   uint8_t *s;
   const uint8_t *d;
   int sp;
@@ -862,7 +864,6 @@
 
   // Ref frame used in partitioning.
   MV_REFERENCE_FRAME ref_frame_partition = LAST_FRAME;
-  NOISE_LEVEL noise_level = kLow;
 
   CHECK_MEM_ERROR(cm, vt, aom_malloc(sizeof(*vt)));
 
@@ -880,10 +881,10 @@
       cyclic_refresh_segment_id_boosted(segment_id) &&
       cpi->sf.rt_sf.use_nonrd_pick_mode) {
     int q = av1_get_qindex(&cm->seg, segment_id, cm->quant_params.base_qindex);
-    set_vbp_thresholds(cpi, thresholds, q, content_state, 1);
+    set_vbp_thresholds(cpi, thresholds, q, x->content_state_sb.low_sumdiff, 1);
   } else {
     set_vbp_thresholds(cpi, thresholds, cm->quant_params.base_qindex,
-                       content_state, 0);
+                       x->content_state_sb.low_sumdiff, 0);
   }
 
   // For non keyframes, disable 4x4 average for low resolution when speed = 8
@@ -931,10 +932,6 @@
                             maxvar_16x16, minvar_16x16, variance4x4downsample,
                             thresholds, s, sp, d, dp);
 
-  // Fill the rest of the variance tree by summing split partition values.
-  if (cpi->noise_estimate.enabled)
-    noise_level = av1_noise_estimate_extract_level(&cpi->noise_estimate);
-
   avg_64x64 = 0;
   for (m = 0; m < num_64x64_blocks; ++m) {
     avg_32x32 = 0;
@@ -982,10 +979,7 @@
           force_split[5 + m2 + i] = 1;
           force_split[m + 1] = 1;
           force_split[0] = 1;
-        } else if (!is_key_frame &&
-                   (!cpi->noise_estimate.enabled ||
-                    (cpi->noise_estimate.enabled && noise_level < kLow)) &&
-                   cm->height <= 360 &&
+        } else if (!is_key_frame && cm->height <= 360 &&
                    (maxvar_16x16[m][i] - minvar_16x16[m][i]) >
                        (thresholds[2] >> 1) &&
                    maxvar_16x16[m][i] > thresholds[2]) {
@@ -1019,8 +1013,6 @@
     fill_variance_tree(vt, BLOCK_128X128);
     get_variance(&vt->part_variances.none);
     if (!is_key_frame &&
-        (!cpi->noise_estimate.enabled ||
-         (cpi->noise_estimate.enabled && noise_level >= kMedium)) &&
         vt->part_variances.none.variance > (9 * avg_64x64) >> 5)
       force_split[0] = 1;
 
diff --git a/av1/encoder/var_based_part.h b/av1/encoder/var_based_part.h
index 8067bf5..89e44e8 100644
--- a/av1/encoder/var_based_part.h
+++ b/av1/encoder/var_based_part.h
@@ -46,14 +46,14 @@
  * \callgraph
  * \callergraph
  *
- * \param[in]       cpi               Top level encoder structure
- * \param[in]       q                 q index
- * \param[in]       content_state     Content state of superblock
+ * \param[in]      cpi                Top level encoder structure
+ * \param[in]      q                  q index
+ * \param[in]      content_lowsumdiff Low sumdiff flag for superblock
  *
  * \return Returns the set of thresholds in \c cpi->vbp_info.thresholds.
  */
 void av1_set_variance_partition_thresholds(AV1_COMP *cpi, int q,
-                                           int content_state);
+                                           int content_lowsumdiff);
 
 /*!\brief Variance based partition selection.
  *