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

Help with function ippiYCbCr422ToYCbCr420_8u_C2P3R

gjackson2434
Beginner
683 Views
I need help using this function. My input and output types is LPBYTE. How do I convert it to be used in this function ippiYCbCr422ToYCbCr420_8u_C2P3R?
My image is YUY2 and I am trying to convert it to I420.

When I try it I get unable to reading memory 0x00000000.

Sample code using the IPP would be very helpfully.
0 Kudos
4 Replies
jere_jones1
Beginner
683 Views
While I am not experienced with that specific function, I have encountered the reading memory at 0x00000000. It is the result of trying to use a null pointer.
Have you tested the return code from the function? If it returns ippStsNullPtrError then you are passing it a null pointer.
Jere
0 Kudos
gjackson2434
Beginner
683 Views
Here is the sample code I am using. Please help.

LPBYTE ImageI420[3];

IppiSize RoiSize;

ImageI420[0] = (LPBYTE)

new unsigned char[dwWidth * dwHeight * 3];

ImageI420[1] = (LPBYTE)

new unsigned char[dwWidth * dwHeight * 3];

ImageI420[2] = (LPBYTE)

new unsigned char[dwWidth * dwHeight * 3];

RoiSize.height = dwHeight * 2;

RoiSize.width = dwWidth * 2;

ippiYCbCr422ToYCbCr420_8u_C2P3R(RawImageAddr,0,ImageI420,0,RoiSize);

RawImageAddr is a YUY2 image in LPBYTE type.

0 Kudos
gjackson2434
Beginner
683 Views
Here is my new code please someone help

int

dstStep[3];

LPBYTE ImageI420[3];

IppiSize RoiSize;

ImageI420[0] = (LPBYTE)

new unsigned char[dwWidth * dwHeight * 3];

ImageI420[1] = (LPBYTE)

new unsigned char[dwWidth * dwHeight * 3];

ImageI420[2] = (LPBYTE)

new unsigned char[dwWidth * dwHeight * 3];

dstStep[0] = dwWidth * dwHeight *

sizeof(ImageI420);

dstStep[1] = dwWidth * dwHeight *

sizeof(ImageI420);

dstStep[2] = dwWidth * dwHeight *

sizeof(ImageI420);

RoiSize.height = dwHeight * 2;

RoiSize.width = dwWidth * 2;

ippiYCbCr422ToYCbCr420_8u_C2P3R(RawImageAddr,dwWidth * dwHeight *

sizeof(RawImageAddr),ImageI420,dstStep,RoiSize);

0 Kudos
Vladimir_Dudnik
Employee
683 Views
Hi,
there is piece of code from our expert, hope it will help

{
Ipp8u* ImageI420[3];
int stepI420[3];
Ipp8u* ImageYUY2;
int stepYUY2;
IppiSize roiSize = { 1024, 768};

ImageI420[0] = ippiMalloc_8u_C1( roiSize.width, roiSize.height, &(stepI420[0]));

ImageI420[1] = ippiMalloc_8u_C1( roiSize.width, roiSize.height, &(stepI420[1]));

ImageI420[2] = ippiMalloc_8u_C1( roiSize.width, roiSize.height, &(stepI420[2]));

ImageYUY2 = ippiMalloc_8u_C2( roiSize.width, roiSize.height, &stepYUY2 );

ippiYCbCr422ToYCbCr420_8u_C2P3R( ImageYUY2, stepYUY2, ImageI420, stepI420, roiSize);

ippiFree(ImageI420[0]);
ippiFree(ImageI420[1]);
ippiFree(ImageI420[2]);
ippiFree(ImageYUY2);
}

Regards,
Vladimir

0 Kudos
Reply