AV1 RT: Refine 32x32 block split on min-max var diff
Split 32x32 block on min-max variance condition for noisy content only.
~2% speed up on lowres speed 8 (no noise estimation) with neutral
BDrate. ~1.3% BDRate gain on RTC testset on speed 8 (on 720p clips where
noise estimation is on)
Change-Id: Icce2925f7c425a38934cac37d741745eb38ec8d3
diff --git a/av1/encoder/var_based_part.c b/av1/encoder/var_based_part.c
index c6d0f05..c22dc10 100644
--- a/av1/encoder/var_based_part.c
+++ b/av1/encoder/var_based_part.c
@@ -847,6 +847,7 @@
const uint8_t *d;
int sp;
int dp;
+ NOISE_LEVEL noise_level = kLow;
int is_key_frame =
(frame_is_intra_only(cm) ||
@@ -923,6 +924,8 @@
d = AV1_VAR_OFFS;
dp = 0;
}
+ if (cpi->noise_estimate.enabled)
+ noise_level = av1_noise_estimate_extract_level(&cpi->noise_estimate);
if (low_res && threshold_4x4avg < INT64_MAX)
CHECK_MEM_ERROR(cm, vt2, aom_malloc(sizeof(*vt2)));
@@ -996,14 +999,18 @@
var_64x64 = vt->split[m].part_variances.none.variance;
max_var_64x64 = AOMMAX(var_64x64, max_var_64x64);
min_var_64x64 = AOMMIN(var_64x64, min_var_64x64);
- // If variance of this 64x64 block is above (some threshold of) the
- // average variance over the sub-32x32 blocks, then force this block to
- // split. Only checking this for noise level >= medium for now.
+ // If the difference of the max-min variances of sub-blocks or max
+ // variance of a sub-block is above some threshold of then force this
+ // block to split. Only checking this for noise level >= medium or if
+ // encoder is in SVC.
if (!is_key_frame &&
(max_var_32x32[m] - min_var_32x32[m]) > 3 * (thresholds[1] >> 3) &&
- max_var_32x32[m] > thresholds[1] >> 1)
+ max_var_32x32[m] > thresholds[1] >> 1 &&
+ (noise_level >= kMedium || cpi->use_svc)) {
force_split[1 + m] = 1;
+ force_split[0] = 1;
+ }
avg_64x64 += var_64x64;
}
if (is_small_sb) force_split[0] = 1;