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

Whats wrong with my code?

gjackson2434
Beginner
593 Views
Please help. I don't understand whats wrong with my code.
I am trying to use ippiYCbCr422ToYCbCr420_8u_C2P3R on an YUY2 image in LPBYTE datatype and store the I420 image in LPBYTE datatype. The manuals are to brief to understand most of the functions in IPP.

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(char),ImageI420,dstStep,RoiSize);

0 Kudos
1 Reply
Vladimir_Dudnik
Employee
593 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