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, write to
19 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 # http://www.gnu.org/copyleft/gpl.html
24 PARAM yuvmat[4] = { program.local[0..3] };
25 #stepx, stepy, width, height
26 PARAM dims[1] = { program.local[4] };
29 MAD pos.x , dims[0].x, -0.25, fragment.texcoord[0].x;
30 MOV pos.y , fragment.texcoord[0].y;
31 MUL f.x , dims[0].z, pos.x;
32 MUL f.y , dims[0].w, pos.y;
37 SUB c1pos.x, 0.5, f.x;
38 SUB c2pos.x, 1.5, f.x;
39 MAD c1pos.x, c1pos.x, dims[0].x, pos.x;
40 MAD c2pos.x, c2pos.x, dims[0].x, pos.x;
46 TEX c1, c1pos, texture[0], 2D;
47 TEX c2, c2pos, texture[0], 2D;
51 MAD cint.y, f.x, 2.0, -1.0;
55 LRP yuv.g, cint.x, c1.a , c1.g;
56 LRP yuv.b, cint.y, c2.g , c1.a;
57 LRP yuv.r, cint.z, yuv.b, yuv.g;
59 LRP yuv.g, f.x , c2.b , c1.b;
60 LRP yuv.b, f.x , c2.r , c1.r;
63 DPH rgb.r, yuv, yuvmat[0];
64 DPH rgb.g, yuv, yuvmat[1];
65 DPH rgb.b, yuv, yuvmat[2];
66 MOV rgb.a, fragment.color.a;
67 MOV result.color, rgb;