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

Color conversion from YUV422 to RGB565

phoenixpl
Beginner
549 Views

Hello,

Im new to IPP and Im using evaluation version to see if it will be suitable for our purpose. From what I have heard and readied it will easily fit needs of my company. Right now I want to test most important thing at current stage which is color space conversion. I need to convert YUV422 data to RGB565 in order to deinterlace it and display it on the screen. To do this Im using UMC::ColorSpaceConverter from media samples. Unfortunately Im getting strange result. Image is not correctly transform: image seams to be squeezed by half vertical size and lower part of it seams to be some sort of ghost or artefact from main image. Can someone point me what am I doing wrong here? Here is my sample of conversion:

void InitConversion()
{

ippStaticInit();
colorConversionInfo.FormatSource = UMC::YUV422;
colorConversionInfo.FormatDest = UMC::RGB565;
colorConversionInfo.SizeSource.width = XDIM;
colorConversionInfo.SizeSource.height = YDIM;
colorConversionInfo.SizeDest.width = XDIM;
colorConversionInfo.SizeDest.height = YDIM;
colorConversionInfo.lFlags = UMC::FLAG_CCNV_CONVERT;
colorConversionInfo.lDeinterlace = 0;
colorConversionInfo.lInterpolation = 1;
ippResult = colorConverter.Init( colorConversionInfo );

planeY = new unsigned char [XDIM * YDIM];
planeU = new unsigned char [XDIM / 2 * YDIM];
planeV = new unsigned char [XDIM / 2 * YDIM];
}


void DrawImage()
{


&n bsp; colorConversionParams.lpSource0 = planeY;
colorConversionParams.lpSource1 = planeV;
colorConversionParams.lpSource2 = planeU;
colorConversionParams.PitchSource0 = XDIM * 2;
colorConversionParams.PitchSource1 = XDIM/2;
colorConversionParams.PitchSource2 = XDIM/2;
colorConversionParams.lpDest0 = testBuf;
colorConversionParams.lpDest1 = 0;
colorConversionParams.lpDest2 = 0;
colorConversionParams.PitchDest0 = XDIM * 2;
colorConversionParams.PitchDest1 = 0;
colorConversionParams.PitchDest2 = 0;
colorConversionParams.ConversionInit = colorConversionInfo;


&nb sp; UMC::Status ippStatus = colorConverter.ConvertFrame( &colorConversionParams );
if( ippStatus == UMC::UMC_OK )
{

// draw image

}

}

I have also attached image sample from conversion.


Regards,
Peter

0 Kudos
4 Replies
phoenixpl
Beginner
549 Views

I've found a solution. Unfortunately I've made a type and source0 pitch was multiplited by 2 instead of living original image width. Sorry about that.

0 Kudos
Vladimir_Dudnik
Employee
549 Views

Thanks for updating. What oter parts (if any) of media sample you want to use in your application? How do you find IPP media sample functionality and performance?

Regards,
Vladimir

0 Kudos
phoenixpl
Beginner
549 Views

Hello Vladimir,

Media sample is quite interesting, but I can see that it is not fully finished. I like what you have done with color space conversion and image resizing, but as I browsed through sources I see that a lot of functions are missing (especially for RGB24). Also I like your encoder/decoder samples. They help a lot in estimating how to use IPP. Performance is quite good, but it would be good if you would add some sort of default settings for encoder. Right now I had to put every single option manually and for people that dont know how to set it up its enormous and sometimes impossible job. Overall its a good sample that can be easily converted and used by users.

Regards,

Peter

0 Kudos
Chao_Y_Intel
Moderator
549 Views

Hi, Peter,

Thanks for the valuable feedback. For the RGB24 format, could you specify what kind of functions you want to add? We can put it in our product requirement system, so our engineering will consider it in our future release.

Regards,
Chao Y.

0 Kudos
Reply