Commit 2f0067c6 authored by Marco Paniconi's avatar Marco Paniconi Committed by Gerrit Code Review

Merge "vp9-denoiser: Adjust usage of skin and consec_zeromv."

parents bc6c1997 7467ee04
......@@ -195,7 +195,8 @@ static VP9_DENOISER_DECISION perform_motion_compensation(VP9_DENOISER *denoiser,
PICK_MODE_CONTEXT *ctx,
int motion_magnitude,
int is_skin,
int *zeromv_filter) {
int *zeromv_filter,
int consec_zeromv) {
int mv_col, mv_row;
int sse_diff = ctx->zeromv_sse - ctx->newmv_sse;
MV_REFERENCE_FRAME frame;
......@@ -212,7 +213,7 @@ static VP9_DENOISER_DECISION perform_motion_compensation(VP9_DENOISER *denoiser,
saved_mi = *mi;
if (is_skin && motion_magnitude > 0)
if (is_skin && (motion_magnitude > 0 || consec_zeromv < 4))
return COPY_BLOCK;
// If the best reference frame uses inter-prediction and there is enough of a
......@@ -332,6 +333,7 @@ void vp9_denoiser_denoise(VP9_COMP *cpi, MACROBLOCK *mb,
mi_row, mi_col);
struct buf_2d src = mb->plane[0].src;
int is_skin = 0;
int consec_zeromv = 0;
mv_col = ctx->best_sse_mv.as_mv.col;
mv_row = ctx->best_sse_mv.as_mv.row;
motion_magnitude = mv_row * mv_row + mv_col * mv_col;
......@@ -343,7 +345,7 @@ void vp9_denoiser_denoise(VP9_COMP *cpi, MACROBLOCK *mb,
// If motion for current block is small/zero, compute consec_zeromv for
// skin detection (early exit in skin detection is done for large
// consec_zeromv when current block has small/zero motion).
int consec_zeromv = 0;
consec_zeromv = 0;
if (motion_level == 0) {
CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
VP9_COMMON * const cm = &cpi->common;
......@@ -361,8 +363,8 @@ void vp9_denoiser_denoise(VP9_COMP *cpi, MACROBLOCK *mb,
consec_zeromv = VPXMIN(cr->consec_zero_mv[bl_index], consec_zeromv);
// No need to keep checking 8x8 blocks if any of the sub-blocks
// has small consec_zeromv (since threshold for no_skin based on
// zero/small motion in skin detection is high, i.e, > 5).
if (consec_zeromv < 5) {
// zero/small motion in skin detection is high, i.e, > 4).
if (consec_zeromv < 4) {
i = ymis;
j = xmis;
}
......@@ -393,7 +395,8 @@ void vp9_denoiser_denoise(VP9_COMP *cpi, MACROBLOCK *mb,
mi_row, mi_col, ctx,
motion_magnitude,
is_skin,
&zeromv_filter);
&zeromv_filter,
consec_zeromv);
if (decision == FILTER_BLOCK) {
decision = vp9_denoiser_filter(src.buf, src.stride,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment