11 #ifndef EVIO_6_0_COMPRESSOR_H
12 #define EVIO_6_0_COMPRESSOR_H
77 static z_stream strmDeflate;
78 static z_stream strmInflate;
82 static const uint32_t MTU = 1024*1024;
85 static const int lz4Acceleration = 1;
88 static uint32_t getRevisionId(
ByteBuffer & buf, uint32_t board_id);
89 static uint32_t getSubsystemId(
ByteBuffer & buf, uint32_t board_id);
90 static uint32_t getDeviceId(
ByteBuffer & buf, uint32_t board_id);
92 static void setUpCompressionHardware();
93 static void setUpZlib();
103 static uint8_t* compressGZIP(uint8_t* ungzipped, uint32_t offset,
104 uint32_t length, uint32_t *compLen);
106 static uint8_t* uncompressGZIP(uint8_t* gzipped, uint32_t off,
107 uint32_t length, uint32_t *uncompLen, uint32_t origUncompLen);
109 static int compressGZIP(uint8_t* dest, uint32_t *destLen,
110 const uint8_t* source, uint32_t sourceLen);
112 static int uncompressGZIP(uint8_t* dest, uint32_t *destLen,
113 const uint8_t* source, uint32_t *sourceLen,
116 static uint8_t* uncompressGZIP(
ByteBuffer & gzipped, uint32_t *uncompLen);
123 static int compressLZ4(uint8_t *src,
int srcOff,
int srcSize,
124 uint8_t *dst,
int dstOff,
int maxSize);
129 uint8_t *dst,
int dstOff,
int maxSize);
136 static int uncompressLZ4(uint8_t *src,
int srcOff,
int srcSize, uint8_t *dst,
137 int dstOff,
int dstCapacity);
144 #endif //EVIO_6_0_COMPRESSOR_H
static Compressor & getInstance()
Get an instance of this singleton class.
Definition: Compressor.h:50
This class is copied from one of the same name in the Java programming language.
Definition: ByteBuffer.h:42
static int getMaxCompressedLength(CompressionType compressionType, uint32_t uncompressedLength)
Returns the maximum number of bytes needed to compress the given length of uncompressed data...
Definition: Compressor.cpp:231
Singleton class used to provide data compression and decompression in a variety of formats...
Definition: Compressor.h:41
CompressionType
Enum of supported data compression types.
Definition: Compressor.h:65
Definition: Compressor.h:66
Definition: Compressor.h:69
Definition: Compressor.h:67
static CompressionType toCompressionType(uint32_t type)
Method to convert an integer to a CompressionType object.
Definition: Compressor.cpp:79
static int compressLZ4Best(ByteBuffer &src, int srcSize, ByteBuffer &dst, int maxSize)
Highest LZ4 compression.
Definition: Compressor.cpp:594
static int compressLZ4(ByteBuffer &src, int srcSize, ByteBuffer &dst, int maxSize)
Fastest LZ4 compression.
Definition: Compressor.cpp:497
Definition: Compressor.h:68
static int uncompressLZ4(ByteBuffer &src, int srcSize, ByteBuffer &dst)
LZ4 decompression.
Definition: Compressor.cpp:689