 // output colour for the fragment
 layout(location = 0) out highp vec4 oBuffer;
 layout(location = 1) out highp vec4 oScreen;
+
+#define USE_YCOCG
 
 vec3 RGB2YCbCr(vec3 rgb)
 {


#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;
