Commit Graph

5081 Commits

Author SHA1 Message Date
Yann Collet
0d7626672d fixed c++ conversion warning 2018-05-10 18:17:21 -07:00
Yann Collet
09d0fa29ee minor adjusting of weights 2018-05-10 18:13:48 -07:00
Yann Collet
1a26ec6e8d opt: init statistics from dictionary
instead of starting from fake "default" statistics.
2018-05-10 17:59:12 -07:00
Yann Collet
74b1c75d64 btopt : minor adjustment of update frequencies 2018-05-10 16:32:36 -07:00
Yann Collet
498ab7bb12
Merge pull request #1123 from baruchsiach/fix-install-pc
lib/Makefile: create include directory before headers installation
2018-05-10 10:38:19 -07:00
Yann Collet
ac6105463a opt: minor improvements to log traces
slight improvement when using fractional-bit evaluation (opt:dictionay)
2018-05-09 15:46:11 -07:00
Yann Collet
c39061cb7b fixed declaration-after-statement warning 2018-05-09 12:07:25 -07:00
Yann Collet
4d5bd32a00 added traces to look at symbol costs
evaluation looks correct.
2018-05-09 12:00:12 -07:00
Yann Collet
c0da0f5e9e switchable bit-approximation / fractional-bit accuracy modes
also : makes it possible to select nb of fractional bits.
2018-05-09 10:48:09 -07:00
Yann Collet
33dfc54069
Merge pull request #1124 from terrelln/playtests-gnu
Write to /dev/random for test
2018-05-09 09:39:02 -07:00
Yann Collet
ba2ad9b6b9 implemented fractional bit cost evaluation
for FSE symbols.

While it seems to work, the gains are negligible compared to rough maxNbBits evaluation.
There are even a few losses sometimes, that still need to be explained.
Furthermode, there are still cases where btlazy2 does a better job than btopt,
which seems rather strange too.
2018-05-08 17:43:13 -07:00
Yann Collet
1aff63b114 opt: shift all costs by 8 bits (* 256)
making it possible to represent fractional bit costs.
2018-05-08 16:19:04 -07:00
Yann Collet
6a3c34aa58 opt: estimate cost of both Hufman and FSE symbols
For FSE symbols : provide an upper bound,
in nb of bits,
since cost function is not able to store fractional bit costs.
2018-05-08 16:11:21 -07:00
Yann Collet
338f738c24 pass entropy tables to optimal parser
for proper estimation of symbol's weights
when using dictionary compression.

Note : using only huffman costs is not good enough,
presumably because sequence symbol costs are incorrect.
2018-05-08 15:37:06 -07:00
Yann Collet
a155061328 minor code refactor for readability
removed some useless operations from optimal parser
(should not change performance, too small a difference)
2018-05-08 12:32:44 -07:00
Nick Terrell
2dde9d5aba Write to /dev/random for test 2018-05-08 11:06:01 -07:00
Baruch Siach
9a0643b633 lib/Makefile: create include directory before headers installation
Make sure that $(INCLUDEDIR) exists before copying the headers there.
Otherwise, the contest of header files is copied over
$(DESTDIR)$(INCLUDEDIR), making it a regular file.

While at it, remove $(DESTDIR)$(INCLUDEDIR) from the list of directories
to create in the install-pc target. The install-pc target does not need
this directory.
2018-05-08 20:59:44 +03:00
Yann Collet
87125c2c01
Merge pull request #1122 from facebook/fixCDictBlock
fix ZSTD_compressBlock() associated with ZSTD_CDict
2018-05-07 17:13:59 -07:00
Yann Collet
ad4524d605 fix ZSTD_compressBlock() associated with CDict
reported by @let-def.

It's actually a bug in ZSTD_compressBegin_usingCDict()
which would pass a wrong pledgedSrcSize value (0 instead of ZSTD_CONTENTSIZE_UNKNOWN)
resulting in wrong window size, resulting in downsized seqStore,
resulting in segfault when writing into the seqStore later in the process.

Added a test in fuzzer to cover this use case (fails before the patch).
2018-05-07 12:54:13 -07:00
Yann Collet
ef1abd3c07
Merge pull request #1120 from lamby/897904-libzstd-please-make-the-build-reproducible
Make the build reproducible
2018-05-04 12:39:40 -07:00
Chris Lamb
2dbe408a49 Make the build reproducible
Whilst working on the Reproducible Builds effort [0], we noticed
that zstd could not be built reproducibly.

This is due to the manual page encoding the number of CPUs from the
build machine and thus varies across builds.

This was originally filed in Debian as #897904 [1].

 [0] https://reproducible-builds.org/
 [1] https://bugs.debian.org/897904

