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

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

Threshold_LTVal, Threshold_LTAbsVal, Threshold_GTVal, Threshold_LTValGTVal

Performs the threshold operation on the elements of a vector by limiting the element values by the specified level and replacing them with the specified value.

Syntax

IppStatus ippsThreshold_LTAbsVal_32f(const Ipp32f* pSrc, Ipp32f* pDst, int len, Ipp32f level, Ipp32f value);

IppStatus ippsThreshold_LTAbsVal_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len, Ipp64f level, Ipp64f value);

IppStatus ippsThreshold_LTAbsVal_16s(const Ipp16s* pSrc, Ipp16s* pDst, int len, Ipp16s level, Ipp16s value);

IppStatus ippsThreshold_LTAbsVal_32s(const Ipp32s* pSrc, Ipp32s* pDst, int len, Ipp32s level, Ipp32s value);

IppStatus ippsThreshold_LTAbsVal_32f_I(Ipp32f* pSrcDst, int len, Ipp32f level, Ipp32f value);

IppStatus ippsThreshold_LTAbsVal_64f_I(Ipp64f* pSrcDst, int len, Ipp64f level, Ipp64f value);

IppStatus ippsThreshold_LTAbsVal_16s_I(Ipp16s* pSrcDst, int len, Ipp16s level, Ipp16s value);

IppStatus ippsThreshold_LTAbsVal_32s_I(Ipp32s* pSrcDst, int len, Ipp32s level, Ipp32s value);

IppStatus ippsThreshold_LTVal_16s(const Ipp16s* pSrc, Ipp16s* pDst, int len, Ipp16s level, Ipp16s value);

IppStatus ippsThreshold_LTVal_32f(const Ipp32f* pSrc, Ipp32f* pDst, int len, Ipp32f level, Ipp32f value);

IppStatus ippsThreshold_LTVal_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len, Ipp64f level, Ipp64f value);

IppStatus ippsThreshold_LTVal_16sc(const Ipp16sc* pSrc, Ipp16sc* pDst, int len, Ipp16s level, Ipp16sc value);

IppStatus ippsThreshold_LTVal_32fc(const Ipp32fc* pSrc, Ipp32fc* pDst, int len, Ipp32f level, Ipp32fc value);

IppStatus ippsThreshold_LTVal_64fc(const Ipp64fc* pSrc, Ipp64fc* pDst, int len, Ipp64f level, Ipp64fc value);

IppStatus ippsThreshold_GTVal_16s(const Ipp16s* pSrc, Ipp16s* pDst, int len, Ipp16s level, Ipp16s value);

IppStatus ippsThreshold_GTVal_32f(const Ipp32f* pSrc, Ipp32f* pDst, int len, Ipp32f level, Ipp32f value);

IppStatus ippsThreshold_GTVal_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len, Ipp64f level, Ipp64f value);

IppStatus ippsThreshold_GTVal_16sc(const Ipp16sc* pSrc, Ipp16sc* pDst, int len, Ipp16s level, Ipp16sc value);

IppStatus ippsThreshold_GTVal_32fc(const Ipp32fc* pSrc, Ipp32fc* pDst, int len, Ipp32f level, Ipp32fc value);

IppStatus ippsThreshold_GTVal_64fc(const Ipp64fc* pSrc, Ipp64fc* pDst, int len, Ipp64f level, Ipp64fc value);

IppStatus ippsThreshold_LTValGTVal_16s(const Ipp16s* pSrc, Ipp16s* pDst, int len, Ipp16s levelLT, Ipp16s valueLT, Ipp16s levelGT, Ipp16s valueGT);

IppStatus ippsThreshold_LTValGTVal_32s(const Ipp32s* pSrc, Ipp32s* pDst, int len, Ipp32s levelLT, Ipp32s valueLT, Ipp32s levelGT, Ipp32s valueGT);

IppStatus ippsThreshold_LTValGTVal_32f(const Ipp32f* pSrc, Ipp32f* pDst, int len, Ipp32f levelLT, Ipp32f valueLT, Ipp32f levelGT, Ipp32f valueGT);

IppStatus ippsThreshold_LTValGTVal_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len, Ipp64f levelLT, Ipp64f valueLT, Ipp64f levelGT, Ipp64f valueGT);

IppStatus ippsThreshold_LTVal_16s_I(Ipp16s* pSrcDst, int len, Ipp16s level, Ipp16s value);

IppStatus ippsThreshold_LTVal_32f_I(Ipp32f* pSrcDst, int len, Ipp32f level, Ipp32f value);

IppStatus ippsThreshold_LTVal_64f_I(Ipp64f* pSrcDst, int len, Ipp64f level, Ipp64f value);

IppStatus ippsThreshold_LTVal_16sc_I(Ipp16sc* pSrcDst, int len, Ipp16s level, Ipp16sc value);

IppStatus ippsThreshold_LTVal_32fc_I(Ipp32fc* pSrcDst, int len, Ipp32f level, Ipp32fc value);

