From ee1b3f34c032f6ec8fe2bb0e899ae03234fd98c6 Mon Sep 17 00:00:00 2001 From: Marco Date: Fri, 21 Oct 2016 11:11:34 -0700 Subject: [PATCH] vp9: Nonrd variance partition: increase threshold for using 4x4 avg. In variance partition low resolutions may use varianace based on 4x4 average for better partitioning. Increase the threshold for doing this at speed = 8. Improves speed by ~5%, with little loss, < 1%, on RTC_derf set. Change-Id: Ib5ec420832ccff887a06cb5e1d2c73199b093941 --- vp9/encoder/vp9_encodeframe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 36e288e36..aff7b1d9b 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -799,6 +799,7 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile, int min_var_32x32 = INT_MAX; int var_32x32; int avg_16x16[4]; + int64_t threshold_4x4avg; NOISE_LEVEL noise_level = kLow; uint8_t *s; const uint8_t *d; @@ -833,6 +834,9 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile, } } + threshold_4x4avg = + (cpi->oxcf.speed < 8) ? thresholds[1] << 1 : thresholds[2] >> 1; + memset(x->variance_low, 0, sizeof(x->variance_low)); if (xd->mb_to_right_edge < 0) pixels_wide += (xd->mb_to_right_edge >> 3); @@ -999,7 +1003,7 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile, } if (is_key_frame || (low_res && vt.split[i].split[j].part_variances.none.variance > - (thresholds[1] << 1))) { + threshold_4x4avg)) { force_split[split_index] = 0; // Go down to 4x4 down-sampling for variance. variance4x4downsample[i2 + j] = 1; -- 2.40.0