<?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 Hi, in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128680#M25713</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;For the premul with alpha value, can this function be used there?&lt;BR /&gt;
	&lt;A href="https://software.intel.com/en-us/ipp-dev-reference-alphapremul"&gt;https://software.intel.com/en-us/ipp-dev-reference-alphapremul&lt;/A&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	Thanks,&lt;BR /&gt;
	Chao&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Sep 2018 03:09:38 GMT</pubDate>
    <dc:creator>Chao_Y_Intel</dc:creator>
    <dc:date>2018-09-21T03:09:38Z</dc:date>
    <item>
      <title>Setting the alpha channel</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128679#M25712</link>
      <description>&lt;P&gt;I have a 16u RGBA image and a 16u one-channel grayscale image. The grayscale image must be set as the alpha channel of the RGBA image.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em;"&gt;One would think this is an easy task, but the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="line-height: 15.6px; font-size: 13px;"&gt;RGBA image is (and has to be) premultiplied, for compatibility with CoreGraphics on Mac OS X. In fact, I don't see a fast way to accomplish this using IPP. Any hints (or future new functions) are welcome.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;For 8u images, I call&amp;nbsp;vImageUnpremultiplyData_ARGB8888,&amp;nbsp;ippiCopy_8u_C1C4R and&amp;nbsp;vImagePremultiplyData_ARGB8888. For 32f images, I call&amp;nbsp;vImageUnpremultiplyData_RGBAFFFF,&amp;nbsp;ippiCopy_32f_C1C4R and&amp;nbsp;vImagePremultiplyData_RGBAFFFF. This method works fast. The vImage functions are from Apple's vImage framework&amp;nbsp;&lt;A href="https://developer.apple.com/documentation/accelerate"&gt;https://developer.apple.com/documentation/accelerate&lt;/A&gt;. There are no 16u vImage functions to do this.&lt;/P&gt;

&lt;P&gt;The question remains how to do this with IPP and for 16u.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Adriaan van Os&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 16:14:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128679#M25712</guid>
      <dc:creator>Adriaan_van_Os</dc:creator>
      <dc:date>2018-09-13T16:14:22Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128680#M25713</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;For the premul with alpha value, can this function be used there?&lt;BR /&gt;
	&lt;A href="https://software.intel.com/en-us/ipp-dev-reference-alphapremul"&gt;https://software.intel.com/en-us/ipp-dev-reference-alphapremul&lt;/A&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	Thanks,&lt;BR /&gt;
	Chao&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 03:09:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128680#M25713</guid>
      <dc:creator>Chao_Y_Intel</dc:creator>
      <dc:date>2018-09-21T03:09:38Z</dc:date>
    </item>
    <item>
      <title>Yes, thanks, I hadn't seen</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128681#M25714</link>
      <description>&lt;P&gt;Yes, thanks, I hadn't seen that function. I will note that there are &lt;SPAN style="font-size: 13.008px; line-height: 15.6096px;"&gt;variants for&amp;nbsp;&lt;/SPAN&gt;8u and 16u, but not for 32f. And how to do the preceding unpremultiply ?&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Adriaan van Os&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 08:47:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128681#M25714</guid>
      <dc:creator>Adriaan_van_Os</dc:creator>
      <dc:date>2018-09-21T08:47:32Z</dc:date>
    </item>
    <item>
      <title>Hi Adriaan van Os,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128682#M25715</link>
      <description>&lt;P&gt;Hi Adriaan van Os,&lt;/P&gt;

&lt;P&gt;Could you explain what do you need in a more understandable form? I've taken a look into ippi.h:&lt;/P&gt;

&lt;P&gt;IPPAPI( IppStatus, ippiCopy_16u_C4C1R,&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;( const Ipp16u* pSrc, int srcStep,&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Ipp16u* pDst, int dstStep, IppiSize roiSize ))&lt;/P&gt;

&lt;P&gt;and into Apple alpha-composition:&lt;/P&gt;

