Threshold_LTAbs, Threshold_GTAbs

Performs the threshold operation on the absolute values of elements of a vector.

Syntax

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

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

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

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

IppStatus ippsThreshold_LTAbs_16s_I(Ipp16s* pSrcDst, int len, Ipp16s level);

IppStatus ippsThreshold_LTAbs_32s_I(Ipp32s* pSrcDst, int len, Ipp32s level);

IppStatus ippsThreshold_LTAbs_32f_I(Ipp32f* pSrcDst, int len, Ipp32f level);

IppStatus ippsThreshold_LTAbs_64f_I(Ipp64f* pSrcDst, int len, Ipp64f level);

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

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

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

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

IppStatus ippsThreshold_GTAbs_16s_I(Ipp16s* pSrcDst, int len, Ipp16s level);

IppStatus ippsThreshold_GTAbs_32s_I(Ipp32s* pSrcDst, int len, Ipp32s level);

IppStatus ippsThreshold_GTAbs_32f_I(Ipp32f* pSrcDst, int len, Ipp32f level);

IppStatus ippsThreshold_GTAbs_64f_I(Ipp64f* pSrcDst, int len, Ipp64f level);

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 source vector. This argument can not be negative.

Description

The functions ippsThreshold_LTAbs and ippsThreshold_GTAbs are declared in the ipps.h file. They implement thresholding of the vector pSrc by limiting absolute value of each element by the threshold value level. These functions perform the compare operation of the fixed type: ippsThreshold_LTAbs is for the "less than" comparison, while ippsThreshold_GTAbs is for the "greater than" comparison. Elements of the result vector pDst have the same sign that the source elements.

The in-place flavors perform the threshold operation on the vector pSrcDst.

ippsThreshold_LTAbs. The ippsThreshold_LTAbsfunction performs the operation “less than”, and level is a lower bound for the input. The formula for ippsThreshold_LTAbs is the following:

ippsThreshold_GTAbs. The function ippsThreshold_GTAbs performs the operation “greater than” and level is an upper bound for the input. The formula for ippsThreshold_GTAbs is the following:

The example below shows how to use the function ippsThreshold_LTAbs_64f_I.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

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

ippStsSizeErr

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

ippStsThreshNegLevelErr

Indicates an error if level is negative.

Using the ippThreshold_LTAbs function

IppStatus thresholdLTAbs( void ) {
    Ipp64f      vec[7] = { -4.01, -4.0, -3.9, 0.0, 2.5, 4.0, 4.5 };
    Ipp64f      level = 4.0;
    IppStatus   st = ippsThreshold_LTAbs_64f_I( vec, 7, level );
    printf("threshold abs   =   %f  %f  %f  %f\n",
        vec[0],vec[1],vec[2],vec[3]);
    printf("                     %f   %f   %f\n",
        vec[4],vec[5],vec[6]);
    return st;
}
Output:
threshold abs = -4.010000 -4.000000 -4.000000 4.000000 
                          4.000000   4.000000   4.500000

Submit feedback on this help topic

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