mirror of
https://github.com/facebook/zstd.git
synced 2025-10-15 00:02:02 -04:00
Merge pull request #1724 from facebook/blockSize
clarifications on field `Block_Size`
This commit is contained in:
commit
69c875a0cc
@ -16,7 +16,7 @@ Distribution of this document is unlimited.
|
|||||||
|
|
||||||
### Version
|
### Version
|
||||||
|
|
||||||
0.3.2 (17/07/19)
|
0.3.3 (16/08/19)
|
||||||
|
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
@ -358,6 +358,7 @@ It may be followed by an optional `Content_Checksum`
|
|||||||
__`Block_Type`__
|
__`Block_Type`__
|
||||||
|
|
||||||
The next 2 bits represent the `Block_Type`.
|
The next 2 bits represent the `Block_Type`.
|
||||||
|
`Block_Type` influences the meaning of `Block_Size`.
|
||||||
There are 4 block types :
|
There are 4 block types :
|
||||||
|
|
||||||
| Value | 0 | 1 | 2 | 3 |
|
| Value | 0 | 1 | 2 | 3 |
|
||||||
@ -384,9 +385,12 @@ There are 4 block types :
|
|||||||
__`Block_Size`__
|
__`Block_Size`__
|
||||||
|
|
||||||
The upper 21 bits of `Block_Header` represent the `Block_Size`.
|
The upper 21 bits of `Block_Header` represent the `Block_Size`.
|
||||||
`Block_Size` is the size of the block excluding the header.
|
When `Block_Type` is `Compressed_Block` or `Raw_Block`,
|
||||||
A block can contain any number of bytes (even zero), up to
|
`Block_Size` is the size of `Block_Content`, hence excluding `Block_Header`.
|
||||||
`Block_Maximum_Decompressed_Size`, which is the smallest of:
|
When `Block_Type` is `RLE_Block`, `Block_Content`’s size is always 1,
|
||||||
|
and `Block_Size` represents the number of times this byte must be repeated.
|
||||||
|
A block can contain and decompress into any number of bytes (even zero),
|
||||||
|
up to `Block_Maximum_Decompressed_Size`, which is the smallest of:
|
||||||
- Window_Size
|
- Window_Size
|
||||||
- 128 KB
|
- 128 KB
|
||||||
|
|
||||||
@ -1653,6 +1657,7 @@ or at least provide a meaningful error code explaining for which reason it canno
|
|||||||
|
|
||||||
Version changes
|
Version changes
|
||||||
---------------
|
---------------
|
||||||
|
- 0.3.3 : clarifications for field Block_Size
|
||||||
- 0.3.2 : remove additional block size restriction on compressed blocks
|
- 0.3.2 : remove additional block size restriction on compressed blocks
|
||||||
- 0.3.1 : minor clarification regarding offset history update rules
|
- 0.3.1 : minor clarification regarding offset history update rules
|
||||||
- 0.3.0 : minor edits to match RFC8478
|
- 0.3.0 : minor edits to match RFC8478
|
||||||
|
Loading…
x
Reference in New Issue
Block a user