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

ID 790148
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

PatternMatch

Compares given array of binary patterns with an array of templates.

Syntax

IppStatus ippsPatternMatch_8u16u(const Ipp8u* pSrc, int srcStep, int srcLen, const Ipp8u* pPattern, int patternStep, int patternLen, int patternSize, Ipp16u* pDst, IppPatternMatchMode hint, int* pBufSize);

Include Files

ipps.h

Domain Dependencies

Headers: ippcore.h, ippvm.h

Libraries: ippcore.lib, ippvm.lib

Parameters

pSrc

Pointer to the source array of patterns.

srcStep

Stride between patterns in the source array.

srcLen

Number of patterns in the source array.

pPattern

Pointer to the array of templates.

patternStep

Stride between templates.

patternLen

Number of elements in the array of templates.

patternSize

Size of a pattern, in bytes.

pDst

Pointer to the result of comparison.

hint

Option to run specially optimized code branch, supported values:

ippPatternMatchAuto

The function selects optimization automatically.

ippPatternMatchDirect

The function uses direct method, no additional memory is required.

ippPatternMatchTable

The function uses conversion data for internal representation and requires the memory buffer. Helps to achieve better performance for a big set of input data.

pBufSize

Pointer to the work buffer size. The length of the buffer is srcLen*patternLen*sizeof(Ipp16u).

Description

This function compares a provided array of binary patterns with the array of templates. The pattern is an array containing bits of fixed size (8/16/../128/256/512 bits). The pattern size provided to the function is calculated in bytes. The template is some fixed pattern. The function compares the provided source patterns with the existing templates grouped into an array. To compare patterns, the function performs bitwise XOR operation between two patterns and calculates the number of resulting nonzero bits (population counter). This operation is applied to all source and template patterns.

Returned sequence is:

(patternLen = B, srcLen=A)
pat<0>^src<0>,      …,      pat<0>^src<A-1>,
pat<1>^src<0>,      …,      pat<1>^src<A-1>,
        			             …
pat<B-1>^src<B-1>,  …,    pat<B-1>^src<A-1>,

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when at least one of the pointers is NULL.

ippStsSizeErr

Indicates an error when at least one of the srcLen, dstLen, or size values is less than, or equal to zero; or one of the size values is too big.

ippStsBadArg

Indicates an error when the value of hint is not supported.