AllIntra: Adjust variance-based partition thresholds. This gives 5-30% speed up on AllIntra speed 9 with less than 2% file size max increase in CQ mode. BUG=aomedia:3022 Change-Id: I268aff1de02b90114c7306eb0928000dc31deb5a
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c index 4c428d5..34943e8 100644 --- a/av1/encoder/speed_features.c +++ b/av1/encoder/speed_features.c
@@ -500,6 +500,7 @@ sf->rt_sf.use_nonrd_pick_mode = 1; sf->rt_sf.nonrd_check_partition_merge_mode = 1; sf->rt_sf.nonrd_check_partition_split = 0; + sf->rt_sf.force_large_partition_blocks_intra = 1; // Set mask for intra modes. for (int i = 0; i < BLOCK_SIZES; ++i) if (i >= BLOCK_32X32) @@ -1783,6 +1784,7 @@ rt_sf->nonrd_check_partition_merge_mode = 0; rt_sf->nonrd_check_partition_split = 0; rt_sf->skip_intra_pred_if_tx_skip = 0; + rt_sf->force_large_partition_blocks_intra = 0; } void av1_set_speed_features_framesize_dependent(AV1_COMP *cpi, int speed) {
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h index 8775ebb..4b3e542 100644 --- a/av1/encoder/speed_features.h +++ b/av1/encoder/speed_features.h
@@ -1236,6 +1236,10 @@ // sensitivity is off. When color sensitivity is on for a superblock, all // 64x64 blocks within will not skip. int skip_cdef_sb; + + // Forces larger partition blocks in variance based partitioning for intra + // frames + int force_large_partition_blocks_intra; } REAL_TIME_SPEED_FEATURES; /*!\endcond */
diff --git a/av1/encoder/var_based_part.c b/av1/encoder/var_based_part.c index 8907d0d..8d11b20 100644 --- a/av1/encoder/var_based_part.c +++ b/av1/encoder/var_based_part.c
@@ -351,14 +351,22 @@ const int current_qindex = cm->quant_params.base_qindex; if (is_key_frame) { + if (cpi->sf.rt_sf.force_large_partition_blocks_intra) { + threshold_base <<= cpi->oxcf.speed - 7; + } thresholds[0] = threshold_base; thresholds[1] = threshold_base; if (cm->width * cm->height < 1280 * 720) { thresholds[2] = threshold_base / 3; thresholds[3] = threshold_base >> 1; } else { - thresholds[2] = threshold_base >> 2; - thresholds[3] = threshold_base >> 2; + int shift_val = 2; + if (cpi->sf.rt_sf.force_large_partition_blocks_intra) { + shift_val = 0; + } + + thresholds[2] = threshold_base >> shift_val; + thresholds[3] = threshold_base >> shift_val; } thresholds[4] = threshold_base << 2; } else {