YUV420ToRGB

Convert from YUV with 4:2:0 sampling to RGB

Supported Technologies

MT, SSE2, Family10h

Synopsis

FwStatus   fwiYUV420ToRGB_8u_P3R ( const Fw8u * const pSrc[3]int srcStep[3]Fw8u * const pDst[3]int dstStepFwiSize roiSize );
FwStatus   fwiYUV420ToRGB_8u_P3 ( const Fw8u * const pSrc[3]Fw8u * const pDst[3]FwiSize imgSize );
FwStatus   fwiYUV420ToRGB_8u_P3C3R ( const Fw8u * const pSrc[3]int srcStep[3]Fw8u * pDstint dstStepFwiSize roiSize );
FwStatus   fwiYUV420ToRGB_8u_P3AC4R ( const Fw8u * const pSrc[3]int srcStep[3]Fw8u * pDstint dstStepFwiSize roiSize );
FwStatus   fwiYUV420ToRGB_8u_P3C3 ( const Fw8u * const pSrc[3]Fw8u * pDstFwiSize imgSize );

Parameters

dstStep   Destination buffer step size (width of the buffer in bytes).
imgSize   Specifies the dimensions of an entire image.
pDst   Pointer to a location in a destination buffer.
pDst[3]   Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).
pSrc[3]   Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).
roiSize   Specifies the height and width of an ROI.
srcStep[3]   Source three-channel planar buffer step size (array values define width of each plane in bytes).

Description

These functions convert data in an ROI in a source buffer from the YUV color space with 4:2:0 chroma subsampling to the RGB model, and write the converted data to a destination buffer.

The repeating versions of the functions step through an ROI in a source buffer and write the converted data to a destination buffer.

A YUV image with 4:2:0 chroma subsampling (pSrc) is converted to a gamma-corrected RGB image (pDst).

The following conversion formulas are used:

 R = Y + 1.140*V
 G = Y - 0.394*U - 0.581*V
 B = Y + 2.032*U

Versions of the functions that don't specify an ROI apply the conversion to the whole image buffer.