 
 #if 1
 		vec3 color_diff = abs(neighbor.xyz - center_color.xyz);
-		vec3 ycc = RGB2YCoCg(color_diff.xyz);		// SƂ̍YCbCrŌ
+
+#ifdef USE_YCOCG
+		vec3 ycc = color_diff.xyz;
+#else
+		vec3 ycc = RGB2YCbCr(color_diff.xyz);		// SƂ̍YCbCrŌ
+#endif
+		
 		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);
+#ifdef USE_YCOCG
+			neighbor.rgb = center_color.rgb + ycc;
+#else
+			neighbor.rgb = center_color.rgb + YCbCr2RGB(ycc);
+#endif
+			
 		}
+#else
+#ifdef USE_YCOCG
+		float lum0 = center_color.x;
+		float lum1 = neighbor.x;
 #else
 		float lum0 = RGB2YCbCr(center_color.xyz).x;
 		float lum1 = RGB2YCbCr(neighbor.xyz).x;
+#endif
 
 		float unbiased_diff = abs(lum0 - lum1) / max(lum0, max(lum1, 0.2));
 		float unbiased_weight = 1.0 - unbiased_diff;


	neighbor_sum /= 5.0;

	neighbor_sum.xyz = unmap(neighbor_sum.xyz);

	oBuffer = neighbor_sum;


	clr.xyz = map(clr.xyz);

#ifdef USE_YCOCG
	clr.xyz = RGB2YCoCg(clr.xyz);
#endif

	return clr;
}

