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

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

ResizeYUV422Linear

Changes an YUY2 image size by the linear interpolation method.

Syntax

IppStatus ippiResizeYUV422Linear_8u_C2R(const Ipp8u* pSrc, Ipp32s srcStep, Ipp8u* pDst, Ipp32s dstStep, IppiPoint dstOffset, IppiSize dstSize, IppiBorderType border, const Ipp8u* pBorderValue, const IppiResizeYUV422Spec* pSpec, Ipp8u* pBuffer);

Include Files

ippi.h

Domain Dependencies

Headers: ippcore.h, ippvm.h, ipps.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib

Parameters

pSrc

Pointer to the source image.

srcStep

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

pDst

Pointer to the destination image.

dstStep

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

dstOffset

Offset of the tiled destination image with respect to the destination image origin.

dstSize

Size of the destination image in pixels.

border

Type of the border.

pBorderValue

Pointer to the constant value to assign to pixels of the constant border. This parameter is applicable only to the ippBorderConst border type.

pSpec

Pointer to the spec structure for the resize filter.

pBuffer

Pointer to the work buffer.

Description

This function changes an image size using the linear interpolation method. The image size can be either reduced or increased in each direction, depending on the destination image size.

This function operates with ROI (see ROI Processing in Geometric Transforms). It resizes the source image ROI origin to the destination image ROI origin. The destination image ROI origin must be defined by the following parameters: the offset of the tiled destination image with respect to the destination image origin and the destination image size. The source image ROI origin is defined automatically. To obtain the source image ROI origin offset, call the ippiResizeYUV422GetSrcOffset function. The source and destination images are in the YUY2 pixel format (Y0U0Y1V0,Y2U1Y3V1,.. or Y0Cb0Y1Cr0,Y2Cb1Y3Cr1,..).

Supported values for border are ippBorderRepl and ippBorderInMem.

The interpolation algorithm applied uses edge pixels of the source image that are out of the ROI. The function ippiResizeYUV422Linear uses the weighted values of these outer pixels in calculation. To obtain the size of the out of the ROI source image, call the function ippiResizeYUV422GetBorderSize .

If the border type is equal to ippBorderRepl, the source image edge pixels are replicated out of the ROI. If the border type is equal to ippBorderInMem, the outer pixels are obtained from the out of the ROI image space.

Prior to using the ippiResizeYUV422Linear function, initialize the IppiResizeYUV422Spec structure by calling the ippiResizeYUV422LinearInit and compute the size of the external buffer pBuffer by calling the ippiResizeYUV422GetBufSize for the corresponding flavor.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error if one of the specified pointers is NULL.

ippStsNoOperation

Indicates a warning if width or height of the destination image is equal to zero.

ippStsBorderErr

Indicates an error if the border value is illegal.

ippStsContextMatchErr

Indicates an error if pointer to the spec structure is invalid.

ippStsSizeWrn

Indicates a warning in the following cases:
  • if width of the destination image is odd,

  • if the destination image size is more than the destination image origin.

ippStsMisalignedOffsetErr

Indicates an error if the x field of the dstOffset parameter is odd.

ippStsSizeErr

Indicates an error if width of the destination image is equal to 1, or if width or height of the source or destination image is negative.

ippStsOutOfRangeErr

Indicates an error if the destination image offset point is outside the destination image origin.