 
 	clr.xyz = map(clr.xyz);
 
+#ifdef USE_YCOCG
+	clr.xyz = RGB2YCoCg(clr.xyz);
+#endif
+
 	return clr;
 }
 


#if 1
		vec3 color_diff = abs(neighbor.xyz - center_color.xyz);
		vec3 ycc = RGB2YCoCg(color_diff.xyz);		// SƂ̍YCbCrŌ
		float cbcr_len = length(color_diff.yz);

		// F傫قȂ鎞A臒lɎ܂͈͂ɐF␳č
		if (cbcr_threshhold < cbcr_len) {
			ycc = (cbcr_threshhold / cbcr_len) * ycc;
			neighbor.rgb = center_color.rgb + YCoCg2RGB(ycc);
		}
#else
		float lum0 = RGB2YCbCr(center_color.xyz).x;
		float lum1 = RGB2YCbCr(neighbor.xyz).x;

		float unbiased_diff = abs(lum0 - lum1) / max(lum0, max(lum1, 0.2));
		float unbiased_weight = 1.0 - unbiased_diff;


	neighbor_sum /= 5.0;

#ifdef USE_YCOCG
	neighbor_sum.xyz = YCoCg2RGB(neighbor_sum.xyz);
#endif

	neighbor_sum.xyz = unmap(neighbor_sum.xyz);

	oBuffer = neighbor_sum;
