jdk/src/share/native/sun/awt/medialib/mlib_c_ImageAffineIndex_BC.c
author lana
Thu, 26 Dec 2013 12:04:16 -0800
changeset 23010 6dadb192ad81
parent 5506 202f599c92aa
permissions -rw-r--r--
8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013 Summary: updated files with 2011, 2012 and 2013 years according to the file's last updated date Reviewed-by: tbell, lancea, chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#include "mlib_image.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#include "mlib_ImageAffine.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "mlib_ImageColormap.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#define MLIB_LIMIT  512
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#define MLIB_SHIFT   16
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#define MLIB_PREC    (1 << MLIB_SHIFT)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#define MLIB_MASK    (MLIB_PREC - 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#define DTYPE  MLIB_TYPE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
#define DECLAREVAR_IND()                                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
  DECLAREVAR0();                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
  mlib_s32  *warp_tbl   = param -> warp_tbl;                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
  mlib_s32  xSrc, ySrc;                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
  mlib_s32  srcYStride = param -> srcYStride;                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
  mlib_s32  max_xsize  = param -> max_xsize;                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
  mlib_filter filter = param -> filter;                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
  MLIB_TYPE *sp, *dl;                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
  mlib_d64  xf0, xf1, xf2, xf3;                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
  mlib_d64  yf0, yf1, yf2, yf3;                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
  mlib_d64  c0, c1, c2, c3, val0;                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
  mlib_s32  filterpos;                                          \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
  mlib_f32  *fptr;                                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
  mlib_d64  s0, s1, s2, s3;                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
  mlib_s32  i, size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
#define GET_FILTERS_KOEF()                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
  filterpos = (X >> FILTER_SHIFT) & FILTER_MASK;                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
  fptr = (mlib_f32 *) ((mlib_u8 *)mlib_filters_table + filterpos); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
                                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
  xf0 = fptr[0];                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
  xf1 = fptr[1];                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
  xf2 = fptr[2];                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
  xf3 = fptr[3];                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
                                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
  filterpos = (Y >> FILTER_SHIFT) & FILTER_MASK;                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
  fptr = (mlib_f32 *) ((mlib_u8 *)mlib_filters_table + filterpos); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
                                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
  yf0 = fptr[0];                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
  yf1 = fptr[1];                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
  yf2 = fptr[2];                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
  yf3 = fptr[3]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
#define GET_POINTER()                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
  xSrc = (X >> MLIB_SHIFT)-1;                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
  ySrc = (Y >> MLIB_SHIFT)-1;                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
  sp = ((MLIB_TYPE **)lineAddr)[ySrc] + xSrc
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
#define LOAD_FIRST_ROW(nchan, chan)                             \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
  s0 = *(lut + sp[0]*nchan + chan);                             \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
  s1 = *(lut + sp[1]*nchan + chan);                             \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
  s2 = *(lut + sp[2]*nchan + chan);                             \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
  s3 = *(lut + sp[3]*nchan + chan)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
