summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2013-09-06 16:59:55 -0700
committerYunqing Wang <yunqingwang@google.com>2013-09-10 10:13:24 -0700
commit0607abc3dd26e6782ad9577765f9aeef311b0de9 (patch)
tree55992bc655d2327e0859dc2416b51965913e5758 /vp9
parentf6bc783d630cd191567259279be1b578a4825244 (diff)
downloadlibvpx-0607abc3dd26e6782ad9577765f9aeef311b0de9.tar
libvpx-0607abc3dd26e6782ad9577765f9aeef311b0de9.tar.gz
libvpx-0607abc3dd26e6782ad9577765f9aeef311b0de9.tar.bz2
libvpx-0607abc3dd26e6782ad9577765f9aeef311b0de9.zip
Stop partition checking when distortion is small
If the current obtained distortion is very small, which happens for static image case, we pick the current partition type without further split checking. This won't affect regular videos. For static videos, we got 10%~12% encoding speed gain. PSNR was better for some clips, and worse for others. Overall it was even. Change-Id: If787a57bedf46fc595ca4f5ded2b0c0a69e9fdef
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_encodeframe.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index dcb972edd..6a70e8e9d 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1790,11 +1790,24 @@ static void rd_pick_partition(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row,
}
sum_rd = RDCOST(x->rdmult, x->rddiv, this_rate, this_dist);
if (sum_rd < best_rd) {
+ int64_t stop_thresh = 2048;
+
best_rate = this_rate;
best_dist = this_dist;
best_rd = sum_rd;
if (bsize >= BLOCK_8X8)
*(get_sb_partitioning(x, bsize)) = bsize;
+
+ // Adjust threshold according to partition size.
+ stop_thresh >>= 8 - (b_width_log2_lookup[bsize] +
+ b_height_log2_lookup[bsize]);
+
+ // If obtained distortion is very small, choose current partition
+ // and stop splitting.
+ if (this_dist < stop_thresh) {
+ do_split = 0;
+ do_rect = 0;
+ }
}
}
restore_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);