1 uniform sampler2D PREFIX(tex_y);
2 uniform sampler2D PREFIX(tex_cbcr);
4 vec4 FUNCNAME(vec2 tc) {
5 // OpenGL's origin is bottom-left, but most graphics software assumes
6 // a top-left origin. Thus, for inputs that come from the user,
7 // we flip the y coordinate.
11 ycbcr.x = tex2D(PREFIX(tex_y), tc).y;
12 #if CB_CR_OFFSETS_EQUAL
14 tc_cbcr.x += PREFIX(cb_offset_x);
15 ycbcr.yz = tex2D(PREFIX(tex_cbcr), tc_cbcr).xz;
18 tc_cb.x += PREFIX(cb_offset_x);
19 ycbcr.y = tex2D(PREFIX(tex_cbcr), tc_cb).x;
22 tc_cr.x += PREFIX(cr_offset_x);
23 ycbcr.z = tex2D(PREFIX(tex_cbcr), tc_cr).z;
26 ycbcr -= PREFIX(offset);
29 rgba.rgb = PREFIX(inv_ycbcr_matrix) * ycbcr;