<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic  Access violation in ippiFilterSeparable in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Access-violation-in-ippiFilterSeparable/m-p/1126566#M25675</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm getting an access violation in&amp;nbsp;ippiFilterSeparable in the following scenario: imageSize = (5,2), kernelSize = (9,9). Below is the code section :&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;	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*/, &amp;amp;bufferSize);
	ippiFilterSeparableGetSpecSize_L(kernelSize, dataType, 1 /*channels*/, &amp;amp;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());&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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)).&lt;/P&gt;
&lt;P&gt;Also, setting the roiSize in the following way :&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;IppiSizeL roiSize = { srcSize.width , std::max&amp;lt;int&amp;gt;(srcSize.height, kernel.size()) };&lt;/PRE&gt;

&lt;P&gt;seems to fix the issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this the correct way of handling these scenarios ?&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;
&lt;P&gt;Dorian&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2019 07:25:26 GMT</pubDate>
    <dc:creator>Stoica__Dorian</dc:creator>
    <dc:date>2019-07-12T07:25:26Z</dc:date>
    <item>
      <title>Access violation in ippiFilterSeparable</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Access-violation-in-ippiFilterSeparable/m-p/1126566#M25675</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm getting an access violation in&amp;nbsp;ippiFilterSeparable in the following scenario: imageSize = (5,2), kernelSize = (9,9). Below is the code section :&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;	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*/, &amp;amp;bufferSize);
	ippiFilterSeparableGetSpecSize_L(kernelSize, dataType, 1 /*channels*/, &amp;amp;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());&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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)).&lt;/P&gt;
&lt;P&gt;Also, setting the roiSize in the following way :&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;IppiSizeL roiSize = { srcSize.width , std::max&amp;lt;int&amp;gt;(srcSize.height, kernel.size()) };&lt;/PRE&gt;

&lt;P&gt;seems to fix the issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this the correct way of handling these scenarios ?&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;
&lt;P&gt;Dorian&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 07:25:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Access-violation-in-ippiFilterSeparable/m-p/1126566#M25675</guid>
      <dc:creator>Stoica__Dorian</dc:creator>
      <dc:date>2019-07-12T07:25:26Z</dc:date>
    </item>
    <item>
      <title>Hello, thank you for your</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Access-violation-in-ippiFilterSeparable/m-p/1126567#M25676</link>
      <description>&lt;P&gt;Hello, thank you for your issue. Could you please send all code because access violation might happen due to improper buffers allocation&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 14:05:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Access-violation-in-ippiFilterSeparable/m-p/1126567#M25676</guid>
      <dc:creator>Ilya_O_Intel</dc:creator>
      <dc:date>2019-08-20T14:05:27Z</dc:date>
    </item>
  </channel>
</rss>

