Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright (C) 2003 Maxim Stepin ( maxst@hiend3d.com )
  3.  *
  4.  * Copyright (C) 2010 Cameron Zemek ( grom@zeminvaders.net)
  5.  *
  6.  * This program is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Lesser General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2.1 of the License, or (at your option) 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 GNU
  14.  * Lesser General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Lesser General Public
  17.  * License along with this program; if not, write to the Free Software
  18.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19.  */
  20.  
  21. #include <stdint.h>
  22. #include "hqx.h"
  23. #include "common.h"
  24.  
  25. #define PIXEL00_1M  Interp1_24(dp, w[5], w[1]);
  26. #define PIXEL00_1U  Interp1_24(dp, w[5], w[2]);
  27. #define PIXEL00_1L  Interp1_24(dp, w[5], w[4]);
  28. #define PIXEL00_2   Interp2_24(dp, w[5], w[4], w[2]);
  29. #define PIXEL00_4   Interp4_24(dp, w[5], w[4], w[2]);
  30. #define PIXEL00_5   Interp5_24(dp, w[4], w[2]);
  31. #define PIXEL00_C   u24cpy(dp, w[5]);
  32.  
  33. #define PIXEL01_1   Interp1_24((dp+1), w[5], w[2]);
  34. #define PIXEL01_3   Interp3_24((dp+1), w[5], w[2]);
  35. #define PIXEL01_6   Interp1_24((dp+1), w[2], w[5]);
  36. #define PIXEL01_C   u24cpy((dp+1), w[5]);
  37.  
  38. #define PIXEL02_1M  Interp1_24((dp+2), w[5], w[3]);
  39. #define PIXEL02_1U  Interp1_24((dp+2), w[5], w[2]);
  40. #define PIXEL02_1R  Interp1_24((dp+2), w[5], w[6]);
  41. #define PIXEL02_2   Interp2_24((dp+2), w[5], w[2], w[6]);
  42. #define PIXEL02_4   Interp4_24((dp+2), w[5], w[2], w[6]);
  43. #define PIXEL02_5   Interp5_24((dp+2), w[2], w[6]);
  44. #define PIXEL02_C   u24cpy((dp+2), w[5]);
  45.  
  46. #define PIXEL10_1   Interp1_24((dp+dpL), w[5], w[4]);
  47. #define PIXEL10_3   Interp3_24((dp+dpL), w[5], w[4]);
  48. #define PIXEL10_6   Interp1_24((dp+dpL), w[4], w[5]);
  49. #define PIXEL10_C   u24cpy((dp+dpL), w[5]);
  50.  
  51. #define PIXEL11     u24cpy((dp+dpL+1), w[5]);
  52.  
  53. #define PIXEL12_1   Interp1_24((dp+dpL+2), w[5], w[6]);
  54. #define PIXEL12_3   Interp3_24((dp+dpL+2), w[5], w[6]);
  55. #define PIXEL12_6   Interp1_24((dp+dpL+2), w[6], w[5]);
  56. #define PIXEL12_C   u24cpy((dp+dpL+2), w[5]);
  57.  
  58. #define PIXEL20_1M  Interp1_24((dp+dpL+dpL), w[5], w[7]);
  59. #define PIXEL20_1D  Interp1_24((dp+dpL+dpL), w[5], w[8]);
  60. #define PIXEL20_1L  Interp1_24((dp+dpL+dpL), w[5], w[4]);
  61. #define PIXEL20_2   Interp2_24((dp+dpL+dpL), w[5], w[8], w[4]);
  62. #define PIXEL20_4   Interp4_24((dp+dpL+dpL), w[5], w[8], w[4]);
  63. #define PIXEL20_5   Interp5_24((dp+dpL+dpL), w[8], w[4]);
  64. #define PIXEL20_C   u24cpy((dp+dpL+dpL), w[5]);
  65.  
  66. #define PIXEL21_1   Interp1_24((dp+dpL+dpL+1), w[5], w[8]);
  67. #define PIXEL21_3   Interp3_24((dp+dpL+dpL+1), w[5], w[8]);
  68. #define PIXEL21_6   Interp1_24((dp+dpL+dpL+1), w[8], w[5]);
  69. #define PIXEL21_C   u24cpy((dp+dpL+dpL+1), w[5]);
  70.  
  71. #define PIXEL22_1M  Interp1_24((dp+dpL+dpL+2), w[5], w[9]);
  72. #define PIXEL22_1D  Interp1_24((dp+dpL+dpL+2), w[5], w[8]);
  73. #define PIXEL22_1R  Interp1_24((dp+dpL+dpL+2), w[5], w[6]);
  74. #define PIXEL22_2   Interp2_24((dp+dpL+dpL+2), w[5], w[6], w[8]);
  75. #define PIXEL22_4   Interp4_24((dp+dpL+dpL+2), w[5], w[6], w[8]);
  76. #define PIXEL22_5   Interp5_24((dp+dpL+dpL+2), w[6], w[8]);
  77. #define PIXEL22_C   u24cpy((dp+dpL+dpL+2), w[5]);
  78.  
  79. #define HQ3X_BITS 24
  80. #define HQ3X_BYTES 3
  81. #define HQ3X_TYPE uint24_t
  82. #define HQ3X_CPY(to, from) u24cpy(&(to), (from))
  83.  
  84. #define HQ3X_FUNC hq3x_24
  85. #define HQ3X_RB_FUNC hq3x_24_rb
  86.  
  87. #define RGB_TO_YUV_FUNC rgb24_to_yuv
  88. #define DIFF_FUNC Diff24
  89.  
  90. #include "hq3x-int.h"
  91.