/system/shaders/yuv2rgb_basic_2d_YUY2.arb

http://github.com/xbmc/xbmc · Unknown · 68 lines · 59 code · 9 blank · 0 comment · 0 complexity · fd989b3806d8a7941b95bdc15404ff96 MD5 · raw file

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