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

YUV420ToRGB

Converts a YUV image that has 4:2:0 sampling format to the RGB image.

Syntax

Case 1: Operation on planar data with ROI

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

Case 2: Operation on planar data without ROI

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

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

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

Supported values for mod:

8u_P3C3R 8u_P3AC4R

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

IppStatus ippiYUV420ToRGB_8u_P3C3(const Ipp8u* pSrc[3], Ipp8u* pDst, 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

An array of pointers to the source image buffers in each color plane.

srcStep

An array of distances in bytes between starts of consecutive lines in each source image planes for operations with ROI.

pDst

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

dstStep

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

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 Y'U'V' image pSrc to the gamma-corrected R'G'B' image pDst according to the same formulas as the function ippiYUVToRGB does. The difference is that ippiYUV420ToRGB4:2:0 sampling the input data to be in 4:2:2 sampling format (see Table “Planar Image Formats” for more details).

The function ippiYUV420ToRGB_P3AC4R additionally creates an alpha channel in the destination image with alpha values set to zero.

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.

roiSize.width (imgSize.width) and roiSize.height (imgSize.height) should be multiples of 2. Otherwise, the function reduces their original values to the nearest multiples of 2, 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 pointer is NULL.

ippStsSizeErr

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

ippStsDoubleSize

Indicates a warning if roiSize or imgSize has a field that is not a multiple of 2.