Hello,
I am having some trouble with the buffer sizes returned by FilterBoxBorderGetBufferSize.
According to the documentation, roiSize is the "Maximum size of the destination image ROI". As I understand it the buffer size returned should be valid for any destination image ROI smaller or equal to roiSize. This is important for me since I am allocating a buffer once (for a fixed filter size) and reusing it many times on images that are smaller than some known bound. After some testing however, I found out that the returned buffer size is sometimes larger for smaller images. Here is an example:
int bufferSizeA = -1; int bufferSizeB = -1; const auto filterSize = IppiSize{ 7, 7 }; const auto imageSizeA = IppiSize{ 13, 13 }; const auto imageSizeB = IppiSize{ 14, 14 }; ippiFilterBoxBorderGetBufferSize(imageSizeA, filterSize, ipp8u, 1, &bufferSizeA)); ippiFilterBoxBorderGetBufferSize(imageSizeB, filterSize, ipp8u, 1, &bufferSizeB));
When I run it with the initial release of IPP2018 I get bufferSizeA = 3205 and bufferSizeB = 3184. Is this a bug or is my understanding of roiSize wrong?
I wrote a small program to try out various filter and image sizes. It seems there is always a drop when the width and/or height of the image is exactly twice the corresponding dimension of the filter. If that is true I suppose I could detect it and circumvent it by getting the buffer sizes for nearby image sizes and taking the maximum.
Any advice would be greatly appreciated.