160 |
uint32_t edged_width, |
uint32_t edged_width, |
161 |
uint32_t edged_height, |
uint32_t edged_height, |
162 |
uint32_t width, |
uint32_t width, |
163 |
uint32_t height, |
uint32_t height) |
|
uint32_t interlacing) |
|
164 |
{ |
{ |
165 |
const uint32_t edged_width2 = edged_width / 2; |
const uint32_t edged_width2 = edged_width / 2; |
166 |
const uint32_t width2 = width / 2; |
const uint32_t width2 = width / 2; |
173 |
src = image->y; |
src = image->y; |
174 |
|
|
175 |
for (i = 0; i < EDGE_SIZE; i++) { |
for (i = 0; i < EDGE_SIZE; i++) { |
|
// if interlacing, edges contain top-most data from each field |
|
|
if (interlacing && (i & 1)) { |
|
|
memset(dst, *(src + edged_width), EDGE_SIZE); |
|
|
memcpy(dst + EDGE_SIZE, src + edged_width, width); |
|
|
memset(dst + edged_width - EDGE_SIZE, |
|
|
*(src + edged_width + width - 1), EDGE_SIZE); |
|
|
} else { |
|
176 |
memset(dst, *src, EDGE_SIZE); |
memset(dst, *src, EDGE_SIZE); |
177 |
memcpy(dst + EDGE_SIZE, src, width); |
memcpy(dst + EDGE_SIZE, src, width); |
178 |
memset(dst + edged_width - EDGE_SIZE, *(src + width - 1), |
memset(dst + edged_width - EDGE_SIZE, *(src + width - 1), |
179 |
EDGE_SIZE); |
EDGE_SIZE); |
|
} |
|
180 |
dst += edged_width; |
dst += edged_width; |
181 |
} |
} |
182 |
|
|
189 |
|
|
190 |
src -= edged_width; |
src -= edged_width; |
191 |
for (i = 0; i < EDGE_SIZE; i++) { |
for (i = 0; i < EDGE_SIZE; i++) { |
|
// if interlacing, edges contain bottom-most data from each field |
|
|
if (interlacing && !(i & 1)) { |
|
|
memset(dst, *(src - edged_width), EDGE_SIZE); |
|
|
memcpy(dst + EDGE_SIZE, src - edged_width, width); |
|
|
memset(dst + edged_width - EDGE_SIZE, |
|
|
*(src - edged_width + width - 1), EDGE_SIZE); |
|
|
} else { |
|
192 |
memset(dst, *src, EDGE_SIZE); |
memset(dst, *src, EDGE_SIZE); |
193 |
memcpy(dst + EDGE_SIZE, src, width); |
memcpy(dst + EDGE_SIZE, src, width); |
194 |
memset(dst + edged_width - EDGE_SIZE, *(src + width - 1), |
memset(dst + edged_width - EDGE_SIZE, *(src + width - 1), |
195 |
EDGE_SIZE); |
EDGE_SIZE); |
|
} |
|
196 |
dst += edged_width; |
dst += edged_width; |
197 |
} |
} |
198 |
|
|