From c472342ed98584951e4d6ec1d23f583a3c705892 Mon Sep 17 00:00:00 2001
From: pommicket <pommicket@gmail.com>
Date: Wed, 19 Feb 2025 19:58:11 -0500
Subject: cleanup1

---
 main.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

(limited to 'main.c')

diff --git a/main.c b/main.c
index 95abb3b..6c87cbe 100644
--- a/main.c
+++ b/main.c
@@ -415,14 +415,11 @@ void main() {\n\
 			y1 = mix(t01.z, t11.x, tcfrac.x * 2.0 - 1.0);\n\
 		}\n\
 		float y = mix(y0, y1, tcfrac.y);\n\
-		//y = t00.x;\n\
-		//cbcr = t00.yw;\n\
-		y -= 16.0 / 255.0;\n\
-		float cb = cbcr.x - 128.0 / 255.0;\n\
-		float cr = cbcr.y - 128.0 / 255.0;\n\
-		color = vec3(y+255.0/224.0*1.402*cr,\n\
-			255.0/219.0*y-255.0/224.0*1.772*0.11/0.587*cb-255.0/224.0*1.402*0.299/0.587*cr,\n\
-			255.0/219.0*y+255.0/224.0*1.772*cb);\n\
+		float cb = cbcr.x;\n\
+		float cr = cbcr.y;\n\
+		color = vec3((y-0.0627)+255.0/224.0*1.402*(cr-0.502),\n\
+			255.0/219.0*(y-0.0627)-255.0/224.0*1.772*0.11/0.587*(cb-0.502)-255.0/224.0*1.402*0.299/0.587*(cr-0.502),\n\
+			255.0/219.0*(y-0.0627)+255.0/224.0*1.772*(cb-0.502));\n\
 		//color = vec3(y);\n\
 		color = clamp(color, 0.0, 1.0);\n\
 		} break;\n\
-- 
cgit v1.2.3