documentation: rename Methods.txt to Methods.md

- so the markdown is nice viewable with browsers
This commit is contained in:
Tino Reichardt
2017-05-19 21:17:26 +02:00
parent a6b3f59f0e
commit 715225a73e
3 changed files with 248 additions and 207 deletions

View File

@@ -1,6 +1,6 @@
/** /**
* Copyright (c) 2016 Tino Reichardt * Copyright (c) 2016 - 2017 Tino Reichardt
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the BSD-style license found in the
@@ -26,7 +26,7 @@ extern "C" {
/* current maximum the library will accept */ /* current maximum the library will accept */
#define LZ5MT_THREAD_MAX 128 #define LZ5MT_THREAD_MAX 128
#define LZ5MT_LEVEL_MAX 16 #define LZ5MT_LEVEL_MAX 15
#define LZ5FMT_MAGICNUMBER 0x184D2205U #define LZ5FMT_MAGICNUMBER 0x184D2205U
#define LZ5FMT_MAGIC_SKIPPABLE 0x184D2A50U #define LZ5FMT_MAGIC_SKIPPABLE 0x184D2A50U
@@ -55,7 +55,7 @@ typedef enum {
# undef ERROR /* reported already defined on VS 2015 (Rich Geldreich) */ # undef ERROR /* reported already defined on VS 2015 (Rich Geldreich) */
#endif #endif
#define PREFIX(name) LZ5MT_error_##name #define PREFIX(name) LZ5MT_error_##name
#define ERROR(name) ((size_t)-PREFIX(name)) #define ERROR(name) ((size_t)-PREFIX(name))
extern unsigned LZ5MT_isError(size_t code); extern unsigned LZ5MT_isError(size_t code);
extern const char* LZ5MT_getErrorString(size_t code); extern const char* LZ5MT_getErrorString(size_t code);
@@ -73,7 +73,9 @@ typedef struct {
* reading and writing functions * reading and writing functions
* - you can use stdio functions or plain read/write * - you can use stdio functions or plain read/write
* - just write some wrapper on your own * - just write some wrapper on your own
* - a sample is given in 7-Zip ZS * - a sample is given in 7-Zip ZS or lz5mt.c
* - the function should return -1 on error and zero on success
* - the read or written bytes will go to in->size or out->size
*/ */
typedef int (fn_read) (void *args, LZ5MT_Buffer * in); typedef int (fn_read) (void *args, LZ5MT_Buffer * in);
typedef int (fn_write) (void *args, LZ5MT_Buffer * out); typedef int (fn_write) (void *args, LZ5MT_Buffer * out);
@@ -95,7 +97,7 @@ typedef struct LZ5MT_CCtx_s LZ5MT_CCtx;
* 1) allocate new cctx * 1) allocate new cctx
* - return cctx or zero on error * - return cctx or zero on error
* *
* @level - 1 .. 16 * @level - 1 .. 9
* @threads - 1 .. LZ5MT_THREAD_MAX * @threads - 1 .. LZ5MT_THREAD_MAX
* @inputsize - if zero, becomes some optimal value for the level * @inputsize - if zero, becomes some optimal value for the level
* - if nonzero, the given value is taken * - if nonzero, the given value is taken
@@ -104,7 +106,7 @@ LZ5MT_CCtx *LZ5MT_createCCtx(int threads, int level, int inputsize);
/** /**
* 2) threaded compression * 2) threaded compression
* - return -1 on error * - errorcheck via
*/ */
size_t LZ5MT_compressCCtx(LZ5MT_CCtx * ctx, LZ5MT_RdWr_t * rdwr); size_t LZ5MT_compressCCtx(LZ5MT_CCtx * ctx, LZ5MT_RdWr_t * rdwr);
@@ -122,7 +124,7 @@ size_t LZ5MT_GetOutsizeCCtx(LZ5MT_CCtx * ctx);
void LZ5MT_freeCCtx(LZ5MT_CCtx * ctx); void LZ5MT_freeCCtx(LZ5MT_CCtx * ctx);
/* ************************************** /* **************************************
* Decompression - TODO, but it's easy... * Decompression
****************************************/ ****************************************/
typedef struct LZ5MT_DCtx_s LZ5MT_DCtx; typedef struct LZ5MT_DCtx_s LZ5MT_DCtx;
@@ -131,10 +133,8 @@ typedef struct LZ5MT_DCtx_s LZ5MT_DCtx;
* 1) allocate new cctx * 1) allocate new cctx
* - return cctx or zero on error * - return cctx or zero on error
* *
* @level - 1 .. 22
* @threads - 1 .. LZ5MT_THREAD_MAX * @threads - 1 .. LZ5MT_THREAD_MAX
* @srclen - the max size of src for LZ5MT_CompressCCtx() * @ inputsize - used for single threaded standard lz5 format without skippable frames
* @dstlen - the min size of dst
*/ */
LZ5MT_DCtx *LZ5MT_createDCtx(int threads, int inputsize); LZ5MT_DCtx *LZ5MT_createDCtx(int threads, int inputsize);

