- Timestamp:
- Nov 6, 2009 3:05:33 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/shaders/cconvYV12.c
r23564 r24448 3 3 uniform sampler2DRect uVTex; 4 4 uniform sampler2DRect uUTex; 5 float vboxSplitBGRA(vec4 color, float coord);6 5 void vboxCConvApplyAYUV(vec4 color); 7 6 void vboxCConv() … … 9 8 vec2 clrCoordY = vec2(gl_TexCoord[0]); 10 9 vec2 clrCoordV = vec2(gl_TexCoord[1]); 11 int ix = int(clrCoordY.x); 12 vec2 coordY = vec2(float(ix), clrCoordY.y); 13 ix = int(clrCoordV.x); 14 vec2 coordV = vec2(float(ix), clrCoordV.y); 15 vec4 clrY = texture2DRect(uSrcTex, vec2(coordY)); 16 vec4 clrV = texture2DRect(uVTex, vec2(coordV)); 17 vec4 clrU = texture2DRect(uUTex, vec2(coordV)); 18 float y = vboxSplitBGRA(clrY, clrCoordY.x); 19 float v = vboxSplitBGRA(clrV, clrCoordV.x); 20 float u = vboxSplitBGRA(clrU, clrCoordV.x); 10 int ixY = int(clrCoordY.x); 11 vec2 coordY = vec2(float(ixY), clrCoordY.y); 12 int ixV = int(clrCoordV.x); 13 vec2 coordV = vec2(float(ixV), clrCoordV.y); 14 vec4 clrY = texture2DRect(uSrcTex, coordY); 15 vec4 clrV = texture2DRect(uVTex, coordV); 16 vec4 clrU = texture2DRect(uUTex, coordV); 17 float partY = clrCoordY.x - float(ixY); 18 float partVU = clrCoordV.x - float(ixV); 19 float y; 20 float v; 21 float u; 22 if(partY < 0.25) 23 { 24 y = clrY.b; 25 } 26 else if(partY < 0.5) 27 { 28 y = clrY.g; 29 } 30 else if(partY < 0.75) 31 { 32 y = clrY.r; 33 } 34 else 35 { 36 y = clrY.a; 37 } 38 39 if(partVU < 0.25) 40 { 41 v = clrV.b; 42 u = clrU.b; 43 } 44 else if(partVU < 0.5) 45 { 46 v = clrV.g; 47 u = clrU.g; 48 } 49 else if(partVU < 0.75) 50 { 51 v = clrV.r; 52 u = clrU.r; 53 } 54 else 55 { 56 v = clrV.a; 57 u = clrU.a; 58 } 21 59 vboxCConvApplyAYUV(vec4(u, y, 0.0, v)); 22 60 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r24431 r24448 977 977 else if(fourcc == FOURCC_YV12) 978 978 { 979 apShaders[cShaders++] = &mShaderSplitBGRA;979 // apShaders[cShaders++] = &mShaderSplitBGRA; 980 980 apShaders[cShaders++] = &mShaderCConvYV12; 981 981 bFound = true;
Note:
See TracChangeset
for help on using the changeset viewer.