From 9ff73fe0926b8256306df76f528f23eb1d73b57b Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 4 Apr 2016 09:25:59 -0700 Subject: [PATCH] vp9-noise estimation: Increase threshold for Low-level. This make it more likely clean/low-noise content will be set as LowLow, and hence no denoising will be done. Also set early exit on denoising for small blocks. Change-Id: I4a72bba3e6c5e2d523d304c39deacc9c39bf216c --- vp9/encoder/vp9_denoiser.c | 6 ++++++ vp9/encoder/vp9_noise_estimate.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vp9/encoder/vp9_denoiser.c b/vp9/encoder/vp9_denoiser.c index 3de182fb1..98f5bbd35 100644 --- a/vp9/encoder/vp9_denoiser.c +++ b/vp9/encoder/vp9_denoiser.c @@ -216,6 +216,12 @@ static VP9_DENOISER_DECISION perform_motion_compensation(VP9_DENOISER *denoiser, if (is_skin && (motion_magnitude > 0 || consec_zeromv < 4)) return COPY_BLOCK; + // Avoid denoising for small block (unless motion is small). + // Small blocks are selected in variance partition (before encoding) and + // will typically lie on moving areas. + if (motion_magnitude > 16 && bs <= BLOCK_8X8) + return COPY_BLOCK; + // If the best reference frame uses inter-prediction and there is enough of a // difference in sum-squared-error, use it. if (frame != INTRA_FRAME && diff --git a/vp9/encoder/vp9_noise_estimate.c b/vp9/encoder/vp9_noise_estimate.c index d505629a5..abe676803 100644 --- a/vp9/encoder/vp9_noise_estimate.c +++ b/vp9/encoder/vp9_noise_estimate.c @@ -91,7 +91,7 @@ NOISE_LEVEL vp9_noise_estimate_extract_level(NOISE_ESTIMATE *const ne) { } else { if (ne->value > ne->thresh) noise_level = kMedium; - else if (ne->value > (ne->thresh >> 1)) + else if (ne->value > ((5 * ne->thresh) >> 3)) noise_level = kLow; else noise_level = kLowLow;