Skip to content

Commit 02eaa2e

Browse files
committed
contib upadtes for compression
1 parent c9ab785 commit 02eaa2e

18 files changed

Lines changed: 648 additions & 0 deletions

File tree

contrib/Darwin.x64/include/lib.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* lib.h - LZSA library definitions
3+
*
4+
* Copyright (C) 2019 Emmanuel Marty
5+
*
6+
* This software is provided 'as-is', without any express or implied
7+
* warranty. In no event will the authors be held liable for any damages
8+
* arising from the use of this software.
9+
*
10+
* Permission is granted to anyone to use this software for any purpose,
11+
* including commercial applications, and to alter it and redistribute it
12+
* freely, subject to the following restrictions:
13+
*
14+
* 1. The origin of this software must not be misrepresented; you must not
15+
* claim that you wrote the original software. If you use this software
16+
* in a product, an acknowledgment in the product documentation would be
17+
* appreciated but is not required.
18+
* 2. Altered source versions must be plainly marked as such, and must not be
19+
* misrepresented as being the original software.
20+
* 3. This notice may not be removed or altered from any source distribution.
21+
*/
22+
23+
/*
24+
* Uses the libdivsufsort library Copyright (c) 2003-2008 Yuta Mori
25+
*
26+
* Inspired by LZ4 by Yann Collet. https://github.com/lz4/lz4
27+
* With help, ideas, optimizations and speed measurements by spke <zxintrospec@gmail.com>
28+
* With ideas from Lizard by Przemyslaw Skibinski and Yann Collet. https://github.com/inikep/lizard
29+
* Also with ideas from smallz4 by Stephan Brumme. https://create.stephan-brumme.com/smallz4/
30+
*
31+
*/
32+
33+
/* !!! Modified from the original, to use as a library for 7800basic !!! */
34+
35+
#ifndef _LIB_H
36+
#define _LIB_H
37+
38+
/* Compression flags */
39+
#define LZSA_FLAG_FAVOR_RATIO (1<<0) /**< 1 to compress with the best ratio, 0 to trade some compression ratio for extra decompression speed */
40+
#define LZSA_FLAG_RAW_BLOCK (1<<1) /**< 1 to emit raw block */
41+
#define LZSA_FLAG_RAW_BACKWARD (1<<2) /**< 1 to compress or decompress raw block backward */
42+
43+
#endif /* _LIB_H */
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* shrink_inmem.h - in-memory compression definitions
3+
*
4+
* Copyright (C) 2019 Emmanuel Marty
5+
*
6+
* This software is provided 'as-is', without any express or implied
7+
* warranty. In no event will the authors be held liable for any damages
8+
* arising from the use of this software.
9+
*
10+
* Permission is granted to anyone to use this software for any purpose,
11+
* including commercial applications, and to alter it and redistribute it
12+
* freely, subject to the following restrictions:
13+
*
14+
* 1. The origin of this software must not be misrepresented; you must not
15+
* claim that you wrote the original software. If you use this software
16+
* in a product, an acknowledgment in the product documentation would be
17+
* appreciated but is not required.
18+
* 2. Altered source versions must be plainly marked as such, and must not be
19+
* misrepresented as being the original software.
20+
* 3. This notice may not be removed or altered from any source distribution.
21+
*/
22+
23+
/*
24+
* Uses the libdivsufsort library Copyright (c) 2003-2008 Yuta Mori
25+
*
26+
* Inspired by LZ4 by Yann Collet. https://github.com/lz4/lz4
27+
* With help, ideas, optimizations and speed measurements by spke <zxintrospec@gmail.com>
28+
* With ideas from Lizard by Przemyslaw Skibinski and Yann Collet. https://github.com/inikep/lizard
29+
* Also with ideas from smallz4 by Stephan Brumme. https://create.stephan-brumme.com/smallz4/
30+
*
31+
*/
32+
33+
/* !!! Modified from the original, to use as a library for 7800basic !!! */
34+
35+
#ifndef _SHRINK_INMEM_H
36+
#define _SHRINK_INMEM_H
37+
38+
#include <stdlib.h>
39+
40+
/**
41+
* Get maximum compressed size of input(source) data
42+
*
43+
* @param nInputSize input(source) size in bytes
44+
*
45+
* @return maximum compressed size
46+
*/
47+
extern size_t lzsa_get_max_compressed_size_inmem(size_t nInputSize);
48+
49+
/**
50+
* Compress memory
51+
*
52+
* @param pInputData pointer to input(source) data to compress
53+
* @param pOutBuffer buffer for compressed data
54+
* @param nInputSize input(source) size in bytes
55+
* @param nMaxOutBufferSize maximum capacity of compression buffer
56+
* @param nFlags compression flags (LZSA_FLAG_xxx)
57+
* @param nMinMatchSize minimum match size
58+
* @param nFormatVersion version of format to use (1-2)
59+
*
60+
* @return actual compressed size, or -1 for error
61+
*/
62+
extern size_t lzsa_compress_inmem(unsigned char *pInputData, unsigned char *pOutBuffer, size_t nInputSize, size_t nMaxOutBufferSize,
63+
const unsigned int nFlags, const int nMinMatchSize, const int nFormatVersion);
64+
65+
#endif /* _SHRINK_INMEM_H */

