Commit Graph

75 Commits

Author SHA1 Message Date
Yann Collet
293713a4fa bump version number
to v1.9.3
2020-09-29 14:27:39 -07:00
Yann Collet
5ab7d22fa5 clarify endMark definition 2020-08-14 15:03:03 -07:00
Yann Collet
e9cfa49d0d Clarifies and fix EndMark
EndMark, the 4-bytes value indicating the end of frame,
must be `0x00000000`.

Previously, it was just mentioned as a `0-size` block.
But such definition could encompass uncompressed blocks of size 0,
with a header of value `0x80000000`.

But the intention was to also support uncompressed empty blocks.
They could be used as a keep-alive signal.
Note that compressed empty blocks are already supported,
it's just that they have a size 1 instead of 0 (for the `0` token).

Unfortunately, the decoder implementation was also wrong,
and would also interpret a `0x80000000` block header as an endMark.

This issue evaded detection so far simply because
this situation never happens, as LZ4Frame always issues
a clean 0x00000000 value as a endMark.
It also does not flush empty blocks.

This is fixed in this PR.
The decoder can now deal with empty uncompressed blocks,
and do not confuse them with EndMark.
The specification is also clarified.
Finally, FrameTest is updated to randomly insert empty blocks during fuzzing.
2020-08-12 17:27:33 -07:00
Yann Collet
bb5c34a875 bumped version number to v1.9.2
to reduce risks that future bug reports in `dev` branch report `v1.9.1` as the failing version.
2019-07-01 09:01:43 -07:00
Yann Collet
1d759576b9 precise again that LZ4 decoder needs metadata
and that such metadata must be provided / sent / saved by the application.
2019-06-06 13:20:30 -07:00
Yann Collet
5997e139f5 added more details for in-place documentation 2019-05-31 11:56:59 -07:00
Yann Collet
2f9d1736fb updated API manual 2019-05-30 16:23:53 -07:00
Yann Collet
22adbb176a add more doc on in-place (de)compression 2019-05-30 09:45:21 -07:00
Yann Collet
b17f578a91 added comments and macros for in-place (de)compression 2019-05-29 12:06:13 -07:00
Yann Collet
7a4e3b1fac bumped version number
to v1.9.1
2019-04-19 11:59:49 -07:00
Yann Collet
0b876db6d4 address a few minor Visual warnings
and created target cxx17build
2019-04-18 16:07:16 -07:00
Yann Collet
21ff1a839a updated doc to underline difference between block and frame
as this is a very frequent source of confusion for new users.
2019-04-12 11:27:44 -07:00
Yann Collet
bcb26565a7 improved documentation for LZ4 dictionary compression 2019-04-11 15:20:46 -07:00
Yann Collet
8d76c8a44a introduce LZ4_DISTANCE_MAX build macro
make it possible to generate LZ4-compressed block
with a controlled maximum offset (necessarily <= 65535).

This could be useful for compatibility with decoders
using a very limited memory budget (<64 KB).

Answer #154
2019-04-11 14:15:33 -07:00
Yann Collet
013fee5665 updated block format with more details on MF_LIMIT
aka distance from end of block for the last match.
2019-04-11 13:55:35 -07:00
Yann Collet
14c71dfa9c modified LZ4_initStreamHC() to look like LZ4_initStream()
it is now a pure initializer, for statically allocated states.
It can initialize any memory area, and because of this, requires size.
2019-04-09 13:55:42 -07:00
Yann Collet
2ece0d8380 created LZ4_initStream()
- promoted LZ4_resetStream_fast() to stable
- moved LZ4_resetStream() into deprecate, but without triggering a compiler warning
- update all sources to no longer rely on LZ4_resetStream()

note : LZ4_initStream() proposal is slightly different :
it's able to initialize any buffer, provided that it's large enough.
To this end, it accepts a void*, and returns an LZ4_stream_t*.
2019-04-05 12:56:26 -07:00
Yann Collet
7a39fb8fb6 make _fast*() decoder generate a deprecation warning
updated modification
2019-04-04 12:47:36 -07:00
Yann Collet
50f01d881d fixed doc
and bumped version number fo v1.9.0
2019-04-03 14:27:21 -07:00
Yann Collet
25da6cc967 moved _destSize() into "stable API" status
as requested in #642
2019-04-03 14:18:00 -07:00
Yann Collet
ec735ac53e updated frame format
re-wording non-full blocks,
for clarity.
2019-01-02 15:02:22 -08:00
Yann Collet
7a4e04e6a6 updated LZ4 block format
rewording the end of block conditions
for clarity and answering related questions.
2019-01-02 14:36:12 -08:00
Bing Xu
b4efd20ac8 Merge remote-tracking branch 'upstream/master' into bootcamp 2018-11-26 11:12:49 -08:00
Niklas Hambüchen
ca45db8d4f
lz4_Frame_format.md: Fix typo HexaBytes -> Exabytes 2018-11-24 22:13:10 +01:00
Yann Collet
bf9bf80f8d updated code documentation
to clarify #589
2018-10-15 11:14:30 -07:00
Yann Collet
c4c19c74b8 changed LZ4_streamDecode member order
to reduce memory usage on 128-bits systems
2018-09-25 14:43:19 -07:00
Yann Collet
dea044a485
Merge pull request #575 from lz4/apiDoc
unpublish static-only functions
2018-09-17 17:06:34 -07:00
Yann Collet
a803230f67 unpublish static-only function
these functions are now unpublished in dll by default.
One needs to opt-in, using macro LZ4_PUBLISH_STATIC_FUNCTIONS.

