Merge "vp9: encoder-breakout: Modify UV thresholds."

This commit is contained in:
Marco Paniconi 2016-01-29 01:19:30 +00:00 committed by Gerrit Code Review
commit 35b878ca25

View File

@ -812,7 +812,7 @@ static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x,
mi->mv[0].as_mv.col > 64 ||
mi->mv[0].as_mv.col < -64)
motion_low = 0;
if (x->encode_breakout > 0 && motion_low == 1 && !x->sb_is_skin) {
if (x->encode_breakout > 0 && motion_low == 1) {
// 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.
@ -852,6 +852,12 @@ static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x,
if (var <= thresh_ac && (sse - var) <= thresh_dc) {
unsigned int sse_u, sse_v;
unsigned int var_u, var_v;
unsigned int thresh_ac_uv = thresh_ac;
unsigned int thresh_dc_uv = thresh_dc;
if (x->sb_is_skin) {
thresh_ac_uv = 0;
thresh_dc_uv = 0;
}
// Skip UV prediction unless breakout is zero (lossless) to save
// computation with low impact on the result
@ -867,14 +873,14 @@ static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x,
xd->plane[1].dst.stride, &sse_u);
// U skipping condition checking
if (((var_u << 2) <= thresh_ac) && (sse_u - var_u <= thresh_dc)) {
if (((var_u << 2) <= thresh_ac_uv) && (sse_u - var_u <= thresh_dc_uv)) {
var_v = cpi->fn_ptr[uv_size].vf(x->plane[2].src.buf,
x->plane[2].src.stride,
xd->plane[2].dst.buf,
xd->plane[2].dst.stride, &sse_v);
// V skipping condition checking
if (((var_v << 2) <= thresh_ac) && (sse_v - var_v <= thresh_dc)) {
if (((var_v << 2) <= thresh_ac_uv) && (sse_v - var_v <= thresh_dc_uv)) {
x->skip = 1;
// The cost of skip bit needs to be added.