summaryrefslogtreecommitdiff
path: root/vp8/encoder/denoising.c
diff options
context:
space:
mode:
authorMarco <marpan@google.com>2016-01-19 12:57:29 -0800
committerMarco <marpan@google.com>2016-04-01 11:36:45 -0700
commitbc6c19978508116effeb972aaf24e8f4d461f775 (patch)
treefde72bd2fb6ef24fd4420b9dc8caf865e5b99584 /vp8/encoder/denoising.c
parenta2a97b869f0f4a8dec2a9d8d0c0dcdd56e5a0477 (diff)
downloadlibvpx-bc6c19978508116effeb972aaf24e8f4d461f775.tar
libvpx-bc6c19978508116effeb972aaf24e8f4d461f775.tar.gz
libvpx-bc6c19978508116effeb972aaf24e8f4d461f775.tar.bz2
libvpx-bc6c19978508116effeb972aaf24e8f4d461f775.zip
vp8 denoiser: Some adjustments to usage of skin and motion.
Switch to use new skin model. And fix condition for denoising skin block. Previous condition did not denoise skin blocks if the selected mode was non-zero motion in current frame. Modify condition to also force no denoising if that mode was not selected as zero motion now and for at least "x" past frames in a row (x = 2). Change-Id: I00753e3fe45b9a308a7ef43c58f11868e3bfc6b0
Diffstat (limited to 'vp8/encoder/denoising.c')
-rw-r--r--vp8/encoder/denoising.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/vp8/encoder/denoising.c b/vp8/encoder/denoising.c
index 5ae44e82e..c85251e1c 100644
--- a/vp8/encoder/denoising.c
+++ b/vp8/encoder/denoising.c
@@ -497,7 +497,8 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser,
loop_filter_info_n *lfi_n,
int mb_row,
int mb_col,
- int block_index)
+ int block_index,
+ int consec_zero_last)
{
int mv_row;
@@ -608,11 +609,6 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser,
motion_threshold = denoiser->denoise_pars.scale_motion_thresh *
NOISE_MOTION_THRESHOLD;
- // If block is considered to be skin area, lower the motion threshold.
- // In current version set threshold = 0, so only denoise zero mv on skin.
- if (x->is_skin)
- motion_threshold = 0;
-
if (motion_magnitude2 <
denoiser->denoise_pars.scale_increase_filter * NOISE_MOTION_THRESHOLD)
x->increase_denoising = 1;
@@ -624,6 +620,15 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser,
if (best_sse > sse_thresh || motion_magnitude2 > motion_threshold)
decision = COPY_BLOCK;
+ // If block is considered skin, don't denoise if the block
+ // (1) is selected as non-zero motion for current frame, or
+ // (2) has not been selected as ZERO_LAST mode at least x past frames
+ // in a row.
+ // TODO(marpan): Parameter "x" should be varied with framerate.
+ // In particualar, should be reduced for temporal layers (base layer/LAST).
+ if (x->is_skin && (consec_zero_last < 2 || motion_magnitude2 > 0))
+ decision = COPY_BLOCK;
+
if (decision == FILTER_BLOCK)
{
unsigned char *mc_running_avg_y =