ref: 7467ee045866cb3af32d94705656033c6afcb6fe
parent: a2a97b869f0f4a8dec2a9d8d0c0dcdd56e5a0477
author: Marco <[email protected]>
date: Fri Apr 1 07:41:29 EDT 2016
vp9-denoiser: Adjust usage of skin and consec_zeromv. Change-Id: I250258fc70ec0fcf1b501708c5d4b84685cf882e
--- a/vp9/encoder/vp9_denoiser.c
+++ b/vp9/encoder/vp9_denoiser.c
@@ -195,7 +195,8 @@
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 @@
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 @@
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 @@
// 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 @@
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 @@
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,