Can someone tell me a quick function to find a Gaussian blur of an image using a 5x5 mask. I need this for an iOS app. I am directly working on a memory designated as
unsigned char *image_sqr_Baseaaddr = (unsigned char *) malloc(noOfPixels); for (row = 2; row < H-2; row++) { for (col = 2; col < W-2; col++) { newPixel = 0; for (rowOffset=-2; rowOffset<=2; rowOffset++) { for (colOffset=-2; colOffset<=2; colOffset++) { rowTotal = row + rowOffset; colTotal = col + colOffset; iOffset = (unsigned long)(rowTotal*W + colTotal); newPixel += (*(imgData + iOffset)) * gaussianMask[2 + rowOffset][2 + colOffset]; } } i = (unsigned long)(row*W + col); *(imgData + i) = newPixel / 159; } }
This is obviously the slowest feature. I heard that ARM Neon intrinsics on iOS can be used to perform several operations in 1 cycle. Maybe this is the way to go?
The problem is that I am not very familiar and I donβt have time to learn assembly language. So it would be great if someone could post a neon code for an internal problem for the problem mentioned above or any other fast implementation in C / C ++.
source share