 
 		auto clr1 = sampleColor(prevAovs, width, height, make_int2(px, py));
 
-		clr1 = clipColor(clr1, ix, iy, width, height, curAovs);
-
+		clr1 = clipColor(clr0, clr1, ix, iy, width, height, curAovs);
+
+#ifdef ENABLE_YCOCG
+		float lum0 = clr0.x;
+		float lum1 = clr1.x;
+#else
 		float lum0 = AT_NAME::color::luminance(clr0.x, clr0.y, clr0.z);
 		float lum1 = AT_NAME::color::luminance(clr1.x, clr1.y, clr1.z);
+#endif
 
 		float unbiased_diff = abs(lum0 - lum1) / max(lum0, max(lum1, 0.2f));
 		float unbiased_weight = 1.0 - unbiased_diff;

	int2 p,
	float2 jitter)
{
	auto pclr = sampleColor(aovs, width, height, p);
	auto jclr = sampleColor(aovs, width, height, make_int2(p.x - 1, p.y - 1));

	auto f = sqrtf(dot(jitter, jitter));

	auto ret = lerp(jclr, pclr, f);

	return ret;
}


	auto r2 = sampler->nextSample();
	float2 jitter = make_float2(r1, r2);

	auto tmp = sampleColorRGB(curAovs, width, height, p);

	auto clr0 = sampleColor(curAovs, width, height, p, jitter);

