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

Conversion from YVY2 -> YUY420

vibhor
Beginner
476 Views

Hello All

I am new to using IPP library.

I have an MPEG2 encoder (using IPP), encoder accepts YUY420 Planar format of data.

In Windows Vista WMV decoder is outputting YUY2 format of data.

Please suggest how can I convert from YUY2 to YUY420 format to give an input to my encoder?

Thanks & Regards,

Vibhor Mahajan

0 Kudos
1 Reply
Vladimir_Dudnik
Employee
476 Views

Hi Vibhor,

I would recommend you to take a look on IPP documentation which should cover almost all details. For example, you may find it useful to try the following functions:

/* ////////////////////////////////////////////////////////////////////////////
// Name: ippiYUToYU422_8u_C2P2R, ippiUYToYU422_8u_C2P2R
// Purpose: Converts 2-channel YUY2,UYVY images to the 2-plane NV12 image
//
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr One of the pointers is NULL
// ippStsSizeErr roiSize has a field value less than 2
//
// Parameters:
// pDstY Pointer to the destination image Y plane.
// dstYStep The step through the destination image Y plane.
// pDstCbCr Pointer to the destination image CbCr plane.
// dstCbCrStep The step through the destination image CbCr plane.
// pSrc Pointer to the source image
// srcStep Step through the source image
// roiSize Size of the ROI, should be multiple of 2.
// Notes:
// for ippiYUToYU422_8u_C2P2R sequence of bytes in the source image is( YUY2 ):
// Y0U0Y1V0,Y2U1Y3V1,...
// for ippiUYToYU422_8u_C2P2R sequence of bytes in the destination image is( UYVY ):
// U0Y0V0Y1,U1Y2V1Y3,...
// Sequence of bytes in the destination image is( NV12 ):
// Y plane Y0Y1Y2Y3
// UV plane U0V0U1V1
*/
IPPAPI(IppStatus, ippiYCbCr422ToYCbCr420_8u_C2P2R,( const Ipp8u* pSrc, int srcStep, Ipp8u* pDstY, int dstYStep,Ipp8u* pDstCbCr,int dstCbCrStep, IppiSize roiSize ))
IPPAPI(IppStatus, ippiCbYCr422ToYCbCr420_8u_C2P2R,( const Ipp8u* pSrc, int srcStep, Ipp8u* pDstY, int dstYStep,Ipp8u* pDstCbCr,int dstCbCrStep, IppiSize roiSize ))

Regards,
Vladimir

0 Kudos
Reply