37 #include "allheaders.h"
39 static void fhmt_1_0(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);
40 static void fhmt_1_1(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);
41 static void fhmt_1_2(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);
42 static void fhmt_1_3(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);
43 static void fhmt_1_4(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);
44 static void fhmt_1_5(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);
45 static void fhmt_1_6(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);
46 static void fhmt_1_7(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);
47 static void fhmt_1_8(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);
48 static void fhmt_1_9(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);
60 fhmtgen_low_1(l_uint32 *datad,
72 fhmt_1_0(datad, w, h, wpld, datas, wpls);
75 fhmt_1_1(datad, w, h, wpld, datas, wpls);
78 fhmt_1_2(datad, w, h, wpld, datas, wpls);
81 fhmt_1_3(datad, w, h, wpld, datas, wpls);
84 fhmt_1_4(datad, w, h, wpld, datas, wpls);
87 fhmt_1_5(datad, w, h, wpld, datas, wpls);
90 fhmt_1_6(datad, w, h, wpld, datas, wpls);
93 fhmt_1_7(datad, w, h, wpld, datas, wpls);
96 fhmt_1_8(datad, w, h, wpld, datas, wpls);
99 fhmt_1_9(datad, w, h, wpld, datas, wpls);
119 fhmt_1_0(l_uint32 *datad,
128 l_uint32 *sptr, *dptr;
130 pwpls = (l_uint32)(w + 31) / 32;
132 for (i = 0; i < h; i++) {
133 sptr = datas + i * wpls;
134 dptr = datad + i * wpld;
135 for (j = 0; j < pwpls; j++, sptr++, dptr++) {
136 *dptr = ((~*(sptr - wpls) >> 1) | (~*(sptr - wpls - 1) << 31)) &
138 ((~*(sptr - wpls) << 1) | (~*(sptr - wpls + 1) >> 31)) &
139 ((~*(sptr) >> 1) | (~*(sptr - 1) << 31)) &
141 ((~*(sptr) << 1) | (~*(sptr + 1) >> 31)) &
142 ((~*(sptr + wpls) >> 1) | (~*(sptr + wpls - 1) << 31)) &
144 ((~*(sptr + wpls) << 1) | (~*(sptr + wpls + 1) >> 31));
150 fhmt_1_1(l_uint32 *datad,
159 l_uint32 *sptr, *dptr;
161 pwpls = (l_uint32)(w + 31) / 32;
163 for (i = 0; i < h; i++) {
164 sptr = datas + i * wpls;
165 dptr = datad + i * wpld;
166 for (j = 0; j < pwpls; j++, sptr++, dptr++) {
167 *dptr = ((*(sptr) >> 1) | (*(sptr - 1) << 31)) &
169 ((*(sptr) << 1) | (*(sptr + 1) >> 31)) &
170 ((~*(sptr + wpls) >> 1) | (~*(sptr + wpls - 1) << 31)) &
172 ((~*(sptr + wpls) << 1) | (~*(sptr + wpls + 1) >> 31));
178 fhmt_1_2(l_uint32 *datad,
187 l_uint32 *sptr, *dptr;
189 pwpls = (l_uint32)(w + 31) / 32;
191 for (i = 0; i < h; i++) {
192 sptr = datas + i * wpls;
193 dptr = datad + i * wpld;
194 for (j = 0; j < pwpls; j++, sptr++, dptr++) {
195 *dptr = ((~*(sptr - wpls) >> 1) | (~*(sptr - wpls - 1) << 31)) &
197 ((~*(sptr - wpls) << 1) | (~*(sptr - wpls + 1) >> 31)) &
198 ((*(sptr) >> 1) | (*(sptr - 1) << 31)) &
200 ((*(sptr) << 1) | (*(sptr + 1) >> 31));
206 fhmt_1_3(l_uint32 *datad,
215 l_uint32 *sptr, *dptr;
217 pwpls = (l_uint32)(w + 31) / 32;
219 for (i = 0; i < h; i++) {
220 sptr = datas + i * wpls;
221 dptr = datad + i * wpld;
222 for (j = 0; j < pwpls; j++, sptr++, dptr++) {
223 *dptr = (*(sptr - wpls)) &
224 ((~*(sptr - wpls) << 1) | (~*(sptr - wpls + 1) >> 31)) &
226 ((~*(sptr) << 1) | (~*(sptr + 1) >> 31)) &
228 ((~*(sptr + wpls) << 1) | (~*(sptr + wpls + 1) >> 31));
234 fhmt_1_4(l_uint32 *datad,
243 l_uint32 *sptr, *dptr;
245 pwpls = (l_uint32)(w + 31) / 32;
247 for (i = 0; i < h; i++) {
248 sptr = datas + i * wpls;
249 dptr = datad + i * wpld;
250 for (j = 0; j < pwpls; j++, sptr++, dptr++) {
251 *dptr = ((~*(sptr - wpls) >> 1) | (~*(sptr - wpls - 1) << 31)) &
253 ((~*(sptr) >> 1) | (~*(sptr - 1) << 31)) &
255 ((~*(sptr + wpls) >> 1) | (~*(sptr + wpls - 1) << 31)) &
262 fhmt_1_5(l_uint32 *datad,
271 l_uint32 *sptr, *dptr;
272 l_int32 wpls2, wpls3, wpls4;
273 l_int32 wpls5, wpls6;
280 pwpls = (l_uint32)(w + 31) / 32;
282 for (i = 0; i < h; i++) {
283 sptr = datas + i * wpls;
284 dptr = datad + i * wpld;
285 for (j = 0; j < pwpls; j++, sptr++, dptr++) {
286 *dptr = ((~*(sptr - wpls6) << 1) | (~*(sptr - wpls6 + 1) >> 31)) &
287 ((*(sptr - wpls6) << 3) | (*(sptr - wpls6 + 1) >> 29)) &
289 ((*(sptr - wpls2) << 2) | (*(sptr - wpls2 + 1) >> 30)) &
290 ((~*(sptr + wpls2) >> 1) | (~*(sptr + wpls2 - 1) << 31)) &
291 ((*(sptr + wpls2) << 1) | (*(sptr + wpls2 + 1) >> 31)) &
292 ((~*(sptr + wpls6) >> 2) | (~*(sptr + wpls6 - 1) << 30)) &
299 fhmt_1_6(l_uint32 *datad,
308 l_uint32 *sptr, *dptr;
312 pwpls = (l_uint32)(w + 31) / 32;
314 for (i = 0; i < h; i++) {
315 sptr = datas + i * wpls;
316 dptr = datad + i * wpld;
317 for (j = 0; j < pwpls; j++, sptr++, dptr++) {
318 *dptr = ((~*(sptr - wpls) >> 1) | (~*(sptr - wpls - 1) << 31)) &
320 ((~*(sptr - wpls) << 1) | (~*(sptr - wpls + 1) >> 31)) &
321 ((~*(sptr - wpls) << 2) | (~*(sptr - wpls + 1) >> 30)) &
322 ((~*(sptr) >> 1) | (~*(sptr - 1) << 31)) &
323 ((*(sptr) << 2) | (*(sptr + 1) >> 30)) &
324 ((~*(sptr + wpls) >> 1) | (~*(sptr + wpls - 1) << 31)) &
325 ((*(sptr + wpls) << 1) | (*(sptr + wpls + 1) >> 31)) &
326 ((*(sptr + wpls) << 2) | (*(sptr + wpls + 1) >> 30)) &
327 ((~*(sptr + wpls2) >> 1) | (~*(sptr + wpls2 - 1) << 31)) &
329 ((*(sptr + wpls2) << 1) | (*(sptr + wpls2 + 1) >> 31)) &
330 ((*(sptr + wpls2) << 2) | (*(sptr + wpls2 + 1) >> 30));
336 fhmt_1_7(l_uint32 *datad,
345 l_uint32 *sptr, *dptr;
349 pwpls = (l_uint32)(w + 31) / 32;
351 for (i = 0; i < h; i++) {
352 sptr = datas + i * wpls;
353 dptr = datad + i * wpld;
354 for (j = 0; j < pwpls; j++, sptr++, dptr++) {
355 *dptr = ((~*(sptr - wpls) >> 2) | (~*(sptr - wpls - 1) << 30)) &
356 ((~*(sptr - wpls) >> 1) | (~*(sptr - wpls - 1) << 31)) &
358 ((~*(sptr - wpls) << 1) | (~*(sptr - wpls + 1) >> 31)) &
359 ((*(sptr) >> 2) | (*(sptr - 1) << 30)) &
360 ((~*(sptr) << 1) | (~*(sptr + 1) >> 31)) &
361 ((*(sptr + wpls) >> 2) | (*(sptr + wpls - 1) << 30)) &
362 ((*(sptr + wpls) >> 1) | (*(sptr + wpls - 1) << 31)) &
363 ((~*(sptr + wpls) << 1) | (~*(sptr + wpls + 1) >> 31)) &
364 ((*(sptr + wpls2) >> 2) | (*(sptr + wpls2 - 1) << 30)) &
365 ((*(sptr + wpls2) >> 1) | (*(sptr + wpls2 - 1) << 31)) &
367 ((~*(sptr + wpls2) << 1) | (~*(sptr + wpls2 + 1) >> 31));
373 fhmt_1_8(l_uint32 *datad,
382 l_uint32 *sptr, *dptr;
386 pwpls = (l_uint32)(w + 31) / 32;
388 for (i = 0; i < h; i++) {
389 sptr = datas + i * wpls;
390 dptr = datad + i * wpld;
391 for (j = 0; j < pwpls; j++, sptr++, dptr++) {
392 *dptr = ((~*(sptr - wpls2) >> 1) | (~*(sptr - wpls2 - 1) << 31)) &
394 ((*(sptr - wpls2) << 1) | (*(sptr - wpls2 + 1) >> 31)) &
395 ((*(sptr - wpls2) << 2) | (*(sptr - wpls2 + 1) >> 30)) &
396 ((~*(sptr - wpls) >> 1) | (~*(sptr - wpls - 1) << 31)) &
397 ((*(sptr - wpls) << 1) | (*(sptr - wpls + 1) >> 31)) &
398 ((*(sptr - wpls) << 2) | (*(sptr - wpls + 1) >> 30)) &
399 ((~*(sptr) >> 1) | (~*(sptr - 1) << 31)) &
400 ((*(sptr) << 2) | (*(sptr + 1) >> 30)) &
401 ((~*(sptr + wpls) >> 1) | (~*(sptr + wpls - 1) << 31)) &
403 ((~*(sptr + wpls) << 1) | (~*(sptr + wpls + 1) >> 31)) &
404 ((~*(sptr + wpls) << 2) | (~*(sptr + wpls + 1) >> 30));
410 fhmt_1_9(l_uint32 *datad,
419 l_uint32 *sptr, *dptr;
423 pwpls = (l_uint32)(w + 31) / 32;
425 for (i = 0; i < h; i++) {
426 sptr = datas + i * wpls;
427 dptr = datad + i * wpld;
428 for (j = 0; j < pwpls; j++, sptr++, dptr++) {
429 *dptr = ((*(sptr - wpls2) >> 2) | (*(sptr - wpls2 - 1) << 30)) &
430 ((*(sptr - wpls2) >> 1) | (*(sptr - wpls2 - 1) << 31)) &
432 ((~*(sptr - wpls2) << 1) | (~*(sptr - wpls2 + 1) >> 31)) &
433 ((*(sptr - wpls) >> 2) | (*(sptr - wpls - 1) << 30)) &
434 ((*(sptr - wpls) >> 1) | (*(sptr - wpls - 1) << 31)) &
435 ((~*(sptr - wpls) << 1) | (~*(sptr - wpls + 1) >> 31)) &
436 ((*(sptr) >> 2) | (*(sptr - 1) << 30)) &
437 ((~*(sptr) << 1) | (~*(sptr + 1) >> 31)) &
438 ((~*(sptr + wpls) >> 2) | (~*(sptr + wpls - 1) << 30)) &
439 ((~*(sptr + wpls) >> 1) | (~*(sptr + wpls - 1) << 31)) &
441 ((~*(sptr + wpls) << 1) | (~*(sptr + wpls + 1) >> 31));