33 int16_t
basis[64],
int scale)
38 for (i = 0; i < 8 * 8; i++) {
39 int b = rem[i] + ((basis[i] * scale +
46 sum += (w *
b) * (w * b) >> 4;
55 for (i = 0; i < 8 * 8; i++)
56 rem[i] += (basis[i] * scale +
65 for (i = 0; i < 16; i++) {
66 for (j = 0; j < 16; j += 8) {
77 pix += line_size - 16;
87 for (i = 0; i < 16; i++) {
88 for (j = 0; j < 16; j += 8) {
100 register uint64_t x = *(uint64_t *) pix;
102 s += sq[(x >> 8) & 0xff];
103 s += sq[(x >> 16) & 0xff];
104 s += sq[(x >> 24) & 0xff];
105 s += sq[(x >> 32) & 0xff];
106 s += sq[(x >> 40) & 0xff];
107 s += sq[(x >> 48) & 0xff];
108 s += sq[(x >> 56) & 0xff];
110 register uint32_t x = *(uint32_t *) pix;
112 s += sq[(x >> 8) & 0xff];
113 s += sq[(x >> 16) & 0xff];
114 s += sq[(x >> 24) & 0xff];
115 x = *(uint32_t *) (pix + 4);
117 s += sq[(x >> 8) & 0xff];
118 s += sq[(x >> 16) & 0xff];
119 s += sq[(x >> 24) & 0xff];
124 pix += line_size - 16;
132 int w,
int h,
int sides)
138 for (i = 0; i <
height; i++) {
139 memset(ptr - w, ptr[0], w);
140 memset(ptr + width, ptr[width - 1], w);
146 last_line = buf + (height - 1) * wrap;
148 for (i = 0; i < h; i++)
150 memcpy(buf - (i + 1) *
wrap,
buf, width + w + w);
152 for (i = 0; i < h; i++)
154 memcpy(last_line + (i + 1) *
wrap, last_line, width + w + w);