4 # Copyright (C) 2010-2013 Team XBMC
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)
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.
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/>.
23 PARAM yuvmat[4] = { program.local[0..3] };
24 #stepx, stepy, width, height
25 PARAM dims[1] = { program.local[4] };
28 MAD pos.x , dims[0].x, -0.25, fragment.texcoord[0].x;
29 MOV pos.y , fragment.texcoord[0].y;
30 MUL f.x , dims[0].z, pos.x;
31 MUL f.y , dims[0].w, pos.y;
36 SUB c1pos.x, 0.5, f.x;
37 SUB c2pos.x, 1.5, f.x;
38 MAD c1pos.x, c1pos.x, dims[0].x, pos.x;
39 MAD c2pos.x, c2pos.x, dims[0].x, pos.x;
45 TEX c1, c1pos, texture[0], 2D;
46 TEX c2, c2pos, texture[0], 2D;
50 MAD cint.y, f.x, 2.0, -1.0;
54 LRP yuv.g, cint.x, c1.a , c1.g;
55 LRP yuv.b, cint.y, c2.g , c1.a;
56 LRP yuv.r, cint.z, yuv.b, yuv.g;
58 LRP yuv.g, f.x , c2.b , c1.b;
59 LRP yuv.b, f.x , c2.r , c1.r;
62 DPH rgb.r, yuv, yuvmat[0];
63 DPH rgb.g, yuv, yuvmat[1];
64 DPH rgb.b, yuv, yuvmat[2];
65 MOV rgb.a, fragment.color.a;
66 MOV result.color, rgb;