18 if(compressedSize <= 0)
20 ERR <<
"Failure trying to compress the data.";
23 int compressWithHeaderSize = compressedSize +
sizeof(
compressedSize);
24 if(compressWithHeaderSize > t_size)
26 ERR <<
"Compression overflow, destination buffer is smaller than the compressed size.";
33 memcpy(t_compressedBuf, &compressedSize,
sizeof(compressedSize));
34 return compressWithHeaderSize;
40 if(decompressed_size < 0)
42 ERR <<
"Failure trying to decompress the frame.";
48 INF <<
"frame " <<
m_decompFrameCounter <<
"\tdepth\tdecompression\tlz4\t" << t_compressedSize <<
"\t/\t" << decompressed_size;
50 return decompressed_size;
int LZ4_decompress_safe(const char *source, char *dest, int compressedSize, int maxDecompressedSize)
int LZ4_compress_default(const char *source, char *dest, int inputSize, int maxOutputSize)
Lz4Compression(int t_width, int t_height, rs2_format t_format, int t_bpp)
int decompressBuffer(unsigned char *t_buffer, int t_size, unsigned char *t_uncompressedBuf)
int compressBuffer(unsigned char *t_buffer, int t_size, unsigned char *t_compressedBuf)
rs2_format
A stream's format identifies how binary data is encoded within a frame.
LZ4LIB_API char int compressedSize
LZ4LIB_API char int int maxDstSize
int LZ4_compressBound(int isize)