summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Converse <aconverse@google.com>2014-06-25 10:51:57 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-06-25 10:51:57 -0700
commitbd1fc3402c9e97c3b285370422ab56861320bd5a (patch)
treeb183df09f5bf8da05be3163432126b1d50095ccd
parentd9c37b08f8c9489eddf96cbc9037b09f61f2b7f4 (diff)
parent1409d1e1ff94fa7853bbae62f2ec31e08cb8cbe1 (diff)
downloadlibvpx-bd1fc3402c9e97c3b285370422ab56861320bd5a.tar
libvpx-bd1fc3402c9e97c3b285370422ab56861320bd5a.tar.gz
libvpx-bd1fc3402c9e97c3b285370422ab56861320bd5a.tar.bz2
libvpx-bd1fc3402c9e97c3b285370422ab56861320bd5a.zip
Merge "Allow lossless breakout in non-rd mode decision."
-rw-r--r--vp9/encoder/vp9_pickmode.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index 149fafdf8..e33d52b0c 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -439,29 +439,35 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
// Skipping checking: test to see if this block can be reconstructed by
// prediction only.
- if (cpi->allow_encode_breakout && x->encode_breakout) {
+ if (cpi->allow_encode_breakout) {
const BLOCK_SIZE uv_size = get_plane_block_size(bsize, &xd->plane[1]);
unsigned int var = var_y, sse = sse_y;
// Skipping threshold for ac.
unsigned int thresh_ac;
// Skipping threshold for dc.
unsigned int thresh_dc;
- // Set a maximum for threshold to avoid big PSNR loss in low bit rate
- // case. Use extreme low threshold for static frames to limit skipping.
- const unsigned int max_thresh = 36000;
- // The encode_breakout input
- const unsigned int min_thresh =
- MIN(((unsigned int)x->encode_breakout << 4), max_thresh);
-
- // Calculate threshold according to dequant value.
- thresh_ac = (xd->plane[0].dequant[1] * xd->plane[0].dequant[1]) / 9;
- thresh_ac = clamp(thresh_ac, min_thresh, max_thresh);
-
- // Adjust ac threshold according to partition size.
- thresh_ac >>= 8 - (b_width_log2_lookup[bsize] +
- b_height_log2_lookup[bsize]);
-
- thresh_dc = (xd->plane[0].dequant[0] * xd->plane[0].dequant[0] >> 6);
+ if (x->encode_breakout > 0) {
+ // Set a maximum for threshold to avoid big PSNR loss in low bit rate
+ // case. Use extreme low threshold for static frames to limit
+ // skipping.
+ const unsigned int max_thresh = 36000;
+ // The encode_breakout input
+ const unsigned int min_thresh =
+ MIN(((unsigned int)x->encode_breakout << 4), max_thresh);
+
+ // Calculate threshold according to dequant value.
+ thresh_ac = (xd->plane[0].dequant[1] * xd->plane[0].dequant[1]) / 9;
+ thresh_ac = clamp(thresh_ac, min_thresh, max_thresh);
+
+ // Adjust ac threshold according to partition size.
+ thresh_ac >>=
+ 8 - (b_width_log2_lookup[bsize] + b_height_log2_lookup[bsize]);
+
+ thresh_dc = (xd->plane[0].dequant[0] * xd->plane[0].dequant[0] >> 6);
+ } else {
+ thresh_ac = 0;
+ thresh_dc = 0;
+ }
// Y skipping condition checking for ac and dc.
if (var <= thresh_ac && (sse - var) <= thresh_dc) {