[Bf-blender-cvs] [96769f3b199] master: Cycles Denoising: Skip confidence interval test for outlier central pixels

Lukas Stockner noreply at git.blender.org
Sun May 21 05:44:15 CEST 2017


Commit: 96769f3b199f52ada7e4f7cd1f53d4e4a8f906ef
Author: Lukas Stockner
Date:   Sun May 21 05:26:13 2017 +0200
Branches: master
https://developer.blender.org/rB96769f3b199f52ada7e4f7cd1f53d4e4a8f906ef

Cycles Denoising: Skip confidence interval test for outlier central pixels

If the central pixel is an outlier, the denoiser is supposed to predict its
value from the surrounding pixels. However, in some cases the confidence
interval test would reject every single surrounding pixel, which leaves the
model fitting with no data to work with.

===================================================================

M	intern/cycles/kernel/filter/filter_reconstruction.h

===================================================================

diff --git a/intern/cycles/kernel/filter/filter_reconstruction.h b/intern/cycles/kernel/filter/filter_reconstruction.h
index dc90f318570..4a4c81b7ba3 100644
--- a/intern/cycles/kernel/filter/filter_reconstruction.h
+++ b/intern/cycles/kernel/filter/filter_reconstruction.h
@@ -55,9 +55,14 @@ ccl_device_inline void kernel_filter_construct_gramian(int x, int y,
 	float q_std_dev = sqrtf(filter_get_pixel_variance(variance_pass + q_offset, pass_stride));
 
 	/* If the pixel was flagged as an outlier during prefiltering, skip it.
-	 * Otherwise, perform the regular confidence interval test. */
-	if(ccl_get_feature(buffer + q_offset, 0) < 0.0f ||
-	   average(fabs(p_color - q_color)) > 2.0f*(p_std_dev + q_std_dev + 1e-3f)) {
+	 * Otherwise, perform the regular confidence interval test unless
+	 * the center pixel is an outlier (in that case, using the confidence
+	 * interval test could result in no pixels being used at all). */
+	bool p_outlier = (ccl_get_feature(buffer + p_offset, 0) < 0.0f);
+	bool q_outlier = (ccl_get_feature(buffer + q_offset, 0) < 0.0f);
+	bool outside_of_interval = (average(fabs(p_color - q_color)) > 2.0f*(p_std_dev + q_std_dev + 1e-3f));
+
+	if(q_outlier || (!p_outlier && outside_of_interval)) {
 		return;
 	}




More information about the Bf-blender-cvs mailing list