56 #ifndef NV_VPI_DATALAYOUT_H
57 #define NV_VPI_DATALAYOUT_H
60 #include "detail/FormatUtils.h"
76 #define VPI_MAX_CHANNEL_COUNT (4)
347 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, 0, 0, 0),
348 VPI_DETAIL_DEF_SWIZZLE_ENUM(1, 0, 0, 0),
349 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, 0, 0, 1),
350 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, Y, Z, W),
351 VPI_DETAIL_DEF_SWIZZLE_ENUM(Z, Y, X, W),
352 VPI_DETAIL_DEF_SWIZZLE_ENUM(W, X, Y, Z),
353 VPI_DETAIL_DEF_SWIZZLE_ENUM(W, Z, Y, X),
354 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, Z, W, X),
355 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, Y, Z, 1),
356 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, Y, Z, 0),
357 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, Z, W, 1),
358 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, X, X, 1),
359 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, Z, Y, 1),
360 VPI_DETAIL_DEF_SWIZZLE_ENUM(Z, Y, X, 1),
361 VPI_DETAIL_DEF_SWIZZLE_ENUM(Z, Y, X, 0),
362 VPI_DETAIL_DEF_SWIZZLE_ENUM(W, Z, Y, 1),
363 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, 0, 0, 0),
364 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, X, 0, 0),
365 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, 0, X, 0),
366 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, 0, 0, X),
367 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, 0, 0, 0),
368 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, Y, 0, 0),
369 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, 0, Y, 0),
370 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, 0, 0, Y),
371 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, X, Y, 0),
372 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, X, X, Y),
373 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, Y, Y, X),
374 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, Y, X, 0),
375 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, 0, 0, Y),
376 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, 0, 0, X),
377 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, 0, 0, 1),
378 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, Y, 0, 1),
379 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, Y, 0, 0),
380 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, X, Z, 0),
381 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, Z, X, 0),
382 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, Z, Y, 0),
383 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, Z, X, 1),
384 VPI_DETAIL_DEF_SWIZZLE_ENUM(Z, Y, W, 1),
385 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, Y, X, 1),
386 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, Y, X, Z),
387 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, X, Z, X),
388 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, Z, 0, 0),
389 VPI_DETAIL_DEF_SWIZZLE_ENUM(W, Y, X, Z),
390 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, X, 0, 0),
391 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, X, 0, 1),
392 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, 0, Y, X),
393 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, 0, X, Y),
394 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, X, Y, 1),
395 VPI_DETAIL_DEF_SWIZZLE_ENUM(0, X, 0, 1),
396 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, Z, X, W),
397 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, W, 0, 0),
398 VPI_DETAIL_DEF_SWIZZLE_ENUM(X, Y, W, 0),
399 VPI_DETAIL_DEF_SWIZZLE_ENUM(Y, Z, W, 0),
419 # define VPI_MAKE_SWIZZLE_ABBREV(x, y, z, w)
421 # define VPI_MAKE_SWIZZLE_ABBREV (VPISwizzle) VPI_DETAIL_MAKE_SWZL
439 # define VPI_MAKE_SWIZZLE(x, y, z, w)
441 # define VPI_MAKE_SWIZZLE (VPISwizzle) VPI_DETAIL_MAKE_SWIZZLE
VPIEndianness endianness
Component ordering in a word.
VPISwizzle swizzle
Channel ordering.
VPISwizzle
Defines the supported channel swizzle operations.
void vpiSwizzleGetChannels(VPISwizzle swizzle, VPIChannel *channels)
Get the swizzle channels.
int vpiPackingGetBitsPerPixel(VPIPacking packing)
Returns the number of bits per pixel of the given packing.
int vpiSwizzleGetChannelCount(VPISwizzle swizzle)
Get the number of channels specified by the given swizzle.
VPIPacking vpiMakePacking(const VPIPackingParams *params)
Returns a pre-defined VPIPacking given its params.
VPIPacking
Defines how channels are packed into an image plane element.
void vpiPackingGetBitsPerComponent(VPIPacking packing, int32_t *bits)
Returns the number of bits per packing component.
int vpiPackingGetComponentCount(VPIPacking packing)
Returns the number of components defined by the given packing.
#define VPI_MAX_CHANNEL_COUNT
Maximum VPI channel count.
VPIMemLayout
Defines how the 2D plane pixels are laid out in memory.
VPISwizzle vpiMakeSwizzle(VPIChannel x, VPIChannel y, VPIChannel z, VPIChannel w)
Creates a user-defined VPISwizzle operation.
VPIChannel
Defines the format channel names.
VPIDataType
Defines the channel data type.
VPIEndianness
Endianness of a VPIPacking value.
void vpiPackingGetParams(VPIPacking packing, VPIPackingParams *params)
Returns channels' information from a format packing.
@ VPI_SWIZZLE_INVALID
Represents an invalid swizzle.
@ VPI_PACKING_X64
One 64-bit channel.
@ VPI_PACKING_X8_Y8_Z8_W8
Four 8-bit channels in one 32-bit word.
@ VPI_PACKING_X3Y3Z2
Three 3-, 3- and 2-bit channels in one 8-bit word.
@ VPI_PACKING_X8_Y8_Z8
Three 8-bit channels in three 8-bit words.
@ VPI_PACKING_INVALID
Denotes an invalid packing.
@ VPI_PACKING_X2
One 2-bit channel.
@ VPI_PACKING_X24
One 24-bit channel.
@ VPI_PACKING_X10Y10Z10W2
Four 10-, 10-, 10- and 2-bit channels in one 32-bit word.
@ VPI_PACKING_X12b4_Y12b4
Two MSB 12-bit channels in two 16-bit words.
@ VPI_PACKING_X64_Y64
Two 64-bit channels in two 64-bit words.
@ VPI_PACKING_X5Y5Z6
Three 5-, 5- and 6-bit channels in one 16-bit word.
@ VPI_PACKING_X192
One 192-bit channel.
@ VPI_PACKING_X1
One 1-bit channel.
@ VPI_PACKING_X32_Y32_Z32_W32
Four 32-bit channels in three 32-bit words.
@ VPI_PACKING_X12b4
One MSB 12-bit channel in one 16-bit word.
@ VPI_PACKING_X4Y4Z4W4
Four 4-bit channels in one 16-bit word.
@ VPI_PACKING_X10b6_Y10b6
Two MSB 10-bit channels in two 16-bit words.
@ VPI_PACKING_X8
One 8-bit channel.
@ VPI_PACKING_X5Y6Z5
Three 5-, 6- and 5-bit channels in one 16-bit word.
@ VPI_PACKING_X10b6
One MSB 10-bit channel in one 16-bit word.
@ VPI_PACKING_X4Y4
Two 4-bit channels in one word.
@ VPI_PACKING_X32_Y32_Z32
Three 32-bit channels in three 32-bit words.
@ VPI_PACKING_X5Y5b1Z5
Three 5-bit channels in one 16-bit word.
@ VPI_PACKING_X128
One 128-bit channel.
@ VPI_PACKING_b4X4Y4Z4
Three 4-bit channels in one 16-bit word.
@ VPI_PACKING_X32
One 32-bit channel.
@ VPI_PACKING_X5Y1Z5W5
Four 5-, 1-, 5- and 5-bit channels in one 16-bit word.
@ VPI_PACKING_X8_Y8
Two 8-bit channels in two 8-bit words.
@ VPI_PACKING_X64_Y64_Z64
Three 64-bit channels in three 64-bit words.
@ VPI_PACKING_X64_Y64_Z64_W64
Four 64-bit channels in four 64-bit words.
@ VPI_PACKING_X5Y5Z1W5
Four 5-, 5-, 1- and 5-bit channels in one 16-bit word.
@ VPI_PACKING_0
No channels.
@ VPI_PACKING_X10Y11Z11
Three 10-, 11- and 11-bit channels in one 32-bit word.
@ VPI_PACKING_X16_Y16_Z16
Three 16-bit channels in three 16-bit words.
@ VPI_PACKING_X2Y10Z10W10
Four 2-, 10-, 10- and 10-bit channels in one 32-bit word.
@ VPI_PACKING_X11Y11Z10
Three 11-, 11- and 10-bit channels in one 32-bit word.
@ VPI_PACKING_b4X12
One LSB 12-bit channel in one 16-bit word.
@ VPI_PACKING_b1X5Y5Z5
Three 5-bit channels in one 16-bit word.
@ VPI_PACKING_X256
One 128-bit channel.
@ VPI_PACKING_b12X20
One LSB 20-bit channel in one 32-bit word.
@ VPI_PACKING_X16
One 16-bit channel.
@ VPI_PACKING_X4
One 4-bit channel.
@ VPI_PACKING_X6Y5Z5
Three 6-, 5- and 5-bit channels in one 16-bit word.
@ VPI_PACKING_X1Y5Z5W5
Four 1-, 5-, 5- and 5-bit channels in one 16-bit word.
@ VPI_PACKING_b2X14
One LSB 14-bit channel in one 16-bit word.
@ VPI_PACKING_X96
One 96-bit channel.
@ VPI_PACKING_X16_Y16
Two 16-bit channels in two 16-bit words.
@ VPI_PACKING_X16_Y16_Z16_W16
Four 16-bit channels in one 64-bit word.
@ VPI_PACKING_X8_Y8__X8_Z8
2 pixels of 2 8-bit channels each, totalling 4 8-bit words.
@ VPI_PACKING_X32_Y32
Two 32-bit channels in two 32-bit words.
@ VPI_PACKING_X48
One 48-bit channel.
@ VPI_PACKING_Y8_X8__Z8_X8
2 pixels of 2 swapped 8-bit channels each, totalling 4 8-bit words.
@ VPI_PACKING_b6X10
One LSB 10-bit channel in one 16-bit word.
@ VPI_PACKING_X5Y5Z5W1
Four 5-, 5-, 5- and 1-bit channels in one 16-bit word.
@ VPI_MEM_LAYOUT_PITCH_LINEAR
Pixels are laid out in row-major order.
@ VPI_MEM_LAYOUT_BLOCK8_LINEAR
Pixels are laid out in block-linear format with height = 8.
@ VPI_MEM_LAYOUT_INVALID
Represents an invalid memory layout.
@ VPI_MEM_LAYOUT_BLOCK1_LINEAR
Pixels are laid out in block-linear format with height = 1.
@ VPI_MEM_LAYOUT_BLOCK_LINEAR
Default block-linear format.
@ VPI_MEM_LAYOUT_BLOCK2_LINEAR
Pixels are laid out in block-linear format with height = 2.
@ VPI_MEM_LAYOUT_BLOCK4_LINEAR
Pixels are laid out in block-linear format with height = 4.
@ VPI_MEM_LAYOUT_BLOCK16_LINEAR
Pixels are laid out in block-linear format with height = 16.
@ VPI_MEM_LAYOUT_BLOCK32_LINEAR
Pixels are laid out in block-linear format with height = 32.
@ VPI_CHANNEL_Z
Selects the third channel of the color model.
@ VPI_CHANNEL_1
Sets the corresponding channel to have its maximum value.
@ VPI_CHANNEL_INVALID
Represents an invalid swizzle channel.
@ VPI_CHANNEL_X
Selects the first channel of the color model.
@ VPI_CHANNEL_0
Don't select a channel.
@ VPI_CHANNEL_W
Selects the fourth channel of the color model.
@ VPI_CHANNEL_Y
Selects the second channel of the color model.
@ VPI_DATA_TYPE_FLOATISP
Proprietary floating point format from NVIDIA.
@ VPI_DATA_TYPE_FLOAT
Channel are floating point values.
@ VPI_DATA_TYPE_INVALID
Represents an invalid data type.
@ VPI_DATA_TYPE_UNSIGNED
Channels are unsigned integer values.
@ VPI_DATA_TYPE_SIGNED
Channels are signed integer values.
@ VPI_BIG_ENDIAN
Big endian, where most significant byte has lower memory address.
@ VPI_INVALID_ENDIAN
Invalid endianness value.
@ VPI_HOST_ENDIAN
Endianness of the host machine.
Defines the parameters encoded in a VPIPacking.