uniform sampler2D tex;
void main(void)
{
float nx, ny, r, g, b, y, u, v;
float u1,u2,v1,v2;
nx = gl_TexCoord[0].x;
ny = gl_TexCoord[0].y;
y = texture2D(tex, vec2( (nx), (ny)*(4.0/6.0) )).r;
u1 = texture2D(tex, vec2( (nx/2.0), (ny+4.0)/6.0 )).r;
u2 = texture2D(tex, vec2( (nx/2.0)+0.5, (ny+4.0)/6.0 )).r;
v1 = texture2D(tex, vec2( (nx/2.0), (ny+5.0)/6.0 )).r;
v2 = texture2D(tex, vec2( (nx/2.0)+0.5, (ny+5.0)/6.0 )).r;
y = 1.1643 * (y - 0.0625);
u = (u1+u2)/2.0 - 0.5;
v = (v1+v2)/2.0 - 0.5;
r = y + 1.5958 * v;
g = y - 0.39173 * u - 0.8129 * v;
b = y + 2.017 * u;
gl_FragColor=vec4(b,g,r,1.0);
}