IppStatus ippsThreshold_LTVal_64fc_I(Ipp64fc* pSrcDst, int len, Ipp64f level, Ipp64fc value);

IppStatus ippsThreshold_GTVal_16s_I(Ipp16s* pSrcDst, int len, Ipp16s level, Ipp16s value);

IppStatus ippsThreshold_GTVal_32f_I(Ipp32f* pSrcDst, int len, Ipp32f level, Ipp32f value);

IppStatus ippsThreshold_GTVal_64f_I(Ipp64f* pSrcDst, int len, Ipp64f level, Ipp64f value);

IppStatus ippsThreshold_GTVal_16sc_I(Ipp16sc* pSrcDst, int len, Ipp16s level, Ipp16sc value);

IppStatus ippsThreshold_GTVal_32fc_I(Ipp32fc* pSrcDst, int len, Ipp32f level, Ipp32fc value);

IppStatus ippsThreshold_GTVal_64fc_I(Ipp64fc* pSrcDst, int len, Ipp64f level, Ipp64fc value);

IppStatus ippsThreshold_LTValGTVal_16s_I(Ipp16s* pSrcDst, int len, Ipp16s levelLT, Ipp16s valueLT, Ipp16s levelGT, Ipp16s valueGT);

IppStatus ippsThreshold_LTValGTVal_32s_I(Ipp32s* pSrcDst, int len, Ipp32s levelLT, Ipp32s valueLT, Ipp32s levelGT, Ipp32s valueGT);

IppStatus ippsThreshold_LTValGTVal_32f_I(Ipp32f* pSrcDst, int len, Ipp32f levelLT, Ipp32f valueLT, Ipp32f levelGT, Ipp32f valueGT);

IppStatus ippsThreshold_LTValGTVal_64f_I(Ipp64f* pSrcDst, int len, Ipp64f levelLT, Ipp64f valueLT, Ipp64f levelGT, Ipp64f valueGT);

Include Files

ipps.h

Domain Dependencies

Headers: ippcore.h, ippvm.h

Libraries: ippcore.lib, ippvm.lib

Parameters

pSrc

Pointer to the source vector.

pDst

Pointer to the destination vector.

pSrcDst

Pointer to the source and destination vector for the in-place operation.

len

Number of elements in the vector.

level

Value used to limit each element of pSrc or pSrcDst.This argument must always be real. For complex versions, it must be positive and represent magnitude.

levelLT

Low bound used to limit each element of pSrc or pSrcDst for the ippsThreshold_LTValGTVal function.

levelGT

Upper bound used to limit each element of pSrc or pSrcDst for the ippsThreshold_LTValGTVal function.

value

Value to be assigned to vector elements which are “less than” or “greater than” level.

valueLT

Value to be assigned to vector elements which are less than levelLT for the ippsThreshold_LTValGTVal function.

valueGT

Value to be assigned to vector elements which are greater than levelGT for the ippsThreshold_LTValGTVal function.

Description

These functions perform the threshold operation on the vector pSrc by limiting each element by the threshold level and replacing it with the specified value.

The in-place flavors of the function perform the threshold operation on the vector pSrcDst by limiting each element by the threshold value.

ippsThreshold_LTAbsVal. The ippsThreshold_LTAbsVal function substitutes each element of the source vector that is less by absolute value than specified level with the specified constant value.

The formula for ippsThreshold_LTAbsVal is:

if( ABS(x[i]) < level ) y[i] = value;
else y[i] = x[i];

ippsThreshold_LTVal. The function ippsThreshold_LTVal performs the operation “less than” and level is a lower bound for the input. The vector elements less than level are set to value.

The formula for ippsThreshold_LTVal is:



For complex versions of the function ippsThreshold_LTVal, the parameter level is always real.

The formula for complex ippsThreshold_LTVal is:



ippsThreshold_GTVal. The function ippsThreshold_GTVal performs the operation “greater than” and level is an upper bound for the input. The vector elements greater than level are set to value.

The formula for ippsThreshold_GtVal is:



For complex versions of the function ippsThreshold_GTVal, the parameter level is always real.

The formula for complex ippsThreshold_GTVal is:



ippsThreshold_LTValGTVal. The function ippsThreshold_LTValGTVal checks both the “less than” and “greater than” conditions. The parameter levelLT is a lower bound and the parameter levelGT is an upper bound for the input. The source vector elements less than levelLT are set to valueLT, and the source vector elements greater than levelGT are set to valueGT. The value of levelLT must be less than or equal to levelGT.

The formula for ippsThreshold_LTValGTVal is:



For all complex versions, level must be positive and represent a magnitude.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pSrc, pDst, or pSrcDst pointer is NULL.

ippStsSizeErr

Indicates an error when len is less than or equal to 0.

ippStsThresholdErr

Indicates an error when levelLT is greater than levelGT.

ippStsThreshNegLevelErr

Indicates an error when level for the complex version is negative (see appendix A “Handling of Special Cases” for more information).