#include <sys/types.h>

Go to the source code of this file.
Classes | |
| struct | EqCompressorInfo |
| Information about one compressor. More... | |
Defines | |
Compressor Plugin API Versioning | |
| #define | EQ_COMPRESSOR_VERSION 1 |
| The version of the Compressor API described by this header. | |
| #define | EQ_COMPRESSOR_VERSION_1 1 |
| At least version 1 of the Compressor API is described by this header. | |
Compressor type name registry | |
The compressor type registry ensures the uniqueness of compressor names.
It is maintained by the Equalizer development team <info@equalizergraphics.com>. New types can be requested free of charge. | |
| #define | EQ_COMPRESSOR_NONE 0x1u |
| No Compressor. | |
| #define | EQ_COMPRESSOR_RLE_UNSIGNED 0x2u |
| RLE Compression of 4-byte tokens. | |
| #define | EQ_COMPRESSOR_RLE_BYTE 0x3u |
| RLE Compression of 1-byte tokens. | |
| #define | EQ_COMPRESSOR_RLE_3_BYTE 0x4u |
| RLE Compression of three 1-byte tokens. | |
| #define | EQ_COMPRESSOR_RLE_4_BYTE 0x5u |
| RLE Compression of four 1-byte tokens. | |
| #define | EQ_COMPRESSOR_RLE_4_FLOAT 0x6u |
| RLE Compression of four float32 tokens. | |
| #define | EQ_COMPRESSOR_RLE_4_HALF_FLOAT 0x7u |
| RLE Compression of four float16 tokens. | |
| #define | EQ_COMPRESSOR_DIFF_RLE_3_BYTE 0x8u |
| Differential RLE Compression of three 1-byte tokens. | |
| #define | EQ_COMPRESSOR_DIFF_RLE_4_BYTE 0x9u |
| Differential RLE Compression of three 1-byte tokens. | |
| #define | EQ_COMPRESSOR_RLE_4_BYTE_UNSIGNED 0xau |
| RLE Compression of one 4-byte token. | |
| #define | EQ_COMPRESSOR_PRIVATE 0xefffffffu |
| Private types -FOR DEVELOPMENT ONLY-. | |
Compressor token types | |
The compressor token type is reported by the DSO, and defines which type of input data can be processed by the given compressor.
It is used by Equalizer to select candidates for compression. | |
| #define | EQ_COMPRESSOR_DATATYPE_BYTE 1 |
| Data is processed in one-byte tokens. | |
| #define | EQ_COMPRESSOR_DATATYPE_UNSIGNED 2 |
| Data is processed in four-byte tokens. | |
| #define | EQ_COMPRESSOR_DATATYPE_HALF_FLOAT 3 |
| Data is processed in float16 tokens. | |
| #define | EQ_COMPRESSOR_DATATYPE_FLOAT 4 |
| Data is processed in float32 tokens. | |
| #define | EQ_COMPRESSOR_DATATYPE_3_BYTE 1024 |
| Data is processed in three interleaved streams of one-byte tokens. | |
| #define | EQ_COMPRESSOR_DATATYPE_4_BYTE 1025 |
| Data is processed in four interleaved streams of one-byte tokens. | |
| #define | EQ_COMPRESSOR_DATATYPE_3_HALF_FLOAT 1026 |
| Data is processed in four interleaved streams of float16 tokens. | |
| #define | EQ_COMPRESSOR_DATATYPE_4_HALF_FLOAT 1027 |
| Data is processed in four interleaved streams of float16 tokens. | |
| #define | EQ_COMPRESSOR_DATATYPE_3_FLOAT 1028 |
| Data is processed in four interleaved streams of float32 tokens. | |
| #define | EQ_COMPRESSOR_DATATYPE_4_FLOAT 1029 |
| Data is processed in four interleaved streams of float32 tokens. | |
| #define | EQ_COMPRESSOR_DATATYPE_3BYTE_1BYTE 2048 |
| Data is processed in two interleaved streams, one 24 bit and one 8 bit. | |
Compressor capability flags | |
Capability flags define what special features a compressor supports.
They are queried from the DSO, and passed as input to certain functions to select a given mode. | |
| #define | EQ_COMPRESSOR_INPLACE 1 |
| The compressor can (query time) or should (compress) write the compressed data in the same place as the uncompressed data. | |
| #define | EQ_COMPRESSOR_DATA_1D 2 |
| The compressor can handle linear data (query time), or the input data is linear (compress, decompress). | |
| #define | EQ_COMPRESSOR_DATA_2D 4 |
| The compressor can handle two-dimensional data (query time), or the input data is two-dimensional (compress, decompress). | |
| #define | EQ_COMPRESSOR_IGNORE_MSE 8 |
| The compressor can (query time) or should (compress) ignore the most-significant element of the input data. | |
Functions | |
DSO information interface. | |
| EQ_PLUGIN_API size_t | EqCompressorGetNumCompressors () |
| EQ_PLUGIN_API void | EqCompressorGetInfo (const size_t n, EqCompressorInfo *const info) |
| Query information of the nth compressor in the DSO. | |
Compressor lifecycle management. | |
| EQ_PLUGIN_API void * | EqCompressorNewCompressor (const unsigned name) |
| Instantiate a new compressor. | |
| EQ_PLUGIN_API void | EqCompressorDeleteCompressor (void *const compressor) |
| Release a compressor instance. | |
| EQ_PLUGIN_API void * | EqCompressorNewDecompressor (const unsigned name) |
| Instantiate a new decompressor. | |
| EQ_PLUGIN_API void | EqCompressorDeleteDecompressor (void *const decompressor) |
| Release a decompressor instance. | |
Compressor worker functions | |
| EQ_PLUGIN_API void | EqCompressorCompress (void *const compressor, const unsigned name, void *const in, const eq_uint64_t *inDims, const eq_uint64_t flags) |
| Compress data. | |
| EQ_PLUGIN_API unsigned | EqCompressorGetNumResults (void *const compressor, const unsigned name) |
| Return the number of results produced by the last compression. | |
| EQ_PLUGIN_API void | EqCompressorGetResult (void *const compressor, const unsigned name, const unsigned i, void **const out, eq_uint64_t *const outSize) |
| Return the ith result of the last compression. | |
| EQ_PLUGIN_API void | EqCompressorDecompress (void *const decompressor, const unsigned name, const void *const *in, const eq_uint64_t *const inSizes, const unsigned numInputs, void *const out, eq_uint64_t *const outDims, const eq_uint64_t flags) |
| Decompress data. | |
To implement a compression plugin, the following steps are to be taken:
Definition in file plugins/compressor.h.
| #define EQ_COMPRESSOR_VERSION 1 |
The version of the Compressor API described by this header.
Definition at line 71 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_VERSION_1 1 |
At least version 1 of the Compressor API is described by this header.
Definition at line 73 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_RLE_UNSIGNED 0x2u |
| #define EQ_COMPRESSOR_RLE_BYTE 0x3u |
| #define EQ_COMPRESSOR_RLE_3_BYTE 0x4u |
| #define EQ_COMPRESSOR_RLE_4_BYTE 0x5u |
| #define EQ_COMPRESSOR_RLE_4_FLOAT 0x6u |
| #define EQ_COMPRESSOR_RLE_4_HALF_FLOAT 0x7u |
| #define EQ_COMPRESSOR_DIFF_RLE_3_BYTE 0x8u |
Differential RLE Compression of three 1-byte tokens.
Definition at line 99 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_DIFF_RLE_4_BYTE 0x9u |
Differential RLE Compression of three 1-byte tokens.
Definition at line 101 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_RLE_4_BYTE_UNSIGNED 0xau |
| #define EQ_COMPRESSOR_PRIVATE 0xefffffffu |
Private types -FOR DEVELOPMENT ONLY-.
Any name equal or bigger than this can be used for in-house development and testing. As soon as the Compressor DSO is distributed, request public types free of charge from info@equalizergraphics.com.
Definition at line 112 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_DATATYPE_BYTE 1 |
| #define EQ_COMPRESSOR_DATATYPE_UNSIGNED 2 |
| #define EQ_COMPRESSOR_DATATYPE_HALF_FLOAT 3 |
| #define EQ_COMPRESSOR_DATATYPE_FLOAT 4 |
| #define EQ_COMPRESSOR_DATATYPE_3_BYTE 1024 |
Data is processed in three interleaved streams of one-byte tokens.
Definition at line 134 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_DATATYPE_4_BYTE 1025 |
Data is processed in four interleaved streams of one-byte tokens.
Definition at line 136 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_DATATYPE_3_HALF_FLOAT 1026 |
Data is processed in four interleaved streams of float16 tokens.
Definition at line 138 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_DATATYPE_4_HALF_FLOAT 1027 |
Data is processed in four interleaved streams of float16 tokens.
Definition at line 140 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_DATATYPE_3_FLOAT 1028 |
Data is processed in four interleaved streams of float32 tokens.
Definition at line 142 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_DATATYPE_4_FLOAT 1029 |
Data is processed in four interleaved streams of float32 tokens.
Definition at line 144 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_DATATYPE_3BYTE_1BYTE 2048 |
Data is processed in two interleaved streams, one 24 bit and one 8 bit.
Definition at line 146 of file plugins/compressor.h.
| #define EQ_COMPRESSOR_DATA_1D 2 |
The compressor can handle linear data (query time), or the input data is linear (compress, decompress).
Typically used for binary data.
Definition at line 166 of file plugins/compressor.h.
Referenced by EqCompressorCompress(), and EqCompressorDecompress().
| #define EQ_COMPRESSOR_DATA_2D 4 |
The compressor can handle two-dimensional data (query time), or the input data is two-dimensional (compress, decompress).
Typically used for image data.
Definition at line 172 of file plugins/compressor.h.
Referenced by eq::Image::compressPixelData(), and eq::Image::setPixelData().
| #define EQ_COMPRESSOR_IGNORE_MSE 8 |
The compressor can (query time) or should (compress) ignore the most-significant element of the input data.
Typically used for image data when the alpha-channel is present in the input data, but unneeded.
Definition at line 178 of file plugins/compressor.h.
Referenced by eq::Image::compressPixelData(), EqCompressorCompress(), EqCompressorDecompress(), and eq::Image::setPixelData().
| EQ_PLUGIN_API size_t EqCompressorGetNumCompressors | ( | ) |
Definition at line 87 of file compressor/compressor.cpp.
| EQ_PLUGIN_API void EqCompressorGetInfo | ( | const size_t | n, | |
| EqCompressorInfo *const | info | |||
| ) |
Query information of the nth compressor in the DSO.
Definition at line 93 of file compressor/compressor.cpp.
| EQ_PLUGIN_API void* EqCompressorNewCompressor | ( | const unsigned | name | ) |
Instantiate a new compressor.
This function has to create a new instance of the given compressor type. Multiple instances might be used concurrently. One given instance is always used from one thread at any given time.
| name | the type name of the compressor. |
Definition at line 98 of file compressor/compressor.cpp.
| EQ_PLUGIN_API void EqCompressorDeleteCompressor | ( | void *const | compressor | ) |
Release a compressor instance.
| compressor | the compressor instance to free. |
Definition at line 105 of file compressor/compressor.cpp.
| EQ_PLUGIN_API void* EqCompressorNewDecompressor | ( | const unsigned | name | ) |
Instantiate a new decompressor.
This function might create a new instance of the given decompressor type. Multiple instances might be used concurrently. One given instance is always used from one thread at any given time. State-less decompressors might return 0.
| name | the type name of the decompressor. |
Definition at line 110 of file compressor/compressor.cpp.
| EQ_PLUGIN_API void EqCompressorDeleteDecompressor | ( | void *const | decompressor | ) |
Release a decompressor instance.
| decompressor | the decompressor instance to free. |
Definition at line 115 of file compressor/compressor.cpp.
| EQ_PLUGIN_API void EqCompressorCompress | ( | void *const | compressor, | |
| const unsigned | name, | |||
| void *const | in, | |||
| const eq_uint64_t * | inDims, | |||
| const eq_uint64_t | flags | |||
| ) |
Compress data.
The number of dimensions in the input and output data is given as a flag. The input dimensions give an offset and a size for each dimension in the format dim0_offset, dim0_size, dim1_offset, ..., dimN_size. The offset does not apply to the input pointer, it is merely a hint on where the data is positioned, e.g., where a 2D image is positioned in a virtual framebuffer. The size of the input data is mul( inDims[1,3,...,n] ) * sizeof( info->dataType ).
The compressor has to store the results internally in its instance data The result of the compression run will be queried later. Results of previous compression do not have to be retained, i.e., they can be overwritten on subsequent compression runs.
| compressor | the compressor instance. | |
| name | the type name of the compressor. | |
| in | the pointer to the input data. | |
| inDims | the dimensions of the input data. | |
| flags | capability flags for the compression. |
Definition at line 121 of file compressor/compressor.cpp.
References EQ_COMPRESSOR_DATA_1D, and EQ_COMPRESSOR_IGNORE_MSE.
| EQ_PLUGIN_API unsigned EqCompressorGetNumResults | ( | void *const | compressor, | |
| const unsigned | name | |||
| ) |
Return the number of results produced by the last compression.
A compressor might generate multiple output stream, e.g., when operating on structured data or using parallel compression routines.
| compressor | the compressor instance. | |
| name | the type name of the compressor. |
Definition at line 134 of file compressor/compressor.cpp.
| EQ_PLUGIN_API void EqCompressorGetResult | ( | void *const | compressor, | |
| const unsigned | name, | |||
| const unsigned | i, | |||
| void **const | out, | |||
| eq_uint64_t *const | outSize | |||
| ) |
Return the ith result of the last compression.
| compressor | the compressor instance. | |
| name | the type name of the compressor. | |
| i | the result index to return. | |
| out | the return value to store the result pointer. | |
| outSize | the return value to store the result size in bytes. |
Definition at line 142 of file compressor/compressor.cpp.
References eq::base::Buffer< T >::getData(), eq::base::Buffer< T >::getMaxSize(), and eq::base::Buffer< T >::getSize().

| EQ_PLUGIN_API void EqCompressorDecompress | ( | void *const | decompressor, | |
| const unsigned | name, | |||
| const void *const * | in, | |||
| const eq_uint64_t *const | inSizes, | |||
| const unsigned | numInputs, | |||
| void *const | out, | |||
| eq_uint64_t *const | outDims, | |||
| const eq_uint64_t | flags | |||
| ) |
Decompress data.
The decompressor gets all result pointers as produced by the compressor as input. The routine should use the output buffer fully. For dimensions and output size see EqCompressorCompress.
| decompressor | the decompressor instance, can be 0. | |
| name | the type name of the decompressor. | |
| in | the pointer to an array of input data pointers. | |
| inSizes | the array of input data sizes in bytes. | |
| numInputs | the number of input data elements. | |
| out | the pointer to a pre-allocated buffer for the uncompressed output result. | |
| outDims | the dimensions of the output data. | |
| flags | capability flags for the decompression. |
Definition at line 156 of file compressor/compressor.cpp.
References EQ_COMPRESSOR_DATA_1D, and EQ_COMPRESSOR_IGNORE_MSE.
0.9 by
1.5.8