93 assert (kernel.
x <= src_sz.
x);
96 *border_l_p = anchor.
x;
97 *border_r_p = kernel.
x - (anchor.
x + 1);
104 for (y = 0; y < src_sz.
y; y++)
106 src_row = src + y * src_stride;
107 dst_row = dst + y * dst_stride;
115 for (x = 0; x < offset; x++)
117 sum[k] += * (src_row + x * RGBA_CH + k);
123 for (x = 0; x < *border_l_p; x++)
125 sum[k] += * (src_row + (offset + x) *
127 * (dst_row + x * RGBA_CH + k) = sum[k] /
136 for (x = 0; x < kernel.
x; x++)
138 sum[k] += * (src_row + (src_sz.
x - kernel.
x + x) *
145 for (x = 0; x < *border_r_p; x++)
147 sum[k] -= * (src_row + (src_sz.
x - kernel.
x + x) *
149 * (dst_row + (src_sz.
x - *border_r_p + x) *
150 RGBA_CH + k) = sum[k] / kernel.
x;
167 assert ( (kernel.
x > 0) && (kernel.
x < (1 << 16)));
168 assert (kernel.
x <= src_sz.
x);
172 for (y = 0; y < src_sz.
y; y++)
182 for (x = 0; x < kernel.
x; x++)
184 sum[k] += * (src_row + x * RGBA_CH + k);
187 * (dst_row + border_l * RGBA_CH + k) = sum[k] /
193 const ne10_uint8_t *src_pixel = src_row + (1 + border_l) * RGBA_CH;
194 const ne10_uint8_t *src_pixel_end = src_row + (src_sz.
x - border_r) *
196 ne10_uint8_t *dst_pixel = dst_row + (1 + border_l) * RGBA_CH;
198 for (k = 0; src_pixel < src_pixel_end; src_pixel++, dst_pixel++)
200 sum[k] += src_pixel[next] - * (src_pixel - prev);
201 *dst_pixel = sum[k] / kernel.
x;
218 assert (kernel.
y <= src_sz.
y);
221 *border_t_p = anchor.
y;
222 *border_b_p = kernel.
y - (anchor.
y + 1);
228 for (x = 0; x < src_sz.
x; x++)
240 for (y = 0; y < offset; y++)
242 sum[k] += * (src_col + y * src_stride + k);
248 for (y = 0; y < *border_t_p; y++)
250 sum[k] += * (src_col + (offset + y) *
252 * (dst_col + y * dst_stride + k) = sum[k] /
261 for (y = 0; y < kernel.
y; y++)
263 sum[k] += * (src_col + (src_sz.
y - kernel.
y + y) *
270 for (y = 0; y < *border_b_p; y++)
272 sum[k] -= * (src_col + (src_sz.
y - kernel.
y + y) *
274 * (dst_col + (src_sz.
y - *border_b_p + y) * dst_stride + k) =
292 assert ( (kernel.
y > 0) && (kernel.
y < (1 << 16)));
293 assert (kernel.
y <= src_sz.
y);
297 for (x = 0; x < src_sz.
x; x++)
307 for (y = 0; y < kernel.
y; y++)
309 sum[k] += * (src_col + y * src_stride + k);
312 * (dst_col + border_t * dst_stride + k) = sum[k] / kernel.
y;
317 const ne10_uint8_t *src_pixel = src_col + (1 + border_t) * src_stride;
318 const ne10_uint8_t *src_end = src_col + (src_sz.
y - border_b) *
320 ne10_uint8_t *dst_pixel = dst_col + (1 + border_t) * dst_stride;
322 while (src_pixel < src_end)
326 sum[k] += src_pixel[next + k] - * (src_pixel - prev + k);
327 * (dst_pixel + k) = sum[k] / kernel.
y;
329 dst_pixel += dst_stride;
330 src_pixel += src_stride;
354 assert (src != 0 && dst != 0);
355 assert (src_sz.
x > 0 && src_sz.
y > 0);
356 assert (src_stride > 0 && dst_stride > 0);
357 assert (kernel.
x > 0 && kernel.
x <= src_sz.
x 358 && kernel.
y > 0 && kernel.
y <= src_sz.
y);
360 anchor.
x = kernel.
x / 2;
361 anchor.
y = kernel.
y / 2;
371 "ERROR: buffer allocation fails!\nallocation size: %d\n",
void ne10_img_boxfilter_col_border(const ne10_uint8_t *src, ne10_uint8_t *dst, ne10_size_t src_sz, ne10_int32_t src_stride, ne10_int32_t dst_stride, ne10_size_t kernel, ne10_point_t anchor, ne10_int32_t *border_t_p, ne10_int32_t *border_b_p)
void ne10_img_boxfilter_rgba8888_c(const ne10_uint8_t *src, ne10_uint8_t *dst, ne10_size_t src_sz, ne10_int32_t src_stride, ne10_int32_t dst_stride, ne10_size_t kernel)
Specific implementation of ne10_img_boxfilter_rgba8888 using plain C.
void ne10_img_boxfilter_row_c(const ne10_uint8_t *src, ne10_uint8_t *dst, ne10_size_t src_sz, ne10_int32_t src_stride, ne10_int32_t dst_stride, ne10_size_t kernel, ne10_point_t anchor, ne10_int32_t border_l, ne10_int32_t border_r)
void ne10_img_boxfilter_col_c(const ne10_uint8_t *src, ne10_uint8_t *dst, ne10_size_t src_sz, ne10_int32_t src_stride, ne10_int32_t dst_stride, ne10_size_t kernel, ne10_point_t anchor, ne10_int32_t border_t, ne10_int32_t border_b)
void ne10_img_boxfilter_row_border(const ne10_uint8_t *src, ne10_uint8_t *dst, ne10_size_t src_sz, ne10_int32_t src_stride, ne10_int32_t dst_stride, ne10_size_t kernel, ne10_point_t anchor, ne10_int32_t *border_l_p, ne10_int32_t *border_r_p)
Structure for point in image.