summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2014-10-18 13:31:41 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-10-18 13:31:41 -0700
commit7bf475926b943a057b0097364f2f4280d22382c3 (patch)
treea3622097491e9c052d31771dd0fa4a045af6efd0 /vp9/encoder
parent6f77bff6aab085af8a8f3364ce842194e88a9bfb (diff)
parent5e766ccee030a207a2edd37a5f7012665bc43796 (diff)
downloadlibvpx-7bf475926b943a057b0097364f2f4280d22382c3.tar
libvpx-7bf475926b943a057b0097364f2f4280d22382c3.tar.gz
libvpx-7bf475926b943a057b0097364f2f4280d22382c3.tar.bz2
libvpx-7bf475926b943a057b0097364f2f4280d22382c3.zip
Merge "Use rate/distortion thresholds to control non-RD partition search"
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_encodeframe.c20
-rw-r--r--vp9/encoder/vp9_speed_features.c6
2 files changed, 16 insertions, 10 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index b4fe70acc..87114f1bd 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -2833,8 +2833,13 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
this_rate += cpi->partition_cost[pl][PARTITION_NONE];
sum_rd = RDCOST(x->rdmult, x->rddiv, this_rate, this_dist);
if (sum_rd < best_rd) {
- int64_t stop_thresh = 4096;
- int64_t stop_thresh_rd;
+ int dist_breakout_thr = sf->partition_search_breakout_dist_thr;
+ int64_t rate_breakout_thr = sf->partition_search_breakout_rate_thr;
+
+ dist_breakout_thr >>= 8 - (b_width_log2_lookup[bsize] +
+ b_height_log2_lookup[bsize]);
+
+ rate_breakout_thr *= num_pels_log2_lookup[bsize];
best_rate = this_rate;
best_dist = this_dist;
@@ -2842,14 +2847,9 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
if (bsize >= BLOCK_8X8)
pc_tree->partitioning = PARTITION_NONE;
- // Adjust threshold according to partition size.
- stop_thresh >>= 8 - (b_width_log2_lookup[bsize] +
- b_height_log2_lookup[bsize]);
-
- stop_thresh_rd = RDCOST(x->rdmult, x->rddiv, 0, stop_thresh);
- // If obtained distortion is very small, choose current partition
- // and stop splitting.
- if (!x->e_mbd.lossless && best_rd < stop_thresh_rd) {
+ if (!x->e_mbd.lossless &&
+ this_rate < rate_breakout_thr &&
+ this_dist < dist_breakout_thr) {
do_split = 0;
do_rect = 0;
}
diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c
index bec77d71f..9e3ee2c94 100644
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -275,6 +275,12 @@ static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf,
sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST_NEW_ZERO;
sf->inter_mode_mask[BLOCK_64X32] = INTER_NEAREST_NEW_ZERO;
sf->inter_mode_mask[BLOCK_64X64] = INTER_NEAREST_NEW_ZERO;
+
+ 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 = 200;
}
if (speed >= 6) {