contrib/Darwin.x64/lib/liblzsa.a

280 KB
Binary file not shown.

contrib/Darwin.x86/include/lib.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* lib.h - LZSA library definitions
3+
*
4+
* Copyright (C) 2019 Emmanuel Marty
5+
*
6+
* This software is provided 'as-is', without any express or implied
7+
* warranty. In no event will the authors be held liable for any damages
8+
* arising from the use of this software.
9+
*
10+
* Permission is granted to anyone to use this software for any purpose,
11+
* including commercial applications, and to alter it and redistribute it
12+
* freely, subject to the following restrictions:
13+
*
14+
* 1. The origin of this software must not be misrepresented; you must not
15+
* claim that you wrote the original software. If you use this software
16+
* in a product, an acknowledgment in the product documentation would be
17+
* appreciated but is not required.
18+
* 2. Altered source versions must be plainly marked as such, and must not be
19+
* misrepresented as being the original software.
20+
* 3. This notice may not be removed or altered from any source distribution.
21+
*/
22+
23+
/*
24+
* Uses the libdivsufsort library Copyright (c) 2003-2008 Yuta Mori
25+
*
26+
* Inspired by LZ4 by Yann Collet. https://github.com/lz4/lz4
27+
* With help, ideas, optimizations and speed measurements by spke <zxintrospec@gmail.com>
28+
* With ideas from Lizard by Przemyslaw Skibinski and Yann Collet. https://github.com/inikep/lizard
29+
* Also with ideas from smallz4 by Stephan Brumme. https://create.stephan-brumme.com/smallz4/
30+
*
31+
*/
32+
33+
/* !!! Modified from the original, to use as a library for 7800basic !!! */
34+
35+
#ifndef _LIB_H
36+
#define _LIB_H
37+
38+
/* Compression flags */
39+
#define LZSA_FLAG_FAVOR_RATIO (1<<0) /**< 1 to compress with the best ratio, 0 to trade some compression ratio for extra decompression speed */
40+
#define LZSA_FLAG_RAW_BLOCK (1<<1) /**< 1 to emit raw block */
41+
#define LZSA_FLAG_RAW_BACKWARD (1<<2) /**< 1 to compress or decompress raw block backward */
42+
43+
#endif /* _LIB_H */
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* shrink_inmem.h - in-memory compression definitions
3+
*
4+
* Copyright (C) 2019 Emmanuel Marty
5+
*
6+
* This software is provided 'as-is', without any express or implied
7+
* warranty. In no event will the authors be held liable for any damages
8+
* arising from the use of this software.
9+
*
10+
* Permission is granted to anyone to use this software for any purpose,
11+
* including commercial applications, and to alter it and redistribute it
12+
* freely, subject to the following restrictions:
13+
*
14+
* 1. The origin of this software must not be misrepresented; you must not
15+
* claim that you wrote the original software. If you use this software
16+
* in a product, an acknowledgment in the product documentation would be
17+
* appreciated but is not required.
18+
* 2. Altered source versions must be plainly marked as such, and must not be
19+
* misrepresented as being the original software.
20+
* 3. This notice may not be removed or altered from any source distribution.
21+
*/
22+
23+
/*
24+
* Uses the libdivsufsort library Copyright (c) 2003-2008 Yuta Mori
25+
*
26+
* Inspired by LZ4 by Yann Collet. https://github.com/lz4/lz4
27+
* With help, ideas, optimizations and speed measurements by spke <zxintrospec@gmail.com>
28+
* With ideas from Lizard by Przemyslaw Skibinski and Yann Collet. https://github.com/inikep/lizard
29+
* Also with ideas from smallz4 by Stephan Brumme. https://create.stephan-brumme.com/smallz4/
30+
*
31+
*/
32+
33+
/* !!! Modified from the original, to use as a library for 7800basic !!! */
34+
35+
#ifndef _SHRINK_INMEM_H
36+
#define _SHRINK_INMEM_H
37+
38+
#include <stdlib.h>
39+
40+
/**
41+
* Get maximum compressed size of input(source) data
42+
*
43+
* @param nInputSize input(source) size in bytes
44+
*
45+
* @return maximum compressed size
46+
*/
47+
extern size_t lzsa_get_max_compressed_size_inmem(size_t nInputSize);
48+
49+
/**
50+
* Compress memory
51+
*
52+
* @param pInputData pointer to input(source) data to compress
53+
* @param pOutBuffer buffer for compressed data
54+
* @param nInputSize input(source) size in bytes
55+
* @param nMaxOutBufferSize maximum capacity of compression buffer
56+
* @param nFlags compression flags (LZSA_FLAG_xxx)
57+
* @param nMinMatchSize minimum match size
58+
* @param nFormatVersion version of format to use (1-2)
59+
*
60+
* @return actual compressed size, or -1 for error
61+
*/
62+
extern size_t lzsa_compress_inmem(unsigned char *pInputData, unsigned char *pOutBuffer, size_t nInputSize, size_t nMaxOutBufferSize,
63+
const unsigned int nFlags, const int nMinMatchSize, const int nFormatVersion);
64+
65+
#endif /* _SHRINK_INMEM_H */