&lt;DIV class="task-topic" style="box-sizing: inherit; margin-bottom: 1.5rem; color: rgb(51, 51, 51); font-family: &amp;quot;SF Pro Text&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 17px; letter-spacing: -0.357px; background-color: rgb(250, 250, 250);"&gt;
	&lt;DIV class="task-topic-info" style="box-sizing: inherit;"&gt;&lt;A class="has-adjacent-element symbol-name" href="https://developer.apple.com/documentation/accelerate/1410638-vimageunpremultiplydata_argb16u?language=objc" style="box-sizing: inherit; color: rgb(0, 112, 201); overflow-wrap: break-word; overflow: auto; display: inline-flex; padding: 5px 2rem 5px 0.76471rem; margin-left: -0.76471rem; width: calc((100% + 13px) + 1px); align-items: flex-start;"&gt;&lt;CODE style="box-sizing: inherit; font-weight: inherit; font-family: &amp;quot;SF Mono&amp;quot;, Menlo, monospace; letter-spacing: 0px;"&gt;&lt;SPAN style="box-sizing: inherit;"&gt;v&lt;WBR style="box-sizing: inherit;" /&gt;Image&lt;WBR style="box-sizing: inherit;" /&gt;Unpremultiply&lt;WBR style="box-sizing: inherit;" /&gt;Data&lt;WBR style="box-sizing: inherit;" /&gt;_ARGB16U&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/A&gt;

		&lt;DIV class="task-topic-abstract task-topic-data abstract formatted-content" style="box-sizing: inherit; margin-left: 2.35294rem;"&gt;
			&lt;DIV style="box-sizing: inherit;"&gt;
				&lt;P style="box-sizing: inherit; margin-bottom: 0px;"&gt;Transforms an ARGB16U image in premultiplied alpha format into an image in nonpremultiplied alpha format.&lt;/P&gt;
			&lt;/DIV&gt;
		&lt;/DIV&gt;
	&lt;/DIV&gt;
&lt;/DIV&gt;

&lt;DIV class="task-topic" style="box-sizing: inherit; margin-bottom: 1.5rem; color: rgb(51, 51, 51); font-family: &amp;quot;SF Pro Text&amp;quot;, &amp;quot;SF Pro Icons&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 17px; letter-spacing: -0.357px; background-color: rgb(250, 250, 250);"&gt;
	&lt;DIV class="task-topic-info" style="box-sizing: inherit;"&gt;regards, Igor&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 21 Sep 2018 08:51:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128682#M25715</guid>
      <dc:creator>Igor_A_Intel</dc:creator>
      <dc:date>2018-09-21T08:51:02Z</dc:date>
    </item>
    <item>
      <title>Unpremultiply is the inverse</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128683#M25716</link>
      <description>&lt;P&gt;Unpremultiply is the inverse operation of premultiply. With a premultiply, every RGB channel is multiplied by the value of the A channel. With an unpremultiply,&amp;nbsp;&lt;SPAN style="font-size: 13.008px; line-height: 15.6096px;"&gt;every RGB channel is divided by the value of the A channel, unless the A channel has value 0.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 15.6096px;"&gt;So, if an image is in premultiplied form, the RGB channels contain their proper value multiplied by the value of the A channel. So, if we change the A channel to another value, we must first unpremultiply (divide by the current value of the A channel), set the new value of the A channel and then premultiply (multiply with the new value of the A channel). If the A channel has value 0, then the proper RGB values are lost.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 15.6096px;"&gt;I am not fond about images that are in premultiplied form, but if the OS requires it, you have little choice.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 15.6096px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 15.6096px;"&gt;Adriaan van Os&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 09:52:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128683#M25716</guid>
      <dc:creator>Adriaan_van_Os</dc:creator>
      <dc:date>2018-09-21T09:52:18Z</dc:date>
    </item>
    <item>
      <title>Got it, thank you.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128684#M25717</link>
      <description>&lt;P&gt;Got it, thank you.&lt;/P&gt;

&lt;P&gt;this operation is rather easy for 32f images (just divide new alpha by the old one and call premul once more time - with, as you already mentioned, - "0" exception). But for the integer images this approach doesn't work - you need "unpremul" support. Do you need any additional support from the IPP side?&lt;/P&gt;

&lt;P&gt;regards, Igor&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 12:47:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128684#M25717</guid>
      <dc:creator>Igor_A_Intel</dc:creator>
      <dc:date>2018-09-21T12:47:01Z</dc:date>
    </item>
    <item>
      <title>Thanks. For 8u and 16u images</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128685#M25718</link>
      <description>&lt;P&gt;Thanks. For 8u and 16u images "unpremul" support, analog ippAlphaPremul, would suffice.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I welcome these functions (for premultiplication and unpremultiplication) also for 32f, unless I miss something. Can you elaborate what current ipp functions you have in mind for doing "&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; line-height: 14.4px;"&gt;this operation rather easy for 32f images" ?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 14.4px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 14.4px;"&gt;Adriaan van Os&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;P.S. Ah, I see now that&amp;nbsp;&lt;SPAN style="box-sizing: inherit;"&gt;v&lt;WBR style="box-sizing: inherit;" /&gt;Image&lt;WBR style="box-sizing: inherit;" /&gt;Unpremultiply&lt;WBR style="box-sizing: inherit;" /&gt;Data&lt;WBR style="box-sizing: inherit;" /&gt;_ARGB16U is a new (and very useful) function. Thanks for bringing that to my attention !&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 16:40:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128685#M25718</guid>
      <dc:creator>Adriaan_van_Os</dc:creator>
      <dc:date>2018-09-21T16:40:00Z</dc:date>
    </item>
    <item>
      <title>I had in mind the next: for</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128686#M25719</link>
      <description>&lt;P&gt;I had in mind the next: for 32f you don't need "un-premul" - you can divide "new" alpha by the "old" one and then call only "pre-mul".&lt;/P&gt;

