Intel® Integrated Performance Primitives Developer Guide and Reference

ID 790148
Date 11/07/2023
Public

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

Document Table of Contents

Pack

Converts 16-bit image to 12-bit image by discarding 4 upper bits (MSB).

Syntax

IppStatus ippiPack_16u12u_C1R(Ipp16u* pSrc, int srcStep, Ipp8u* pDst, int dstStep, IppiSize roiSize);

Include Files

ippcc.h

Parameters

pSrc

Pointer to the source image ROI.

srcStep

Steps throught the source image.

pDst

Pointer to the destination image ROI.

dstStep

Steps throught the destination image.

roiSize

Size of the source and destination ROI in pixels.

Description

This function operates with ROI (see Regions of Interest in Intel IPP).

This function converts 16-bit image to 12-bit image by discarding 4 upper bits (MSB).

For 12-bit images, neighboring 2 pixels occupy 3 bytes and occupy memory space in the following order:

bits      7         6         5         4         3         2         1         0                                                  
Byte 0: P0[11]    P0[10]    P0[ 9]    P0[ 8]    P0[ 7]    P0[ 6]    P0[ 5]    P0[ 4]
Byte 1: P0[ 3]    P0[ 2]    P0[ 1]    P0[ 0]    P1[11]    P1[10]    P1[ 9]    P1[ 8]
Byte 2: P1[ 7]    P1[ 6]    P1[ 5]    P1[ 4]    P1[ 3]    P1[ 2]    P1[ 1]    P1[ 0]

If the width of the image is odd, the last pixel occupies 2 bytes.

Despite the fact that the pointer to a 12-bit image is of the Ipp8u* type, in fact, such an image occupies at least roiSize.height*roiSize.width*(12/8) bytes, satisfying the condition srcStep >= roiSize.width*(12/8).

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error.

ippStsNullPtrErr

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

ippStsStepErr

Indicates an error condition if srcStep or dstStep is less than or equal to zero.

ippStsSizeErr

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