#define COUNT_NEXT_ROW(dst, nchan, chan)                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
  sp = (MLIB_TYPE*)((mlib_addr)sp + srcYStride);                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
  dst = ((*(lut + sp[0]*nchan + chan))*xf0 +                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
         (*(lut + sp[1]*nchan + chan))*xf1 +                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
         (*(lut + sp[2]*nchan + chan))*xf2 +                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
         (*(lut + sp[3]*nchan + chan))*xf3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
#ifdef MLIB_USE_FTOI_CLAMPING
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
/***********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
#define STORE_SAT_VALUE_U8(ind)                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
  dp[ind] = ((mlib_s32)(val0 - (mlib_d64)0x7F800000) >> 24) ^ 0x80
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
/***********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
#define STORE_SAT_VALUE_S16(ind)                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
  dp[ind] = ((mlib_s32)(val0)) >> 16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
/***********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
#define STORE_SAT_VALUE_U8(ind)                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
  val0 -= (mlib_d64)0x7F800000;                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
  if (val0 >= MLIB_S32_MAX)                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    dp[ind] = MLIB_U8_MAX;                                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
  else if (val0 <= MLIB_S32_MIN)                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    dp[ind] = MLIB_U8_MIN;                                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
  else                                                          \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    dp[ind] = ((mlib_s32)val0 >> 24) ^ 0x80
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
/***********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
#define STORE_SAT_VALUE_S16(ind)                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
  if (val0 >= MLIB_S32_MAX)                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    dp[ind] = MLIB_S16_MAX;                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
  else if (val0 <= MLIB_S32_MIN)                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    dp[ind] = MLIB_S16_MIN;                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
  else                                                          \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    dp[ind] = (mlib_s32)val0 >> 16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#endif /* MLIB_USE_FTOI_CLAMPING */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
#define MAKE_BC_3CH(lut_format)                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
  X += dX;                                                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
  Y += dY;                                                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
  COUNT_NEXT_ROW(c1, 3, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
  COUNT_NEXT_ROW(c2, 3, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
  COUNT_NEXT_ROW(c3, 3, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
  sp = (MLIB_TYPE*)((mlib_addr)sp - 3*srcYStride);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
  LOAD_FIRST_ROW(3, 1);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
  STORE_SAT_VALUE_##lut_format(0);                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
  COUNT_NEXT_ROW(c1, 3, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
  COUNT_NEXT_ROW(c2, 3, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
  COUNT_NEXT_ROW(c3, 3, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
  sp = (MLIB_TYPE*)((mlib_addr)sp - 3*srcYStride);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
  LOAD_FIRST_ROW(3, 2);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
  STORE_SAT_VALUE_##lut_format(1);                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
  COUNT_NEXT_ROW(c1, 3, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
  COUNT_NEXT_ROW(c2, 3, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
  COUNT_NEXT_ROW(c3, 3, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
  GET_FILTERS_KOEF();                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
  GET_POINTER();                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
  LOAD_FIRST_ROW(3, 0);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
  STORE_SAT_VALUE_##lut_format(2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
#define MAKE_LAST_PIXEL_BC_3CH(lut_format)                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
  COUNT_NEXT_ROW(c1, 3, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
  COUNT_NEXT_ROW(c2, 3, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
  COUNT_NEXT_ROW(c3, 3, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
  sp = (MLIB_TYPE*)((mlib_addr)sp - 3*srcYStride);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
  LOAD_FIRST_ROW(3, 1);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
  STORE_SAT_VALUE_##lut_format(0);                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
  COUNT_NEXT_ROW(c1, 3, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
  COUNT_NEXT_ROW(c2, 3, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
  COUNT_NEXT_ROW(c3, 3, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
  sp = (MLIB_TYPE*)((mlib_addr)sp - 3*srcYStride);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
  LOAD_FIRST_ROW(3, 2);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
  STORE_SAT_VALUE_##lut_format(1);                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
  COUNT_NEXT_ROW(c1, 3, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
  COUNT_NEXT_ROW(c2, 3, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
  COUNT_NEXT_ROW(c3, 3, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
  STORE_SAT_VALUE_##lut_format(2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
#define MAKE_BC_4CH(lut_format)                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
  X += dX;                                                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
  Y += dY;                                                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
  COUNT_NEXT_ROW(c1, 4, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
  COUNT_NEXT_ROW(c2, 4, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
  COUNT_NEXT_ROW(c3, 4, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
  sp = (MLIB_TYPE*)((mlib_addr)sp - 3*srcYStride);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
  LOAD_FIRST_ROW(4, 1);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
  STORE_SAT_VALUE_##lut_format(0);                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
  COUNT_NEXT_ROW(c1, 4, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
  COUNT_NEXT_ROW(c2, 4, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
  COUNT_NEXT_ROW(c3, 4, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
  sp = (MLIB_TYPE*)((mlib_addr)sp - 3*srcYStride);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
  LOAD_FIRST_ROW(4, 2);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
  STORE_SAT_VALUE_##lut_format(1);                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
  COUNT_NEXT_ROW(c1, 4, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
  COUNT_NEXT_ROW(c2, 4, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
  COUNT_NEXT_ROW(c3, 4, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
  sp = (MLIB_TYPE*)((mlib_addr)sp - 3*srcYStride);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
  LOAD_FIRST_ROW(4, 3);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
  STORE_SAT_VALUE_##lut_format(2);                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
  COUNT_NEXT_ROW(c1, 4, 3);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
  COUNT_NEXT_ROW(c2, 4, 3);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
  COUNT_NEXT_ROW(c3, 4, 3);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
  GET_FILTERS_KOEF();                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
  GET_POINTER();                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
  LOAD_FIRST_ROW(4, 0);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
  STORE_SAT_VALUE_##lut_format(3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
#define MAKE_LAST_PIXEL_BC_4CH(lut_format)                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
  COUNT_NEXT_ROW(c1, 4, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
  COUNT_NEXT_ROW(c2, 4, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
  COUNT_NEXT_ROW(c3, 4, 0);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
  sp = (MLIB_TYPE*)((mlib_addr)sp - 3*srcYStride);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
  LOAD_FIRST_ROW(4, 1);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
  STORE_SAT_VALUE_##lut_format(0);                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
  COUNT_NEXT_ROW(c1, 4, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
  COUNT_NEXT_ROW(c2, 4, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
  COUNT_NEXT_ROW(c3, 4, 1);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
  sp = (MLIB_TYPE*)((mlib_addr)sp - 3*srcYStride);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
  LOAD_FIRST_ROW(4, 2);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
  STORE_SAT_VALUE_##lut_format(1);                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
  COUNT_NEXT_ROW(c1, 4, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
  COUNT_NEXT_ROW(c2, 4, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
  COUNT_NEXT_ROW(c3, 4, 2);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
  sp = (MLIB_TYPE*)((mlib_addr)sp - 3*srcYStride);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
  LOAD_FIRST_ROW(4, 3);                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
  STORE_SAT_VALUE_##lut_format(2);                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
  c0 = (s0*xf0 + s1*xf1 + s2*xf2 + s3*xf3);                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
  COUNT_NEXT_ROW(c1, 4, 3);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
  COUNT_NEXT_ROW(c2, 4, 3);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
  COUNT_NEXT_ROW(c3, 4, 3);                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
  val0 = (c0*yf0 + c1*yf1 + c2*yf2 + c3*yf3);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
  STORE_SAT_VALUE_##lut_format(3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
#define FILTER_U8  ((filter == MLIB_BICUBIC) ? mlib_filters_u8f_bc  : mlib_filters_u8f_bc2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
#define FILTER_S16 ((filter == MLIB_BICUBIC) ? mlib_filters_s16f_bc : mlib_filters_s16f_bc2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
#define mlib_U8  mlib_u8
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
#define mlib_S16 mlib_s16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
#define FUNC_AFFINEINDEX_BC_0(ITYPE, LTYPE, NCHAN)                                                  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
  mlib_status mlib_ImageAffineIndex_##ITYPE##_##LTYPE##_##NCHAN##CH_BC(mlib_affine_param *param,    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
                                                                       const void        *colormap) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
  {                                                                                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    DECLAREVAR_IND();                                                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    mlib_##LTYPE buff_lcl[NCHAN * MLIB_LIMIT], *pbuff = buff_lcl, *dp;                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    mlib_d64  *lut = ((mlib_d64*)mlib_ImageGetLutDoubleData(colormap) -                             \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
                      NCHAN * mlib_ImageGetLutOffset(colormap));                                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    const mlib_f32 *mlib_filters_table = FILTER_##LTYPE;                                            \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
                                                                                                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    if (max_xsize > MLIB_LIMIT) {                                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
      pbuff = mlib_malloc(NCHAN * sizeof(mlib_##LTYPE) * max_xsize);                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
      if (pbuff == NULL) return MLIB_FAILURE;                                                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    }                                                                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
                                                                                                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    for (j = yStart; j <= yFinish; j++) {                                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
                                                                                                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
      NEW_LINE(1);                                                                                  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
      dp = pbuff;                                                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
                                                                                                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
      GET_FILTERS_KOEF();                                                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
      GET_POINTER();                                                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
      LOAD_FIRST_ROW(NCHAN, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
    /* pragma pipeloop(0) must be here */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
#define FUNC_AFFINEINDEX_BC_1(ITYPE, LTYPE, NCHAN)                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
                                                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
      for (i = 0; i < (xRight - xLeft); i++, dp += NCHAN) {                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
        MAKE_BC_##NCHAN##CH(LTYPE);                                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
      }                                                                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
                                                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
      MAKE_LAST_PIXEL_BC_##NCHAN##CH(LTYPE);                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
                                                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
      mlib_ImageColorTrue2IndexLine_##LTYPE##_##ITYPE##_##NCHAN            \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
                                (pbuff, dl, xRight - xLeft + 1, colormap); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
    }                                                                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
                                                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    if (pbuff != buff_lcl) mlib_free(pbuff);                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
                                                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    return MLIB_SUCCESS;                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
#undef MLIB_TYPE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
#define MLIB_TYPE mlib_u8
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
#undef  FILTER_SHIFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
#define FILTER_SHIFT 4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
#undef  FILTER_MASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
#define FILTER_MASK  (((1 << 8) - 1) << 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
FUNC_AFFINEINDEX_BC_0(U8, U8, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
FUNC_AFFINEINDEX_BC_1(U8, U8, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
#undef  FILTER_SHIFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
#define FILTER_SHIFT 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
#undef  FILTER_MASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
#define FILTER_MASK  (((1 << 9) - 1) << 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
FUNC_AFFINEINDEX_BC_0(U8, S16, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
FUNC_AFFINEINDEX_BC_1(U8, S16, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
#undef  FILTER_SHIFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
#define FILTER_SHIFT 4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
#undef  FILTER_MASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
#define FILTER_MASK  (((1 << 8) - 1) << 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
FUNC_AFFINEINDEX_BC_0(U8, U8, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
FUNC_AFFINEINDEX_BC_1(U8, U8, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
#undef  FILTER_SHIFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
#define FILTER_SHIFT 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
#undef  FILTER_MASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
#define FILTER_MASK  (((1 << 9) - 1) << 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
FUNC_AFFINEINDEX_BC_0(U8, S16, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
FUNC_AFFINEINDEX_BC_1(U8, S16, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
#undef  MLIB_TYPE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
#define MLIB_TYPE mlib_s16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
#undef  FILTER_SHIFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
#define FILTER_SHIFT 4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
#undef  FILTER_MASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
#define FILTER_MASK  (((1 << 8) - 1) << 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
FUNC_AFFINEINDEX_BC_0(S16, U8, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
FUNC_AFFINEINDEX_BC_1(S16, U8, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
#undef  FILTER_SHIFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
#define FILTER_SHIFT 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
#undef  FILTER_MASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
#define FILTER_MASK  (((1 << 9) - 1) << 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
FUNC_AFFINEINDEX_BC_0(S16, S16, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
FUNC_AFFINEINDEX_BC_1(S16, S16, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
#undef  FILTER_SHIFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
#define FILTER_SHIFT 4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
#undef  FILTER_MASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
#define FILTER_MASK  (((1 << 8) - 1) << 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
FUNC_AFFINEINDEX_BC_0(S16, U8, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
FUNC_AFFINEINDEX_BC_1(S16, U8, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
#undef  FILTER_SHIFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
#define FILTER_SHIFT 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
#undef  FILTER_MASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
#define FILTER_MASK  (((1 << 9) - 1) << 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
FUNC_AFFINEINDEX_BC_0(S16, S16, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
FUNC_AFFINEINDEX_BC_1(S16, S16, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
/***************************************************************/