&lt;P&gt;regards, Igor.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Sep 2018 17:42:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128686#M25719</guid>
      <dc:creator>Igor_A_Intel</dc:creator>
      <dc:date>2018-09-23T17:42:09Z</dc:date>
    </item>
    <item>
      <title>One would have to allocate a</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128687#M25720</link>
      <description>&lt;P class="p1"&gt;One would have to allocate a one-channel image and copy the old alpha channel to it. Then,&amp;nbsp;ippiDiv_32f_C1R could be called, but the description of this function (and of&amp;nbsp;ippsDiv_32f) says&lt;/P&gt;

&lt;P class="p1"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;ippStsDivByZero&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A warning that a divisor value is zero,&amp;nbsp; the function&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;execution is continued.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P class="p1"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If a dividend is equal to zero,&amp;nbsp; then the result is NAN_32F;&lt;/P&gt;

&lt;P class="p1"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if it is greater than zero,&amp;nbsp; then the result is INF_32F,&amp;nbsp;&lt;/P&gt;

&lt;P class="p1"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if it is less than zero,&amp;nbsp; then the result is INF_NEG_32F&lt;/P&gt;

&lt;P class="p1"&gt;Rather, with unpremultiplication, the result should be 0.&lt;/P&gt;

&lt;P class="p1"&gt;As as sidebar and apart from the division-by-zero problem, note that many Apple accelerate functions have a stride parameter, see e.g.&amp;nbsp;&lt;A href="https://developer.apple.com/documentation/accelerate/1450412-vdsp_svdiv?language=objc"&gt;https://developer.apple.com/documentation/accelerate/1450412-vdsp_svdiv?language=objc&lt;/A&gt;&amp;nbsp;. In many cases, this stride parameter is quite useful. Here it would make allocation and copy to a one-channel image unnecessary,&lt;/P&gt;

&lt;P class="p1"&gt;Regards,&lt;/P&gt;

&lt;P class="p1"&gt;Adriaan van Os&lt;/P&gt;

&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2018 10:03:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128687#M25720</guid>
      <dc:creator>Adriaan_van_Os</dc:creator>
      <dc:date>2018-09-24T10:03:25Z</dc:date>
    </item>
    <item>
      <title>Hi Adriaan van Os,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128688#M25721</link>
      <description>&lt;P&gt;Hi Adriaan van Os,&lt;/P&gt;

&lt;P&gt;agree, "un-premul"-&amp;gt;"premul" may be easier in this case. As regarding NaNs - IPP provides API for their substitution:&lt;/P&gt;

&lt;P&gt;IPPAPI(IppStatus, ippsReplaceNAN_32f_I, (Ipp32f* pSrcDst, int len, Ipp32f value))&lt;BR /&gt;
	IPPAPI(IppStatus, ippsReplaceNAN_64f_I, (Ipp64f* pSrcDst, int len, Ipp64f value))&lt;/P&gt;

&lt;P&gt;as regarding stride - we supported strides for ippMX (small matrix) domain (removed, available in legacy only). It is hard to develop optimized code path for an arbitrary stride - guess Apple provides optimized solution for dense cases only.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regards, Igor&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2018 11:48:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128688#M25721</guid>
      <dc:creator>Igor_A_Intel</dc:creator>
      <dc:date>2018-09-24T11:48:29Z</dc:date>
    </item>
    <item>
      <title>Here is an interesting</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128689#M25722</link>
      <description>&lt;P&gt;Here is an interesting proposal for strided memory access vectorization in LLVM&amp;nbsp;&lt;A href="https://reviews.llvm.org/D21363"&gt;https://reviews.llvm.org/D21363&lt;/A&gt;&amp;nbsp;Functions like&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 14.4px;"&gt;ippiCopy_xx_C1C4R have to deal with strides anyway. But, as you say, they use a specific stride, not an arbitrary stride.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 14.4px;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 14.4px;"&gt;Adriaan van Os&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2018 14:17:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Setting-the-alpha-channel/m-p/1128689#M25722</guid>
      <dc:creator>Adriaan_van_Os</dc:creator>
      <dc:date>2018-09-24T14:17:47Z</dc:date>
    </item>
  </channel>
</rss>

