From: Marco Date: Wed, 22 Oct 2014 17:36:03 +0000 (-0700) Subject: vp8: Update to computation of noise level. X-Git-Tag: v1.4.0~576 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d166be653e76d5ed4fc7a5c1e41abd22ebfd824f;p=platform%2Fupstream%2Flibvpx.git vp8: Update to computation of noise level. Avoid unneeded computation of mse in process_denoise. Change-Id: I3a538178f2d138750d0c38ea4dd05dbbc2b7df41 --- diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index d8eff66..010c01a 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -3334,11 +3334,6 @@ static void process_denoiser_mode_change(VP8_COMP *cpi) { int index = block_index_row + (j >> 4); if (cpi->consec_zero_last[index] >= min_consec_zero_last) { unsigned int sse; - const unsigned int mse = vp8_mse16x16(src + j, - ystride, - dst + j, - ystride, - &sse); const unsigned int var = vp8_variance16x16(src + j, ystride, dst + j, @@ -3347,14 +3342,15 @@ static void process_denoiser_mode_change(VP8_COMP *cpi) { // Only consider this block as valid for noise measurement // if the sum_diff average of the current and previous frame // is small (to avoid effects from lighting change). - if ((mse - var) < 256) { + if ((sse - var) < 256) { + unsigned int sse2; const unsigned int act = vp8_variance16x16(src + j, ystride, const_source, 0, - &sse); + &sse2); if (act > 0) - total += mse / act; + total += sse / act; num_blocks++; } }