Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Silly ippiRGB2Gray conversion bug

Rob_Ottenhoff
New Contributor I
539 Views
Hi,

I noticed that the ippiRGBToGray_8u_AC4C1R and ippiRGBToGray_8u_C3C1R translate RGB(255,255,255) to 254. A rather silly but annoying bug. I now have to rely on a non IPP function to do the conversion. Can this be repaired?

Regards,

Rob Ottenhoff


0 Kudos
4 Replies
Vladimir_Dudnik
Employee
539 Views
Hi Rob,

What version of IPP do you use? And also might be important to know what was the processor and OS you are run on. We need that info to reproduce issue.


Regards,
Vladimir
0 Kudos
Ying_H_Intel
Employee
539 Views

Hi Rob,

Which IPP version and IPP librariesare you using?

I just try IPP\6.1.1.035\ia32\ static serial libraray. Seem it can get 255 correctly.

Regards,
Ying

#include
#include
#include
#include

int main()
{
ippStaticInit();
// Print the version of ipp being used
const IppLibraryVersion* lib = ippccGetLibVersion();
printf("%s %s %d.%d.%d.%d\n", lib->Name, lib->Version,lib->major, lib->minor, lib->majorBuild, lib->build);

Ipp8u pSrc[6] ={255, 255, 255, 30, 40, 4};
Ipp8u pDst[6]={0};
int srcStep=6, dstStep=3;
IppiSize roiSize={2,1};

ippiRGBToGray_8u_C3C1R(pSrc, srcStep,pDst, dstStep, roiSize);

printf(" output: \n");
for(int n=0; n<2; ++n)
{
printf("%d, %d, %d\n", pDst[n*3],pDst[n*3+1],pDst[n*3+2] );}
return 0;
}

output:

ippccv8l.lib 6.1 build 137.20 6.1.137.718
output:
255, 32, 0
0, 0, 0
Press any key to continue . . .

0 Kudos
Rob_Ottenhoff
New Contributor I
539 Views
Hi Ying,vladimir,

I use IPP 6.1.5 (the latest). The processor is an Intel i7. The OS is windows 7 64bit. But I compile 32bit.
I link dynamically.

The test code below shows the complete output buffer is filled with 254.

Regards,

Rob

Here is test code that reprocudes the issue:

int main()
{
// Print the version of ipp being used
const IppLibraryVersion* lib = ippccGetLibVersion();
printf("%s %s %d.%d.%d.%d\n", lib->Name, lib->Version,lib->major, lib->minor, lib->majorBuild, lib->build);

Ipp8u pSrc[320*240*4];
for ( int i = 0; i < 240; ++i )
{
for ( int j = 0; j < 320; ++j )
{
pSrc[4*320*i+4*j] = 255;
pSrc[4*320*i+4*j+1] = 255;
pSrc[4*320*i+4*j+2] = 255;
pSrc[4*320*i+4*j+3] = 0;
}
}
Ipp8u pDst[320*240];
IppiSize roiSize={320,240};

ippiRGBToGray_8u_AC4C1R(pSrc, 320*4, pDst, 320, roiSize);
// whole dst buffer is filled with 0xfe;

int b254count = 0;
for ( int i = 0; i < 240; ++i )
{
for ( int j = 0; j < 320; ++j )
{
if ( pDst[i*320+j] == 254 )
{
b254count++;
}

}
}
printf("254's found : %d\n", b254count );


return 0;
}

output:
ippccp8-6.1.dll+ 6.1 build 137.36 6.1.137.734
254's found : 76800
0 Kudos
Ying_H_Intel
Employee
539 Views
Hi Rob,

Thanks a lot. I can reproduce the problem if run on an Core i7 machine with IPP 6.x

But i happen to IPP 7.0 beta installed on same machine. So try IPP 7.0 beta 32bit dynamic library too.
The result looks fine,
ippccp8-7.0.dll+ 7.0 beta build 183.15 7.0.183.899
254's found : 0.

Would you like to try IPP 7.0 beta? here is 7.0 beta program page:
Intel Integrated Performance Primitives 7.0 Beta Program

I will escalate the issue, hope the fix keep when 7.0 gold release.

Thanks
Ying
0 Kudos
Reply