From e42b3ee765cf11a04c312fd03d5086567f0ae838 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Wed, 7 Jan 2015 11:41:56 -0800 Subject: Initalize zeromv_sse and newmv_sse in vp9_pick_inter_mode These two parameters are used to control the denoiser cut-off thresholds. They should be properly initialized when starting mode search of a given block. Change-Id: Iba8a25487026a0dbe0d350c347d7e4e4e237b637 --- vp9/encoder/vp9_denoiser.c | 5 ++++- vp9/encoder/vp9_pickmode.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'vp9') diff --git a/vp9/encoder/vp9_denoiser.c b/vp9/encoder/vp9_denoiser.c index 2266a26bd..784319f08 100644 --- a/vp9/encoder/vp9_denoiser.c +++ b/vp9/encoder/vp9_denoiser.c @@ -398,7 +398,10 @@ void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser, void vp9_denoiser_reset_frame_stats(PICK_MODE_CONTEXT *ctx) { ctx->zeromv_sse = UINT_MAX; - ctx->newmv_sse = UINT_MAX; + // This should be initialized as zero since mode search stage might skip + // NEWMV mode if inferred motion vector modes provide sufficiently good + // prediction quality. + ctx->newmv_sse = 0; } void vp9_denoiser_update_frame_stats(MB_MODE_INFO *mbmi, unsigned int sse, diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index cf1e9979e..d9659d14c 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -605,6 +605,10 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, mbmi->interp_filter = cm->interp_filter == SWITCHABLE ? EIGHTTAP : cm->interp_filter; +#if CONFIG_VP9_TEMPORAL_DENOISING + vp9_denoiser_reset_frame_stats(ctx); +#endif + for (ref_frame = LAST_FRAME; ref_frame <= GOLDEN_FRAME; ++ref_frame) { x->pred_mv_sad[ref_frame] = INT_MAX; frame_mv[NEWMV][ref_frame].as_int = INVALID_MV; -- cgit v1.2.3