VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/shaders/cconvYV12.c@ 22640

Last change on this file since 22640 was 22640, checked in by vboxsync, 16 years ago

OSE fix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 923 bytes
Line 
1#extension GL_ARB_texture_rectangle : enable
2
3uniform sampler2DRect uSrcTex;
4uniform sampler2DRect uVTex;
5uniform sampler2DRect uUTex;
6
7float splitBGRA(vec4 color, float coord);
8void cconvApplyAYUV(vec4 color);
9/* texture internalFormat: GL_LUMINANCE
10 * size: width X height
11 * data format: GL_LUMINANCE
12 *
13/* YV12-rgb888 conversion shader */
14void cconvYV12(vec2 srcCoord)
15{
16 vec4 clrY = texture2DRect(uSrcTex, srcCoord);
17 vec4 clrV = texture2DRect(uVTex, vec2(gl_TexCoord[2]));
18 vec4 clrU = texture2DRect(uUTex, vec2(gl_TexCoord[3]));
19 float y = splitBGRA(clrY, srcCoord.x);
20 float v = splitBGRA(clrV, gl_TexCoord[2].x);
21 float u = splitBGRA(clrU, gl_TexCoord[3].x);
22
23 /* convert it to AYUV (for the GL_BGRA_EXT texture this is mapped as follows:
24 * A -> B
25 * Y -> G
26 * U -> R
27 * V -> A */
28 cconvApplyAYUV(vec4(u, y, 0.0, v));
29// gl_FragColor = vec4(clrY.r,clrY.r,clrY.r,1.0);
30}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette