Merge "vp8 denoiser: fix to zero_mv mode selection."
This commit is contained in:
commit
688c5ac2a8
@ -249,6 +249,7 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser,
|
|||||||
int mv_col;
|
int mv_col;
|
||||||
unsigned int motion_magnitude2;
|
unsigned int motion_magnitude2;
|
||||||
unsigned int sse_thresh;
|
unsigned int sse_thresh;
|
||||||
|
int sse_diff_thresh = 0;
|
||||||
MV_REFERENCE_FRAME frame = x->best_reference_frame;
|
MV_REFERENCE_FRAME frame = x->best_reference_frame;
|
||||||
MV_REFERENCE_FRAME zero_frame = x->best_zeromv_reference_frame;
|
MV_REFERENCE_FRAME zero_frame = x->best_zeromv_reference_frame;
|
||||||
|
|
||||||
@ -273,11 +274,16 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser,
|
|||||||
mbmi->need_to_clamp_mvs = x->need_to_clamp_best_mvs;
|
mbmi->need_to_clamp_mvs = x->need_to_clamp_best_mvs;
|
||||||
mv_col = x->best_sse_mv.as_mv.col;
|
mv_col = x->best_sse_mv.as_mv.col;
|
||||||
mv_row = x->best_sse_mv.as_mv.row;
|
mv_row = x->best_sse_mv.as_mv.row;
|
||||||
|
// Bias to zero_mv if small amount of motion.
|
||||||
|
// Note sse_diff_thresh is intialized to zero, so this ensures
|
||||||
|
// we will always choose zero_mv for denoising if
|
||||||
|
// zero_mv_see <= best_sse (i.e., sse_diff <= 0).
|
||||||
|
if ((unsigned int)(mv_row * mv_row + mv_col * mv_col)
|
||||||
|
<= NOISE_MOTION_THRESHOLD)
|
||||||
|
sse_diff_thresh = (int)SSE_DIFF_THRESHOLD;
|
||||||
|
|
||||||
if (frame == INTRA_FRAME ||
|
if (frame == INTRA_FRAME ||
|
||||||
((unsigned int)(mv_row *mv_row + mv_col *mv_col)
|
sse_diff <= sse_diff_thresh)
|
||||||
<= NOISE_MOTION_THRESHOLD &&
|
|
||||||
sse_diff < (int)SSE_DIFF_THRESHOLD))
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Handle intra blocks as referring to last frame with zero motion
|
* Handle intra blocks as referring to last frame with zero motion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user