contrib/Darwin.x86/lib/liblzsa.a

188 KB
Binary file not shown.

contrib/Linux.x64/include/lib.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* lib.h - LZSA library definitions
3+
*
4+
* Copyright (C) 2019 Emmanuel Marty
5+
*
6+
* This software is provided 'as-is', without any express or implied
7+
* warranty. In no event will the authors be held liable for any damages
8+
* arising from the use of this software.
9+
*
10+
* Permission is granted to anyone to use this software for any purpose,
11+
* including commercial applications, and to alter it and redistribute it
12+
* freely, subject to the following restrictions:
13+
*
14+
* 1. The origin of this software must not be misrepresented; you must not
15+
* claim that you wrote the original software. If you use this software
16+
* in a product, an acknowledgment in the product documentation would be
17+
* appreciated but is not required.
18+
* 2. Altered source versions must be plainly marked as such, and must not be
19+
* misrepresented as being the original software.
20+
* 3. This notice may not be removed or altered from any source distribution.
21+
*/
22+
23+
/*
24+
* Uses the libdivsufsort library Copyright (c) 2003-2008 Yuta Mori
25+
*
26+
* Inspired by LZ4 by Yann Collet. https://github.com/lz4/lz4
27+
* With help, ideas, optimizations and speed measurements by spke <zxintrospec@gmail.com>
28+
* With ideas from Lizard by Przemyslaw Skibinski and Yann Collet. https://github.com/inikep/lizard
29+
* Also with ideas from smallz4 by Stephan Brumme. https://create.stephan-brumme.com/smallz4/
30+
*
31+
*/
32+
33+
/* !!! Modified from the original, to use as a library for 7800basic !!! */
34+
35+
#ifndef _LIB_H
36+
#define _LIB_H
37+
38+
/* Compression flags */
39+
#define LZSA_FLAG_FAVOR_RATIO (1<<0) /**< 1 to compress with the best ratio, 0 to trade some compression ratio for extra decompression speed */
40+
#define LZSA_FLAG_RAW_BLOCK (1<<1) /**< 1 to emit raw block */
41+
#define LZSA_FLAG_RAW_BACKWARD (1<<2) /**< 1 to compress or decompress raw block backward */
42+
43+
#endif /* _LIB_H */
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* shrink_inmem.h - in-memory compression definitions
3+
*
4+
* Copyright (C) 2019 Emmanuel Marty
5+
*
6+
* This software is provided 'as-is', without any express or implied
7+
* warranty. In no event will the authors be held liable for any damages
8+
* arising from the use of this software.
9+
*
10+
* Permission is granted to anyone to use this software for any purpose,
11+
* including commercial applications, and to alter it and redistribute it
12+
* freely, subject to the following restrictions:
13+
*
14+
* 1. The origin of this software must not be misrepresented; you must not
15+
* claim that you wrote the original software. If you use this software
16+
* in a product, an acknowledgment in the product documentation would be
17+
* appreciated but is not required.
18+
* 2. Altered source versions must be plainly marked as such, and must not be
19+
* misrepresented as being the original software.
20+
* 3. This notice may not be removed or altered from any source distribution.
21+
*/
22+
23+
/*
24+
* Uses the libdivsufsort library Copyright (c) 2003-2008 Yuta Mori
25+
*
26+
* Inspired by LZ4 by Yann Collet. https://github.com/lz4/lz4
27+
* With help, ideas, optimizations and speed measurements by spke <zxintrospec@gmail.com>
28+
* With ideas from Lizard by Przemyslaw Skibinski and Yann Collet. https://github.com/inikep/lizard
29+
* Also with ideas from smallz4 by Stephan Brumme. https://create.stephan-brumme.com/smallz4/
30+
*
31+
*/
32+
33+
/* !!! Modified from the original, to use as a library for 7800basic !!! */
34+
35+
#ifndef _SHRINK_INMEM_H
36+
#define _SHRINK_INMEM_H
37+
38+
#include <stdlib.h>
39+
40+
/**
41+
* Get maximum compressed size of input(source) data
42+
*
43+
* @param nInputSize input(source) size in bytes
44+
*
45+
* @return maximum compressed size
46+
*/
47+
extern size_t lzsa_get_max_compressed_size_inmem(size_t nInputSize);
48+
49+
/**
50+
* Compress memory
51+
*
52+
* @param pInputData pointer to input(source) data to compress
53+
* @param pOutBuffer buffer for compressed data
54+
* @param nInputSize input(source) size in bytes
55+
* @param nMaxOutBufferSize maximum capacity of compression buffer
56+
* @param nFlags compression flags (LZSA_FLAG_xxx)
57+
* @param nMinMatchSize minimum match size
58+
* @param nFormatVersion version of format to use (1-2)
59+
*
60+
* @return actual compressed size, or -1 for error
61+
*/
62+
extern size_t lzsa_compress_inmem(unsigned char *pInputData, unsigned char *pOutBuffer, size_t nInputSize, size_t nMaxOutBufferSize,
63+
const unsigned int nFlags, const int nMinMatchSize, const int nFormatVersion);
64+
65+
#endif /* _SHRINK_INMEM_H */

