Quantcast
Channel: Intel® Software - Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1489

Access violation in ippiFilterSeparable

$
0
0

Hi,

I'm getting an access violation in ippiFilterSeparable in the following scenario: imageSize = (5,2), kernelSize = (9,9). Below is the code section :

	IppiSize kernelSize{ 9,9 };
	IppDataType dataType = IppDataType::ipp16s;
	IppDataType kernelDataType = IppDataType::ipp16s;
	IppiSizeL roiSize = {srcSize.width,srcSize.height};

	int srcStep = srcSize.width * sizeof(uint8_t); //  width = 5
	int dstStep = dstSize.width * sizeof(uint8_t); //width=5

	int specSize = 0;
	IppSizeL bufferSize = 0;
	ippiFilterSeparableGetBufferSize_L(roiSize, kernelSize, dataType, kernelDataType, 1 /*channels*/, &bufferSize);
	ippiFilterSeparableGetSpecSize_L(kernelSize, dataType, 1 /*channels*/, &specSize);

   //allocate pBuffer and pSpec buffers using bufferSize and specSize
   //....

    //kernel is a vector with 9 elements
	ippiFilterSeparableInit_16s_L(kernel.data(), kernel.data(), kernelSize, 1, 0, dataType, 1 /*channels*/, pSpec.getBuffer());
	result = ippiFilterSeparable_8u_C1R_L(pSrc, srcStep, pDst, dstStep, roiSize, IppiBorderType::ippBorderRepl, 0, pSpec.getBuffer(), pBuffer.getBuffer());

 

Actually the same thing is hapenning for kernels of size bigger than (3,3). This doesn't happen if the image has size (2,5) (instead of (5,2)).

Also, setting the roiSize in the following way :

	IppiSizeL roiSize = { srcSize.width , std::max<int>(srcSize.height, static_cast<int>(kernel.size())) };

seems to fix the issue. 

Is this the correct way of handling these scenarios ?

Thank you in advance!

Dorian

 

 


Viewing all articles
Browse latest Browse all 1489


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>