Cross Reference: cconvYV12.c
xref
: /
vbox
/
src
/
VBox
/
Frontends
/
VirtualBox
/
shaders
/
cconvYV12.c
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
cconvYV12.c revision 073b23b4ae48ce7c105b28442f47c9a0c7a1110f
6035a3d1ce01a78c316578f23393c0b7edca0548
vboxsync
#
extension
GL_ARB_texture_rectangle
:
enable
6035a3d1ce01a78c316578f23393c0b7edca0548
vboxsync
uniform
sampler2DRect
uSrcTex
;
6035a3d1ce01a78c316578f23393c0b7edca0548
vboxsync
uniform
sampler2DRect
uVTex
;
6035a3d1ce01a78c316578f23393c0b7edca0548
vboxsync
uniform
sampler2DRect
uUTex
;
64082f4699f276693cf5b1ec5886ac12234af115
vboxsync
float
vboxSplitBGRA
(
vec4
color
,
float
coord
);
64082f4699f276693cf5b1ec5886ac12234af115
vboxsync
void
vboxCConvApplyAYUV
(
vec4
color
);
9fc488be77be11a4dcb83feb09cdee11bb160746
vboxsync
void
vboxCConv
()
6035a3d1ce01a78c316578f23393c0b7edca0548
vboxsync
{
073b23b4ae48ce7c105b28442f47c9a0c7a1110f
vboxsync
vec2
clrCoordY
=
vec2
(
gl_TexCoord
[0]);
073b23b4ae48ce7c105b28442f47c9a0c7a1110f
vboxsync
vec2
clrCoordV
=
vec2
(
gl_TexCoord
[
1
]);
073b23b4ae48ce7c105b28442f47c9a0c7a1110f
vboxsync
int
ix
=
int
(
clrCoordY
.x);
073b23b4ae48ce7c105b28442f47c9a0c7a1110f
vboxsync
vec2
coordY
=
vec2
(
float
(
ix
),
clrCoordY
.y);
073b23b4ae48ce7c105b28442f47c9a0c7a1110f
vboxsync
ix
=
int
(
clrCoordV
.x);
073b23b4ae48ce7c105b28442f47c9a0c7a1110f
vboxsync
vec2
coordV
=
vec2
(
float
(
ix
),
clrCoordV
.y);
64082f4699f276693cf5b1ec5886ac12234af115
vboxsync
vec4
clrY
=
texture2DRect
(
uSrcTex
,
vec2
(
coordY
));
64082f4699f276693cf5b1ec5886ac12234af115
vboxsync
vec4
clrV
=
texture2DRect
(
uVTex
,
vec2
(
coordV
));
9fc488be77be11a4dcb83feb09cdee11bb160746
vboxsync
vec4
clrU
=
texture2DRect
(
uUTex
,
vec2
(
coordV
));
073b23b4ae48ce7c105b28442f47c9a0c7a1110f
vboxsync
float
y =
vboxSplitBGRA
(
clrY
,
clrCoordY
.x);
073b23b4ae48ce7c105b28442f47c9a0c7a1110f
vboxsync
float
v =
vboxSplitBGRA
(
clrV
,
clrCoordV
.x);
073b23b4ae48ce7c105b28442f47c9a0c7a1110f
vboxsync
float
u =
vboxSplitBGRA
(
clrU
,
clrCoordV
.x);
64082f4699f276693cf5b1ec5886ac12234af115
vboxsync
vboxCConvApplyAYUV
(
vec4
(u, y,
0.0
, v));
6035a3d1ce01a78c316578f23393c0b7edca0548
vboxsync
}