TS
static const int dir[4] = { -1, 1, -TS, TS };
ushort (*rgb)[TS][TS][3];
short (*lab)[TS][TS][3];
char (*homo)[TS][TS], *buffer;
buffer = (char *)malloc(26 * TS * TS); /* 1664 kB */
rgb = (ushort(*)[TS][TS][3])buffer;
lab = (short (*)[TS][TS][3])(buffer + 12 * TS * TS);
homo = (char (*)[TS][TS])(buffer + 24 * TS * TS);
float percentageStep = 70.0f / (fInputHeight / (TS - 6));
for (top = 0; top < fInputHeight; top += TS - 6) {
for (left = 0; left < fInputWidth; left += TS - 6) {
memset(rgb, 0, 12 * TS * TS);
for (row = top < 2 ? 2 : top; row < top + TS
for (fc = FC(row, col); col < left + TS
for (row = top + 1; row < top + TS - 1
for (col = left + 1; col < left + TS - 1
- rix[-TS][1] - rix[TS][1] ) >> 1);
- rix[-TS - 1][1] - rix[-TS + 1][1]
- rix[TS - 1][1] - rix[TS + 1][1] + 1) >> 2);
memset(homo, 0, 2 * TS * TS);
for (row = top + 2; row < top+TS-2 && row < fInputHeight; row++) {
for (col = left + 2; col < left + TS - 2
for (row = top + 3; row < top + TS - 3 && row < fInputHeight - 3;
for (col = left + 3; col < left + TS - 3