Merge "vp9-denoiser: Adjust usage of skin and consec_zeromv."
This commit is contained in:
@@ -195,7 +195,8 @@ static VP9_DENOISER_DECISION perform_motion_compensation(VP9_DENOISER *denoiser,
|
|||||||
PICK_MODE_CONTEXT *ctx,
|
PICK_MODE_CONTEXT *ctx,
|
||||||
int motion_magnitude,
|
int motion_magnitude,
|
||||||
int is_skin,
|
int is_skin,
|
||||||
int *zeromv_filter) {
|
int *zeromv_filter,
|
||||||
|
int consec_zeromv) {
|
||||||
int mv_col, mv_row;
|
int mv_col, mv_row;
|
||||||
int sse_diff = ctx->zeromv_sse - ctx->newmv_sse;
|
int sse_diff = ctx->zeromv_sse - ctx->newmv_sse;
|
||||||
MV_REFERENCE_FRAME frame;
|
MV_REFERENCE_FRAME frame;
|
||||||
@@ -212,7 +213,7 @@ static VP9_DENOISER_DECISION perform_motion_compensation(VP9_DENOISER *denoiser,
|
|||||||
|
|
||||||
saved_mi = *mi;
|
saved_mi = *mi;
|
||||||
|
|
||||||
if (is_skin && motion_magnitude > 0)
|
if (is_skin && (motion_magnitude > 0 || consec_zeromv < 4))
|
||||||
return COPY_BLOCK;
|
return COPY_BLOCK;
|
||||||
|
|
||||||
// If the best reference frame uses inter-prediction and there is enough of a
|
// 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);
|
mi_row, mi_col);
|
||||||
struct buf_2d src = mb->plane[0].src;
|
struct buf_2d src = mb->plane[0].src;
|
||||||
int is_skin = 0;
|
int is_skin = 0;
|
||||||
|
int consec_zeromv = 0;
|
||||||
mv_col = ctx->best_sse_mv.as_mv.col;
|
mv_col = ctx->best_sse_mv.as_mv.col;
|
||||||
mv_row = ctx->best_sse_mv.as_mv.row;
|
mv_row = ctx->best_sse_mv.as_mv.row;
|
||||||
motion_magnitude = mv_row * mv_row + mv_col * mv_col;
|
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
|
// If motion for current block is small/zero, compute consec_zeromv for
|
||||||
// skin detection (early exit in skin detection is done for large
|
// skin detection (early exit in skin detection is done for large
|
||||||
// consec_zeromv when current block has small/zero motion).
|
// consec_zeromv when current block has small/zero motion).
|
||||||
int consec_zeromv = 0;
|
consec_zeromv = 0;
|
||||||
if (motion_level == 0) {
|
if (motion_level == 0) {
|
||||||
CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
|
CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
|
||||||
VP9_COMMON * const cm = &cpi->common;
|
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);
|
consec_zeromv = VPXMIN(cr->consec_zero_mv[bl_index], consec_zeromv);
|
||||||
// No need to keep checking 8x8 blocks if any of the sub-blocks
|
// No need to keep checking 8x8 blocks if any of the sub-blocks
|
||||||
// has small consec_zeromv (since threshold for no_skin based on
|
// has small consec_zeromv (since threshold for no_skin based on
|
||||||
// zero/small motion in skin detection is high, i.e, > 5).
|
// zero/small motion in skin detection is high, i.e, > 4).
|
||||||
if (consec_zeromv < 5) {
|
if (consec_zeromv < 4) {
|
||||||
i = ymis;
|
i = ymis;
|
||||||
j = xmis;
|
j = xmis;
|
||||||
}
|
}
|
||||||
@@ -393,7 +395,8 @@ void vp9_denoiser_denoise(VP9_COMP *cpi, MACROBLOCK *mb,
|
|||||||
mi_row, mi_col, ctx,
|
mi_row, mi_col, ctx,
|
||||||
motion_magnitude,
|
motion_magnitude,
|
||||||
is_skin,
|
is_skin,
|
||||||
&zeromv_filter);
|
&zeromv_filter,
|
||||||
|
consec_zeromv);
|
||||||
|
|
||||||
if (decision == FILTER_BLOCK) {
|
if (decision == FILTER_BLOCK) {
|
||||||
decision = vp9_denoiser_filter(src.buf, src.stride,
|
decision = vp9_denoiser_filter(src.buf, src.stride,
|
||||||
|
|||||||
Reference in New Issue
Block a user