Bug Summary

File:ccv_resample.c
Warning:line 80, column 18
The left operand of '+' is a garbage value

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name ccv_resample.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -menable-no-infs -menable-no-nans -menable-unsafe-fp-math -fno-signed-zeros -mreassociate -freciprocal-math -fdenormal-fp-math=preserve-sign,preserve-sign -ffp-contract=fast -fno-rounding-math -ffast-math -ffinite-math-only -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-feature +sse2 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/home/liu/buildslave/linux-x64-runtests/build/lib -resource-dir /usr/local/lib/clang/13.0.0 -I . -I /usr/local/cuda/include -D HAVE_CBLAS -D HAVE_LIBPNG -D HAVE_LIBJPEG -D HAVE_FFTW3 -D HAVE_PTHREAD -D HAVE_LIBLINEAR -D HAVE_TESSERACT -D HAVE_AVCODEC -D HAVE_AVFORMAT -D HAVE_AVUTIL -D HAVE_SWSCALE -D USE_DISPATCH -D HAVE_SSE2 -D HAVE_GSL -D HAVE_CUDA -D HAVE_CUDNN -D HAVE_NCCL -D USE_SYSTEM_CUB -I /usr/local/include -internal-isystem /usr/local/lib/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -fdebug-compilation-dir=/home/liu/buildslave/linux-x64-runtests/build/lib -ferror-limit 19 -fblocks -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /home/liu/buildslave/public_html/analyze/2021-11-15-195359-102457-1 -x c ccv_resample.c
1#include "ccv.h"
2#include "ccv_internal.h"
3
4/* area interpolation resample is adopted from OpenCV */
5
6typedef struct {
7 int si, di;
8 unsigned int alpha;
9} ccv_int_alpha;
10
11static void _ccv_resample_area_8u(ccv_dense_matrix_t* a, ccv_dense_matrix_t* b)
12{
13 assert(a->cols > 0 && b->cols > 0)((void) sizeof ((a->cols > 0 && b->cols >
0) ? 1 : 0), __extension__ ({ if (a->cols > 0 &&
b->cols > 0) ; else __assert_fail ("a->cols > 0 && b->cols > 0"
, "ccv_resample.c", 13, __extension__ __PRETTY_FUNCTION__); }
))
;
20
Assuming field 'cols' is > 0
21
Assuming field 'cols' is > 0
22
Taking true branch
14 ccv_int_alpha* xofs = (ccv_int_alpha*)alloca(sizeof(ccv_int_alpha) * a->cols * 2)__builtin_alloca (sizeof(ccv_int_alpha) * a->cols * 2);
15 int ch = ccv_clamp(CCV_GET_CHANNEL(a->type), 1, 4)({ typeof (1) _a = (1); typeof (4) _b = (4); typeof (((a->
type) & 0xFFF)) _x = (((a->type) & 0xFFF)); (_x <
_a) ? _a : ((_x > _b) ? _b : _x); })
;
23
Assuming '_x' is >= '_a'
24
'?' condition is false
25
Assuming '_x' is <= '_b'
26
'?' condition is false
16 double scale_x = (double)a->cols / b->cols;
17 double scale_y = (double)a->rows / b->rows;
18 // double scale = 1.f / (scale_x * scale_y);
19 unsigned int inv_scale_256 = (int)(scale_x * scale_y * 0x10000);
20 int dx, dy, sx, sy, i, k;
21 for (dx = 0, k = 0; dx
26.1
'dx' is < field 'cols'
< b->cols
; dx++)
27
Loop condition is true. Entering loop body
37
Assuming 'dx' is < field 'cols'
38
Loop condition is true. Entering loop body
48
Assuming 'dx' is >= field 'cols'
49
Loop condition is false. Execution continues on line 49
22 {
23 double fsx1 = dx * scale_x, fsx2 = fsx1 + scale_x;
24 int sx1 = (int)(fsx1 + 1.0 - 1e-6), sx2 = (int)(fsx2);
25 sx1 = ccv_min(sx1, a->cols - 1)({ typeof (sx1) _a = (sx1); typeof (a->cols - 1) _b = (a->
cols - 1); (_a < _b) ? _a : _b; })
;
28
Assuming '_a' is >= '_b'
29
'?' condition is false
39
Assuming '_a' is >= '_b'
40
'?' condition is false
26 sx2 = ccv_min(sx2, a->cols - 1)({ typeof (sx2) _a = (sx2); typeof (a->cols - 1) _b = (a->
cols - 1); (_a < _b) ? _a : _b; })
;
30
Assuming '_a' is >= '_b'
31
'?' condition is false
41
Assuming '_a' is < '_b'
42
'?' condition is true
27
28 if (sx1 > fsx1)
32
Assuming 'sx1' is <= 'fsx1'
33
Taking false branch
43
Assuming 'sx1' is <= 'fsx1'
44
Taking false branch
29 {
30 xofs[k].di = dx * ch;
31 xofs[k].si = (sx1 - 1) * ch;
32 xofs[k++].alpha = (unsigned int)((sx1 - fsx1) * 0x100);
33 }
34
35 for (sx = sx1; sx
44.1
'sx' is >= 'sx2'
< sx2; sx++)
34
Loop condition is false. Execution continues on line 42
45
Loop condition is false. Execution continues on line 42
36 {
37 xofs[k].di = dx * ch;
38 xofs[k].si = sx * ch;
39 xofs[k++].alpha = 256;
40 }
41
42 if (fsx2 - sx2 > 1e-3)
35
Assuming the condition is false
36
Taking false branch
46
Assuming the condition is true
47
Taking true branch
43 {
44 xofs[k].di = dx * ch;
45 xofs[k].si = sx2 * ch;
46 xofs[k++].alpha = (unsigned int)((fsx2 - sx2) * 256);
47 }
48 }
49 int xofs_count = k;
50 unsigned int* buf = (unsigned int*)alloca(b->cols * ch * sizeof(unsigned int))__builtin_alloca (b->cols * ch * sizeof(unsigned int));
51 unsigned int* sum = (unsigned int*)alloca(b->cols * ch * sizeof(unsigned int))__builtin_alloca (b->cols * ch * sizeof(unsigned int));
52 for (dx = 0; dx < b->cols * ch; dx++)
50
Assuming the condition is false
51
Loop condition is false. Execution continues on line 54
53 buf[dx] = sum[dx] = 0;
54 dy = 0;
55 for (sy = 0; sy < a->rows; sy++)
52
Assuming 'sy' is < field 'rows'
53
Loop condition is true. Entering loop body
56 {
57 unsigned char* a_ptr = a->data.u8 + a->step * sy;
58 for (k = 0; k < xofs_count; k++)
54
Loop condition is true. Entering loop body
58
Loop condition is false. Execution continues on line 65
59 {
60 int dxn = xofs[k].di;
61 unsigned int alpha = xofs[k].alpha;
62 for (i = 0; i
54.1
'i' is < 'ch'
< ch
; i++)
55
Loop condition is true. Entering loop body
56
Assuming 'i' is >= 'ch'
57
Loop condition is false. Execution continues on line 58
63 buf[dxn + i] += a_ptr[xofs[k].si + i] * alpha;
64 }
65 if ((dy + 1) * scale_y <= sy + 1 || sy == a->rows - 1)
59
Assuming the condition is true
66 {
67 unsigned int beta = (int)(ccv_max(sy + 1 - (dy + 1) * scale_y, 0.f)({ typeof (sy + 1 - (dy + 1) * scale_y) _a = (sy + 1 - (dy + 1
) * scale_y); typeof (0.f) _b = (0.f); (_a > _b) ? _a : _b
; })
* 256);
60
Assuming '_a' is <= '_b'
61
'?' condition is false
68 unsigned int beta1 = 256 - beta;
69 unsigned char* b_ptr = b->data.u8 + b->step * dy;
70 if (beta <= 0)
62
Assuming 'beta' is > 0
63
Taking false branch
71 {
72 for (dx = 0; dx < b->cols * ch; dx++)
73 {
74 b_ptr[dx] = ccv_clamp((sum[dx] + buf[dx] * 256) / inv_scale_256, 0, 255)({ typeof (0) _a = (0); typeof (255) _b = (255); typeof ((sum
[dx] + buf[dx] * 256) / inv_scale_256) _x = ((sum[dx] + buf[dx
] * 256) / inv_scale_256); (_x < _a) ? _a : ((_x > _b) ?
_b : _x); })
;
75 sum[dx] = buf[dx] = 0;
76 }
77 } else {
78 for (dx = 0; dx < b->cols * ch; dx++)
64
The value 0 is assigned to 'dx'
65
Loop condition is true. Entering loop body
79 {
80 b_ptr[dx] = ccv_clamp((sum[dx] + buf[dx] * beta1) / inv_scale_256, 0, 255)({ typeof (0) _a = (0); typeof (255) _b = (255); typeof ((sum
[dx] + buf[dx] * beta1) / inv_scale_256) _x = ((sum[dx] + buf
[dx] * beta1) / inv_scale_256); (_x < _a) ? _a : ((_x >
_b) ? _b : _x); })
;
66
The left operand of '+' is a garbage value
81 sum[dx] = buf[dx] * beta;
82 buf[dx] = 0;
83 }
84 }
85 dy++;
86 }
87 else
88 {
89 for(dx = 0; dx < b->cols * ch; dx++)
90 {
91 sum[dx] += buf[dx] * 256;
92 buf[dx] = 0;
93 }
94 }
95 }
96}
97
98typedef struct {
99 int si, di;
100 float alpha;
101} ccv_area_alpha_t;
102
103static void _ccv_resample_area(ccv_dense_matrix_t* a, ccv_dense_matrix_t* b)
104{
105 assert(a->cols > 0 && b->cols > 0)((void) sizeof ((a->cols > 0 && b->cols >
0) ? 1 : 0), __extension__ ({ if (a->cols > 0 &&
b->cols > 0) ; else __assert_fail ("a->cols > 0 && b->cols > 0"
, "ccv_resample.c", 105, __extension__ __PRETTY_FUNCTION__); }
))
;
106 ccv_area_alpha_t* xofs = (ccv_area_alpha_t*)alloca(sizeof(ccv_area_alpha_t) * a->cols * 2)__builtin_alloca (sizeof(ccv_area_alpha_t) * a->cols * 2);
107 int ch = CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF);
108 double scale_x = (double)a->cols / b->cols;
109 double scale_y = (double)a->rows / b->rows;
110 double scale = 1.f / (scale_x * scale_y);
111 int dx, dy, sx, sy, i, k;
112 for (dx = 0, k = 0; dx < b->cols; dx++)
113 {
114 double fsx1 = dx * scale_x, fsx2 = fsx1 + scale_x;
115 int sx1 = (int)(fsx1 + 1.0 - 1e-6), sx2 = (int)(fsx2);
116 sx1 = ccv_min(sx1, a->cols - 1)({ typeof (sx1) _a = (sx1); typeof (a->cols - 1) _b = (a->
cols - 1); (_a < _b) ? _a : _b; })
;
117 sx2 = ccv_min(sx2, a->cols - 1)({ typeof (sx2) _a = (sx2); typeof (a->cols - 1) _b = (a->
cols - 1); (_a < _b) ? _a : _b; })
;
118
119 if (sx1 > fsx1)
120 {
121 xofs[k].di = dx * ch;
122 xofs[k].si = (sx1 - 1) * ch;
123 xofs[k++].alpha = (float)((sx1 - fsx1) * scale);
124 }
125
126 for (sx = sx1; sx < sx2; sx++)
127 {
128 xofs[k].di = dx * ch;
129 xofs[k].si = sx * ch;
130 xofs[k++].alpha = (float)scale;
131 }
132
133 if (fsx2 - sx2 > 1e-3)
134 {
135 xofs[k].di = dx * ch;
136 xofs[k].si = sx2 * ch;
137 xofs[k++].alpha = (float)((fsx2 - sx2) * scale);
138 }
139 }
140 int xofs_count = k;
141 float* buf = (float*)alloca(b->cols * ch * sizeof(float))__builtin_alloca (b->cols * ch * sizeof(float));
142 float* sum = (float*)alloca(b->cols * ch * sizeof(float))__builtin_alloca (b->cols * ch * sizeof(float));
143 for (dx = 0; dx < b->cols * ch; dx++)
144 buf[dx] = sum[dx] = 0;
145 dy = 0;
146#define for_block(_for_get, _for_set) \
147 for (sy = 0; sy < a->rows; sy++) \
148 { \
149 unsigned char* a_ptr = a->data.u8 + a->step * sy; \
150 for (k = 0; k < xofs_count; k++) \
151 { \
152 int dxn = xofs[k].di; \
153 float alpha = xofs[k].alpha; \
154 for (i = 0; i < ch; i++) \
155 buf[dxn + i] += _for_get(a_ptr, xofs[k].si + i) * alpha; \
156 } \
157 if ((dy + 1) * scale_y <= sy + 1 || sy == a->rows - 1) \
158 { \
159 float beta = ccv_max(sy + 1 - (dy + 1) * scale_y, 0.f)({ typeof (sy + 1 - (dy + 1) * scale_y) _a = (sy + 1 - (dy + 1
) * scale_y); typeof (0.f) _b = (0.f); (_a > _b) ? _a : _b
; })
; \
160 float beta1 = 1 - beta; \
161 unsigned char* b_ptr = b->data.u8 + b->step * dy; \
162 if (fabs(beta) < 1e-3) \
163 { \
164 for (dx = 0; dx < b->cols * ch; dx++) \
165 { \
166 _for_set(b_ptr, dx, sum[dx] + buf[dx]); \
167 sum[dx] = buf[dx] = 0; \
168 } \
169 } else { \
170 for (dx = 0; dx < b->cols * ch; dx++) \
171 { \
172 _for_set(b_ptr, dx, sum[dx] + buf[dx] * beta1); \
173 sum[dx] = buf[dx] * beta; \
174 buf[dx] = 0; \
175 } \
176 } \
177 dy++; \
178 } \
179 else \
180 { \
181 for(dx = 0; dx < b->cols * ch; dx++) \
182 { \
183 sum[dx] += buf[dx]; \
184 buf[dx] = 0; \
185 } \
186 } \
187 }
188 ccv_matrix_getter(a->type, ccv_matrix_setter, b->type, for_block){ switch (((a->type) & 0xFF000)) { case CCV_32S: { { switch
(((b->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_32s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32s_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32s_value
, _ccv_set_8u_value); } } }; break; } case CCV_32F: { { switch
(((b->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_32f_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32f_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_32f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32f_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32f_value
, _ccv_set_8u_value); } } }; break; } case CCV_64S: { { switch
(((b->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_64s_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64s_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64s_value
, _ccv_set_8u_value); } } }; break; } case CCV_64F: { { switch
(((b->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_64f_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64f_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64f_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64f_value
, _ccv_set_8u_value); } } }; break; } default: { { switch (((
b->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_8u_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_8u_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_8u_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_8u_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_8u_value
, _ccv_set_8u_value); } } }; } } }
;
189#undef for_block
190}
191
192typedef struct {
193 int si[4];
194 float coeffs[4];
195} ccv_cubic_coeffs_t;
196
197typedef struct {
198 int si[4];
199 int coeffs[4];
200} ccv_cubic_integer_coeffs_t;
201
202static void _ccv_init_cubic_coeffs(int si, int sz, float s, ccv_cubic_coeffs_t* coeff)
203{
204 const float A = -0.75f;
205 coeff->si[0] = ccv_max(si - 1, 0)({ typeof (si - 1) _a = (si - 1); typeof (0) _b = (0); (_a >
_b) ? _a : _b; })
;
206 coeff->si[1] = si;
207 coeff->si[2] = ccv_min(si + 1, sz - 1)({ typeof (si + 1) _a = (si + 1); typeof (sz - 1) _b = (sz - 1
); (_a < _b) ? _a : _b; })
;
208 coeff->si[3] = ccv_min(si + 2, sz - 1)({ typeof (si + 2) _a = (si + 2); typeof (sz - 1) _b = (sz - 1
); (_a < _b) ? _a : _b; })
;
209 float x = s - si;
210 coeff->coeffs[0] = ((A * (x + 1) - 5 * A) * (x + 1) + 8 * A) * (x + 1) - 4 * A;
211 coeff->coeffs[1] = ((A + 2) * x - (A + 3)) * x * x + 1;
212 coeff->coeffs[2] = ((A + 2) * (1 - x) - (A + 3)) * (1 - x) * (1 - x) + 1;
213 coeff->coeffs[3] = 1.f - coeff->coeffs[0] - coeff->coeffs[1] - coeff->coeffs[2];
214}
215
216static void _ccv_resample_cubic_float_only(ccv_dense_matrix_t* a, ccv_dense_matrix_t* b)
217{
218 assert(CCV_GET_DATA_TYPE(b->type) == CCV_32F || CCV_GET_DATA_TYPE(b->type) == CCV_64F)((void) sizeof ((((b->type) & 0xFF000) == CCV_32F || (
(b->type) & 0xFF000) == CCV_64F) ? 1 : 0), __extension__
({ if (((b->type) & 0xFF000) == CCV_32F || ((b->type
) & 0xFF000) == CCV_64F) ; else __assert_fail ("CCV_GET_DATA_TYPE(b->type) == CCV_32F || CCV_GET_DATA_TYPE(b->type) == CCV_64F"
, "ccv_resample.c", 218, __extension__ __PRETTY_FUNCTION__); }
))
;
219 int i, j, k, ch = CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF);
220 assert(b->cols > 0 && b->step > 0)((void) sizeof ((b->cols > 0 && b->step >
0) ? 1 : 0), __extension__ ({ if (b->cols > 0 &&
b->step > 0) ; else __assert_fail ("b->cols > 0 && b->step > 0"
, "ccv_resample.c", 220, __extension__ __PRETTY_FUNCTION__); }
))
;
221 ccv_cubic_coeffs_t* xofs = (ccv_cubic_coeffs_t*)alloca(sizeof(ccv_cubic_coeffs_t) * b->cols)__builtin_alloca (sizeof(ccv_cubic_coeffs_t) * b->cols);
222 float scale_x = (float)a->cols / b->cols;
223 for (i = 0; i < b->cols; i++)
224 {
225 float sx = (i + 0.5) * scale_x - 0.5;
226 _ccv_init_cubic_coeffs((int)sx, a->cols, sx, xofs + i);
227 }
228 float scale_y = (float)a->rows / b->rows;
229 unsigned char* buf = (unsigned char*)alloca(b->step * 4)__builtin_alloca (b->step * 4);
230#ifdef __clang_analyzer__1
231 memset(buf, 0, b->step * 4);
232#endif
233 unsigned char* a_ptr = a->data.u8;
234 unsigned char* b_ptr = b->data.u8;
235 int psi = -1, siy = 0;
236#define for_block(_for_get, _for_set_b, _for_get_b) \
237 for (i = 0; i < b->rows; i++) \
238 { \
239 ccv_cubic_coeffs_t yofs; \
240 float sy = (i + 0.5) * scale_y - 0.5; \
241 _ccv_init_cubic_coeffs((int)sy, a->rows, sy, &yofs); \
242 if (yofs.si[3] > psi) \
243 { \
244 for (; siy <= yofs.si[3]; siy++) \
245 { \
246 unsigned char* row = buf + (siy & 0x3) * b->step; \
247 for (j = 0; j < b->cols; j++) \
248 for (k = 0; k < ch; k++) \
249 _for_set_b(row, j * ch + k, _for_get(a_ptr, xofs[j].si[0] * ch + k) * xofs[j].coeffs[0] + \
250 _for_get(a_ptr, xofs[j].si[1] * ch + k) * xofs[j].coeffs[1] + \
251 _for_get(a_ptr, xofs[j].si[2] * ch + k) * xofs[j].coeffs[2] + \
252 _for_get(a_ptr, xofs[j].si[3] * ch + k) * xofs[j].coeffs[3]); \
253 a_ptr += a->step; \
254 } \
255 psi = yofs.si[3]; \
256 } \
257 unsigned char* row[4] = { \
258 buf + (yofs.si[0] & 0x3) * b->step, \
259 buf + (yofs.si[1] & 0x3) * b->step, \
260 buf + (yofs.si[2] & 0x3) * b->step, \
261 buf + (yofs.si[3] & 0x3) * b->step, \
262 }; \
263 for (j = 0; j < b->cols * ch; j++) \
264 _for_set_b(b_ptr, j, _for_get_b(row[0], j, 0) * yofs.coeffs[0] + _for_get_b(row[1], j) * yofs.coeffs[1] + \
265 _for_get_b(row[2], j, 0) * yofs.coeffs[2] + _for_get_b(row[3], j) * yofs.coeffs[3]); \
266 b_ptr += b->step; \
267 }
268 ccv_matrix_getter(a->type, ccv_matrix_setter_getter_float_only, b->type, for_block){ switch (((a->type) & 0xFF000)) { case CCV_32S: { { switch
(((b->type) & 0xFF000)) { case CCV_32F: { for_block(_ccv_get_32s_value
, _ccv_set_32f_value, _ccv_get_32f_value); break; } case CCV_64F
: { for_block(_ccv_get_32s_value, _ccv_set_64f_value, _ccv_get_64f_value
); break; } default: { ((void) sizeof (((b->type & CCV_32F
) || (b->type & CCV_64F)) ? 1 : 0), __extension__ ({ if
((b->type & CCV_32F) || (b->type & CCV_64F)) ;
else __assert_fail ("(b->type & CCV_32F) || (b->type & CCV_64F)"
, "ccv_resample.c", 268, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_32F: { { switch (((b->type) &
0xFF000)) { case CCV_32F: { for_block(_ccv_get_32f_value, _ccv_set_32f_value
, _ccv_get_32f_value); break; } case CCV_64F: { for_block(_ccv_get_32f_value
, _ccv_set_64f_value, _ccv_get_64f_value); break; } default: {
((void) sizeof (((b->type & CCV_32F) || (b->type &
CCV_64F)) ? 1 : 0), __extension__ ({ if ((b->type & CCV_32F
) || (b->type & CCV_64F)) ; else __assert_fail ("(b->type & CCV_32F) || (b->type & CCV_64F)"
, "ccv_resample.c", 268, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64S: { { switch (((b->type) &
0xFF000)) { case CCV_32F: { for_block(_ccv_get_64s_value, _ccv_set_32f_value
, _ccv_get_32f_value); break; } case CCV_64F: { for_block(_ccv_get_64s_value
, _ccv_set_64f_value, _ccv_get_64f_value); break; } default: {
((void) sizeof (((b->type & CCV_32F) || (b->type &
CCV_64F)) ? 1 : 0), __extension__ ({ if ((b->type & CCV_32F
) || (b->type & CCV_64F)) ; else __assert_fail ("(b->type & CCV_32F) || (b->type & CCV_64F)"
, "ccv_resample.c", 268, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64F: { { switch (((b->type) &
0xFF000)) { case CCV_32F: { for_block(_ccv_get_64f_value, _ccv_set_32f_value
, _ccv_get_32f_value); break; } case CCV_64F: { for_block(_ccv_get_64f_value
, _ccv_set_64f_value, _ccv_get_64f_value); break; } default: {
((void) sizeof (((b->type & CCV_32F) || (b->type &
CCV_64F)) ? 1 : 0), __extension__ ({ if ((b->type & CCV_32F
) || (b->type & CCV_64F)) ; else __assert_fail ("(b->type & CCV_32F) || (b->type & CCV_64F)"
, "ccv_resample.c", 268, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } default: { { switch (((b->type) & 0xFF000
)) { case CCV_32F: { for_block(_ccv_get_8u_value, _ccv_set_32f_value
, _ccv_get_32f_value); break; } case CCV_64F: { for_block(_ccv_get_8u_value
, _ccv_set_64f_value, _ccv_get_64f_value); break; } default: {
((void) sizeof (((b->type & CCV_32F) || (b->type &
CCV_64F)) ? 1 : 0), __extension__ ({ if ((b->type & CCV_32F
) || (b->type & CCV_64F)) ; else __assert_fail ("(b->type & CCV_32F) || (b->type & CCV_64F)"
, "ccv_resample.c", 268, __extension__ __PRETTY_FUNCTION__); }
)); } } }; } } }
;
269#undef for_block
270}
271
272static void _ccv_init_cubic_integer_coeffs(int si, int sz, float s, ccv_cubic_integer_coeffs_t* coeff)
273{
274 const float A = -0.75f;
275 coeff->si[0] = ccv_max(si - 1, 0)({ typeof (si - 1) _a = (si - 1); typeof (0) _b = (0); (_a >
_b) ? _a : _b; })
;
276 coeff->si[1] = si;
277 coeff->si[2] = ccv_min(si + 1, sz - 1)({ typeof (si + 1) _a = (si + 1); typeof (sz - 1) _b = (sz - 1
); (_a < _b) ? _a : _b; })
;
278 coeff->si[3] = ccv_min(si + 2, sz - 1)({ typeof (si + 2) _a = (si + 2); typeof (sz - 1) _b = (sz - 1
); (_a < _b) ? _a : _b; })
;
279 float x = s - si;
280 const int W_BITS = 1 << 6;
281 coeff->coeffs[0] = (int)((((A * (x + 1) - 5 * A) * (x + 1) + 8 * A) * (x + 1) - 4 * A) * W_BITS + 0.5);
282 coeff->coeffs[1] = (int)((((A + 2) * x - (A + 3)) * x * x + 1) * W_BITS + 0.5);
283 coeff->coeffs[2] = (int)((((A + 2) * (1 - x) - (A + 3)) * (1 - x) * (1 - x) + 1) * W_BITS + 0.5);
284 coeff->coeffs[3] = W_BITS - coeff->coeffs[0] - coeff->coeffs[1] - coeff->coeffs[2];
285}
286
287static void _ccv_resample_cubic_integer_only(ccv_dense_matrix_t* a, ccv_dense_matrix_t* b)
288{
289 assert(CCV_GET_DATA_TYPE(b->type) == CCV_8U || CCV_GET_DATA_TYPE(b->type) == CCV_32S || CCV_GET_DATA_TYPE(b->type) == CCV_64S)((void) sizeof ((((b->type) & 0xFF000) == CCV_8U || ((
b->type) & 0xFF000) == CCV_32S || ((b->type) & 0xFF000
) == CCV_64S) ? 1 : 0), __extension__ ({ if (((b->type) &
0xFF000) == CCV_8U || ((b->type) & 0xFF000) == CCV_32S
|| ((b->type) & 0xFF000) == CCV_64S) ; else __assert_fail
("CCV_GET_DATA_TYPE(b->type) == CCV_8U || CCV_GET_DATA_TYPE(b->type) == CCV_32S || CCV_GET_DATA_TYPE(b->type) == CCV_64S"
, "ccv_resample.c", 289, __extension__ __PRETTY_FUNCTION__); }
))
;
290 int i, j, k, ch = CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF);
291 int no_8u_type = (b->type & CCV_8U) ? CCV_32S : b->type;
292 assert(b->cols > 0)((void) sizeof ((b->cols > 0) ? 1 : 0), __extension__ (
{ if (b->cols > 0) ; else __assert_fail ("b->cols > 0"
, "ccv_resample.c", 292, __extension__ __PRETTY_FUNCTION__); }
))
;
293 ccv_cubic_integer_coeffs_t* xofs = (ccv_cubic_integer_coeffs_t*)alloca(sizeof(ccv_cubic_integer_coeffs_t) * b->cols)__builtin_alloca (sizeof(ccv_cubic_integer_coeffs_t) * b->
cols)
;
294 float scale_x = (float)a->cols / b->cols;
295 for (i = 0; i < b->cols; i++)
296 {
297 float sx = (i + 0.5) * scale_x - 0.5;
298 _ccv_init_cubic_integer_coeffs((int)sx, a->cols, sx, xofs + i);
299 }
300 float scale_y = (float)a->rows / b->rows;
301 int bufstep = b->cols * ch * CCV_GET_DATA_TYPE_SIZE(no_8u_type)_ccv_get_data_type_size[((no_8u_type) & 0xFF000) >>
12]
;
302 unsigned char* buf = (unsigned char*)alloca(bufstep * 4)__builtin_alloca (bufstep * 4);
303#ifdef __clang_analyzer__1
304 memset(buf, 0, bufstep * 4);
305#endif
306 unsigned char* a_ptr = a->data.u8;
307 unsigned char* b_ptr = b->data.u8;
308 int psi = -1, siy = 0;
309#define for_block(_for_get_a, _for_set, _for_get, _for_set_b) \
310 for (i = 0; i < b->rows; i++) \
311 { \
312 ccv_cubic_integer_coeffs_t yofs; \
313 float sy = (i + 0.5) * scale_y - 0.5; \
314 _ccv_init_cubic_integer_coeffs((int)sy, a->rows, sy, &yofs); \
315 if (yofs.si[3] > psi) \
316 { \
317 for (; siy <= yofs.si[3]; siy++) \
318 { \
319 unsigned char* row = buf + (siy & 0x3) * bufstep; \
320 for (j = 0; j < b->cols; j++) \
321 for (k = 0; k < ch; k++) \
322 _for_set(row, j * ch + k, _for_get_a(a_ptr, xofs[j].si[0] * ch + k) * xofs[j].coeffs[0] + \
323 _for_get_a(a_ptr, xofs[j].si[1] * ch + k) * xofs[j].coeffs[1] + \
324 _for_get_a(a_ptr, xofs[j].si[2] * ch + k) * xofs[j].coeffs[2] + \
325 _for_get_a(a_ptr, xofs[j].si[3] * ch + k) * xofs[j].coeffs[3]); \
326 a_ptr += a->step; \
327 } \
328 psi = yofs.si[3]; \
329 } \
330 unsigned char* row[4] = { \
331 buf + (yofs.si[0] & 0x3) * bufstep, \
332 buf + (yofs.si[1] & 0x3) * bufstep, \
333 buf + (yofs.si[2] & 0x3) * bufstep, \
334 buf + (yofs.si[3] & 0x3) * bufstep, \
335 }; \
336 for (j = 0; j < b->cols * ch; j++) \
337 _for_set_b(b_ptr, j, ccv_descale(_for_get(row[0], j) * yofs.coeffs[0] + _for_get(row[1], j) * yofs.coeffs[1] + \(((_for_get(row[0], j) * yofs.coeffs[0] + _for_get(row[1], j)
* yofs.coeffs[1] + _for_get(row[2], j) * yofs.coeffs[2] + _for_get
(row[3], j) * yofs.coeffs[3]) + (1 << ((12) - 1))) >>
(12))
338 _for_get(row[2], j) * yofs.coeffs[2] + _for_get(row[3], j) * yofs.coeffs[3], 12)(((_for_get(row[0], j) * yofs.coeffs[0] + _for_get(row[1], j)
* yofs.coeffs[1] + _for_get(row[2], j) * yofs.coeffs[2] + _for_get
(row[3], j) * yofs.coeffs[3]) + (1 << ((12) - 1))) >>
(12))
); \
339 b_ptr += b->step; \
340 }
341 ccv_matrix_getter(a->type, ccv_matrix_setter_getter_integer_only, no_8u_type, ccv_matrix_setter_integer_only, b->type, for_block){ switch (((a->type) & 0xFF000)) { case CCV_32S: { { switch
(((no_8u_type) & 0xFF000)) { case CCV_32S: { { switch ((
(b->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_32s_value)
; break; } case CCV_64S: { for_block(_ccv_get_32s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_64s_value); break; } case CCV_8U
: { for_block(_ccv_get_32s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_8u_value); break; } default: { ((void) sizeof (((b
->type & CCV_32S) || (b->type & CCV_64S) || (b->
type & CCV_8U)) ? 1 : 0), __extension__ ({ if ((b->type
& CCV_32S) || (b->type & CCV_64S) || (b->type &
CCV_8U)) ; else __assert_fail ("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64S: { { switch (((b->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_32s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_32s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_8u_value);
break; } default: { ((void) sizeof (((b->type & CCV_32S
) || (b->type & CCV_64S) || (b->type & CCV_8U))
? 1 : 0), __extension__ ({ if ((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ; else
__assert_fail ("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_8U: { { switch (((b->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_32s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_32s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); break
; } default: { ((void) sizeof (((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ? 1
: 0), __extension__ ({ if ((b->type & CCV_32S) || (b->
type & CCV_64S) || (b->type & CCV_8U)) ; else __assert_fail
("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } default: { ((void) sizeof (((no_8u_type &
CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U
)) ? 1 : 0), __extension__ ({ if ((no_8u_type & CCV_32S) ||
(no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)) ; else
__assert_fail ("(no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_32F: { { switch (((no_8u_type) &
0xFF000)) { case CCV_32S: { { switch (((b->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_32f_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_32f_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_32f_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_8u_value);
break; } default: { ((void) sizeof (((b->type & CCV_32S
) || (b->type & CCV_64S) || (b->type & CCV_8U))
? 1 : 0), __extension__ ({ if ((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ; else
__assert_fail ("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64S: { { switch (((b->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32f_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_32f_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_32f_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_8u_value);
break; } default: { ((void) sizeof (((b->type & CCV_32S
) || (b->type & CCV_64S) || (b->type & CCV_8U))
? 1 : 0), __extension__ ({ if ((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ; else
__assert_fail ("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_8U: { { switch (((b->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32f_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_32f_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_32f_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); break
; } default: { ((void) sizeof (((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ? 1
: 0), __extension__ ({ if ((b->type & CCV_32S) || (b->
type & CCV_64S) || (b->type & CCV_8U)) ; else __assert_fail
("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } default: { ((void) sizeof (((no_8u_type &
CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U
)) ? 1 : 0), __extension__ ({ if ((no_8u_type & CCV_32S) ||
(no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)) ; else
__assert_fail ("(no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64S: { { switch (((no_8u_type) &
0xFF000)) { case CCV_32S: { { switch (((b->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_64s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_64s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_64s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_8u_value);
break; } default: { ((void) sizeof (((b->type & CCV_32S
) || (b->type & CCV_64S) || (b->type & CCV_8U))
? 1 : 0), __extension__ ({ if ((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ; else
__assert_fail ("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64S: { { switch (((b->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_64s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_64s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_64s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_8u_value);
break; } default: { ((void) sizeof (((b->type & CCV_32S
) || (b->type & CCV_64S) || (b->type & CCV_8U))
? 1 : 0), __extension__ ({ if ((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ; else
__assert_fail ("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_8U: { { switch (((b->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_64s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_64s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_64s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); break
; } default: { ((void) sizeof (((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ? 1
: 0), __extension__ ({ if ((b->type & CCV_32S) || (b->
type & CCV_64S) || (b->type & CCV_8U)) ; else __assert_fail
("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } default: { ((void) sizeof (((no_8u_type &
CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U
)) ? 1 : 0), __extension__ ({ if ((no_8u_type & CCV_32S) ||
(no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)) ; else
__assert_fail ("(no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64F: { { switch (((no_8u_type) &
0xFF000)) { case CCV_32S: { { switch (((b->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_64f_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_64f_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_64f_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_8u_value);
break; } default: { ((void) sizeof (((b->type & CCV_32S
) || (b->type & CCV_64S) || (b->type & CCV_8U))
? 1 : 0), __extension__ ({ if ((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ; else
__assert_fail ("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64S: { { switch (((b->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_64f_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_64f_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_64f_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_8u_value);
break; } default: { ((void) sizeof (((b->type & CCV_32S
) || (b->type & CCV_64S) || (b->type & CCV_8U))
? 1 : 0), __extension__ ({ if ((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ; else
__assert_fail ("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_8U: { { switch (((b->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_64f_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_64f_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_64f_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); break
; } default: { ((void) sizeof (((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ? 1
: 0), __extension__ ({ if ((b->type & CCV_32S) || (b->
type & CCV_64S) || (b->type & CCV_8U)) ; else __assert_fail
("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } default: { ((void) sizeof (((no_8u_type &
CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U
)) ? 1 : 0), __extension__ ({ if ((no_8u_type & CCV_32S) ||
(no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)) ; else
__assert_fail ("(no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } default: { { switch (((no_8u_type) & 0xFF000
)) { case CCV_32S: { { switch (((b->type) & 0xFF000)) {
case CCV_32S: { for_block(_ccv_get_8u_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_8u_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_8u_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_8u_value);
break; } default: { ((void) sizeof (((b->type & CCV_32S
) || (b->type & CCV_64S) || (b->type & CCV_8U))
? 1 : 0), __extension__ ({ if ((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ; else
__assert_fail ("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64S: { { switch (((b->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_8u_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_8u_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_8u_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_8u_value);
break; } default: { ((void) sizeof (((b->type & CCV_32S
) || (b->type & CCV_64S) || (b->type & CCV_8U))
? 1 : 0), __extension__ ({ if ((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ; else
__assert_fail ("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_8U: { { switch (((b->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_8u_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32s_value); break; } case CCV_64S
: { for_block(_ccv_get_8u_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64s_value); break; } case CCV_8U: { for_block(_ccv_get_8u_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); break
; } default: { ((void) sizeof (((b->type & CCV_32S) ||
(b->type & CCV_64S) || (b->type & CCV_8U)) ? 1
: 0), __extension__ ({ if ((b->type & CCV_32S) || (b->
type & CCV_64S) || (b->type & CCV_8U)) ; else __assert_fail
("(b->type & CCV_32S) || (b->type & CCV_64S) || (b->type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } default: { ((void) sizeof (((no_8u_type &
CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U
)) ? 1 : 0), __extension__ ({ if ((no_8u_type & CCV_32S) ||
(no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)) ; else
__assert_fail ("(no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)"
, "ccv_resample.c", 341, __extension__ __PRETTY_FUNCTION__); }
)); } } }; } } }
;
342#undef for_block
343}
344
345void ccv_resample(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int btype, int rows, int cols, int type)
346{
347 assert(rows > 0 && cols > 0)((void) sizeof ((rows > 0 && cols > 0) ? 1 : 0)
, __extension__ ({ if (rows > 0 && cols > 0) ; else
__assert_fail ("rows > 0 && cols > 0", "ccv_resample.c"
, 347, __extension__ __PRETTY_FUNCTION__); }))
;
1
Assuming 'rows' is > 0
2
Assuming 'cols' is > 0
3
Taking true branch
348 ccv_declare_derived_signature(sig, a->sig != 0, ccv_sign_with_format(64, "ccv_resample(%d,%d,%d)", rows, cols, type), a->sig, CCV_EOF_SIGN)char _ccv_identifier_348[(64)]; memset(_ccv_identifier_348, 0
, (64)); snprintf(_ccv_identifier_348, (64), ("ccv_resample(%d,%d,%d)"
), rows, cols, type); size_t _ccv_string_size_348 = (64);; uint64_t
sig = (a->sig != 0) ? ccv_cache_generate_signature(_ccv_identifier_348
, _ccv_string_size_348, a->sig, ((uint64_t)0)) : 0;
;
4
Assuming field 'sig' is equal to 0
5
'?' condition is false
349 btype = (btype == 0) ? CCV_GET_DATA_TYPE(a->type)((a->type) & 0xFF000) | CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF) : CCV_GET_DATA_TYPE(btype)((btype) & 0xFF000) | CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF);
6
Assuming 'btype' is not equal to 0
7
'?' condition is false
350 ccv_dense_matrix_t* db = *b = ccv_dense_matrix_renew(*b, rows, cols, CCV_ALL_DATA_TYPE(CCV_8U | CCV_32S | CCV_32F | CCV_64S | CCV_64F) | CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF), btype, sig);
351 ccv_object_return_if_cached(, db){ if ((!(db) || (((int*)(db))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE))) { (void)((db) && (((int*)(db))[0] &=
~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~
CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE
));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE)
);(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE))
;(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));
(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(
void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void
)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)
((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)(
(0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((
0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0
) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0)
&& (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) &&
(((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (
((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && ((
(int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((
int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int
*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*
)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)
(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(
0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0
))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0)
)[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))
[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[
0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0
] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0]
&= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &=
~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~
CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE
));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE)
);(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE))
;(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));
(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(
void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void
)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)
((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)(
(0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((
0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0
) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0)
&& (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) &&
(((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (
((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && ((
(int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((
int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int
*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*
)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)
(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(
0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0
))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0)
)[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))
[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[
0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0
] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0]
&= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &=
~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~
CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE
));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE)
);(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE))
;(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));
(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));;
; return ; } }
;
8
Assuming 'db' is non-null
9
Assuming the condition is false
352 if (a->rows == db->rows && a->cols == db->cols)
10
Assuming 'a->rows' is not equal to 'db->rows'
353 {
354 if (CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF) == CCV_GET_CHANNEL(db->type)((db->type) & 0xFFF) && CCV_GET_DATA_TYPE(db->type)((db->type) & 0xFF000) == CCV_GET_DATA_TYPE(a->type)((a->type) & 0xFF000))
355 memcpy(db->data.u8, a->data.u8, a->rows * a->step);
356 else {
357 ccv_shift(a, (ccv_matrix_t**)&db, 0, 0, 0);
358 }
359 return;
360 }
361 if ((type & CCV_INTER_AREA) && a->rows >= db->rows && a->cols >= db->cols)
11
Assuming the condition is true
12
Assuming 'a->rows' is >= 'db->rows'
13
Assuming 'a->cols' is >= 'db->cols'
14
Taking true branch
362 {
363 /* using the fast alternative (fix point scale, 0x100 to avoid overflow) */
364 if (CCV_GET_DATA_TYPE(a->type)((a->type) & 0xFF000) == CCV_8U && CCV_GET_DATA_TYPE(db->type)((db->type) & 0xFF000) == CCV_8U && a->rows * a->cols / (db->rows * db->cols) < 0x100)
15
Assuming the condition is true
16
Assuming the condition is true
17
Assuming the condition is true
18
Taking true branch
365 _ccv_resample_area_8u(a, db);
19
Calling '_ccv_resample_area_8u'
366 else
367 _ccv_resample_area(a, db);
368 } else if (type & CCV_INTER_CUBIC) {
369 if (CCV_GET_DATA_TYPE(db->type)((db->type) & 0xFF000) == CCV_32F || CCV_GET_DATA_TYPE(db->type)((db->type) & 0xFF000) == CCV_64F)
370 _ccv_resample_cubic_float_only(a, db);
371 else
372 _ccv_resample_cubic_integer_only(a, db);
373 } else if (type & CCV_INTER_LINEAR) {
374 assert(0 && "CCV_INTER_LINEAR is not implemented")((void) sizeof ((0 && "CCV_INTER_LINEAR is not implemented"
) ? 1 : 0), __extension__ ({ if (0 && "CCV_INTER_LINEAR is not implemented"
) ; else __assert_fail ("0 && \"CCV_INTER_LINEAR is not implemented\""
, "ccv_resample.c", 374, __extension__ __PRETTY_FUNCTION__); }
))
;
375 } else if (type & CCV_INTER_LANCZOS) {
376 assert(0 && "CCV_INTER_LANCZOS is not implemented")((void) sizeof ((0 && "CCV_INTER_LANCZOS is not implemented"
) ? 1 : 0), __extension__ ({ if (0 && "CCV_INTER_LANCZOS is not implemented"
) ; else __assert_fail ("0 && \"CCV_INTER_LANCZOS is not implemented\""
, "ccv_resample.c", 376, __extension__ __PRETTY_FUNCTION__); }
))
;
377 } else {
378 assert(0 && "Not implemented")((void) sizeof ((0 && "Not implemented") ? 1 : 0), __extension__
({ if (0 && "Not implemented") ; else __assert_fail (
"0 && \"Not implemented\"", "ccv_resample.c", 378, __extension__
__PRETTY_FUNCTION__); }))
;
379 }
380}
381
382/* the following code is adopted from OpenCV cvPyrDown */
383void ccv_sample_down(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int type, int src_x, int src_y)
384{
385 assert(src_x >= 0 && src_y >= 0)((void) sizeof ((src_x >= 0 && src_y >= 0) ? 1 :
0), __extension__ ({ if (src_x >= 0 && src_y >=
0) ; else __assert_fail ("src_x >= 0 && src_y >= 0"
, "ccv_resample.c", 385, __extension__ __PRETTY_FUNCTION__); }
))
;
386 ccv_declare_derived_signature(sig, a->sig != 0, ccv_sign_with_format(64, "ccv_sample_down(%d,%d)", src_x, src_y), a->sig, CCV_EOF_SIGN)char _ccv_identifier_386[(64)]; memset(_ccv_identifier_386, 0
, (64)); snprintf(_ccv_identifier_386, (64), ("ccv_sample_down(%d,%d)"
), src_x, src_y); size_t _ccv_string_size_386 = (64);; uint64_t
sig = (a->sig != 0) ? ccv_cache_generate_signature(_ccv_identifier_386
, _ccv_string_size_386, a->sig, ((uint64_t)0)) : 0;
;
387 type = (type == 0) ? CCV_GET_DATA_TYPE(a->type)((a->type) & 0xFF000) | CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF) : CCV_GET_DATA_TYPE(type)((type) & 0xFF000) | CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF);
388 ccv_dense_matrix_t* db = *b = ccv_dense_matrix_renew(*b, a->rows / 2, a->cols / 2, CCV_ALL_DATA_TYPE(CCV_8U | CCV_32S | CCV_32F | CCV_64S | CCV_64F) | CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF), type, sig);
389 ccv_object_return_if_cached(, db){ if ((!(db) || (((int*)(db))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE))) { (void)((db) && (((int*)(db))[0] &=
~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~
CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE
));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE)
);(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE))
;(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));
(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(
void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void
)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)
((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)(
(0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((
0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0
) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0)
&& (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) &&
(((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (
((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && ((
(int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((
int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int
*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*
)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)
(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(
0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0
))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0)
)[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))
[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[
0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0
] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0]
&= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &=
~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~
CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE
));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE)
);(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE))
;(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));
(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(
void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void
)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)
((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)(
(0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((
0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0
) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0)
&& (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) &&
(((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (
((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && ((
(int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((
int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int
*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*
)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)
(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(
0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0
))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0)
)[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))
[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[
0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0
] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0]
&= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &=
~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~
CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE
));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE)
);(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE))
;(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));
(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));;
; return ; } }
;
390 int ch = CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF);
391 int cols0 = db->cols - 1 - src_x;
392 int dy, sy = -2 + src_y, sx = src_x * ch, dx, k;
393 int* tab = (int*)alloca((a->cols + src_x + 2) * ch * sizeof(int))__builtin_alloca ((a->cols + src_x + 2) * ch * sizeof(int)
)
;
394 for (dx = 0; dx < a->cols + src_x + 2; dx++)
395 for (k = 0; k < ch; k++)
396 tab[dx * ch + k] = ((dx >= a->cols) ? a->cols * 2 - 1 - dx : dx) * ch + k;
397 unsigned char* buf = (unsigned char*)alloca(5 * db->cols * ch * ccv_max(CCV_GET_DATA_TYPE_SIZE(db->type), sizeof(int)))__builtin_alloca (5 * db->cols * ch * ({ typeof (_ccv_get_data_type_size
[((db->type) & 0xFF000) >> 12]) _a = (_ccv_get_data_type_size
[((db->type) & 0xFF000) >> 12]); typeof (sizeof(
int)) _b = (sizeof(int)); (_a > _b) ? _a : _b; }))
;
398 int bufstep = db->cols * ch * ccv_max(CCV_GET_DATA_TYPE_SIZE(db->type), sizeof(int))({ typeof (_ccv_get_data_type_size[((db->type) & 0xFF000
) >> 12]) _a = (_ccv_get_data_type_size[((db->type) &
0xFF000) >> 12]); typeof (sizeof(int)) _b = (sizeof(int
)); (_a > _b) ? _a : _b; })
;
399#ifdef __clang_analyzer__1
400 memset(buf, 0, 5 * bufstep);
401#endif
402 unsigned char* b_ptr = db->data.u8;
403 /* why is src_y * 4 in computing the offset of row?
404 * Essentially, it means sy - src_y but in a manner that doesn't result negative number.
405 * notice that we added src_y before when computing sy in the first place, however,
406 * it is not desirable to have that offset when we try to wrap it into our 5-row buffer (
407 * because in later rearrangement, we have no src_y to backup the arrangement). In
408 * such micro scope, we managed to stripe 5 addition into one shift and addition. */
409#define for_block(_for_get_a, _for_set, _for_get, _for_set_b) \
410 for (dy = 0; dy < db->rows; dy++) \
411 { \
412 for(; sy <= dy * 2 + 2 + src_y; sy++) \
413 { \
414 unsigned char* row = buf + ((sy + src_y * 4 + 2) % 5) * bufstep; \
415 int _sy = (sy < 0) ? -1 - sy : (sy >= a->rows) ? a->rows * 2 - 1 - sy : sy; \
416 unsigned char* a_ptr = a->data.u8 + a->step * _sy; \
417 for (k = 0; k < ch; k++) \
418 _for_set(row, k, _for_get_a(a_ptr, sx + k) * 10 + _for_get_a(a_ptr, ch + sx + k) * 5 + _for_get_a(a_ptr, 2 * ch + sx + k)); \
419 for(dx = ch; dx < cols0 * ch; dx += ch) \
420 for (k = 0; k < ch; k++) \
421 _for_set(row, dx + k, _for_get_a(a_ptr, dx * 2 + sx + k) * 6 + (_for_get_a(a_ptr, dx * 2 + sx + k - ch) + _for_get_a(a_ptr, dx * 2 + sx + k + ch)) * 4 + _for_get_a(a_ptr, dx * 2 + sx + k - ch * 2) + _for_get_a(a_ptr, dx * 2 + sx + k + ch * 2)); \
422 x_block(_for_get_a, _for_set, _for_get, _for_set_b); \
423 } \
424 unsigned char* rows[5]; \
425 for(k = 0; k < 5; k++) \
426 rows[k] = buf + ((dy * 2 + k) % 5) * bufstep; \
427 for(dx = 0; dx < db->cols * ch; dx++) \
428 _for_set_b(b_ptr, dx, (_for_get(rows[2], dx) * 6 + (_for_get(rows[1], dx) + _for_get(rows[3], dx)) * 4 + _for_get(rows[0], dx) + _for_get(rows[4], dx)) / 256); \
429 b_ptr += db->step; \
430 }
431 int no_8u_type = (a->type & CCV_8U) ? CCV_32S : a->type;
432 if (src_x > 0)
433 {
434#define x_block(_for_get_a, _for_set, _for_get, _for_set_b) \
435 for (dx = cols0 * ch; dx < db->cols * ch; dx += ch) \
436 for (k = 0; k < ch; k++) \
437 _for_set(row, dx + k, _for_get_a(a_ptr, tab[dx * 2 + sx + k]) * 6 + (_for_get_a(a_ptr, tab[dx * 2 + sx + k - ch]) + _for_get_a(a_ptr, tab[dx * 2 + sx + k + ch])) * 4 + _for_get_a(a_ptr, tab[dx * 2 + sx + k - ch * 2]) + _for_get_a(a_ptr, tab[dx * 2 + sx + k + ch * 2]));
438 ccv_matrix_getter_a(a->type, ccv_matrix_setter_getter, no_8u_type, ccv_matrix_setter_b, db->type, for_block){ switch (((a->type) & 0xFF000)) { case CCV_32S: { { switch
(((no_8u_type) & 0xFF000)) { case CCV_32S: { { switch ((
(db->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_32s_value)
; break; } case CCV_32F: { for_block(_ccv_get_32s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_32s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_8u_value); } } }; break; } case
CCV_32F: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_32s_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32s_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_32s_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_32s_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32s_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_8u_value);
} } }; break; } case CCV_64S: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_32s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_32s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_32s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_32s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_8u_value); } } }; break; } case CCV_64F: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_32s_value, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_32s_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32s_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32s_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_32s_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_8u_value); } } }; break; } default
: { { switch (((db->type) & 0xFF000)) { case CCV_32S: {
for_block(_ccv_get_32s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32f_value); break
; } case CCV_64S: { for_block(_ccv_get_32s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_32s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); }
} }; } } }; break; } case CCV_32F: { { switch (((no_8u_type)
& 0xFF000)) { case CCV_32S: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32f_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_32f_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_32f_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_32f_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_32f_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_8u_value); } } }; break; } case CCV_32F: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_32f_value, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_32f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_32f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_8u_value); } } }; break; } case
CCV_64S: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_32f_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32f_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_32f_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_32f_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32f_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_8u_value);
} } }; break; } case CCV_64F: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_32f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_32f_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_32f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_32f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_8u_value); } } }; break; } default: { { switch (((
db->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_32f_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32s_value); break
; } case CCV_32F: { for_block(_ccv_get_32f_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32f_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32f_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_64f_value); break
; } default: { for_block(_ccv_get_32f_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_8u_value); } } }; } } }; break;
} case CCV_64S: { { switch (((no_8u_type) & 0xFF000)) { case
CCV_32S: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_64s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_64s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_64s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_8u_value);
} } }; break; } case CCV_32F: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_64s_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_64s_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64s_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_64s_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_64s_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_8u_value); } } }; break; } case CCV_64S: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_64s_value, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_64s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_64s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_64s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_8u_value); } } }; break; } case
CCV_64F: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_64s_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64s_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_64s_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_64s_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64s_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_8u_value);
} } }; break; } default: { { switch (((db->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_64s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_64s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_64s_value); break
; } case CCV_64F: { for_block(_ccv_get_64s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_64s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_8u_value); } } }; } } }; break; } case CCV_64F: { {
switch (((no_8u_type) & 0xFF000)) { case CCV_32S: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_64f_value, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_64f_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_64f_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64f_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_64f_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_8u_value); } } }; break; } case
CCV_32F: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_64f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_64f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_64f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_8u_value);
} } }; break; } case CCV_64S: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_64f_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_64f_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64f_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_64f_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_64f_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_8u_value); } } }; break; } case CCV_64F: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_64f_value, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_64f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_64f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64f_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_64f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_8u_value); } } }; break; } default
: { { switch (((db->type) & 0xFF000)) { case CCV_32S: {
for_block(_ccv_get_64f_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64f_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32f_value); break
; } case CCV_64S: { for_block(_ccv_get_64f_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_64f_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64f_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); }
} }; } } }; break; } default: { { switch (((no_8u_type) &
0xFF000)) { case CCV_32S: { { switch (((db->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_8u_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_8u_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_8u_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_8u_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_8u_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_8u_value); } } }; break; } case CCV_32F: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_8u_value, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_8u_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_8u_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_8u_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_8u_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_8u_value); } } }; break; } case
CCV_64S: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_8u_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_8u_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_8u_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_8u_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_8u_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_8u_value);
} } }; break; } case CCV_64F: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_8u_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_8u_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_8u_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_8u_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_8u_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_8u_value); } } }; break; } default: { { switch (((
db->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_8u_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32s_value); break
; } case CCV_32F: { for_block(_ccv_get_8u_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_8u_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_8u_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_64f_value); break
; } default: { for_block(_ccv_get_8u_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_8u_value); } } }; } } }; } } }
;
439#undef x_block
440 } else {
441#define x_block(_for_get_a, _for_set, _for_get, _for_set_b) \
442 for (k = 0; k < ch; k++) \
443 _for_set(row, (db->cols - 1) * ch + k, _for_get_a(a_ptr, a->cols * ch + sx - ch + k) * 10 + _for_get_a(a_ptr, (a->cols - 2) * ch + sx + k) * 5 + _for_get_a(a_ptr, (a->cols - 3) * ch + sx + k));
444 ccv_matrix_getter_a(a->type, ccv_matrix_setter_getter, no_8u_type, ccv_matrix_setter_b, db->type, for_block){ switch (((a->type) & 0xFF000)) { case CCV_32S: { { switch
(((no_8u_type) & 0xFF000)) { case CCV_32S: { { switch ((
(db->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_32s_value)
; break; } case CCV_32F: { for_block(_ccv_get_32s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_32s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_8u_value); } } }; break; } case
CCV_32F: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_32s_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32s_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_32s_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_32s_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32s_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_8u_value);
} } }; break; } case CCV_64S: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_32s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_32s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_32s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_32s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_8u_value); } } }; break; } case CCV_64F: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_32s_value, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_32s_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32s_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32s_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_32s_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_8u_value); } } }; break; } default
: { { switch (((db->type) & 0xFF000)) { case CCV_32S: {
for_block(_ccv_get_32s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32f_value); break
; } case CCV_64S: { for_block(_ccv_get_32s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_32s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); }
} }; } } }; break; } case CCV_32F: { { switch (((no_8u_type)
& 0xFF000)) { case CCV_32S: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32f_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_32f_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_32f_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_32f_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_32f_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_8u_value); } } }; break; } case CCV_32F: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_32f_value, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_32f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_32f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_8u_value); } } }; break; } case
CCV_64S: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_32f_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32f_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_32f_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_32f_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32f_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_8u_value);
} } }; break; } case CCV_64F: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_32f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_32f_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_32f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_32f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_8u_value); } } }; break; } default: { { switch (((
db->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_32f_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32s_value); break
; } case CCV_32F: { for_block(_ccv_get_32f_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32f_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32f_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_64f_value); break
; } default: { for_block(_ccv_get_32f_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_8u_value); } } }; } } }; break;
} case CCV_64S: { { switch (((no_8u_type) & 0xFF000)) { case
CCV_32S: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_64s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_64s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_64s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_8u_value);
} } }; break; } case CCV_32F: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_64s_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_64s_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64s_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_64s_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_64s_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_8u_value); } } }; break; } case CCV_64S: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_64s_value, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_64s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_64s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_64s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_8u_value); } } }; break; } case
CCV_64F: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_64s_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64s_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_64s_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_64s_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64s_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_8u_value);
} } }; break; } default: { { switch (((db->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_64s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_64s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_64s_value); break
; } case CCV_64F: { for_block(_ccv_get_64s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_64s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_8u_value); } } }; } } }; break; } case CCV_64F: { {
switch (((no_8u_type) & 0xFF000)) { case CCV_32S: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_64f_value, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_64f_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_64f_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64f_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_64f_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_8u_value); } } }; break; } case
CCV_32F: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_64f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_64f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_64f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_8u_value);
} } }; break; } case CCV_64S: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_64f_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_64f_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64f_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_64f_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_64f_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_8u_value); } } }; break; } case CCV_64F: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_64f_value, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_64f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_64f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64f_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_64f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_8u_value); } } }; break; } default
: { { switch (((db->type) & 0xFF000)) { case CCV_32S: {
for_block(_ccv_get_64f_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64f_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32f_value); break
; } case CCV_64S: { for_block(_ccv_get_64f_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_64f_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64f_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); }
} }; } } }; break; } default: { { switch (((no_8u_type) &
0xFF000)) { case CCV_32S: { { switch (((db->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_8u_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_8u_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_8u_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_8u_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_8u_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_8u_value); } } }; break; } case CCV_32F: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_8u_value, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_8u_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_8u_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_8u_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_8u_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_8u_value); } } }; break; } case
CCV_64S: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_8u_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_8u_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_8u_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_8u_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_8u_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_8u_value);
} } }; break; } case CCV_64F: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_8u_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_8u_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_8u_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_8u_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_8u_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_8u_value); } } }; break; } default: { { switch (((
db->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_8u_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32s_value); break
; } case CCV_32F: { for_block(_ccv_get_8u_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_8u_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_8u_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_64f_value); break
; } default: { for_block(_ccv_get_8u_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_8u_value); } } }; } } }; } } }
;
445#undef x_block
446 }
447#undef for_block
448}
449
450void ccv_sample_up(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int type, int src_x, int src_y)
451{
452 assert(src_x >= 0 && src_y >= 0)((void) sizeof ((src_x >= 0 && src_y >= 0) ? 1 :
0), __extension__ ({ if (src_x >= 0 && src_y >=
0) ; else __assert_fail ("src_x >= 0 && src_y >= 0"
, "ccv_resample.c", 452, __extension__ __PRETTY_FUNCTION__); }
))
;
453 ccv_declare_derived_signature(sig, a->sig != 0, ccv_sign_with_format(64, "ccv_sample_up(%d,%d)", src_x, src_y), a->sig, CCV_EOF_SIGN)char _ccv_identifier_453[(64)]; memset(_ccv_identifier_453, 0
, (64)); snprintf(_ccv_identifier_453, (64), ("ccv_sample_up(%d,%d)"
), src_x, src_y); size_t _ccv_string_size_453 = (64);; uint64_t
sig = (a->sig != 0) ? ccv_cache_generate_signature(_ccv_identifier_453
, _ccv_string_size_453, a->sig, ((uint64_t)0)) : 0;
;
454 type = (type == 0) ? CCV_GET_DATA_TYPE(a->type)((a->type) & 0xFF000) | CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF) : CCV_GET_DATA_TYPE(type)((type) & 0xFF000) | CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF);
455 ccv_dense_matrix_t* db = *b = ccv_dense_matrix_renew(*b, a->rows * 2, a->cols * 2, CCV_ALL_DATA_TYPE(CCV_8U | CCV_32S | CCV_32F | CCV_64S | CCV_64F) | CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF), type, sig);
456 ccv_object_return_if_cached(, db){ if ((!(db) || (((int*)(db))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE
)) && (!(0) || (((int*)(0))[0] & CCV_GARBAGE)) &&
(!(0) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0
) || (((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (
((int*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int
*)(0))[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0)
)[0] & CCV_GARBAGE)) && (!(0) || (((int*)(0))[0] &
CCV_GARBAGE))) { (void)((db) && (((int*)(db))[0] &=
~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~
CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE
));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE)
);(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE))
;(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));
(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(
void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void
)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)
((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)(
(0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((
0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0
) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0)
&& (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) &&
(((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (
((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && ((
(int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((
int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int
*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*
)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)
(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(
0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0
))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0)
)[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))
[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[
0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0
] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0]
&= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &=
~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~
CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE
));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE)
);(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE))
;(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));
(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(
void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void
)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)
((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)(
(0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((
0) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0
) && (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0)
&& (((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) &&
(((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (
((int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && ((
(int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((
int*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int
*)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*
)(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)
(0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(
0))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0
))[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0)
)[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))
[0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[
0] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0
] &= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0]
&= ~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &=
~CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~
CCV_GARBAGE));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE
));(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE)
);(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE))
;(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));
(void)((0) && (((int*)(0))[0] &= ~CCV_GARBAGE));;
; return ; } }
;
457 int ch = CCV_GET_CHANNEL(a->type)((a->type) & 0xFFF);
458 int cols0 = a->cols - 1 - src_x;
459 assert(a->cols > 0 && cols0 > 0)((void) sizeof ((a->cols > 0 && cols0 > 0) ?
1 : 0), __extension__ ({ if (a->cols > 0 && cols0
> 0) ; else __assert_fail ("a->cols > 0 && cols0 > 0"
, "ccv_resample.c", 459, __extension__ __PRETTY_FUNCTION__); }
))
;
460 int y, x, sy = -1 + src_y, sx = src_x * ch, k;
461 int* tab = (int*)alloca((a->cols + src_x + 2) * ch * sizeof(int))__builtin_alloca ((a->cols + src_x + 2) * ch * sizeof(int)
)
;
462 for (x = 0; x < a->cols + src_x + 2; x++)
463 for (k = 0; k < ch; k++)
464 tab[x * ch + k] = ((x >= a->cols) ? a->cols * 2 - 1 - x : x) * ch + k;
465 unsigned char* buf = (unsigned char*)alloca(3 * db->cols * ch * ccv_max(CCV_GET_DATA_TYPE_SIZE(db->type), sizeof(int)))__builtin_alloca (3 * db->cols * ch * ({ typeof (_ccv_get_data_type_size
[((db->type) & 0xFF000) >> 12]) _a = (_ccv_get_data_type_size
[((db->type) & 0xFF000) >> 12]); typeof (sizeof(
int)) _b = (sizeof(int)); (_a > _b) ? _a : _b; }))
;
466 int bufstep = db->cols * ch * ccv_max(CCV_GET_DATA_TYPE_SIZE(db->type), sizeof(int))({ typeof (_ccv_get_data_type_size[((db->type) & 0xFF000
) >> 12]) _a = (_ccv_get_data_type_size[((db->type) &
0xFF000) >> 12]); typeof (sizeof(int)) _b = (sizeof(int
)); (_a > _b) ? _a : _b; })
;
467#ifdef __clang_analyzer__1
468 memset(buf, 0, 3 * bufstep);
469#endif
470 unsigned char* b_ptr = db->data.u8;
471 /* why src_y * 2: the same argument as in ccv_sample_down */
472#define for_block(_for_get_a, _for_set, _for_get, _for_set_b) \
473 for (y = 0; y < a->rows; y++) \
474 { \
475 for (; sy <= y + 1 + src_y; sy++) \
476 { \
477 unsigned char* row = buf + ((sy + src_y * 2 + 1) % 3) * bufstep; \
478 int _sy = (sy < 0) ? -1 - sy : (sy >= a->rows) ? a->rows * 2 - 1 - sy : sy; \
479 unsigned char* a_ptr = a->data.u8 + a->step * _sy; \
480 if (a->cols == 1) \
481 { \
482 for (k = 0; k < ch; k++) \
483 { \
484 _for_set(row, k, _for_get_a(a_ptr, k) * (G025 + G075 + G125)); \
485 _for_set(row, k + ch, _for_get_a(a_ptr, k) * (G025 + G075 + G125)); \
486 } \
487 continue; \
488 } \
489 if (sx == 0) \
490 { \
491 for (k = 0; k < ch; k++) \
492 { \
493 _for_set(row, k, _for_get_a(a_ptr, k + sx) * (G025 + G075) + _for_get_a(a_ptr, k + sx + ch) * G125); \
494 _for_set(row, k + ch, _for_get_a(a_ptr, k + sx) * (G125 + G025) + _for_get_a(a_ptr, k + sx + ch) * G075); \
495 } \
496 } \
497 /* some serious flaw in computing Gaussian weighting in previous version
498 * specially, we are doing perfect upsampling (2x) so, it concerns a grid like:
499 * XXYY
500 * XXYY
501 * in this case, to upsampling, the weight should be from distance 0.25 and 1.25, and 0.25 and 0.75
502 * previously, it was mistakingly be 0.0 1.0, 0.5 0.5 (imperfect upsampling (2x - 1)) */ \
503 for (x = (sx == 0) ? ch : 0; x < cols0 * ch; x += ch) \
504 { \
505 for (k = 0; k < ch; k++) \
506 { \
507 _for_set(row, x * 2 + k, _for_get_a(a_ptr, x + sx - ch + k) * G075 + _for_get_a(a_ptr, x + sx + k) * G025 + _for_get_a(a_ptr, x + sx + ch + k) * G125); \
508 _for_set(row, x * 2 + ch + k, _for_get_a(a_ptr, x + sx - ch + k) * G125 + _for_get_a(a_ptr, x + sx + k) * G025 + _for_get_a(a_ptr, x + sx + ch + k) * G075); \
509 } \
510 } \
511 x_block(_for_get_a, _for_set, _for_get, _for_set_b); \
512 } \
513 unsigned char* rows[3]; \
514 for (k = 0; k < 3; k++) \
515 rows[k] = buf + ((y + k) % 3) * bufstep; \
516 for (x = 0; x < db->cols * ch; x++) \
517 { \
518 _for_set_b(b_ptr, x, (_for_get(rows[0], x) * G075 + _for_get(rows[1], x) * G025 + _for_get(rows[2], x) * G125) / GALL); \
519 _for_set_b(b_ptr + db->step, x, (_for_get(rows[0], x) * G125 + _for_get(rows[1], x) * G025 + _for_get(rows[2], x) * G075) / GALL); \
520 } \
521 b_ptr += 2 * db->step; \
522 }
523 int no_8u_type = (a->type & CCV_8U) ? CCV_32S : a->type;
524 /* unswitch if condition in manual way */
525 if ((a->type & CCV_8U) || (a->type & CCV_32S) || (a->type & CCV_64S))
526 {
527#define G025 (23)
528#define G075 (8)
529#define G125 (1)
530#define GALL (1024)
531 if (src_x > 0)
532 {
533#define x_block(_for_get_a, _for_set, _for_get, _for_set_b) \
534 for (x = cols0 * ch; x < a->cols * ch; x += ch) \
535 for (k = 0; k < ch; k++) \
536 { \
537 _for_set(row, x * 2 + k, _for_get_a(a_ptr, tab[x + sx - ch + k]) * G075 + _for_get_a(a_ptr, tab[x + sx + k]) * G025 + _for_get_a(a_ptr, tab[x + sx + ch + k]) * G125); \
538 _for_set(row, x * 2 + ch + k, _for_get_a(a_ptr, tab[x + sx - ch + k]) * G125 + _for_get_a(a_ptr, tab[x + sx + k]) * G025 + _for_get_a(a_ptr, tab[x + sx + ch + k], 0) * G075); \
539 }
540 ccv_matrix_getter_integer_only(a->type, ccv_matrix_setter_getter_integer_only, no_8u_type, ccv_matrix_setter_b, db->type, for_block){ switch (((a->type) & 0xFF000)) { case CCV_32S: { { switch
(((no_8u_type) & 0xFF000)) { case CCV_32S: { { switch ((
(db->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_32s_value)
; break; } case CCV_32F: { for_block(_ccv_get_32s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_32s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_8u_value); } } }; break; } case
CCV_64S: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_32s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_32s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_32s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_8u_value);
} } }; break; } case CCV_8U: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_32s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_32s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_64s_value); break
; } case CCV_64F: { for_block(_ccv_get_32s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_32s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_8u_value); } } }; break; } default: { ((void) sizeof
(((no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) ||
(no_8u_type & CCV_8U)) ? 1 : 0), __extension__ ({ if ((no_8u_type
& CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type &
CCV_8U)) ; else __assert_fail ("(no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)"
, "ccv_resample.c", 540, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64S: { { switch (((no_8u_type) &
0xFF000)) { case CCV_32S: { { switch (((db->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_64s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_64s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_64s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_64s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_8u_value); } } }; break; } case CCV_64S: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_64s_value, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_64s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_64s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_64s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_8u_value); } } }; break; } case
CCV_8U: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_64s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32f_value); break
; } case CCV_64S: { for_block(_ccv_get_64s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_64s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); }
} }; break; } default: { ((void) sizeof (((no_8u_type & CCV_32S
) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U))
? 1 : 0), __extension__ ({ if ((no_8u_type & CCV_32S) ||
(no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)) ; else
__assert_fail ("(no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)"
, "ccv_resample.c", 540, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_8U: { { switch (((no_8u_type) &
0xFF000)) { case CCV_32S: { { switch (((db->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_8u_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_8u_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_8u_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_8u_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_8u_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_8u_value); } } }; break; } case CCV_64S: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_8u_value, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_8u_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_8u_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_8u_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_8u_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_8u_value); } } }; break; } case
CCV_8U: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_8u_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_8u_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32f_value); break
; } case CCV_64S: { for_block(_ccv_get_8u_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_8u_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_8u_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); }
} }; break; } default: { ((void) sizeof (((no_8u_type & CCV_32S
) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U))
? 1 : 0), __extension__ ({ if ((no_8u_type & CCV_32S) ||
(no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)) ; else
__assert_fail ("(no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)"
, "ccv_resample.c", 540, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } default: { ((void) sizeof (((a->type &
CCV_32S) || (a->type & CCV_64S) || (a->type & CCV_8U
)) ? 1 : 0), __extension__ ({ if ((a->type & CCV_32S) ||
(a->type & CCV_64S) || (a->type & CCV_8U)) ; else
__assert_fail ("(a->type & CCV_32S) || (a->type & CCV_64S) || (a->type & CCV_8U)"
, "ccv_resample.c", 540, __extension__ __PRETTY_FUNCTION__); }
)); } } }
;
541#undef x_block
542 } else {
543#define x_block(_for_get_a, _for_set, _for_get, _for_set_b) \
544 for (k = 0; k < ch; k++) \
545 { \
546 _for_set(row, (a->cols - 1) * 2 * ch + k, _for_get_a(a_ptr, (a->cols - 2) * ch + k) * G075 + _for_get_a(a_ptr, (a->cols - 1) * ch + k) * (G025 + G125)); \
547 _for_set(row, (a->cols - 1) * 2 * ch + ch + k, _for_get_a(a_ptr, (a->cols - 2) * ch + k) * G125 + _for_get_a(a_ptr, (a->cols - 1) * ch + k) * (G025 + G075)); \
548 }
549 ccv_matrix_getter_integer_only(a->type, ccv_matrix_setter_getter_integer_only, no_8u_type, ccv_matrix_setter_b, db->type, for_block){ switch (((a->type) & 0xFF000)) { case CCV_32S: { { switch
(((no_8u_type) & 0xFF000)) { case CCV_32S: { { switch ((
(db->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_32s_value)
; break; } case CCV_32F: { for_block(_ccv_get_32s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_32s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_8u_value); } } }; break; } case
CCV_64S: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_32s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_32s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_32s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_8u_value);
} } }; break; } case CCV_8U: { { switch (((db->type) &
0xFF000)) { case CCV_32S: { for_block(_ccv_get_32s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_32s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_32s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_64s_value); break
; } case CCV_64F: { for_block(_ccv_get_32s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_32s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_8u_value); } } }; break; } default: { ((void) sizeof
(((no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) ||
(no_8u_type & CCV_8U)) ? 1 : 0), __extension__ ({ if ((no_8u_type
& CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type &
CCV_8U)) ; else __assert_fail ("(no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)"
, "ccv_resample.c", 549, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64S: { { switch (((no_8u_type) &
0xFF000)) { case CCV_32S: { { switch (((db->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_64s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_64s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64s_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_64s_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_64s_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_8u_value); } } }; break; } case CCV_64S: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_64s_value, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_64s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_64s_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64s_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_64s_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_8u_value); } } }; break; } case
CCV_8U: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_64s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_64s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32f_value); break
; } case CCV_64S: { for_block(_ccv_get_64s_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_64s_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_64s_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); }
} }; break; } default: { ((void) sizeof (((no_8u_type & CCV_32S
) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U))
? 1 : 0), __extension__ ({ if ((no_8u_type & CCV_32S) ||
(no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)) ; else
__assert_fail ("(no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)"
, "ccv_resample.c", 549, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_8U: { { switch (((no_8u_type) &
0xFF000)) { case CCV_32S: { { switch (((db->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_8u_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_8u_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_8u_value
, _ccv_set_32s_value, _ccv_get_32s_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_8u_value, _ccv_set_32s_value
, _ccv_get_32s_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_8u_value, _ccv_set_32s_value, _ccv_get_32s_value
, _ccv_set_8u_value); } } }; break; } case CCV_64S: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_8u_value, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_8u_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_8u_value, _ccv_set_64s_value, _ccv_get_64s_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_8u_value
, _ccv_set_64s_value, _ccv_get_64s_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_8u_value, _ccv_set_64s_value
, _ccv_get_64s_value, _ccv_set_8u_value); } } }; break; } case
CCV_8U: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_8u_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_8u_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_32f_value); break
; } case CCV_64S: { for_block(_ccv_get_8u_value, _ccv_set_8u_value
, _ccv_get_8u_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_8u_value, _ccv_set_8u_value, _ccv_get_8u_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_8u_value
, _ccv_set_8u_value, _ccv_get_8u_value, _ccv_set_8u_value); }
} }; break; } default: { ((void) sizeof (((no_8u_type & CCV_32S
) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U))
? 1 : 0), __extension__ ({ if ((no_8u_type & CCV_32S) ||
(no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)) ; else
__assert_fail ("(no_8u_type & CCV_32S) || (no_8u_type & CCV_64S) || (no_8u_type & CCV_8U)"
, "ccv_resample.c", 549, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } default: { ((void) sizeof (((a->type &
CCV_32S) || (a->type & CCV_64S) || (a->type & CCV_8U
)) ? 1 : 0), __extension__ ({ if ((a->type & CCV_32S) ||
(a->type & CCV_64S) || (a->type & CCV_8U)) ; else
__assert_fail ("(a->type & CCV_32S) || (a->type & CCV_64S) || (a->type & CCV_8U)"
, "ccv_resample.c", 549, __extension__ __PRETTY_FUNCTION__); }
)); } } }
;
550#undef x_block
551 }
552#undef GALL
553#undef G125
554#undef G075
555#undef G025
556 } else {
557#define G025 (0.705385)
558#define G075 (0.259496)
559#define G125 (0.035119)
560#define GALL (1)
561 if (src_x > 0)
562 {
563#define x_block(_for_get_a, _for_set, _for_get, _for_set_b) \
564 for (x = cols0 * ch; x < a->cols * ch; x += ch) \
565 for (k = 0; k < ch; k++) \
566 { \
567 _for_set(row, x * 2 + k, _for_get_a(a_ptr, tab[x + sx - ch + k]) * G075 + _for_get_a(a_ptr, tab[x + sx + k]) * G025 + _for_get_a(a_ptr, tab[x + sx + ch + k]) * G125); \
568 _for_set(row, x * 2 + ch + k, _for_get_a(a_ptr, tab[x + sx - ch + k]) * G125 + _for_get_a(a_ptr, tab[x + sx + k]) * G025 + _for_get_a(a_ptr, tab[x + sx + ch + k]) * G075); \
569 }
570 ccv_matrix_getter_float_only(a->type, ccv_matrix_setter_getter_float_only, no_8u_type, ccv_matrix_setter_b, db->type, for_block){ switch (((a->type) & 0xFF000)) { case CCV_32F: { { switch
(((no_8u_type) & 0xFF000)) { case CCV_32F: { { switch ((
(db->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_32f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_32s_value)
; break; } case CCV_32F: { for_block(_ccv_get_32f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_32f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_8u_value); } } }; break; } case
CCV_64F: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_32f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32f_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_32f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_32f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32f_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_8u_value);
} } }; break; } default: { ((void) sizeof (((no_8u_type &
CCV_32F) || (no_8u_type & CCV_64F)) ? 1 : 0), __extension__
({ if ((no_8u_type & CCV_32F) || (no_8u_type & CCV_64F
)) ; else __assert_fail ("(no_8u_type & CCV_32F) || (no_8u_type & CCV_64F)"
, "ccv_resample.c", 570, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64F: { { switch (((no_8u_type) &
0xFF000)) { case CCV_32F: { { switch (((db->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_64f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_64f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_64f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_64f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_8u_value); } } }; break; } case CCV_64F: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_64f_value, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_64f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_64f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64f_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_64f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_8u_value); } } }; break; } default
: { ((void) sizeof (((no_8u_type & CCV_32F) || (no_8u_type
& CCV_64F)) ? 1 : 0), __extension__ ({ if ((no_8u_type &
CCV_32F) || (no_8u_type & CCV_64F)) ; else __assert_fail
("(no_8u_type & CCV_32F) || (no_8u_type & CCV_64F)",
"ccv_resample.c", 570, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } default: { ((void) sizeof (((a->type &
CCV_32F) || (a->type & CCV_64F)) ? 1 : 0), __extension__
({ if ((a->type & CCV_32F) || (a->type & CCV_64F
)) ; else __assert_fail ("(a->type & CCV_32F) || (a->type & CCV_64F)"
, "ccv_resample.c", 570, __extension__ __PRETTY_FUNCTION__); }
)); } } }
;
571#undef x_block
572 } else {
573#define x_block(_for_get_a, _for_set, _for_get, _for_set_b) \
574 for (k = 0; k < ch; k++) \
575 { \
576 _for_set(row, (a->cols - 1) * 2 * ch + k, _for_get_a(a_ptr, (a->cols - 2) * ch + k) * G075 + _for_get_a(a_ptr, (a->cols - 1) * ch + k) * (G025 + G125)); \
577 _for_set(row, (a->cols - 1) * 2 * ch + ch + k, _for_get_a(a_ptr, (a->cols - 2) * ch + k) * G125 + _for_get_a(a_ptr, (a->cols - 1) * ch + k) * (G025 + G075)); \
578 }
579 ccv_matrix_getter_float_only(a->type, ccv_matrix_setter_getter_float_only, no_8u_type, ccv_matrix_setter_b, db->type, for_block){ switch (((a->type) & 0xFF000)) { case CCV_32F: { { switch
(((no_8u_type) & 0xFF000)) { case CCV_32F: { { switch ((
(db->type) & 0xFF000)) { case CCV_32S: { for_block(_ccv_get_32f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_32s_value)
; break; } case CCV_32F: { for_block(_ccv_get_32f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_32f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_32f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_32f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_8u_value); } } }; break; } case
CCV_64F: { { switch (((db->type) & 0xFF000)) { case CCV_32S
: { for_block(_ccv_get_32f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_32s_value); break; } case CCV_32F: { for_block(_ccv_get_32f_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_32f_value)
; break; } case CCV_64S: { for_block(_ccv_get_32f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_64s_value); break; } case CCV_64F
: { for_block(_ccv_get_32f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_64f_value); break; } default: { for_block(_ccv_get_32f_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_8u_value);
} } }; break; } default: { ((void) sizeof (((no_8u_type &
CCV_32F) || (no_8u_type & CCV_64F)) ? 1 : 0), __extension__
({ if ((no_8u_type & CCV_32F) || (no_8u_type & CCV_64F
)) ; else __assert_fail ("(no_8u_type & CCV_32F) || (no_8u_type & CCV_64F)"
, "ccv_resample.c", 579, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } case CCV_64F: { { switch (((no_8u_type) &
0xFF000)) { case CCV_32F: { { switch (((db->type) & 0xFF000
)) { case CCV_32S: { for_block(_ccv_get_64f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_32s_value); break; } case CCV_32F
: { for_block(_ccv_get_64f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_32f_value); break; } case CCV_64S: { for_block(_ccv_get_64f_value
, _ccv_set_32f_value, _ccv_get_32f_value, _ccv_set_64s_value)
; break; } case CCV_64F: { for_block(_ccv_get_64f_value, _ccv_set_32f_value
, _ccv_get_32f_value, _ccv_set_64f_value); break; } default: {
for_block(_ccv_get_64f_value, _ccv_set_32f_value, _ccv_get_32f_value
, _ccv_set_8u_value); } } }; break; } case CCV_64F: { { switch
(((db->type) & 0xFF000)) { case CCV_32S: { for_block(
_ccv_get_64f_value, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_32s_value
); break; } case CCV_32F: { for_block(_ccv_get_64f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_32f_value); break; } case CCV_64S
: { for_block(_ccv_get_64f_value, _ccv_set_64f_value, _ccv_get_64f_value
, _ccv_set_64s_value); break; } case CCV_64F: { for_block(_ccv_get_64f_value
, _ccv_set_64f_value, _ccv_get_64f_value, _ccv_set_64f_value)
; break; } default: { for_block(_ccv_get_64f_value, _ccv_set_64f_value
, _ccv_get_64f_value, _ccv_set_8u_value); } } }; break; } default
: { ((void) sizeof (((no_8u_type & CCV_32F) || (no_8u_type
& CCV_64F)) ? 1 : 0), __extension__ ({ if ((no_8u_type &
CCV_32F) || (no_8u_type & CCV_64F)) ; else __assert_fail
("(no_8u_type & CCV_32F) || (no_8u_type & CCV_64F)",
"ccv_resample.c", 579, __extension__ __PRETTY_FUNCTION__); }
)); } } }; break; } default: { ((void) sizeof (((a->type &
CCV_32F) || (a->type & CCV_64F)) ? 1 : 0), __extension__
({ if ((a->type & CCV_32F) || (a->type & CCV_64F
)) ; else __assert_fail ("(a->type & CCV_32F) || (a->type & CCV_64F)"
, "ccv_resample.c", 579, __extension__ __PRETTY_FUNCTION__); }
)); } } }
;
580#undef x_block
581 }
582#undef GALL
583#undef G125
584#undef G075
585#undef G025
586 }
587#undef for_block
588}