[ad_1]
im new to NEON and whilst i can do some processing i struggle with lack of knowledge at some basics concepts especially with optimizing 2d arrays.
uint8_t** add_padding(uint8_t** img,int width, int height) {
uint8_t** padded_image = (uint8_t**)calloc((height + 2), sizeof(uint8_t*));
for (int i = 0; i < height + 2; i++) {
if (padded_image) {
padded_image[i] = (uint8_t*)calloc((width + 2), sizeof(uint8_t));
}
}
for (int i = 1; i < height; i++) {
for (int j = 1; j < width; j++) {
padded_image[i][j] = img[i - 1][j - 1];
}
}
return padded_image;
}
How can i vectorize function above using NEON intrinsics in C ?
[ad_2]