]> granicus.if.org Git - libvpx/commitdiff
vp9: Wrap threshold tuning for HD only when denoiser is enabled.
authorJerome Jiang <jianj@google.com>
Wed, 10 May 2017 00:23:00 +0000 (17:23 -0700)
committerMarco <marpan@google.com>
Wed, 10 May 2017 19:15:41 +0000 (12:15 -0700)
Fixes a speed regression.

Change-Id: I23d942e4af17fa81fe4a366c7369b3ad537e59b0

vp9/encoder/vp9_noise_estimate.c

index ca0873e4c436f46ed36a6e1364ce7b38fc8a5e1b..c769407dfbabe4a3a3f36359428349a66d3eee0f 100644 (file)
@@ -111,16 +111,18 @@ void vp9_update_noise_estimate(VP9_COMP *const cpi) {
   // Estimate is between current source and last source.
   YV12_BUFFER_CONFIG *last_source = cpi->Last_Source;
 #if CONFIG_VP9_TEMPORAL_DENOISING
-  if (cpi->oxcf.noise_sensitivity > 0 && denoise_svc(cpi))
+  if (cpi->oxcf.noise_sensitivity > 0 && denoise_svc(cpi)) {
     last_source = &cpi->denoiser.last_source;
-#endif
-  // Tune these thresholds for different resolutions.
-  if (cm->width > 640 && cm->width < 1920) {
-    thresh_consec_zeromv = 5;
-    thresh_sum_diff = 200;
-    thresh_sum_spatial = (120 * 120) << 8;
-    thresh_spatial_var = (48 * 48) << 8;
+    // Tune these thresholds for different resolutions when denoising is
+    // enabled.
+    if (cm->width > 640 && cm->width < 1920) {
+      thresh_consec_zeromv = 5;
+      thresh_sum_diff = 200;
+      thresh_sum_spatial = (120 * 120) << 8;
+      thresh_spatial_var = (48 * 48) << 8;
+    }
   }
+#endif
   ne->enabled = enable_noise_estimation(cpi);
   if (cpi->svc.number_spatial_layers > 1)
     frame_counter = cpi->svc.current_superframe;