Reduce sampling time for noise estimate. Change-Id: I46abd85e2187b8f4c2846416a23fab26d9b9f67d
diff --git a/vp9/encoder/vp9_noise_estimate.c b/vp9/encoder/vp9_noise_estimate.c index c3a3171..b41ffd0 100644 --- a/vp9/encoder/vp9_noise_estimate.c +++ b/vp9/encoder/vp9_noise_estimate.c
@@ -36,6 +36,7 @@ } else if (width * height >= 1280 * 720) { ne->thresh = 130; } + ne->num_frames_estimate = 20; } int enable_noise_estimation(VP9_COMP *const cpi) { @@ -91,7 +92,6 @@ unsigned int thresh_sum_diff = 100; unsigned int thresh_sum_spatial = (200 * 200) << 8; unsigned int thresh_spatial_var = (32 * 32) << 8; - int num_frames_estimate = 20; int min_blocks_estimate = cm->mi_rows * cm->mi_cols >> 7; // Estimate is between current source and last source. YV12_BUFFER_CONFIG *last_source = cpi->Last_Source; @@ -216,9 +216,9 @@ // Update noise estimate. ne->value = (int)((15 * ne->value + avg_est) >> 4); ne->count++; - if (ne->count == num_frames_estimate) { + if (ne->count == ne->num_frames_estimate) { // Reset counter and check noise level condition. - num_frames_estimate = 40; + ne->num_frames_estimate = 30; ne->count = 0; if (ne->value > (ne->thresh << 1)) ne->level = kHigh;
diff --git a/vp9/encoder/vp9_noise_estimate.h b/vp9/encoder/vp9_noise_estimate.h index b5dded9..0d22ef0 100644 --- a/vp9/encoder/vp9_noise_estimate.h +++ b/vp9/encoder/vp9_noise_estimate.h
@@ -38,6 +38,7 @@ int count; int last_w; int last_h; + int num_frames_estimate; } NOISE_ESTIMATE; struct VP9_COMP;