contrib/Linux.x64/lib/liblzsa.a

416 KB
Binary file not shown.

contrib/Linux.x86/include/lib.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* lib.h - LZSA library definitions
3+
*
4+
* Copyright (C) 2019 Emmanuel Marty
5+
*
6+
* This software is provided 'as-is', without any express or implied
7+
* warranty. In no event will the authors be held liable for any damages
8+
* arising from the use of this software.
9+
*
10+
* Permission is granted to anyone to use this software for any purpose,
11+
* including commercial applications, and to alter it and redistribute it
12+
* freely, subject to the following restrictions:
13+
*
14+
* 1. The origin of this software must not be misrepresented; you must not
15+
* claim that you wrote the original software. If you use this software
16+
* in a product, an acknowledgment in the product documentation would be
17+
* appreciated but is not required.
18+
* 2. Altered source versions must be plainly marked as such, and must not be
19+
* misrepresented as being the original software.
20+
* 3. This notice may not be removed or altered from any source distribution.
21+
*/
22+
23+
/*
24+
* Uses the libdivsufsort library Copyright (c) 2003-2008 Yuta Mori
25+
*
26+
* Inspired by LZ4 by Yann Collet. https://github.com/lz4/lz4
27+
* With help, ideas, optimizations and speed measurements by spke <zxintrospec@gmail.com>
28+
* With ideas from Lizard by Przemyslaw Skibinski and Yann Collet. https://github.com/inikep/lizard
29+
* Also with ideas from smallz4 by Stephan Brumme. https://create.stephan-brumme.com/smallz4/
30+
*
31+
*/
32+
33+
/* !!! Modified from the original, to use as a library for 7800basic !!! */
34+
35+
#ifndef _LIB_H
36+
#define _LIB_H
37+
38+
/* Compression flags */
39+
#define LZSA_FLAG_FAVOR_RATIO (1<<0) /**< 1 to compress with the best ratio, 0 to trade some compression ratio for extra decompression speed */
40+
#define LZSA_FLAG_RAW_BLOCK (1<<1) /**< 1 to emit raw block */
41+
#define LZSA_FLAG_RAW_BACKWARD (1<<2) /**< 1 to compress or decompress raw block backward */
42+
43+
#endif /* _LIB_H */

0 commit comments

Comments
 (0)