Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

RGBToYUV422

Converts an RGB image to the YUV color model; uses 4:2:2 sampling.

Syntax

Case 1: Operation on pixel-order data

IppStatus ippiRGBToYUV422_8u_C3C2R(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep, IppiSize roiSize);

Case 2: Operation on planar data with ROI

IppStatus ippiRGBToYUV422_8u_P3R(const Ipp8u* pSrc[3], int srcStep, Ipp8u* pDst[3], int dstStep[3], IppiSize roiSize);

Case 3: Operation on planar data without ROI

IppStatus ippiRGBToYUV422_8u_P3(const Ipp8u* pSrc[3], Ipp8u* pDst[3], IppiSize imgSize);

Case 4: Conversion from pixel-order to planar data with ROI

IppStatus ippiRGBToYUV422_8u_C3P3R(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst[3], int dstStep[3], IppiSize roiSize);

Case 5: Conversion from pixel-order to planar data without ROI

IppStatus ippiRGBToYUV422_8u_C3P3(const Ipp8u* pSrc, Ipp8u* pDst[3], IppiSize imgSize);

Include Files

ippcc.h

Domain Dependencies

Headers: ippcore.h, ippvm.h, ipps.h, ippi.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib, ippi.lib

Parameters

pSrc

Pointer to the source image buffer for pixel-order image. An array of pointers to the source image buffer in each color plane for planar image.

srcStep

Distance in bytes between starts of consecutive lines in the source image for operations with ROI.

pDst

Pointer to the destination image buffer for pixel-order image. An array of pointers to the destination image buffer in each color plane for planar image.

dstStep

Distance in bytes between starts of consecutive lines in the destination image for operations with ROI. An array of three values for planar image.

roiSize

Size of the source and destination ROI in pixels.

imgSize

Size of the source and destination images in pixels for operations without ROI.

Description

This function converts the gamma-corrected R'G'B' image pSrc to the Y'U'V' image pDst with 4:2:2 sampling format, according to the same formulas as the function ippiRGBToYUV does. For more details on this sampling format, see Table “Pixel-Order Image Formats” and Table “Planar Image Formats”.

For digital RGB values in the range [0..255], Y' has the range [0..255], U varies in the range [-112..+112], and V in the range [-157..+157]. To fit in the range of [0..255], the constant value 128 is added to computed U and V values, and V is then saturated.

Some function flavors operates with ROI (see Regions of Interest in Intel IPP). The function flavors that does not use ROI operate on the assumption that both the source and destination images have the same size and occupy a contiguous memory area, which means that image rows are not padded with zeroes. In this case the step parameters are not needed.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or a warning.

ippStsNullPtrErr

Indicates an error condition if pSrc or pDst pointer is NULL.

ippStsSizeErr

Indicates an error condition if roiSize or imgSize has a field with a zero or negative value.