<?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 RGBToYCbCr returns wrong range in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850302#M6476</link>
    <description>&lt;P&gt;Coould you please double check that your assumption that image step for your case is really 512*3. This depends on how you allocated memory for your 512x512 C3 image.&lt;BR /&gt;&lt;BR /&gt;Vladimir&lt;/P&gt;</description>
    <pubDate>Fri, 09 Apr 2010 09:03:27 GMT</pubDate>
    <dc:creator>Vladimir_Dudnik</dc:creator>
    <dc:date>2010-04-09T09:03:27Z</dc:date>
    <item>
      <title>RGBToYCbCr returns wrong range</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850296#M6470</link>
      <description>Hi, I am usingippiRGBToYCbCr_8u_C3Rto convert the colorspace of a rgb image to YCbCr.&lt;DIV&gt;The returned range of the Y channel is different than it should be, i.e., it has a maximum of 255 value, though as it says in the documentation and in theory that it cannot be greater than 235.&lt;/DIV&gt;&lt;DIV&gt;Below is the source code that I used:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;_________________________________________________________________________________________&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;void getY_8u(Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep, IppiSize roiSize)&lt;/DIV&gt;&lt;DIV&gt;{&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;&lt;/SPAN&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;IppStatus sts = ippiCopy_8u_C3C1R(pSrc+0, srcStep, pDst, dstStep, roiSize);&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;assert(sts==ippStsNoErr || sts!=ippStsNullPtrErr || sts!=ippStsSizeErr || sts!=ippStsStepErr);&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;DIV id="_mcePaste"&gt;IppStatus sts;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;int srcStep;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	Ipp8u* pSrcYCbCr = ippiMalloc_8u_C3(imgWidth, imgHeight, &amp;amp;srcStep);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;int dstStep = srcStep;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	sts = ippiRGBToYCbCr_8u_C3R(pSrc,srcStep,pSrcYCbCr,srcStep,srcRoiSize);		//RGB to YCbCr conversion&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	assert(sts==ippStsNoErr || sts!=ippStsNullPtrErr || sts!=ippStsSizeErr);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	int srcYstep;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	Ipp8u* pSrcY = ippiMalloc_8u_C1(imgWidth , imgHeight, &amp;amp;srcYstep);	//Y channel&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	getY_8u(pSrc, srcStep, pSrcY, srcYstep, srcRoiSize);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	Ipp8u max,min;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	sts = ippiMax_8u_C1R(pSrcY, srcYstep, srcRoiSize, &amp;amp;max);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	sts = ippiMin_8u_C1R(pSrcY, srcYstep, srcRoiSize, &amp;amp;min);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;_________________________________________________________________________________________&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;When I do the same rgb2ycbcr operation in matlab, it produces a maximum of 226 for the same image while ipp function produces 255.&lt;/DIV&gt;&lt;DIV&gt;What could be wrong?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Best regards.&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Apr 2010 13:41:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850296#M6470</guid>
      <dc:creator>kkirtac</dc:creator>
      <dc:date>2010-04-08T13:41:58Z</dc:date>
    </item>
    <item>
      <title>RGBToYCbCr returns wrong range</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850297#M6471</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;could you please provide input RGB values for the point where you believeyou get wrong YCbCr result?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir</description>
      <pubDate>Thu, 08 Apr 2010 21:24:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850297#M6471</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-04-08T21:24:39Z</dc:date>
    </item>
    <item>
      <title>RGBToYCbCr returns wrong range</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850298#M6472</link>
      <description>hello,&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I've checked for one of the pixel location for which 255 is produced, and found out that the corresponding RGB values are 91,207,89, respectively.&lt;/DIV&gt;&lt;DIV&gt;The Y channel output for that triple should be (0.257*91) + (0.504*207) + (0.098*89) + 16 =152.4370.&lt;/DIV&gt;&lt;DIV&gt;I give the code below, which I find matching pixel locations in input image, for generated 255 values:&lt;/DIV&gt;&lt;DIV&gt;________________________________________________________________________________________&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;	for (int i=0; i&lt;IMGHEIGHT&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;for (int j=0; j&lt;IMGWIDTH&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;if ( pSrcY[i*srcYstep+j] == max )&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;{&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;			&lt;/SPAN&gt;printf("%d\n%d\n%d\n",pSrc[i*srcStep+j],pSrc[i*srcStep+j+1],pSrc[i*srcStep+j+2]);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;}&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;________________________________________________________________________________________&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;My input image has 512*512 size, and hence, srcYstep=512, srcStep=512x3=1536 .&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Thanks..&lt;/DIV&gt;&lt;/IMGWIDTH&gt;&lt;/DIV&gt;&lt;/IMGHEIGHT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Apr 2010 06:13:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850298#M6472</guid>
      <dc:creator>kkirtac</dc:creator>
      <dc:date>2010-04-09T06:13:05Z</dc:date>
    </item>
    <item>
      <title>RGBToYCbCr returns wrong range</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850299#M6473</link>
      <description>Hi again,&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;I changed the printf code to&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;printf("%d\n",(Ipp8u)0.257*pSrc[i*srcStep+j]+0.504*pSrc[i*srcStep+j+1]+0.098*pSrc[i*srcStep+j+2]+16);&lt;BR /&gt;&lt;/B&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;&lt;BR /&gt;&lt;/B&gt;&lt;/DIV&gt;&lt;DIV&gt;which prints out a value 1133871366 . How can a value such that big can be produced with integer arithmetic of&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;range 0-255 ?&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Apr 2010 06:24:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850299#M6473</guid>
      <dc:creator>kkirtac</dc:creator>
      <dc:date>2010-04-09T06:24:38Z</dc:date>
    </item>
    <item>
      <title>RGBToYCbCr returns wrong range</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850300#M6474</link>
      <description>Well, it prints the right value when the pSrc pixel values are casted to float before the arithmetic:&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;printf("%d\n",(Ipp8u)((0.257*(float)pSrc[i*srcStep+j])+(0.504*(float)pSrc[i*srcStep+j+1])+(0.098*(float)pSrc[i*srcStep+j+2])+16));&lt;/B&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;&lt;BR /&gt;&lt;/B&gt;&lt;/DIV&gt;&lt;DIV&gt;but, why&lt;B&gt;ippiRGBToYCbCr_8u_C3R&lt;/B&gt;function can't produce this value? Maybe it doesnt implicitly cast the rgb values to float type prior to arithmetic, and so the previous wrong value of1133871366is generated and converted to the biggest value of the range,i.e.,255 .&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Apr 2010 08:56:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850300#M6474</guid>
      <dc:creator>kkirtac</dc:creator>
      <dc:date>2010-04-09T08:56:32Z</dc:date>
    </item>
    <item>
      <title>RGBToYCbCr returns wrong range</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850301#M6475</link>
      <description>It's ok now, its all my fault that I was using the wrong image pointer while retrieving the Y channel. I noticed that I am giving the original rgb input image to the function&lt;B&gt;getY_8u&lt;/B&gt;.. so its normal to see 255 values in Y image..&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;this thread can be removed..&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Best regards.&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Apr 2010 09:03:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850301#M6475</guid>
      <dc:creator>kkirtac</dc:creator>
      <dc:date>2010-04-09T09:03:17Z</dc:date>
    </item>
    <item>
      <title>RGBToYCbCr returns wrong range</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850302#M6476</link>
      <description>&lt;P&gt;Coould you please double check that your assumption that image step for your case is really 512*3. This depends on how you allocated memory for your 512x512 C3 image.&lt;BR /&gt;&lt;BR /&gt;Vladimir&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2010 09:03:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850302#M6476</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-04-09T09:03:27Z</dc:date>
    </item>
    <item>
      <title>RGBToYCbCr returns wrong range</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850303#M6477</link>
      <description>it was all my fault that I used wrong input, sorry,&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;this thread can be removed..&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thank you.&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Apr 2010 09:04:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850303#M6477</guid>
      <dc:creator>kkirtac</dc:creator>
      <dc:date>2010-04-09T09:04:56Z</dc:date>
    </item>
    <item>
      <title>RGBToYCbCr returns wrong range</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850304#M6478</link>
      <description>No problem, thanks for updating us and I'm really glad IPP work for you as expected (I hope) :)&lt;BR /&gt;&lt;BR /&gt;Vladimir</description>
      <pubDate>Fri, 09 Apr 2010 09:07:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGBToYCbCr-returns-wrong-range/m-p/850304#M6478</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-04-09T09:07:33Z</dc:date>
    </item>
  </channel>
</rss>

