From f129e09529e7d9e78acc39c44714d6e5fc2f0008 Mon Sep 17 00:00:00 2001 From: Jerome Jiang Date: Tue, 10 Jan 2017 12:43:22 -0800 Subject: [PATCH] vp9: Turn on the partition copy for speed 8. Tune threshold. For speed 8, it speeds up the encoding on android by 6% for QVGA and 7.4% for VGA with the new threshold. Overall PSNR is improved by 0.667 for rtc. Change-Id: I4a644560b32c0b5b4e9f49ffb953d000413a3732 --- vp9/encoder/vp9_encodeframe.c | 8 +++++++- vp9/encoder/vp9_speed_features.c | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 323c053ed..096ff4f61 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -516,6 +516,7 @@ void vp9_set_variance_partition_thresholds(VP9_COMP *cpi, int q) { // The thresholds below are not changed locally. if (is_key_frame) { cpi->vbp_threshold_sad = 0; + cpi->vbp_threshold_copy = 0; cpi->vbp_bsize_min = BLOCK_8X8; } else { if (cm->width <= 352 && cm->height <= 288) @@ -525,8 +526,13 @@ void vp9_set_variance_partition_thresholds(VP9_COMP *cpi, int q) { ? (cpi->y_dequant[q][1] << 1) : 1000; cpi->vbp_bsize_min = BLOCK_16X16; + if (cm->width <= 352 && cm->height <= 288) + cpi->vbp_threshold_copy = 40960; + else + cpi->vbp_threshold_copy = (cpi->y_dequant[q][1] << 6) > 32000 + ? (cpi->y_dequant[q][1] << 6) + : 32000; } - cpi->vbp_threshold_copy = cpi->vbp_thresholds[0] << 16; cpi->vbp_threshold_minmax = 15 + (q >> 3); } } diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index 6561ce930..088c4d0a9 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -497,8 +497,10 @@ static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf, int speed, if (speed >= 8) { sf->adaptive_rd_thresh = 4; - // Disabled for now until the threshold is tuned. - sf->copy_partition_flag = 0; + // Enable partition copy + if (!cpi->use_svc && !cpi->resize_pending && !cpi->resize_state && + !cpi->external_resize) + sf->copy_partition_flag = 1; if (sf->copy_partition_flag) { if (cpi->prev_partition == NULL) { cpi->prev_partition = (BLOCK_SIZE *)vpx_calloc( -- 2.40.0