vp9-denoiser: Bugfix and some adjustments for high noise case.

Need to check that sse for non-zero mv has been set for the current block
(i.e., check that nonzero-mv is tested as a mode, so newmv_sse != UINT_MAX)
before forcing to not use zero-mv for denoising.

Also increase some thresholds (sse and sse_diff) for high noise case,
and use shift operaton instead of multiplication on a threshold computation.

Change-Id: Iae7339475d57240316b7fa8b887c4ee3c0d0dbec
This commit is contained in:
Marco 2016-04-25 08:49:08 -07:00
Родитель cc5023d55f
Коммит 229c686c89
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -49,16 +49,19 @@ static int noise_motion_thresh(BLOCK_SIZE bs, int increase_denoising) {
} }
static unsigned int sse_thresh(BLOCK_SIZE bs, int increase_denoising) { static unsigned int sse_thresh(BLOCK_SIZE bs, int increase_denoising) {
return (1 << num_pels_log2_lookup[bs]) * (increase_denoising ? 60 : 40); return (1 << num_pels_log2_lookup[bs]) * (increase_denoising ? 80 : 40);
} }
static int sse_diff_thresh(BLOCK_SIZE bs, int increase_denoising, static int sse_diff_thresh(BLOCK_SIZE bs, int increase_denoising,
int motion_magnitude) { int motion_magnitude) {
if (motion_magnitude > if (motion_magnitude >
noise_motion_thresh(bs, increase_denoising)) { noise_motion_thresh(bs, increase_denoising)) {
return 0; if (increase_denoising)
return (1 << num_pels_log2_lookup[bs]) << 2;
else
return 0;
} else { } else {
return (1 << num_pels_log2_lookup[bs]) * 20; return (1 << num_pels_log2_lookup[bs]) << 4;
} }
} }
@ -222,6 +225,7 @@ static VP9_DENOISER_DECISION perform_motion_compensation(VP9_DENOISER *denoiser,
// 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
// difference in sum-squared-error, use it. // difference in sum-squared-error, use it.
if (frame != INTRA_FRAME && if (frame != INTRA_FRAME &&
ctx->newmv_sse != UINT_MAX &&
sse_diff > sse_diff_thresh(bs, increase_denoising, motion_magnitude)) { sse_diff > sse_diff_thresh(bs, increase_denoising, motion_magnitude)) {
mi->ref_frame[0] = ctx->best_reference_frame; mi->ref_frame[0] = ctx->best_reference_frame;
mi->mode = ctx->best_sse_inter_mode; mi->mode = ctx->best_sse_inter_mode;