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

ID 790148
Date 3/22/2024
Public
Document Table of Contents

RGBToYCbCr420

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

Syntax

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

IppStatus ippiRGBToYCbCr420_8u_C3P2R(const Ipp8u* pSrc, int srcStep, Ipp8u* pDstY, int dstYStep, Ipp8u* pDstCbCr, int dstCbCrStep, IppiSize roiSize);

IppStatus ippiRGBToYCbCr420_8u_C4P2R(const Ipp8u* pSrc, int srcStep, Ipp8u* pDstY, int dstYStep, Ipp8u* pDstCbCr, int dstCbCrStep, IppiSize roiSize);

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.

srcStep

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

pDst

An array of pointers to ROI in the separate planes of the destination image for three-plane image.

dstStep

Array of distances in bytes between starts of consecutive lines in each plane of the destination image for three-plane image.

pDstY

Pointer to ROI in the luminance plane of the destination image for two-plane image.

dstStep, dstYStep

Distance in bytes between starts of consecutive lines in the luminance plane for two-plane image.

pDstCbCr

Pointer to ROI in the interleaved chrominance plane of the destination image for two-plane image.

dstCbCrStep

Distance in bytes between starts of consecutive lines in the interleaved chrominance plane for two-plane 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 to the Y'Cb'Cr' image according to the same formulas as the function ippiRGBToYCbCr does. The difference is that ippiRGBToYCbCr420 uses 4:2:0 sampling format for the converted image (see Table “Planar Image Formats” for more details).

roiSize.width should be multiple of 2, and roiSize.height should be multiple of 2 (for three-plane image) or 4 (for two-plane image). If not the function reduces their original values to the nearest multiples of 2 or 4 correspondingly, performs operation, and returns warning message.

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 value less than 2.

ippStsDoubleSize

Indicates a warning if roiSize.width is not a multiple of 2, or if roiSize.height is not a multiple of 2 (for three-plane image) or 4 (for two-plane image).