| 1 |
/********************************************************************* |
| 2 |
Blosc - Blocked Shuffling and Compression Library |
| 3 |
|
| 4 |
Copyright (c) 2021 Blosc Development Team <[email protected]> |
| 5 |
https://blosc.org |
| 6 |
License: BSD 3-Clause (see LICENSE.txt) |
| 7 |
|
| 8 |
See LICENSE.txt for details about copyright and rights to use. |
| 9 |
**********************************************************************/ |
| 10 |
|
| 11 |
/********************************************************************* |
| 12 |
The code in this file is heavily based on FastLZ, a lightning-fast |
| 13 |
lossless compression library. See LICENSES/FASTLZ.txt for details |
| 14 |
about copyright and rights to use. |
| 15 |
**********************************************************************/ |
| 16 |
|
| 17 |
#ifndef BLOSC_BLOSCLZ_H |
| 18 |
#define BLOSC_BLOSCLZ_H |
| 19 |
|
| 20 |
#include "context.h" |
| 21 |
|
| 22 |
#define BLOSCLZ_VERSION_STRING "2.5.3" |
| 23 |
|
| 24 |
/** |
| 25 |
Compress a block of data in the input buffer and returns the size of |
| 26 |
compressed block. The size of input buffer is specified by |
| 27 |
length. The minimum input buffer size is 16. |
| 28 |
|
| 29 |
The output buffer must be at least 5% larger than the input buffer |
| 30 |
and can not be smaller than 66 bytes. |
| 31 |
|
| 32 |
If the input is not compressible, or output does not fit in maxout |
| 33 |
bytes, the return value will be 0 and you will have to discard the |
| 34 |
output buffer. |
| 35 |
|
| 36 |
The acceleration parameter is related with the frequency for |
| 37 |
updating the internal hash. An acceleration of 1 means that the |
| 38 |
internal hash is updated at full rate. A value < 1 is not allowed |
| 39 |
and will be silently set to 1. |
| 40 |
|
| 41 |
The input buffer and the output buffer can not overlap. |
| 42 |
*/ |
| 43 |
|
| 44 |
int blosclz_compress(int opt_level, const void* input, int length, |
| 45 |
void* output, int maxout, blosc2_context* ctx); |
| 46 |
|
| 47 |
/** |
| 48 |
Decompress a block of compressed data and returns the size of the |
| 49 |
decompressed block. If error occurs, e.g. the compressed data is |
| 50 |
corrupted or the output buffer is not large enough, then 0 (zero) |
| 51 |
will be returned instead. |
| 52 |
|
| 53 |
The input buffer and the output buffer can not overlap. |
| 54 |
|
| 55 |
Decompression is memory safe and guaranteed not to write the output buffer |
| 56 |
more than what is specified in maxout. |
| 57 |
*/ |
| 58 |
|
| 59 |
int blosclz_decompress(const void* input, int length, void* output, int maxout); |
| 60 |
|
| 61 |
#endif /* BLOSC_BLOSCLZ_H */ |