From 04a99cb36bb6a3d24de0d99ac621e0313ea759a6 Mon Sep 17 00:00:00 2001 From: Marco Date: Fri, 30 Oct 2015 11:51:06 -0700 Subject: [PATCH] Bias against non-zero mv for large blocks. Change is only for real-time mode, speed > 5, and non-screen content mode. Bias is based on block size and motion vector level (motion above some threshold). Helps to improves stability in background from lightning changes. PSNR/SSIM metrics on RTC set almost no change/neutral (within +/- 0.1). Change-Id: I7eac13c1ae10be4ab1f40acc7f9f1df5653ece9d --- vp9/encoder/vp9_pickmode.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index 867b435bd..e810ef5d7 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -1477,6 +1477,20 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, this_rdc.rate += ref_frame_cost[ref_frame]; this_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, this_rdc.rate, this_rdc.dist); + // Bias against non-zero (above some threshold) motion for large blocks. + // This is temporary fix to avoid selection of large mv for big blocks. + if (cpi->oxcf.speed > 5 && + cpi->oxcf.content != VP9E_CONTENT_SCREEN && + (frame_mv[this_mode][ref_frame].as_mv.row > 64 || + frame_mv[this_mode][ref_frame].as_mv.row < -64 || + frame_mv[this_mode][ref_frame].as_mv.col > 64 || + frame_mv[this_mode][ref_frame].as_mv.col < -64)) { + if (bsize == BLOCK_64X64) + this_rdc.rdcost = this_rdc.rdcost << 1; + else if (bsize >= BLOCK_32X32) + this_rdc.rdcost = 3 * this_rdc.rdcost >> 1; + } + // Skipping checking: test to see if this block can be reconstructed by // prediction only. if (cpi->allow_encode_breakout) { -- 2.40.0