Filter_Round

Perform filtering an image and rounding the result.

Syntax

Case 1: Filters with integer 16s kernel

IppStatus ippiFilter_Round16s_<mod>(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep, IppiSize dstRoiSize, const Ipp16s* pKernel, IppiSize kernelSize, IppiPoint anchor, int divisor, IppRoundMode roundMode, Ipp8u* pBuffer);

Supported values for mod:

8u_C1R
8u_C3R
8u_C4R
8u_AC4R

Case 2: Filters with integer 32s kernel

IppStatus ippiFilter_Round32s_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize dstRoiSize, const Ipp32s* pKernel, IppiSize kernelSize, IppiPoint anchor, int divisor, IppRoundMode roundMode, Ipp8u* pBuffer);

Supported values for mod:

16u_C1R 16s_C1R
16u_C3R 16s_C3R
16u_C4R 16s_C4R
16u_AC4R 16s_AC4R

Case 3: Filters with floating-point 32f kernel

IppStatus ippiFilter_Round32f_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize dstRoiSize, const Ipp32f* pKernel, IppiSize kernelSize, IppiPoint anchor, IppRoundMode roundMode, Ipp8u* pBuffer);

Supported values for mod:

8u_C1R 16u_C1R 16s_C1R
8u_C3R 16u_C3R 16s_C3R
8u_C4R 16u_C4R 16s_C4R
8u_AC4R 16u_AC4R 16s_AC4R

Parameters

pSrc

Pointer to the source image ROI.

srcStep

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

pDst

Pointer to the destination image ROI.

dstStep

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

dstRoiSize

Size of the source and destination ROI in pixels.

pKernel

Pointer to the kernel values.

kernelSize

Size of the rectangular kernel in pixels.

anchor

Anchor cell specifying the rectangular kernel alignment with respect to the position of the input pixel.

divisor

The integer value by which the computed result is divided (for operations on integer data only).

roundMode

Rounding mode, the following values are possible:

ippRndZero

specifies that floating-point values are truncated toward zero,

ippRndNear

specifies that floating-point values are rounded to the nearest even integer when the fractional part equals 0.5; otherwise they are rounded to the nearest integer,

ippRndFinancial

specifies that floating-point values are rounded down to the nearest integer when the fractional part is less than 0.5, or rounded up to the nearest integer if the fractional part is equal or greater than 0.5.

pBuffer

Pointer to the working buffer.

Description

The function ippiFilter_Round is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP). This function uses the general rectangular kernel of size kernelSize to filter an image ROI. This function sums the products between the kernel coefficients pKernel and pixel values taken over the source pixel neighborhood defined by kernelSize and anchor. The anchor cell is specified by its coordinates anchor.x and anchor.y in the coordinate system associated with the bottom right corner of the kernel. Note that kernel coefficients are used in inverse order. The sum is written to the destination pixel.

In case of integer kernel, the result is divided by the fixed scaling factor divisor (see formula above) and then is rounded using the rounding method specified by the parameter roundMode.

In case of floating-point kernel the result is rounded using the rounding method specified by the parameter roundMode.

To ensure valid operation when image boundary pixels are processed, the application should correctly define additional border pixels (see Borders).

This function requires the temporary working buffer. Its size must be computed beforehand using the one of the functions ippiFilterRoundGetBufSize16s, ippiFilterRoundGetBufSize32s, ippiFilterRoundGetBufSize32f.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error.

ippStsNullPtrErr

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

ippStsSizeErr

Indicates an error condition if dstRoiSize or kernelSize has a field with a zero or negative value.

ippStsDivisorErr

Indicates an error condition if the divisor value is zero, the execution is interrupted.

ippStsStepErr

Indicates an error condition if the srcStep is less than (roiSize.width + kernelSize.width-1)* sizeof( pSrc); or dstStep is less than roiSize.width*sizeof(pSrc).

ippStsRoundModeNotSupportedErr

Indicates an error condition if the roundMode has an illegal value.

Submit feedback on this help topic

Copyright © 2000 - 2010, Intel Corporation. All rights reserved.