Data Structures | |
struct | VPIPackingParams |
Defines the parameters encoded in a VPIPacking. More... | |
Macros | |
#define | VPI_MAX_CHANNEL_COUNT (4) |
Maximum VPI channel count. | |
#define | VPI_MAKE_SWIZZLE_ABBREV(x, y, z, w) |
Creates a user-defined swizzle operation, using abbreviated parameters. More... | |
#define | VPI_MAKE_SWIZZLE(x, y, z, w) |
Creates a user-defined swizzle operation. More... | |
Enumerations | |
enum | VPIPacking |
Defines how channels are packed into an image plane element. More... | |
enum | VPIDataType |
Defines the channel data type. More... | |
enum | VPIMemLayout |
Defines how the 2D plane pixels are laid out in memory. More... | |
enum | VPIChannel |
Defines the format channel names. More... | |
enum | VPISwizzle |
Defines the supported channel swizzle operations. More... | |
enum | VPIEndianness |
Endianness of a VPIPacking value. More... | |
Functions | |
VPISwizzle | vpiMakeSwizzle (VPIChannel x, VPIChannel y, VPIChannel z, VPIChannel w) |
Creates a user-defined VPISwizzle operation. More... | |
void | vpiSwizzleGetChannels (VPISwizzle swizzle, VPIChannel *channels) |
Get the swizzle channels. More... | |
int | vpiSwizzleGetChannelCount (VPISwizzle swizzle) |
Get the number of channels specified by the given swizzle. More... | |
VPIPacking | vpiMakePacking (const VPIPackingParams *params) |
Returns a pre-defined VPIPacking given its params. More... | |
void | vpiPackingGetParams (VPIPacking packing, VPIPackingParams *params) |
Returns channels' information from a format packing. More... | |
int | vpiPackingGetComponentCount (VPIPacking packing) |
Returns the number of components defined by the given packing. More... | |
void | vpiPackingGetBitsPerComponent (VPIPacking packing, int32_t *bits) |
Returns the number of bits per packing component. More... | |
int | vpiPackingGetBitsPerPixel (VPIPacking packing) |
Returns the number of bits per pixel of the given packing. More... | |
struct VPIPackingParams |
Defines the parameters encoded in a VPIPacking.
Definition at line 495 of file DataLayout.h.
Data Fields | ||
---|---|---|
VPIEndianness | endianness | Component ordering in a word. |
VPISwizzle | swizzle |
Channel ordering.
|
int | bits[VPI_MAX_CHANNEL_COUNT] |
Number of bits in each channel. If channel doesn't exist, corresponding bits==0. |
#define VPI_MAKE_SWIZZLE_ABBREV | ( | x, | |
y, | |||
z, | |||
w | |||
) |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Creates a user-defined swizzle operation, using abbreviated parameters.
This macro is used to create a user-defined swizzle operation. Parameters are specified literally by X, Y, Z, 0, 1. They correpond to VPIChannel values. Example:
[in] | x | Channel that will correspond to the first component, without the VPI_CHANNEL prefix. |
[in] | y | Channel that will correspond to the second component, without the VPI_CHANNEL prefix. |
[in] | z | Channel that will correspond to the third component, without the VPI_CHANNEL prefix. |
[in] | w | Channel that will correspond to the fourth component, without the VPI_CHANNEL prefix. |
Definition at line 419 of file DataLayout.h.
#define VPI_MAKE_SWIZZLE | ( | x, | |
y, | |||
z, | |||
w | |||
) |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Creates a user-defined swizzle operation.
This macro is used to create a user-defined swizzle operation if it's not predefined. Example:
[in] | x | Channel that will correspond to the first component. |
[in] | y | Channel that will correspond to the second component. |
[in] | z | Channel that will correspond to the third component. |
[in] | w | Channel that will correspond to the fourth component. |
Definition at line 439 of file DataLayout.h.
enum VPIPacking |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Defines how channels are packed into an image plane element.
Packing encodes how many channels the plane element has, and how they are arranged in memory.
Up to 4 channels (denoted by X, Y, Z, W) can be packed into an image plane element, each one occupying a specified number of bits.
When two channels are specified one right after the other, they are ordered from most-significant bit to least-significant bit. Words are separated by underscores. For example:
X8Y8Z8W8 = a single 32-bit word containing 4 channels, 8 bits each.
In little-endian architectures:
Address 0 || 1 || 2 || 3 WWWWWWWWZZZZZZZZYYYYYYYYXXXXXXXX
In big-endian architectures:
Address 0 || 1 || 2 || 3 XXXXXXXXYYYYYYYYZZZZZZZZWWWWWWWW
X8_Y8_Z8_W8 = four consecutive 8-bit words, corresponding to 4 channels, 8 bits each.
In little-endian architectures:
Address 0 || 1 || 2 || 3 XXXXXXXXYYYYYYYYZZZZZZZZWWWWWWWW
In big-endian architectures:
Address 0 || 1 || 2 || 3 XXXXXXXXYYYYYYYYZZZZZZZZWWWWWWWW
In cases where a word is less than 8 bits (e.g., X1 1-bit channel), channels are ordered from LSB to MSB within a word.
Some formats allow different packings when pixels' horizontal coordinate is even or odd. For instance, every pixel of YUV422 packed format contains an Y channel, while only even pixels contain the U channel, and odd pixels contain V channel. Such formats use a double-underscore to separate the even pixels from the odd pixels. The packing just described might be referred to X8_Y8__X8_Z8, where X = luma, Y = U chroma, Z = V chroma.
Definition at line 132 of file DataLayout.h.
enum VPIDataType |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Defines the channel data type.
Definition at line 264 of file DataLayout.h.
enum VPIMemLayout |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Defines how the 2D plane pixels are laid out in memory.
This defines how a pixel are addressed, i.e., given its \((x,y)\) coordinate, what's its memory address. Block-linear formats have a proprietary memory representation and aren't supposed to be addressed by the user directly.
Definition at line 282 of file DataLayout.h.
enum VPIChannel |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Defines the format channel names.
The channels are color model-agnostic.
Definition at line 321 of file DataLayout.h.
enum VPISwizzle |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Defines the supported channel swizzle operations.
The operations map an input vector \((x,y,z,w)\) into an output vector \((x',y',z',w')\). Any output channel can select any of the input channels, or the constants zero or one. For example, the swizzle "X000" selects the first channel, whereas swizzle "ZYXW" swaps the X and Z channels, needed for conversion between RGBA and BGRA image formats.
Definition at line 341 of file DataLayout.h.
enum VPIEndianness |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Endianness of a VPIPacking value.
Enumerator | |
---|---|
VPI_INVALID_ENDIAN | Invalid endianness value. |
VPI_HOST_ENDIAN | Endianness of the host machine. |
VPI_BIG_ENDIAN | Big endian, where most significant byte has lower memory address. |
Definition at line 487 of file DataLayout.h.
VPISwizzle vpiMakeSwizzle | ( | VPIChannel | x, |
VPIChannel | y, | ||
VPIChannel | z, | ||
VPIChannel | w | ||
) |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Creates a user-defined VPISwizzle operation.
This is similar to VPI_MAKE_SWIZZLE, but accepts the swizzle channels as runtime variables.
[in] | x | Channel that will correspond to the first component. |
[in] | y | Channel that will correspond to the second component. |
[in] | z | Channel that will correspond to the third component. |
[in] | w | Channel that will correspond to the fourth component. |
VPI_SWIZZLE_INVALID | Input channel is invalid. |
void vpiSwizzleGetChannels | ( | VPISwizzle | swizzle, |
VPIChannel * | channels | ||
) |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Get the swizzle channels.
For example, given swizzle VPI_SWIZZLE_YZWX, it returns VPI_CHANNEL_Y, VPI_CHANNEL_Z, VPI_CHANNEL_W and VPI_CHANNEL_X.
[in] | swizzle | Swizzle to be queried. |
[out] | channels | Output channel array with 4 elements. |
int vpiSwizzleGetChannelCount | ( | VPISwizzle | swizzle | ) |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Get the number of channels specified by the given swizzle.
Only the following count as channels:
[in] | swizzle | Swizzle to be queried. |
VPIPacking vpiMakePacking | ( | const VPIPackingParams * | params | ) |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Returns a pre-defined VPIPacking given its params.
This function calculates the VPIPacking based on the channel characteristics at run time.
[in] | params | Packing parameters. If VPIPackingParams::swizzle is set to VPI_SWIZZLE_0000 or VPI_SWIZZLE_INVALID, the swizzle will be inferred from VPIPackingParams::bits |
params
.VPI_PACKING_INVALID | Requested packing isn't defined or is malformed. |
VPI_PACKING_INVALID | params is NULL. |
void vpiPackingGetParams | ( | VPIPacking | packing, |
VPIPackingParams * | params | ||
) |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Returns channels' information from a format packing.
[in] | packing | The format packing to be queried. |
[out] | params | The packing parameters. Passing NULL is allowed, to which the function simply does nothing. |
int vpiPackingGetComponentCount | ( | VPIPacking | packing | ) |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Returns the number of components defined by the given packing.
[in] | packing | The format packing to be queried. |
void vpiPackingGetBitsPerComponent | ( | VPIPacking | packing, |
int32_t * | bits | ||
) |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Returns the number of bits per packing component.
[in] | packing | The format packing to be queried. |
[out] | bits | Pointer to an int32_t array with 4 elements where output will be stored. Passing NULL is allowed, to which the function simply does nothing. |
int vpiPackingGetBitsPerPixel | ( | VPIPacking | packing | ) |
#include </opt/nvidia/vpi2/include/vpi/DataLayout.h>
Returns the number of bits per pixel of the given packing.
[in] | packing | The format packing to be queried. |