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  *dp = Interp1_16(w[5], w[1]);
  26. #define PIXEL00_1U  *dp = Interp1_16(w[5], w[2]);
  27. #define PIXEL00_1L  *dp = Interp1_16(w[5], w[4]);
  28. #define PIXEL00_2   *dp = Interp2_16(w[5], w[4], w[2]);
  29. #define PIXEL00_4   *dp = Interp4_16(w[5], w[4], w[2]);
  30. #define PIXEL00_5   *dp = Interp5_16(w[4], w[2]);
  31. #define PIXEL00_C   *dp   = w[5];
  32.  
  33. #define PIXEL01_1   *(dp+1) = Interp1_16(w[5], w[2]);
  34. #define PIXEL01_3   *(dp+1) = Interp3_16(w[5], w[2]);
  35. #define PIXEL01_6   *(dp+1) = Interp1_16(w[2], w[5]);
  36. #define PIXEL01_C   *(dp+1) = w[5];
  37.  
  38. #define PIXEL02_1M  *(dp+2) = Interp1_16(w[5], w[3]);
  39. #define PIXEL02_1U  *(dp+2) = Interp1_16(w[5], w[2]);
  40. #define PIXEL02_1R  *(dp+2) = Interp1_16(w[5], w[6]);
  41. #define PIXEL02_2   *(dp+2) = Interp2_16(w[5], w[2], w[6]);
  42. #define PIXEL02_4   *(dp+2) = Interp4_16(w[5], w[2], w[6]);
  43. #define PIXEL02_5   *(dp+2) = Interp5_16(w[2], w[6]);
  44. #define PIXEL02_C   *(dp+2) = w[5];
  45.  
  46. #define PIXEL10_1   *(dp+dpL) = Interp1_16(w[5], w[4]);
  47. #define PIXEL10_3   *(dp+dpL) = Interp3_16(w[5], w[4]);
  48. #define PIXEL10_6   *(dp+dpL) = Interp1_16(w[4], w[5]);
  49. #define PIXEL10_C   *(dp+dpL) = w[5];
  50.  
  51. #define PIXEL11     *(dp+dpL+1) = w[5];
  52.  
  53. #define PIXEL12_1   *(dp+dpL+2) = Interp1_16(w[5], w[6]);
  54. #define PIXEL12_3   *(dp+dpL+2) = Interp3_16(w[5], w[6]);
  55. #define PIXEL12_6   *(dp+dpL+2) = Interp1_16(w[6], w[5]);
  56. #define PIXEL12_C   *(dp+dpL+2) = w[5];
  57.  
  58. #define PIXEL20_1M  *(dp+dpL+dpL) = Interp1_16(w[5], w[7]);
  59. #define PIXEL20_1D  *(dp+dpL+dpL) = Interp1_16(w[5], w[8]);
  60. #define PIXEL20_1L  *(dp+dpL+dpL) = Interp1_16(w[5], w[4]);
  61. #define PIXEL20_2   *(dp+dpL+dpL) = Interp2_16(w[5], w[8], w[4]);
  62. #define PIXEL20_4   *(dp+dpL+dpL) = Interp4_16(w[5], w[8], w[4]);
  63. #define PIXEL20_5   *(dp+dpL+dpL) = Interp5_16(w[8], w[4]);
  64. #define PIXEL20_C   *(dp+dpL+dpL) = w[5];
  65.  
  66. #define PIXEL21_1   *(dp+dpL+dpL+1) = Interp1_16(w[5], w[8]);
  67. #define PIXEL21_3   *(dp+dpL+dpL+1) = Interp3_16(w[5], w[8]);
  68. #define PIXEL21_6   *(dp+dpL+dpL+1) = Interp1_16(w[8], w[5]);
  69. #define PIXEL21_C   *(dp+dpL+dpL+1) = w[5];
  70.  
  71. #define PIXEL22_1M  *(dp+dpL+dpL+2) = Interp1_16(w[5], w[9]);
  72. #define PIXEL22_1D  *(dp+dpL+dpL+2) = Interp1_16(w[5], w[8]);
  73. #define PIXEL22_1R  *(dp+dpL+dpL+2) = Interp1_16(w[5], w[6]);
  74. #define PIXEL22_2   *(dp+dpL+dpL+2) = Interp2_16(w[5], w[6], w[8]);
  75. #define PIXEL22_4   *(dp+dpL+dpL+2) = Interp4_16(w[5], w[6], w[8]);
  76. #define PIXEL22_5   *(dp+dpL+dpL+2) = Interp5_16(w[6], w[8]);
  77. #define PIXEL22_C   *(dp+dpL+dpL+2) = w[5];
  78.  
  79. #define HQ3X_BITS 16
  80. #define HQ3X_BYTES 2
  81. #define HQ3X_TYPE uint16_t
  82. #define HQ3X_CPY(to, from) (to) = (from)
  83.  
  84. #define HQ3X_FUNC hq3x_16
  85. #define HQ3X_RB_FUNC hq3x_16_rb
  86.  
  87. #define RGB_TO_YUV_FUNC rgb16_to_yuv
  88. #define DIFF_FUNC Diff16
  89.  
  90. #include "hq3x-int.h"
  91.