used this opportunity to update a bunch of api comments in lz4.h
2018-09-13 16:02:11 -07:00
Yann Collet
86023f01f2 avoid final trailing comma for enum lists
as detected in #485 by @JoachimSchneider.

Refactored the c_standards tests
so that these issues get automatically detected in CI tests.
2018-09-13 14:29:41 -07:00
Yann Collet
4a84836c13 removed image from repository
used for v1.8.2 announcement
2018-09-12 10:50:37 -07:00
Yann Collet
eaed9ea4a1 updated function interface documentation 2018-09-07 16:21:31 -07:00
Yann Collet
0fea528e3a updated documentation regarding dictionary compression
following suggestion from @stbrumme (#558)

Also : bumped version number, regenerated man page and html doc
2018-09-05 14:05:08 -07:00
Jack Luo
3358e169ee fixed spelling mistake in lz4_manual 2018-07-28 22:12:55 -04:00
Yann Collet
d358e33faa Added CDict speed graph to be used for release statement 2018-05-03 16:01:24 -07:00
Yann Collet
e00ba49cde updated API documentation 2018-05-03 15:40:01 -07:00
Yann Collet
c25eb16666 random lz4f clarifications
the initial intention was to update lz4f ring buffer strategy,
but lz4f doesn't use ring buffer.
Instead, it uses the destination buffer as much as possible,
and merely copies just what's required to preserve history
into its own buffer, at the end.
Pretty efficient.

This patch just clarifies a few comments and add some assert().
It's built on top of #528.

It also updates doc.
2018-05-02 16:05:42 -07:00
Yann Collet
47d70e755e
Merge pull request #519 from lz4/fdParser
Faster decoding speed
2018-04-27 11:46:29 -07:00
Yann Collet
d294dd7fc6 ensure favorDecSpeed is properly initialized
also :
- fix a potential malloc error
- proper use of ALLOC macro inside lz4hc
- update html API doc
2018-04-27 09:04:09 -07:00
Cyan4973
bd92689798 minor edit of block format
clarifying parsing restrictions near end of block.
2018-04-25 06:42:57 -07:00
Alexey Tourbin
ff9b4cf826 lz4_Block_format.md: clarify on short inputs and restrictions
It occurred to me that the formula "The last 5 bytes are always
literals", on the list of "assumptions made by the decoder", is
remarkably ambiguous.  Suppose the decoder is presented with 5 bytes.
Are they literals?  It may seem that the decoder degenerates
to memcpy on short inputs.  But of course the answer is no,
so the formula needs some clarification.

Parsing restrictions should be explained as well, otherwise they look
like arbitrary numbers.  The 5-byte restriction has been mentioned
recently in connection with the shortcut in LZ4_decompress_generic,
so I add that.  The second restriction is left to be explained
by the author.

I also took the liberty to explain that empty inputs "are either
unrepresentable or can be represented with a null byte".  This wording
may actually have some merit: it leaves for the implementation,
as opposed to the spec, to decide whether the encoder can compress
empty inputs, and whether the decoder can produce an empty output
(which the implementation should further clarify).
2018-04-25 02:39:28 +03:00
Yann Collet
4785bd6a35 minor length reduction of several large lines 2018-04-18 16:49:27 -07:00
Cyan4973
57afa36795 compatibility with gcc-4.4 string.h version
Someone found it would be a great idea to define there a global variable under the very generic name "index".
Cause problem with shadow warnings, so no variable can be named "index" now ...

Also : automatically update API manual
2018-04-13 01:01:54 -07:00
Yann Collet
b5233d3726 updated LZ4F_compressBound() documentation
to clarify it includes potentially buffered data.
2018-02-27 23:23:27 -08:00
Yann Collet
39fda9a447 bumped version number to v1.8.2
updated NEWS was current progresses
2018-02-26 13:50:04 -08:00
Yann Collet
ba115386fa update code comment on LZ4 streaming interface
notably regarding LZ4_saveDict() speed advantage,
answering #477.
2018-02-26 13:31:18 -08:00
Yann Collet
d74f079748 update API doc regarding double-buffer strategy
answering question #473
2018-02-18 11:00:33 -08:00
Yann Collet
ea25250c99 fixed code comment as detected in #466
Also clarified a few API code comments
and updated associated html documentation
2018-02-07 02:21:25 -08:00
Yann Collet
99a81c89f0
Merge pull request #458 from lz4/ff161
Minor change to LZ4 Frame format specification
2018-02-01 10:55:02 -08:00
Yann Collet
87fb7a1d03 refactored frameCompress example
to better reflect LZ4F API usage.
2018-01-31 14:33:16 -08:00
Yann Collet
d03224b633 fix typos as suggested by @psteinb 2018-01-31 09:54:30 -08:00