<?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 CopySubpix problem in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789472#M2283</link>
    <description>Tested - increasing the size of the destination image by one row (1024 bytes in this case) stops the access violation.</description>
    <pubDate>Wed, 21 Mar 2012 09:50:16 GMT</pubDate>
    <dc:creator>jon_shadforth</dc:creator>
    <dc:date>2012-03-21T09:50:16Z</dc:date>
    <item>
      <title>CopySubpix problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789467#M2278</link>
      <description>&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;IPP6.1.5.054, 64-bit on Windows 7 64-bit&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Am getting occasional crashes (access violation) usingippiCopySubpix_8u_C1R. I've just managed to replicate this using the demo application (ippiDemo_em64t.exe) and I have some code that will reproduce it quite quickly. (I've deliberately left out ippiFree because I need to get lots of different pointers before the crash occurs).&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	for(int i = 0; i &amp;lt; 1000; i++)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	{&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;IppiSize ippiSize = { 1024, 4 };&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;Ipp8u* image1 = (Ipp8u*)ippMalloc(ippiSize.width * ippiSize.height);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;Ipp8u* image2 = (Ipp8u*)ippMalloc(ippiSize.width * ippiSize.height);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;ippiCopySubpix_8u_C1R(image2, ippiSize.width, image1, ippiSize.width, ippiSize, 0, 0);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	}&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;When the access violation occurs the disassembler shows:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;movzx    r15d,byte ptr [r11+r10+1] &lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Where...&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;r10 = image2 + (1024 * 4)&lt;/DIV&gt;&lt;DIV&gt;r11 = 799&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;So it looks like it's trying to read data below the last valid line of image2.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;To replicate this in the demo app I created 8 8U images at 660*496 pixels, then used the CopySubpix function with manual destination image selection enabled, and tested copying from image 8 to 7, then 6 to 5, and I think at copy from 4 to 3 it popped up an access violation message.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I can't see any other reference to this in the forum, nor is it listed in any of the bug fixes.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Any help appreciated - Jon.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 16 Mar 2012 15:56:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789467#M2278</guid>
      <dc:creator>jon_shadforth</dc:creator>
      <dc:date>2012-03-16T15:56:13Z</dc:date>
    </item>
    <item>
      <title>CopySubpix problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789468#M2279</link>
      <description>Jon, I couldn't reproduce the problem with the latest version - 7.0 update 6. Please get the evaluation version on check on your side.&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 17 Mar 2012 15:51:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789468#M2279</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2012-03-17T15:51:06Z</dc:date>
    </item>
    <item>
      <title>CopySubpix problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789469#M2280</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1332022756906="58" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=427155" href="https://community.intel.com/en-us/profile/427155/" class="basic"&gt;jon_shadforth&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;IPP6.1.5.054, 64-bit on Windows 7 64-bit&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;...&lt;BR /&gt;(I've deliberately left out ippiFree because I need to get lots of different pointers before the crash occurs).&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;for(int i = 0; i &amp;lt; 1000; i++)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;{&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;&lt;/SPAN&gt;IppiSize ippiSize = { 1024, 4 };&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;&lt;/SPAN&gt;Ipp8u* image1 = (Ipp8u*)ippMalloc(ippiSize.width * ippiSize.height);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;&lt;/SPAN&gt;Ipp8u* image2 = (Ipp8u*)ippMalloc(ippiSize.width * ippiSize.height);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;&lt;/SPAN&gt;ippiCopySubpix_8u_C1R(image2, ippiSize.width, image1, ippiSize.width, ippiSize, 0, 0);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;}&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;...&lt;BR /&gt;Any help appreciated - Jon.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Could you try a test with verifications of '&lt;STRONG&gt;image1&lt;/STRONG&gt;' and '&lt;STRONG&gt;image2&lt;/STRONG&gt;' pointersas follows:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;for( int i = 0; i &amp;lt; 1000; i++ )&lt;BR /&gt;{&lt;BR /&gt; IppiSize ippiSize = { 1024, 4 };&lt;BR /&gt; Ipp8u* image1 = (Ipp8u*)ippiMalloc(ippiSize.width * ippiSize.height);&lt;BR /&gt; if( image1 == NULL )&lt;BR /&gt; {&lt;BR /&gt;  printf( "Failed to allocate memory for Image1\n" );&lt;BR /&gt;  break;&lt;BR /&gt; }&lt;BR /&gt; Ipp8u* image2 = (Ipp8u*)ippiMalloc(ippiSize.width * ippiSize.height);&lt;BR /&gt; if( image2 == NULL )&lt;BR /&gt; {&lt;BR /&gt;  printf( "Failed to allocate memory for Image2\n" );&lt;BR /&gt;  break;&lt;BR /&gt; }&lt;BR /&gt; ippiCopySubpix_8u_C1R(image2, ippiSize.width, image1, ippiSize.width, ippiSize, 0, 0);&lt;BR /&gt;}&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;I don't think that the problem with access violation is related to a "lack of memory" on a &lt;STRONG&gt;64-bit&lt;/STRONG&gt; Windows 7 because ~&lt;STRONG&gt;31MB&lt;/STRONG&gt; of memory is allocated&lt;BR /&gt;after &lt;STRONG&gt;1,000&lt;/STRONG&gt; interations in Jon's test case.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Sergey&lt;/P&gt;</description>
      <pubDate>Sat, 17 Mar 2012 22:29:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789469#M2280</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2012-03-17T22:29:13Z</dc:date>
    </item>
    <item>
      <title>CopySubpix problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789470#M2281</link>
      <description>I've re-tested this on another PC running the latest IPP 7 (rev 6), it still crashes.&lt;BR /&gt;&lt;BR /&gt;
