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

ID 790148
Date 3/22/2024
Public

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

Document Table of Contents

RGBToYCbCr

Converts an RGB image to the YCbCr color model.

Syntax

Case 1: Operation on pixel-order data

IppStatus ippiRGBToYCbCr_<mod>(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep, IppiSize roiSize);

Supported values for mod:

8u_C3R 8u_AC4R

Case 2: Operation on planar data

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

Case 3: Conversion from pixel-order to planar data

IppStatus ippiRGBToYCbCr_<mod>(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst[3], int dstStep, IppiSize roiSize);

Supported values for mod:

8u_C3P3R 8u_AC4P3R

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 ROI for a pixel-order image. An array of pointers to ROI in each separate source color planes for planar images.

srcStep

Distance in bytes between starts of consecutive lines in the source image.

pDst

Pointer to the destination imnage ROI. Array of pointers to ROI in the separate destination color planes for planar images.

dstStep

Distance in bytes between starts of consecutive lines in the destination image.

roiSize

Size of the source and destination ROI in pixels.

Description

This function operates with ROI (see Regions of Interest in Intel IPP).

This function converts the gamma-corrected R'G'B' image pSrc with values in the range [0..255] to the Y'Cb'Cr' image pDst according to the following formulas:

Y' = 0.257*R' + 0.504*G' + 0.098*B' + 16

Cb' = -0.148*R' - 0.291*G' + 0.439*B' + 128

Cr' = 0.439*R' - 0.368*G' - 0.071*B' + 128

In the YCbCr model, Y is defined to have a nominal range [16..235], while Cb and Cr are defined to have a range [16..240], with the value of 128 as corresponding to zero.

Both the source and destination images have the same bit depth.

Return Values

ippStsNoErr

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

ippStsNullPtrErr

Indicates an error condition if pSrc or pDst is NULL.

ippStsSizeErr

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