Developer Reference

  • 2020
  • 10/21/2020
  • Public Content
Contents

BGRToYUV420

Converts an BGR image to the YUV color model; uses 4:2:0 sampling

Syntax

IppStatus ippiBGRToYUV420_8u_AC4P3R(const Ipp8u*
pSrc
, int
srcStep
, Ipp8u*
pDst
[3], int
dstStep
[3], 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 the destination image buffers in each color plane.
dstStep
An array of distances in bytes between starts of consecutive lines in each plane of 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
B'G'R'
image
pSrc
to the
Y'U'V'
image
pDst
with the
4:2:0 sampling
(see Table
“Planar Image Formats”
for more details). The function uses the same formulas as the function
ippiRGBToYUV
does.
For digital
BGR
values in the range [0..255],
Y'
varies in the range [0..255],
U
- in the range [-112..+112], and
V
- in the range [-157..+157]. To fit in the range of [0..255], a constant value 128 is added to the computed
U
and
V
values, and
V
is then saturated.
roiSize.width
and
roiSize.height
should be multiples of 2. If not 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
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.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.