disassembler: movq xmm5,mmword ptr [eax+esi+8] &lt;BR /&gt;
image2 = 16317472&lt;BR /&gt;
esi = 16321528&lt;BR /&gt;
eax = 1024&lt;BR /&gt;
image size in bytes = 1024 * 4 = 4096&lt;BR /&gt;
image2 + image size = 16321568&lt;BR /&gt;&lt;BR /&gt;
The address being used at the point of failure = [1024 + 16321528 + 8] = 16322560&lt;BR /&gt;
So the reason for the crash is the algorithm is trying to read memory (16322560) that is beyond the end of image 2 (16317472 to 16321567)&lt;BR /&gt;
&lt;BR /&gt;
If my understanding is correct then the algorithm is sampling data outside of the image bounds. This makes sense when you think of the fractional offsets being used. But this also means that the documentation is incorrect by not stipulating that the ROI should take into account this effect (as we do for most kernel operations). It also means the demo app has the same bug that I do because it also processes the entire region of an image. (The demo app can be made to crash using this function).&lt;BR /&gt;&lt;BR /&gt;
So my current conclusion is that the documentation is wrong, and that my software and your demo need to be fixed. For the moment I have to stop using the function as I have alternatives (such as the affine transformation) that work for my full ROI.&lt;BR /&gt;&lt;BR /&gt;
Any more feedback on this much appreciated.</description>
      <pubDate>Tue, 20 Mar 2012 08:11:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789470#M2281</guid>
      <dc:creator>jon_shadforth</dc:creator>
      <dc:date>2012-03-20T08:11:20Z</dc:date>
    </item>
    <item>
      <title>CopySubpix problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789471#M2282</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1332290868875="58" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=427155" href="https://community.intel.com/en-us/profile/427155/" class="basic"&gt;jon_shadforth&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;...&lt;BR /&gt;If my understanding is correct then the algorithm is sampling data outside of the image bounds...&lt;BR /&gt;...&lt;BR /&gt;Any more feedback on this much appreciated.&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;I think Intel Software Engineers should look at the problem.&lt;BR /&gt;&lt;BR /&gt;One more thing, could you try to increasethe sizeof a buffer that holds the second image:&lt;BR /&gt; ...&lt;BR /&gt; int iExtra = 128; // Number of Extra Rowsand Cols&lt;BR /&gt;&lt;BR /&gt; Ipp8u* image2 = (Ipp8u*)ippiMalloc( ( ippiSize.width +iExtra )* (ippiSize.height + iExtra ));&lt;BR /&gt; ...&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2012 00:55:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789471#M2282</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2012-03-21T00:55:50Z</dc:date>
    </item>
    <item>
      <title>CopySubpix problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789472#M2283</link>
      <description>Tested - increasing the size of the destination image by one row (1024 bytes in this case) stops the access violation.</description>
      <pubDate>Wed, 21 Mar 2012 09:50:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-problem/m-p/789472#M2283</guid>
      <dc:creator>jon_shadforth</dc:creator>
      <dc:date>2012-03-21T09:50:16Z</dc:date>
    </item>
  </channel>
</rss>

