All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Signal-Processing Specific API Conventions

# Signal Data

Signal data is passed to and from NPPS primitives via a pointer to the signal's data type.

The general idea behind this fairly low-level way of passing signal data is ease-of-adoption into existing software projects:

- Passing the data pointer rather than a higher- level signal struct allows for easy adoption by not requiring a specific signal representation (that could include total signal size offset, or other additional information). This avoids awkward packing and unpacking of signal data from the host application to an NPP specific signal representation.

## Parameter Names for Signal Data

There are three general cases of image-data passing throughout NPP detailed in the following sections.

Those are signals consumed by the algorithm.

### Source Signal Pointer

The source signal data is generally passed via a pointer named

pSrc

The source signal pointer is generally defined constant, enforcing that the primitive does not change any image data pointed to by that pointer. E.g.

nppsPrimitive_32s(const Npp32s * pSrc, ...)

In case the primitive consumes multiple signals as inputs the source pointers are numbered like this:

pSrc1, pScr2, ...

### Destination Signal Pointer

The destination signal data is generally passed via a pointer named

pDst

In case the primitive consumes multiple signals as inputs the source pointers are numbered like this:

pDst1, pDst2, ...

### In-Place Signal Pointer

In the case of in-place processing, source and destination are served by the same pointer and thus pointers to in-place signal data are called:

pSrcDst

## Signal Data Alignment Requirements

NPP requires signal sample data to be naturally aligned, i.e. any pointer

NppType * p;

to a sample in a signal needs to fulfill:

assert(p % sizeof(p) == 0);

## Signal Data Related Error Codes

All NPPI primitives operating on signal data validate the signal-data pointer for proper alignment and test that the point is not null.

Failed validation results in one of the following error codes being returned and the primitive not being executed:

- NPP_NULL_POINTER_ERROR is returned if the image-data pointer is 0 (NULL).
- NPP_ALIGNMENT_ERROR if the signal-data pointer address is not a multiple of the signal's data-type size.

# Signal Length

The vast majority of NPPS functions take a

nLength

parameter that tells the primitive how many of the signal's samples starting from the given data pointer are to be processed.

## Length Related Error Codes

All NPPS primitives taking a length parameter validate this input.

Failed validation results in the following error code being returned and the primitive not being executed:

- NPP_SIZE_ERROR is returned if the length is negative.

Copyright © 2009-2019 NVIDIA Corporation