summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2014-09-23 12:14:51 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-09-23 16:10:59 -0700
commit4a101310e8fc7bf7bc0cd947d863634d40fb19fc (patch)
tree4649af49889a196bb3c6bbc4fb7dcebc07be9468 /vp9
parent56032b471d65b392315b9fe504053a1f1d3650f4 (diff)
downloadlibvpx-4a101310e8fc7bf7bc0cd947d863634d40fb19fc.tar
libvpx-4a101310e8fc7bf7bc0cd947d863634d40fb19fc.tar.gz
libvpx-4a101310e8fc7bf7bc0cd947d863634d40fb19fc.tar.bz2
libvpx-4a101310e8fc7bf7bc0cd947d863634d40fb19fc.zip
Adapt mode based rd_threshold for similar block size
The rd_thresholds are adaptively changed based on best mode tested. It was only changed for the same block size, this commit makes the adaptation for similar block sizes too. The commit also made minor adjustment and code cleanups. The impact on encoding time for _ped: 118089 ms -> 111927 ms The impact on compression: derf: -0.339% stdhd: -0.303% Change-Id: I8817fed1102350497f2ec631849e43f753878e5d
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_rdopt.c23
-rw-r--r--vp9/encoder/vp9_speed_features.c9
2 files changed, 14 insertions, 18 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index e7b082766..e7403c445 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -2510,24 +2510,23 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
ctx->mic = *xd->mi[0].src_mi;
}
-// Updating rd_thresh_freq_fact[] here means that the different
-// partition/block sizes are handled independently based on the best
-// choice for the current partition. It may well be better to keep a scaled
-// best rd so far value and update rd_thresh_freq_fact based on the mode/size
-// combination that wins out.
static void update_rd_thresh_fact(VP9_COMP *cpi, int bsize,
int best_mode_index) {
if (cpi->sf.adaptive_rd_thresh > 0) {
const int top_mode = bsize < BLOCK_8X8 ? MAX_REFS : MAX_MODES;
int mode;
for (mode = 0; mode < top_mode; ++mode) {
- int *const fact = &cpi->rd.thresh_freq_fact[bsize][mode];
-
- if (mode == best_mode_index) {
- *fact -= (*fact >> 3);
- } else {
- *fact = MIN(*fact + RD_THRESH_INC,
- cpi->sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT);
+ const BLOCK_SIZE min_size = MAX(bsize - 1, BLOCK_4X4);
+ const BLOCK_SIZE max_size = MIN(bsize + 2, BLOCK_64X64);
+ BLOCK_SIZE bs;
+ for (bs = min_size; bs <= max_size; ++bs) {
+ int *const fact = &cpi->rd.thresh_freq_fact[bs][mode];
+ if (mode == best_mode_index) {
+ *fact -= (*fact >> 4);
+ } else {
+ *fact = MIN(*fact + RD_THRESH_INC,
+ cpi->sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT);
+ }
}
}
}
diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c
index 52e9a8e7b..bde1624a2 100644
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -96,28 +96,24 @@ static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm,
if (MIN(cm->width, cm->height) >= 720) {
sf->disable_split_mask = DISABLE_ALL_SPLIT;
sf->schedule_mode_search = cm->base_qindex < 220 ? 1 : 0;
+ sf->partition_search_breakout_dist_thr = (1 << 25);
} else {
sf->max_intra_bsize = BLOCK_32X32;
sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT;
sf->schedule_mode_search = cm->base_qindex < 175 ? 1 : 0;
+ sf->partition_search_breakout_dist_thr = (1 << 23);
}
sf->adaptive_pred_interp_filter = 0;
sf->adaptive_mode_search = 1;
sf->cb_partition_search = !boosted;
sf->cb_pred_filter_search = 1;
sf->alt_ref_search_fp = 1;
- sf->motion_field_mode_search = !boosted;
sf->recode_loop = ALLOW_RECODE_KFMAXBW;
sf->adaptive_rd_thresh = 3;
sf->mode_skip_start = 6;
sf->intra_y_mode_mask[TX_32X32] = INTRA_DC;
sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC;
sf->adaptive_interp_filter_search = 1;
-
- if (MIN(cm->width, cm->height) >= 720)
- sf->partition_search_breakout_dist_thr = (1 << 25);
- else
- sf->partition_search_breakout_dist_thr = (1 << 23);
sf->partition_search_breakout_rate_thr = 1000;
}
@@ -133,6 +129,7 @@ static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm,
sf->use_lp32x32fdct = 1;
sf->use_fast_coef_updates = ONE_LOOP_REDUCED;
sf->use_fast_coef_costing = 1;
+ sf->motion_field_mode_search = !boosted;
if (MIN(cm->width, cm->height) >= 720)
sf->partition_search_breakout_dist_thr = (1 << 26);