source: branches/threaded/src/blosc.h @ 51

Revision 51, 3.1 KB checked in by faltet, 3 years ago (diff)

First version of threaded blosc. Performance increase has not been detected yet (rather the contrary :-/).

Line 
1/*********************************************************************
2  Blosc - Blocked Suffling and Compression Library
3
4  Author: Francesc Alted (faltet@pytables.org)
5
6  See LICENSES/BLOSC.txt for details about copyright and rights to use.
7**********************************************************************/
8
9
10#ifndef BLOSC_H
11#define BLOSC_H
12
13/* Version numbers */
14#define BLOSC_VERSION_MAJOR    0    /* for major interface/format changes  */
15#define BLOSC_VERSION_MINOR    9    /* for minor interface/format changes  */
16#define BLOSC_VERSION_RELEASE  0    /* for tweaks, bug-fixes, or development */
17
18#define BLOSC_VERSION_STRING   "0.9.0.dev"  /* string version.  Sync with above! */
19#define BLOSC_VERSION_DATE     "2010-03-30"      /* date version */
20
21/* The *_VERS_FORMAT should be just 1-byte long */
22#define BLOSC_VERSION_FORMAT    1   /* Blosc format version, starting at 1 */
23#define BLOSCLZ_VERSION_FORMAT  1   /* Blosclz format version, starting at 1 */
24
25/* The combined blosc and blosclz formats */
26#define BLOSC_VERSION_CFORMAT (BLOSC_VERSION_FORMAT << 8) & (BLOSCLZ_VERSION_FORMAT)
27
28
29/**
30
31  Compress a block of data in the `src` buffer and returns the size of
32  compressed block.  The size of `src` buffer is specified by
33  `nbytes`.
34
35  `clevel` is the desired compression level and must be a number
36  between 0 (no compression) and 9 (maximum compression).
37
38  `doshuffle` specifies whether the shuffle compression preconditioner
39  should be applyied or not.  0 means not applying it and 1 means
40  applying it.
41
42  `bytesoftype` is the number of bytes for the atomic type in binary
43  `src` buffer.  This is only useful for the shuffle preconditioner.
44  Only a bytesoftype > 1 the will allow the shuffle to work.
45
46  The minimum `src` buffer size is 16.  The `dest` buffer must have at
47  least the size of the `src` buffer and can not be smaller than 66
48  bytes.  The `src` buffer and the `dest` buffer can not overlap.
49
50  If `src` buffer is not compressible (len(`dest`) >= len(`src`)), the
51  return value is zero and you should discard the contents of the
52  `dest` buffer.
53
54  A negative return value means that an internal error happened.  This
55  should never happen.  If you see this, please report it back
56  together with the buffer data causing this and compression settings.
57
58  Compression is memory safe and guaranteed not to write the `dest`
59  buffer more than what is specified in `nbytes`.
60
61 */
62
63unsigned int
64blosc_compress(int clevel, int doshuffle, size_t bytesoftype, size_t nbytes,
65               const void *src, void *dest);
66
67
68/**
69
70  Decompress a block of compressed data in `src`, put the result in
71  `dest` and returns the size of the decompressed block. If error
72  occurs, e.g. the compressed data is corrupted or the output buffer
73  is not large enough, then 0 (zero) or a negative value will be
74  returned instead.
75
76  The `src` buffer and the `dest` buffer can not overlap.
77
78  Decompression is memory safe and guaranteed not to write the `dest`
79  buffer more than what is specified in `dest_size`.
80
81*/
82
83unsigned int
84blosc_decompress(const void *src, void *dest, size_t dest_size);
85
86#endif
Note: See TracBrowser for help on using the repository browser.