Signed-off-by: Chris Lamb <lamby@debian.org>
2018-05-04 08:39:51 -07:00
Yann Collet
5ec92c4d96
Merge pull request #1118 from terrelln/playtests-typo
Fix playTests.sh typo
2018-05-03 14:26:26 -07:00
Nick Terrell
263134ce66 Fix playTests.sh typo
Thanks to @mestia for reporting and finding the bug!
Fixes #1116.
2018-05-03 13:03:08 -07:00
cyan4973
b095bffac6 ignore Windows build/test artefacts 2018-05-01 05:45:46 -07:00
Yann Collet
1fc15dfd9d
Merge pull request #1114 from pseiderer/ps-devel-001
Split library install target into pc, static, shared and include only target
2018-04-30 14:59:59 -07:00
Yann Collet
82ad249645 Clarifications of Zstandard format specification
from IETF RFC review
2018-04-30 12:36:55 -07:00
Peter Seiderer
64bfdca5b9 Split library install target into pc, static, shared and include only target
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
2018-04-30 20:32:32 +02:00
Yann Collet
a11f0c67bb
Merge pull request #1113 from terrelln/dict-fix
Fix parameter adjustment with dictionary
2018-04-26 10:31:25 -07:00
Nick Terrell
ca77822ddf Fix parameter adjustment with dictionary
The new advanced API basically set `requestedParams = appliedParams` when
using a dictionary. This halted all parameter adjustment, which can hurt
compression ratio if, for example, the window log is small for the first
call, but the rest of the files are large.

This patch fixes the bug, and checks that the `requestedParams` don't change
in the new advanced API when using a dictionary, and generally in the fuzzer.
2018-04-25 16:32:29 -07:00
Yann Collet
12f60b8c98 clarified documentation related to refPrefix() 2018-04-25 10:17:06 -07:00
Yann Collet
449cccf6c9
Merge pull request #1112 from facebook/lz4dec
fixed decoding bogus lz4 frame
2018-04-24 16:50:54 -07:00
Yann Collet
ace856a835 updated documentation of streaming compression api 2018-04-24 14:44:27 -07:00
cyan4973
62487b5e76 fixed decoding bogus lz4 frame
FIO would keep presenting data after an LZ4F decoding error
resulting in a NULL pointer dereference
when associated with older liblz4 version (< v1.8.1.2)
2018-04-23 18:50:16 -07:00
taigacon
2c3ad05812 Fix the problem that enables DYNAMIC_BMI2 macro by mistake on ARM architecture with Clang (#1110) 2018-04-23 15:41:50 -07:00
Yann Collet
9de03cd748
Merge pull request #1107 from terrelln/reset-params
Add ZSTD_CCtx_resetParameters() function
2018-04-13 13:23:47 -07:00
Nick Terrell
e8c9dc5cea Fix documentation 2018-04-13 12:43:38 -07:00
Nick Terrell
c0987986e5 Only reset CDict in ZSTD_CCtx_resetParameters() 2018-04-13 11:26:40 -07:00
Nick Terrell
9f76eebd17 Add ZSTD_CCtx_resetParameters() function
* Fix docs for `ZSTD_CCtx_reset()`.
* Add `ZSTD_CCtx_resetParameters()`.

Fixes #1094.
2018-04-12 16:54:07 -07:00
Nick Terrell
3c3f59e68f
Enforce pledgeSrcSize whenever known (#1106)
The test fails before the patch and passes after.

Fixes #1095.
2018-04-12 16:02:03 -07:00
Yann Collet
1f25b17c7d
Merge pull request #1105 from terrelln/get-param
Add ZSTD_CCtx(Param)?_getParameter() function
2018-04-12 13:25:57 -07:00
Nick Terrell
280a236e9e Add ZSTD_CCtx(Param)?_getParameter() function
Closes #1096.
2018-04-12 11:50:12 -07:00
Yann Collet
04212178b5 doc : clarified advanced API usage
sticky parameters only work with `ZSTD_compress_generic()`
2018-04-10 11:40:36 -07:00
Yann Collet
ad5ba6cdcf updated comment on parameters that can be changed during compression 2018-04-09 17:39:07 -07:00
Yann Collet
1da629f2ad
Merge pull request #1104 from terrelln/fast-train
Allow negative compression levels in training
2018-04-09 14:16:20 -07:00
Nick Terrell
569e2abccd Allow negative compression levels in training
* Set `dictCLevel` in `zstdcli.c`.
* Only set to default level if the compression level `== 0`, not `<= 0`.
2018-04-09 12:12:03 -07:00
Yann Collet
77e373bff5
Merge pull request #1103 from kilobyte/dev
Fix riscv.
2018-04-09 11:12:51 -07:00
Adam Borowski
00d52282d0 Use -pthread rather than -lpthread.
It can have other effects, such as pulling in extra libraries.  Without it,
riscv build fails with undefined reference to `__atomic_compare_exchange_1'.
2018-04-09 01:50:49 +02:00
Yann Collet
4195b36dd7
Merge pull request #1100 from bket/stable_sort
zstd requires a stable sort.
2018-04-05 11:39:27 -07:00
Yann Collet
f35b8ba9da updated ZSTD_p_chainLog description 2018-04-05 11:05:11 -07:00
Yann Collet
b1e4d891cf
Merge pull request #1099 from bket/fix_typo
fix typo in programs/zstd.{1,1.md}
2018-04-05 10:30:35 -07:00