<?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 How to use ippiAddSquare in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798756#M2963</link>
    <description>Hi bibi88, &lt;BR /&gt;&lt;BR /&gt;I noticed the EdgeVert are claimed as Ipp 16s *, But when use in the call ippiAddSquare_8s32f_C1IR, it was converted to (Ipp8s*).This may cause the zero in eachelements. is there any specialreason forthe data conversion in your application?&lt;BR /&gt;&lt;BR /&gt;You may use eitherIpp 8s orIPP 16sat both place. &lt;BR /&gt;&lt;BR /&gt;In addition,I'd likerecommend to use stepBytes itself convertWidthStep 1,2 instead of width*sizeof(ipp32f) ,(to avoid potiental error in the future).&lt;BR /&gt;&lt;BR /&gt;Kind Regards,&lt;BR /&gt;Ying &lt;BR /&gt;</description>
    <pubDate>Thu, 28 Oct 2010 08:04:18 GMT</pubDate>
    <dc:creator>Ying_H_Intel</dc:creator>
    <dc:date>2010-10-28T08:04:18Z</dc:date>
    <item>
      <title>How to use ippiAddSquare</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798753#M2960</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Using ippiAddSquare, I've found a strange behavior. To explain it, here is an example:&lt;BR /&gt;&lt;BR /&gt;src 1 2 3 4 5 6 7 8 9&lt;BR /&gt;&lt;BR /&gt;I was waiting for this result:&lt;BR /&gt;dsl 1 4 9 16 25 36 49 64 81&lt;BR /&gt;&lt;BR /&gt;Here is the kind of dst I've acutally received:&lt;BR /&gt;&lt;BR /&gt; 1 0 4 0 9 0 16 0 25&lt;BR /&gt;&lt;BR /&gt;More specificaly, here is my code:&lt;BR /&gt;&lt;BR /&gt;IppiSize Roi = {width , height};&lt;BR /&gt;Ipp16s* pEdgeVert = ippiMalloc_16s_C1(width, height, &amp;amp;convertWidthStep1);&lt;BR /&gt;Ipp32f* pEdgeBorder = ippiMalloc_32f_C1(width, height, &amp;amp;convertWidthStep2);&lt;BR /&gt;/* ... processing of pEdgeVert to get some values in /*&lt;BR /&gt;ippiSet_32f_C1R(0, pEdgeBorder, width*sizeof(Ipp32f), Roi);&lt;BR /&gt;ippiAddSquare_8s32f_C1IR((Ipp8s *) pEdgeVert,width *sizeof(Ipp8s), pEdgeBorder, width *sizeof(Ipp32f),Roi);&lt;BR /&gt;&lt;BR /&gt;Why this code inserts a zero each two column of the expected result?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Oct 2010 16:01:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798753#M2960</guid>
      <dc:creator>bibi88</dc:creator>
      <dc:date>2010-10-27T16:01:22Z</dc:date>
    </item>
    <item>
      <title>How to use ippiAddSquare</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798754#M2961</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;could you please provide an additional info in order to help us identify the problem: what IPP version do you use, what OS and cpu you were run your test case?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir</description>
      <pubDate>Wed, 27 Oct 2010 16:29:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798754#M2961</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-10-27T16:29:13Z</dc:date>
    </item>
    <item>
      <title>How to use ippiAddSquare</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798755#M2962</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I'm using IPP 6.1.6.063 on em64t with Ubuntu 64 bits. &lt;BR /&gt;&lt;BR /&gt;Thanks for your help! &lt;BR /&gt;</description>
      <pubDate>Thu, 28 Oct 2010 07:42:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798755#M2962</guid>
      <dc:creator>bibi88</dc:creator>
      <dc:date>2010-10-28T07:42:53Z</dc:date>
    </item>
    <item>
      <title>How to use ippiAddSquare</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798756#M2963</link>
      <description>Hi bibi88, &lt;BR /&gt;&lt;BR /&gt;I noticed the EdgeVert are claimed as Ipp 16s *, But when use in the call ippiAddSquare_8s32f_C1IR, it was converted to (Ipp8s*).This may cause the zero in eachelements. is there any specialreason forthe data conversion in your application?&lt;BR /&gt;&lt;BR /&gt;You may use eitherIpp 8s orIPP 16sat both place. &lt;BR /&gt;&lt;BR /&gt;In addition,I'd likerecommend to use stepBytes itself convertWidthStep 1,2 instead of width*sizeof(ipp32f) ,(to avoid potiental error in the future).&lt;BR /&gt;&lt;BR /&gt;Kind Regards,&lt;BR /&gt;Ying &lt;BR /&gt;</description>
      <pubDate>Thu, 28 Oct 2010 08:04:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798756#M2963</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2010-10-28T08:04:18Z</dc:date>
    </item>
    <item>
      <title>How to use ippiAddSquare</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798757#M2964</link>
      <description>Hello Ying,&lt;BR /&gt;&lt;BR /&gt;Thanks for your help!&lt;BR /&gt;First of all, I don't use convertWidthStep because it always gives me strange results. Mayeb I don't use it correctly, so here is an example:&lt;BR /&gt;&lt;BR /&gt; int stepGray;&lt;BR /&gt; int timeReplicate = 1;&lt;BR /&gt; IppiSize Roi = {GrayImg-&amp;gt;width, GrayImg-&amp;gt;height};&lt;BR /&gt; int widthReplicated = GrayImg-&amp;gt;width + 2*timeReplicate;&lt;BR /&gt; int heightReplicated = GrayImg-&amp;gt;height + 2*timeReplicate;&lt;BR /&gt; IppiSize RoiReplicated = {widthReplicated, heightReplicated};&lt;BR /&gt; Ipp16s* pGray = ippiMalloc_16s_C1(GrayImg-&amp;gt;width, GrayImg-&amp;gt;height, &amp;amp;stepGray);&lt;BR /&gt;&lt;BR /&gt;ippiConvert_8u16s_C1R(GrayImg-&amp;gt;imageData, GrayImg-&amp;gt;widthStep*sizeof(Ipp8u), pGray, stepGray, RoiReplicated);&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; int m,n;&lt;BR /&gt; for (m = 0 ; m &amp;lt; 4; m++)&lt;BR /&gt; {&lt;BR /&gt; for (n = 0 ; n &amp;lt; GrayImg-&amp;gt;widthStep ; n++)&lt;BR /&gt; {&lt;BR /&gt; printf("%d ", GrayImg-&amp;gt;imageData[n+m*(GrayImg-&amp;gt;widthStep)]);&lt;BR /&gt; }&lt;BR /&gt; printf("\n");&lt;BR /&gt; }&lt;BR /&gt; printf("\n\n\n\n");&lt;BR /&gt;&lt;BR /&gt; for (m = 0 ; m &amp;lt; 4; m++)&lt;BR /&gt; {&lt;BR /&gt; for (n = 0 ; n &amp;lt; stepGray ; n++)&lt;BR /&gt; {&lt;BR /&gt; printf("%d ", pGray[n+m*(stepGray)]);&lt;BR /&gt; }&lt;BR /&gt; printf("\n\n");&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;It doesn't give me the same displayed matrix, that's why I don't use it generally.&lt;BR /&gt;Secondly, even without the casting or with another cast, I have the same problem (0 between two columns).&lt;BR /&gt;If you're kind enough to explain me the problem with stepGray, I will do a simplified version of my code to detail the problem with the zeros.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Thu, 28 Oct 2010 08:53:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798757#M2964</guid>
      <dc:creator>bibi88</dc:creator>
      <dc:date>2010-10-28T08:53:34Z</dc:date>
    </item>
    <item>
      <title>How to use ippiAddSquare</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798758#M2965</link>
      <description>Hi Bibi88, &lt;BR /&gt;&lt;BR /&gt;The stepBytes is defined as Distance in bytes between starts of consecutive lines in the source image.&lt;BR /&gt;Or you may understand it is the length of onerow, but &lt;STRONG&gt;in Byte&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;For example, a 4 row and 2 column image, image width=2, image hight=4. &lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;1 2&lt;BR /&gt;3 4&lt;BR /&gt;5 6&lt;BR /&gt;7 8&lt;/P&gt;&lt;P&gt;If use ippiMalloc_xtoallocate memory for the image, &lt;BR /&gt;ippiMalloc&lt;BR /&gt;Allocates memory aligned to 32-byte boundary for good performance.&lt;BR /&gt;then the stepBytesis always a multiple of 32.&lt;BR /&gt;&lt;BR /&gt;SotheconvertWidthStep1/2 is 32. It is not image width 2, not image*sizeof(Ipp16s)=4 or&lt;BR /&gt;image*sizeof(Ipp32f)=8 . &lt;BR /&gt;the space between 4-32 will be padded with 0. &lt;BR /&gt;If print a imagewhich is allocated by ippiMalloc, a pefered solution should be &lt;BR /&gt;for (m = 0 ; m &amp;lt; height; m++)&lt;BR /&gt; {&lt;BR /&gt; for (n = 0 ; n &lt;WIDTH&gt;&lt;/WIDTH&gt; {&lt;BR /&gt; printf("%d ", pGray[n+m*(stepGray)/sizeof(Ipp16s)]);&lt;BR /&gt; }&lt;BR /&gt; printf("\n\n");&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;Forthe value of GrayImg-&amp;gt;widthStep,you maymake sure if it is 4-bytes aligned or it is 32-bytes aligned. But printf the image 8u,&lt;BR /&gt;for (n = 0 ; n &amp;lt; GrayImg-&amp;gt;widthStep ; n++) 'dbetter to change intofor (n = 0 ; n &lt;WIDTH&gt;&lt;/WIDTH&gt;&lt;BR /&gt;Icreat asmallexample code for yourreference.&lt;/P&gt;&lt;P&gt;#include &lt;STDAFX.H&gt;&lt;BR /&gt;#include "ipp.h" &lt;BR /&gt; &lt;BR /&gt;int main() &lt;BR /&gt;{&lt;/STDAFX.H&gt;&lt;/P&gt;&lt;P&gt;// Print the version of ipp being used&lt;BR /&gt; const IppLibraryVersion* lib = ippiGetLibVersion();&lt;BR /&gt; printf("%s %s %d.%d.%d.%d\n", lib-&amp;gt;Name, lib-&amp;gt;Version,lib-&amp;gt;major, lib-&amp;gt;minor, lib-&amp;gt;majorBuild, lib-&amp;gt;build);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*src 1 2 3 4 5 6 7 8 9&lt;/P&gt;&lt;P&gt;I was waiting for this result:&lt;BR /&gt;dsl 1 4 9 16 25 36 49 64 81&lt;/P&gt;&lt;P&gt;Here is the kind of dst I've acutally received:&lt;/P&gt;&lt;P&gt; 1 0 4 0 9 0 16 0 25&lt;/P&gt;&lt;P&gt;More specificaly, here is my code:&lt;BR /&gt;*/&lt;BR /&gt;int width=2;&lt;BR /&gt;int height=4;&lt;BR /&gt;IppiSize Roi = {width, height};&lt;BR /&gt;int convertWidthStep1, convertWidthStep2;&lt;BR /&gt;Ipp16s* pEdgeVert = ippiMalloc_16s_C1(width, height, &amp;amp;convertWidthStep1);&lt;BR /&gt;Ipp32f* pEdgeBorder = ippiMalloc_32f_C1(width, height, &amp;amp;convertWidthStep2);&lt;/P&gt;&lt;P&gt;int m,n;&lt;BR /&gt;Ipp16s temp=1;&lt;/P&gt;&lt;P&gt;printf("the src image\n");&lt;BR /&gt; for (m = 0 ; m &amp;lt; height; m++)&lt;BR /&gt; {&lt;BR /&gt; for (n = 0 ; n &amp;lt; width ; n++)&lt;BR /&gt; {&lt;BR /&gt;pEdgeVert[n+m*convertWidthStep1/sizeof(Ipp16s)]=temp;&lt;BR /&gt;temp++;&lt;BR /&gt;printf("%d ", pEdgeVert[n+m*convertWidthStep1/sizeof(Ipp16u)]);&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; printf("\n");&lt;BR /&gt;&lt;BR /&gt; }&lt;BR /&gt; printf("\n");&lt;/P&gt;&lt;P&gt;printf("convertWidthStep1 is %d,\t convertWidthStep2 is %d\n ", convertWidthStep1,convertWidthStep2);&lt;BR /&gt;printf("image width is %d,\t image width*sizeof(Ipp32f)is %d \n", width,width*sizeof(Ipp32f) );&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;// ... processing of pEdgeVert to get some values in &lt;BR /&gt;ippiSet_32f_C1R(0, pEdgeBorder, convertWidthStep2, Roi);&lt;BR /&gt;IppStatus status=ippiAddSquare_16u32f_C1IR((Ipp16u*) pEdgeVert,convertWidthStep1, pEdgeBorder, convertWidthStep2,Roi);&lt;BR /&gt;printf("\n%d : %s\n\n", status, ippGetStatusString(status));&lt;/P&gt;&lt;P&gt;printf("the result image\n");&lt;BR /&gt;for (m = 0 ; m &amp;lt; height; m++)&lt;BR /&gt; {&lt;BR /&gt; for (n = 0 ; n &amp;lt; width ; n++)&lt;BR /&gt; {&lt;BR /&gt; printf("%f ", pEdgeBorder[n+m*convertWidthStep1/sizeof(Ipp32f)]);&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; printf("\n");&lt;BR /&gt; }&lt;BR /&gt; printf("\n");&lt;BR /&gt; return 0; &lt;BR /&gt;} &lt;/P&gt;&lt;P&gt;The result,&lt;/P&gt;&lt;P&gt;ippiv8-6.1.dll 6.1 build 137.53 6.1.137.842 &lt;BR /&gt;the src image&lt;BR /&gt;1 2&lt;BR /&gt;3 4&lt;BR /&gt;5 6&lt;BR /&gt;7 8&lt;/P&gt;&lt;P&gt;convertWidthStep1 is 32, convertWidthStep2 is 32&lt;BR /&gt;image width is 2, image width*sizeof(Ipp32f)is 8&lt;/P&gt;&lt;P&gt;0 : ippStsNoErr: No error, it's OK&lt;/P&gt;&lt;P&gt;the result image&lt;BR /&gt;1.000000 4.000000&lt;BR /&gt;9.000000 16.000000&lt;BR /&gt;25.000000 36.000000&lt;BR /&gt;49.000000 64.000000&lt;/P&gt;&lt;P&gt;Press any key to continue . . .&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Ying&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2010 02:07:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-use-ippiAddSquare/m-p/798758#M2965</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2010-10-29T02:07:11Z</dc:date>
    </item>
  </channel>
</rss>

