Merge pull request #4735 from cg110/fix_web_server_mem_leak
[vuplus_xbmc] / system / shaders / yuv2rgb_basic_rect_UYVY.arb
1 !!ARBfp1.0
2
3 #
4 #      Copyright (C) 2010-2013 Team XBMC
5 #      http://xbmc.org
6 #
7 #  This Program is free software; you can redistribute it and/or modify
8 #  it under the terms of the GNU General Public License as published by
9 #  the Free Software Foundation; either version 2, or (at your option)
10 #  any later version.
11 #
12 #  This Program is distributed in the hope that it will be useful,
13 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 #  GNU General Public License for more details.
16 #
17 #  You should have received a copy of the GNU General Public License
18 #  along with XBMC; see the file COPYING.  If not, see
19 #  <http://www.gnu.org/licenses/>.
20 #
21 #
22
23 PARAM yuvmat[4] = { program.local[0..3] };
24 TEMP  f;
25 TEMP  pos;
26 ADD   pos.x  , fragment.texcoord[0].x, -0.25;
27 MOV   pos.y  , fragment.texcoord[0].y;
28 FRC   f      , pos;
29
30 TEMP  c1pos;
31 TEMP  c2pos;
32 SUB   c1pos.x, 0.5, f.x;
33 SUB   c2pos.x, 1.5, f.x;
34 ADD   c1pos.x, c1pos.x, pos.x;
35 ADD   c2pos.x, c2pos.x, pos.x;
36 MOV   c1pos.y, pos.y;
37 MOV   c2pos.y, pos.y;
38
39 TEMP  c1;
40 TEMP  c2;
41 TEX   c1, c1pos, texture[0], RECT;
42 TEX   c2, c2pos, texture[0], RECT;
43
44 TEMP  cint;
45 MUL   cint.x, f.x, 2.0;
46 MAD   cint.y, f.x, 2.0, -1.0;
47 SGE   cint.z, f.x, 0.5;
48
49 TEMP  yuv;
50 LRP   yuv.g, cint.x, c1.a , c1.g;
51 LRP   yuv.b, cint.y, c2.g , c1.a;
52 LRP   yuv.r, cint.z, yuv.b, yuv.g;
53
54 LRP   yuv.g, f.x   , c2.b , c1.b;
55 LRP   yuv.b, f.x   , c2.r , c1.r;
56
57 TEMP  rgb;
58 DPH   rgb.r, yuv, yuvmat[0];
59 DPH   rgb.g, yuv, yuvmat[1];
60 DPH   rgb.b, yuv, yuvmat[2];
61 MOV   rgb.a, fragment.color.a;
62 MOV   result.color, rgb;
63
64 END