View File

@@ -1,197 +1,236 @@
7-Zip external method IDs, that are not included to 7-Zip 7-Zip external method IDs, that are not included to 7-Zip
--------------------------------------------------------- ---------------------------------------------------------
History of this document
------------------------ History of this document
------------------------
- 7-Zip Version 15.01, initial release
- see https://github.com/mcmilk/7-Zip-zstd/commits/master/DOC/Methods-Extern.txt
Overview of defined ID ranges
----------------------------- Overview of defined ID ranges
-----------------------------
F7 0x xx - reserved
F7 10 xx - LZHAM by Rich Geldreich ID | Codec, Author | 7-Zip Plugin Author
F7 11 01 - ZStandard by Yann Collet, Tino Reichardt ---------+------------------------------+----------------------
F7 11 04 - LZ4 by Yann Collet, Tino Reichardt F7 0x xx | reserved |
F7 11 05 - LZ5 by Przemyslaw Skibinski, Tino Reichardt F7 10 xx | LZHAM, Rich Geldreich | Rich Geldreich
F7 11 01 | ZStandard, Yann Collet | Tino Reichardt
F7 11 02 | Brotli, Google | Tino Reichardt
F7 11 04 | LZ4, Yann Collet | Tino Reichardt
Range F7 10 xx - LZHAM F7 11 05 | LZ5, Przemyslaw Skibinski | Tino Reichardt
----------------------- F7 11 06 | Lizard, Przemyslaw Skibinski | Tino Reichardt
Description:
Lossless data compression codec with LZMA-like ratios but 1.5x-8x faster Range F7 10 xx - LZHAM
decompression speed, C/C++ -----------------------
License: Description:
LZHAM library is provided as open source software using a MIT license. Lossless is a data compression codec with LZMA-like ratios but 1.5x-8x faster
decompression speed.
7-Zip Container Header:
Byte _ver; License:
Byte _dict_size; LZHAM library is provided as open source software using the MIT license.
Byte _level;
Byte _flags; 7-Zip Container Header:
Byte _reserved[1]; Byte _ver;
Byte _dict_size;
Byte _level;
Algorithm author: Rich Geldreich Byte _flags;
Algorithm Homepage: https://github.com/richgel999/lzham_codec Byte _reserved[1];
Source code: https://github.com/richgel999/lzham_codec
Codec plugin author: Rich Geldreich Algorithm author: Rich Geldreich
Codec Homepage: http://richg42.blogspot.com/2015/11/lzham-custom-codec-plugin-for-7-zip.html - Homepage: https://github.com/richgel999/lzham_codec
Source Code: https://github.com/richgel999/lzham_codec_devel - Source: https://github.com/richgel999/lzham_codec
Codec plugin author: Rich Geldreich
Range F7 11 01, ZStandard - Homepage: http://richg42.blogspot.com/2015/11/lzham-custom-codec-plugin-for-7-zip.html
------------------------- - Source: https://github.com/richgel999/lzham_codec_devel
Description:
Zstandard is a real-time compression algorithm, providing high compression Range F7 11 01, ZStandard
ratios. It offers a very wide range of compression / speed trade-off, while -------------------------
being backed by a very fast decoder (see benchmarks below). It also offers a
special mode for small data, called dictionary compression, and can create Description:
dictionaries from any sample set. Zstandard is a real-time compression algorithm, providing high compression
ratios. It offers a very wide range of compression / speed trade-off, while
License: being backed by a very fast decoder.
Zstandard library is provided as open source software using a BSD license.
License:
7-Zip Container Header: Zstandard library is provided as open source software using the BSD license.
Byte _ver_major; // currently 1
Byte _ver_minor; // currently 1 7-Zip Container Header:
Byte _level; // currently 1..22 Byte _ver_major; // currently 1
Byte _reserved[2]; Byte _ver_minor; // currently 1
- this header holds some information about the version, which was Byte _level; // currently 1..22
used for creating that 7-Zip container data Byte _reserved[2];
- _ver_major should contain the major release of zstd - this header holds some information about the version, which was
- _ver_minor should contain the major release of zstd used for creating that 7-Zip container data
- _level should contain the level, the data is packed with - _ver_major should contain the major release of zstd
- the other two bytes should be set to zero currently and are - _ver_minor should contain the major release of zstd
reserved for future use - _level should contain the level, the data is packed with
- the other two bytes should be set to zero currently and are
Algorithm author: Yann Collet reserved for future use
Algorithm Homepage: https://facebook.github.io/zstd/
Source code: https://github.com/facebook/zstd Algorithm author: Yann Collet
- Homepage: https://facebook.github.io/zstd/
Codec plugin author: Tino Reichardt - Source: https://github.com/facebook/zstd
Codec Homepage: https://mcmilk.de/projects/7-Zip-zstd/
Source Code: https://github.com/mcmilk/7-Zip-zstd Codec plugin author: Tino Reichardt
- Homepage: https://mcmilk.de/projects/7-Zip-zstd/
Modes: - Source: https://github.com/mcmilk/7-Zip-zstd
- threading is supported through skippable frame id 0x184D2A50U
- all levels are supported (1..22) Modes:
- future versions of zstd will support multithreading out of the box - threading is supported through skippable frame id 0x184D2A50U
-> this new format is fully compatible with the one within this codec - all levels are supported (1..22)
- the codec is used as archiv handler also, see ZstdHandler.cpp - future versions of zstd will support multithreading out of the box
- this handler is does not use any additional headers, it supports the plain - this new format is fully compatible with the one within this codec
zstd v1.0 format (this covers all current v1.x implemetations) - the codec is used as archiv handler also, see ZstdHandler.cpp
- when compiled with ZSTD_LEGACY_SUPPORT, then support is increased to these - this handler is does not use any additional headers, it supports the plain
addtional version numbers of zstd: v0.1 up v0.7 zstd v1.0 format
- future formats of this algorithm will be fully compatible with release v1.0 of - when compiled with ZSTD_LEGACY_SUPPORT, then support is increased to these
ZStandard (ZStandard 0.8 == ZStandard 1.0) addtional version numbers of zstd: v0.1 up v0.7
- one ID should be okay for this codec - future formats of this algorithm will be fully compatible with release v1.0
of ZStandard (ZStandard 0.8 == ZStandard 1.0)
Versions: - one ID should be okay for this codec
The 7-Zip codec will be kept in sync with the current releases of ZStandard.
Versions:
The 7-Zip codec will be kept in sync with the current releases of ZStandard.
Range F7 11 04, LZ4
-------------------
Range F7 11 02, Brotli
Description: ----------------------
LZ4 is lossless compression algorithm, providing compression speed at 400 MB/s
per core (0.16 Bytes/cycle). It features an extremely fast decoder, with speed Description:
in multiple GB/s per core (0.71 Bytes/cycle). A high compression derivative, Brotli is a generic-purpose lossless compression algorithm that compresses
called LZ4_HC, is available, trading customizable CPU time for compression data using a combination of a modern variant of the LZ77 algorithm, Huffman
ratio. LZ4 library is provided as open source software using a BSD license. coding and 2nd order context modeling, with a compression ratio comparable to
the best currently available general-purpose compression methods. It is
License: similar in speed with deflate but offers more dense compression.
LZ4 library is provided as open source software using a BSD license.
License:
7-Zip Container Header: The Brotli library is provided as open source software using the MIT license.
Byte _ver_major; // currently 1
Byte _ver_minor; // currently 7 7-Zip Container Header (3 bytes):
Byte _level; // 1..16 Byte _ver_major; // currently 0
Byte _reserved[2]; Byte _ver_minor; // currently 6
- this header holds some information about the version, which was Byte _level; // currently 1..11 (Brotli quality)
used for creating that 7-Zip container data - this header holds some information about the version, which was
- _ver_major should contain the major release of LZ4 used for creating that 7-Zip container data
- _ver_minor should contain the major release of LZ4 - _ver_major should contain the major release of brotli
- _level should contain the level, the data is packed with - _ver_minor should contain the major release of brotli
- the other two bytes should be set to zero currently and are - _level should contain the level, the data is packed with
reserved for future use
Algorithm author: Google Staff
- Homepage: https://brotli.org/
Algorithm author: Yann Collet - Source: https://github.com/google/brotli
Algorithm Homepage: https://lz4.github.io/lz4/
Source code: https://github.com/lz4/lz4 Codec plugin author: Tino Reichardt
- Homepage: https://mcmilk.de/projects/7-Zip-zstd/
Codec plugin author: Tino Reichardt - Source: https://github.com/mcmilk/7-Zip-zstd
Codec Homepage: https://mcmilk.de/projects/7-Zip-zstd/
Source Code: https://github.com/mcmilk/7-Zip-zstd Modes:
- threading is supported through skippable frame id 0x184D2A50U
Modes: - all levels are supported (1..11)
- threading is supported through skippable frame id 0x184D2A50U - one ID should be okay for this codec
- all levels of LZ4 v1.7.4 are supported (1..16)
- the codec is used as archiv handler also, see Lz4Handler.cpp Versions:
- this handler is does not use any additional headers, it supports the plain The 7-Zip codec will be kept in sync with the current releases of Brotli.
lz4 v1.7.4 format (this covers all current lz4 implemetations)
- future formats of this algorithm should be fully compatible with current
release Range F7 11 04, LZ4
- one ID should be okay for this codec -------------------
Versions: Description:
The 7-Zip codec will be kept in sync with the current releases of LZ4. LZ4 is lossless compression algorithm, providing compression speed at 400 MB/s
per core (0.16 Bytes/cycle). It features an extremely fast decoder, with speed
in multiple GB/s per core (0.71 Bytes/cycle). A high compression derivative,
Range F7 11 05, LZ5 called LZ4_HC, is available, trading customizable CPU time for compression
------------------- ratio.
Description: License:
LZ5 is a modification of LZ4 which gives a better ratio at cost of slower LZ4 library is provided as open source software using the BSD license.
compression and decompression.
7-Zip Container Header:
License: Byte _ver_major; // currently 1
LZ5 library is provided as open source software using a BSD license. Byte _ver_minor; // currently 7
Byte _level; // 1..12
7-Zip Container Header: Byte _reserved[2];
Byte _ver_major; // currently 1 - this header holds some information about the version, which was
Byte _ver_minor; // currently 5 used for creating that 7-Zip container data
Byte _level; // 1..16 - _ver_major should contain the major release of LZ4
Byte _reserved[2]; - _ver_minor should contain the major release of LZ4
- this header holds some information about the version, which was - _level should contain the level, the data is packed with
used for creating that 7-Zip container data - the other two bytes should be set to zero currently and are
- _ver_major should contain the major release of LZ5 reserved for future use
- _ver_minor should contain the major release of LZ5
- _level should contain the level, the data is packed with Algorithm author: Yann Collet
- the other two bytes should be set to zero currently and are - Homepage: https://lz4.github.io/lz4/
reserved for future use - Source: https://github.com/lz4/lz4
Algorithm author: Przemyslaw Skibinski Codec plugin author: Tino Reichardt
Algorithm Homepage: https://github.com/inikep/lz5 - Homepage: https://mcmilk.de/projects/7-Zip-zstd/
Source code: https://github.com/inikep/lz5 - Source: https://github.com/mcmilk/7-Zip-zstd
Codec plugin author: Tino Reichardt Modes:
Codec Homepage: https://mcmilk.de/projects/7-Zip-zstd/ - threading is supported through skippable frame id 0x184D2A50U
Source Code: https://github.com/mcmilk/7-Zip-zstd - all levels of LZ4 v1.7.4 are supported (1..16)
- the codec is used as archiv handler also, see Lz4Handler.cpp
Modes: - this handler is does not use any additional headers
- threading is supported through skippable frame id 0x184D2A50U - it supports the plain LZ4 v1.7.4 format (this covers all current lz4
- all levels of v1.5 are supported (1..16) implemetations)
- the codec is used as archiv handler also, see Lz5Handler.cpp - future formats of this algorithm should be fully compatible with current
- this handler is does not use any additional headers, it supports the plain release
lz5 v1.5 format - one ID should be okay for this codec
- future formats of this algorithm may not be compatible with current release,
this codec is very experimental Versions:
- one ID should be okay for this codec The 7-Zip codec will be kept in sync with the current releases of LZ4.
Versions:
The 7-Zip codec will be kept in sync with the current releases of LZ5. Range F7 11 05, LZ5
The current codec plugin supports version v1.5. Version 2.0 will follow, when it -------------------
seems to be stable.
Description:
--- LZ5 is a modification of LZ4 which gives a better ratio at cost of slower
End of document compression and decompression.
Tino Reichardt, 2016-12-28
License:
LZ5 library is provided as open source software using the BSD license.
7-Zip Container Header:
Byte _ver_major; // currently 1
Byte _ver_minor; // currently 5
Byte _level; // 1..15
Byte _reserved[2];
- this header holds some information about the version, which was used for
creating that 7-Zip container data
- _ver_major should contain the major release of LZ5
- _ver_minor should contain the major release of LZ5
- _level should contain the level, the data is packed with
- the other two bytes should be set to zero currently and are reserved for
future use
Algorithm author: Przemyslaw Skibinski
- Homepage: https://github.com/inikep/lz5
- Source: https://github.com/inikep/lz5
Codec plugin author: Tino Reichardt
- Homepage: https://mcmilk.de/projects/7-Zip-zstd/
- Source: https://github.com/mcmilk/7-Zip-zstd
Modes:
- threading is supported through skippable frame id 0x184D2A50U
- all levels of v1.5 are supported, which means: 1..15
- the codec is used as archiv handler also, see Lz5Handler.cpp
- this handler is does not use any additional headers, it supports the plain
lz5 v1.5 format
- future formats of this algorithm will not follow
- one ID should be okay for this codec
Versions:
The 7-Zip codec will be frozen to v1.5 of this codec.
---
End of document
Tino Reichardt, 2017-05-19

View File

@@ -128,8 +128,10 @@ List of defined IDs
11 xx - reserved (Tino Reichardt) 11 xx - reserved (Tino Reichardt)
01 - ZSTD 01 - ZSTD
02 - Brotli
04 - LZ4 04 - LZ4
05 - LZ5 05 - LZ5
06 - Lizard
06.. - Crypto 06.. - Crypto