]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
6 years ago[libzstd] Switch dictUses to an enum 1580/head
Nick Terrell [Wed, 10 Apr 2019 23:50:35 +0000 (16:50 -0700)] 
[libzstd] Switch dictUses to an enum

6 years ago[libzstd] Fix decompression dictionary bugs and clean up initialization
Nick Terrell [Wed, 10 Apr 2019 19:34:21 +0000 (12:34 -0700)] 
[libzstd] Fix decompression dictionary bugs and clean up initialization

Bugs:

* `ZSTD_DCtx_refPrefix()` didn't clear the dictionary after the first
  use. Fix and add a test case.
* `ZSTD_DCtx_reset()` always cleared the dictionary. Fix and add a test
  case.
* After calling `ZSTD_resetDStream()` you could no longer load a
  dictionary, since the stage was set to `zdss_loadHeader`. Fix and add
  a test case.

Cleanup:

* Make `ZSTD_initDStream*()` and `ZSTD_resetDStream()` wrap the new
 advanced API, and add test cases.
* Document the equivalent of these functions in the advanced API and
  document the unstable functions as deprecated.

6 years agoMerge pull request #1576 from terrelln/dict-fuzz
Nick Terrell [Wed, 10 Apr 2019 18:29:15 +0000 (11:29 -0700)] 
Merge pull request #1576 from terrelln/dict-fuzz

Add new fuzzers and fix exposed bugs

6 years agoMerge pull request #1578 from orip/r-flag-typo
Nick Terrell [Wed, 10 Apr 2019 18:19:02 +0000 (11:19 -0700)] 
Merge pull request #1578 from orip/r-flag-typo

Fixed `-r` typo

6 years agoFixed `-r` typo 1578/head
Ori Peleg [Wed, 10 Apr 2019 10:37:41 +0000 (13:37 +0300)] 
Fixed `-r` typo

6 years ago[fuzzer] Use ZSTD_DCtx_loadDictionary_advanced() half the time 1576/head
Nick Terrell [Wed, 10 Apr 2019 01:02:22 +0000 (18:02 -0700)] 
[fuzzer] Use ZSTD_DCtx_loadDictionary_advanced() half the time

6 years ago[fuzzer] Make the regression_driver work while fuzzers are active
Nick Terrell [Wed, 10 Apr 2019 01:01:49 +0000 (18:01 -0700)] 
[fuzzer] Make the regression_driver work while fuzzers are active

6 years ago[libzstd] Fix ZSTD_decompressDCtx() with a dictionary
Nick Terrell [Wed, 10 Apr 2019 00:59:27 +0000 (17:59 -0700)] 
[libzstd] Fix ZSTD_decompressDCtx() with a dictionary

* `ZSTD_decompressDCtx()` did not use the dictionary loaded by
  `ZSTD_DCtx_loadDictionary()`.
* Add a unit test.
* A stacked diff uses `ZSTD_decompressDCtx()` in the
  `dictionary_round_trip` and `dictionary_decompress` fuzzers.

6 years ago[fuzzer] Sometimes fuzz with one less output byte
Nick Terrell [Tue, 9 Apr 2019 23:47:59 +0000 (16:47 -0700)] 
[fuzzer] Sometimes fuzz with one less output byte

Zstd compression sometimes does different stuff when it has at least
`ZSTD_compressBound()` output bytes, or not. Half of the time fuzz with
`ZSTD_compressBound() - 1` output bytes. Ensure that we have at least
one byte of overhead by disabling either the dictionary ID or checksum.

6 years ago[libzstd] Fix ZSTD_compress2() for multithreaded compression
Nick Terrell [Tue, 9 Apr 2019 23:24:17 +0000 (16:24 -0700)] 
[libzstd] Fix ZSTD_compress2() for multithreaded compression

`ZSTD_compress2()` wouldn't wait for multithreaded compression to
finish. We didn't find this because ZSTDMT will block when it can
compress all in one go, but it can't do that if it doesn't have enough
output space, or if `ZSTD_c_rsyncable` is enabled.

Since we will already sometimes block when using `ZSTD_e_end`, I've
changed `ZSTD_e_end` and `ZSTD_e_flush` to guarantee maximum forward
progress. This simplifies the API, and helps users avoid the easy bug
that was made in `ZSTD_compress2()`

* Found by the libfuzzer fuzzers.
* Added a test case that catches the problem.
* I will make the fuzzers sometimes allocate less than
  `ZSTD_compressBound()` output space.

6 years ago[fuzzer] Add dictionary fuzzers
Nick Terrell [Tue, 9 Apr 2019 04:07:28 +0000 (21:07 -0700)] 
[fuzzer] Add dictionary fuzzers

6 years ago[fuzzer] Fix stream_round_trip for the new options
Nick Terrell [Tue, 9 Apr 2019 04:06:19 +0000 (21:06 -0700)] 
[fuzzer] Fix stream_round_trip for the new options

6 years ago[fuzz] Use the new advanced API
Nick Terrell [Tue, 9 Apr 2019 03:01:38 +0000 (20:01 -0700)] 
[fuzz] Use the new advanced API

6 years ago[dictBuilder] Fix displayLevel for corpus warning
Nick Terrell [Tue, 9 Apr 2019 03:00:18 +0000 (20:00 -0700)] 
[dictBuilder] Fix displayLevel for corpus warning

Pass the displaylevel into the corpus warning, because it is used in
fast cover and cover, so it needs to respect the local level.

6 years ago[libzstd] Don't check the dictID in fuzzing mode
Nick Terrell [Tue, 9 Apr 2019 02:57:41 +0000 (19:57 -0700)] 
[libzstd] Don't check the dictID in fuzzing mode

When `FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION` is defined don't check
the dictID. This check makes the fuzzers job harder, and it is at the
very beginning.

6 years agoMerge pull request #1575 from terrelln/zstdmt
Nick Terrell [Mon, 8 Apr 2019 23:51:40 +0000 (16:51 -0700)] 
Merge pull request #1575 from terrelln/zstdmt

[libzstd] Remove ZSTDMT from the shared library

6 years agoRemove double the from README 1575/head
Nick Terrell [Mon, 8 Apr 2019 23:50:18 +0000 (16:50 -0700)] 
Remove double the from README

6 years ago[libzstd] Remove ZSTDMT from the shared object
Nick Terrell [Mon, 8 Apr 2019 01:47:52 +0000 (18:47 -0700)] 
[libzstd] Remove ZSTDMT from the shared object

* Remove ZSTDMT from the shared object by default.
* Provide a macro `ZSTD_LEGACY_MULTITHREADED_API` to override it.
* Document it in `lib/README.md`.

6 years agoMerge pull request #1574 from terrelln/examples
Nick Terrell [Sat, 6 Apr 2019 06:29:32 +0000 (23:29 -0700)] 
Merge pull request #1574 from terrelln/examples

Stabilize ZSTD_getDictID_*() functions and clean up examples

6 years ago[examples] Clean up and comment the examples 1574/head
Nick Terrell [Sat, 6 Apr 2019 01:11:17 +0000 (18:11 -0700)] 
[examples] Clean up and comment the examples

6 years ago[libzstd] Stabilize ZSTD_getDictID_*() functions
Nick Terrell [Sat, 6 Apr 2019 00:44:56 +0000 (17:44 -0700)] 
[libzstd] Stabilize ZSTD_getDictID_*() functions

6 years ago[libzstd] Fix return value docs for ZSTD_compressStream2()
Nick Terrell [Sat, 6 Apr 2019 00:44:07 +0000 (17:44 -0700)] 
[libzstd] Fix return value docs for ZSTD_compressStream2()

6 years agoMerge pull request #1573 from terrelln/regression
Nick Terrell [Fri, 5 Apr 2019 18:06:35 +0000 (11:06 -0700)] 
Merge pull request #1573 from terrelln/regression

[regression] Update results.csv for level 1 change

6 years agoMerge pull request #1569 from terrelln/stable
Nick Terrell [Fri, 5 Apr 2019 17:47:48 +0000 (10:47 -0700)] 
Merge pull request #1569 from terrelln/stable

Stabilize the advanced API

6 years ago[regression] Update results.csv for level 1 change 1573/head
Nick Terrell [Fri, 5 Apr 2019 17:46:22 +0000 (10:46 -0700)] 
[regression] Update results.csv for level 1 change

6 years ago[libzstd] Reword the streaming docs for the new API 1569/head
Nick Terrell [Thu, 4 Apr 2019 02:21:05 +0000 (19:21 -0700)] 
[libzstd] Reword the streaming docs for the new API

6 years agoMove the dictionary API and mark the legacy API
Nick Terrell [Thu, 4 Apr 2019 02:01:51 +0000 (19:01 -0700)] 
Move the dictionary API and mark the legacy API

* Move the dictionary API below the streaming API
* Mark the legacy streaming API as redundant

6 years agoStabilize advance API
Nick Terrell [Fri, 29 Mar 2019 01:04:32 +0000 (19:04 -0600)] 
Stabilize advance API

This commit moves the candidate advanced API to the stable section.
It makes some minor whitespace changes, but it doesn't change any
of the wording of the documentation.

I'll put up a separate PR that tweaks some of the documentation
once this lands, so that it is easier to review.

NOTE: Even though these functions are now in stable, they aren't
stable until the next release (in under 1 month). It is possible
that they change until then.

6 years ago[libzstd] Bump the library version to 1.4.0
Nick Terrell [Tue, 2 Apr 2019 01:43:32 +0000 (18:43 -0700)] 
[libzstd] Bump the library version to 1.4.0

Bumps the library version to 1.4.0 in preparation to stabilize the
advanced API.

6 years agoMerge pull request #1562 from terrelln/2fast
Nick Terrell [Thu, 4 Apr 2019 01:08:15 +0000 (18:08 -0700)] 
Merge pull request #1562 from terrelln/2fast

[libzstd] Speed up single segment zstd_fast by 5%

6 years agoMerge pull request #1567 from terrelln/examples2
Nick Terrell [Wed, 3 Apr 2019 18:27:49 +0000 (11:27 -0700)] 
Merge pull request #1567 from terrelln/examples2

[examples] Update streaming_decompression.c

6 years agoMerge pull request #1568 from terrelln/examples3
Yann Collet [Wed, 3 Apr 2019 16:07:13 +0000 (09:07 -0700)] 
Merge pull request #1568 from terrelln/examples3

Update streaming_memory_usage.c and fix ZSTD_estimateCStreamSize_usingCCtxParams()

6 years ago[examples] Update streaming_memory_usage.c 1568/head
Nick Terrell [Tue, 2 Apr 2019 01:05:49 +0000 (18:05 -0700)] 
[examples] Update streaming_memory_usage.c

Update to use the new streaming API. Making progress on Issue #1548.

Tested that the checks don't fail.
Tested with window log 9-32. The lowest and highest fail as expected.

6 years ago[libzstd] Setting ZSTD_d_maxWindowLog to 0 means default
Nick Terrell [Wed, 3 Apr 2019 02:20:52 +0000 (19:20 -0700)] 
[libzstd] Setting ZSTD_d_maxWindowLog to 0 means default

6 years ago[libzstd] Speed up single segment zstd_fast by 5% 1562/head
Nick Terrell [Fri, 29 Mar 2019 18:31:21 +0000 (12:31 -0600)] 
[libzstd] Speed up single segment zstd_fast by 5%

This PR is based on top of PR #1563.

The optimization is to process two input pointers per loop.
It is based on ideas from [igzip] level 1, and talking to @gbtucker.

| Platform                | Silesia     | Enwik8 |
|-------------------------|-------------|--------|
| OSX clang-10            | +5.3%       | +5.4%  |
| i9 5 GHz gcc-8          | +6.6%       | +6.6%  |
| i9 5 GHz clang-7        | +8.0%       | +8.0%  |
| Skylake 2.4 GHz gcc-4.8 | +6.3%       | +7.9%  |
| Skylake 2.4 GHz clang-7 | +6.2%       | +7.5%  |

Testing on all Silesia files on my Intel i9-9900k with gcc-8

| Silesia File | Ratio Change | Speed Change |
|--------------|--------------|--------------|
| silesia.tar  | +0.17%       | +6.6%        |
| dickens      | +0.25%       | +7.0%        |
| mozilla      | +0.02%       | +6.8%        |
| mr           | -0.30%       | +10.9%       |
| nci          | +1.28%       | +4.5%        |
| ooffice      | -0.35%       | +10.7%       |
| osdb         | +0.75%       | +9.8%        |
| reymont      | +0.65%       | +4.6%        |
| samba        | +0.70%       | +5.9%        |
| sao          | -0.01%       | +14.0%       |
| webster      | +0.30%       | +5.5%        |
| xml          | +0.92%       | +5.3%        |
| x-ray        | -0.00%       | +1.4%        |

Same tests on Calgary. For brevity, I've only included files
where compression ratio regressed or was much better.

| Calgary File | Ratio Change | Speed Change |
|--------------|--------------|--------------|
| calgary.tar  | +0.30%       | +7.1%        |
| geo          | -0.14%       | +25.0%       |
| obj1         | -0.46%       | +15.2%       |
| obj2         | -0.18%       | +6.0%        |
| pic          | +1.80%       | +9.3%        |
| trans        | -0.35%       | +5.5%        |

We gain 0.1% of compression ratio on Silesia.
We gain 0.3% of compression ratio on enwik8.
I also tested on the GitHub and hg-commands datasets without a dictionary,
and we gain a small amount of compression ratio on each, as well as speed.

I tested the negative compression levels on Silesia on my
Intel i9-9900k with gcc-8:

| Level | Ratio Change | Speed Change |
|-------|--------------|--------------|
| -1    | +0.13%       | +6.4%        |
| -2    | +4.6%        | -1.5%        |
| -3    | +7.5%        | -4.8%        |
| -4    | +8.5%        | -6.9%        |
| -5    | +9.1%        | -9.1%        |

Roughly, the negative levels now scale half as quickly. E.g. the new
level 16 is roughly equivalent to the old level 8, but a bit quicker
and smaller.  If you don't think this is the right trade off, we can
change it to multiply the step size by 2, instead of adding 1. I think
this makes sense, because it gives a bit slower ratio decay.

[igzip]: https://github.com/01org/isa-l/tree/master/igzip

6 years ago[examples] Update streaming_decompression.c 1567/head
Nick Terrell [Tue, 2 Apr 2019 00:25:26 +0000 (17:25 -0700)] 
[examples] Update streaming_decompression.c

Update to use the new streaming API. Making progress on Issue #1548.

Tested that it can decompress files produced by `streaming_compression`.
Tested that it can decompress two frames concatenated together.
Tested that it fails on corrupted data.

6 years agoMerge pull request #1566 from terrelln/examples
Nick Terrell [Wed, 3 Apr 2019 00:13:10 +0000 (17:13 -0700)] 
Merge pull request #1566 from terrelln/examples

[examples] Update multiple_streaming_compression.c

6 years agoFix ZSTD_estimateCStreamSize_usingCCtxParams()
Nick Terrell [Tue, 2 Apr 2019 00:51:28 +0000 (17:51 -0700)] 
Fix ZSTD_estimateCStreamSize_usingCCtxParams()

It wasn't using the ZSTD_CCtx_params correctly. It must actualize
the compression parameters by calling ZSTD_getCParamsFromCCtxParams()
to get the real window log.

Tested by updating the streaming memory usage example in the next
commit. The CHECK() failed before this patch, and passes after.

I also added a unit test to zstreamtest.c that failed before this
patch, and passes after.

6 years agoFix indentation 1566/head
Nick Terrell [Tue, 2 Apr 2019 00:33:49 +0000 (17:33 -0700)] 
Fix indentation

6 years ago[examples] Update multiple_streaming_compression.c
Nick Terrell [Mon, 1 Apr 2019 23:41:06 +0000 (16:41 -0700)] 
[examples] Update multiple_streaming_compression.c

Update to use the new streaming API. Making progress on Issue #1548.

Tested that multiple files could be compressed, and that the output
is the same as calling `streaming_compression` multiple times with
the same compression level, and that it can be decompressed.

6 years agoMerge pull request #1563 from terrelln/dms-sep
Nick Terrell [Fri, 29 Mar 2019 22:19:21 +0000 (16:19 -0600)] 
Merge pull request #1563 from terrelln/dms-sep

[libzstd] Split out zstd_fast dict match state function

6 years agoSplit out zstd_fast dict match state function 1563/head
Nick Terrell [Fri, 29 Mar 2019 16:39:16 +0000 (10:39 -0600)] 
Split out zstd_fast dict match state function

6 years agoMerge pull request #1561 from shakeelrao/fix-typo
Nick Terrell [Fri, 29 Mar 2019 05:42:16 +0000 (23:42 -0600)] 
Merge pull request #1561 from shakeelrao/fix-typo

Update comments in zstd.h and fileio.c

6 years agofix srcSize typo and add new UTIL func to comment 1561/head
shakeelrao [Fri, 29 Mar 2019 00:50:34 +0000 (17:50 -0700)] 
fix srcSize typo and add new UTIL func to comment

6 years agoMerge pull request #1556 from terrelln/dictbuilder
Nick Terrell [Mon, 25 Mar 2019 22:08:32 +0000 (15:08 -0700)] 
Merge pull request #1556 from terrelln/dictbuilder

[cover] Improvements for small or homogeneous data

6 years agoMerge pull request #1557 from terrelln/examples
Nick Terrell [Mon, 25 Mar 2019 22:07:35 +0000 (15:07 -0700)] 
Merge pull request #1557 from terrelln/examples

[examples] Update streaming_compression to the new API

6 years agoMerge pull request #1559 from shakeelrao/reject-dict
Nick Terrell [Mon, 25 Mar 2019 22:06:58 +0000 (15:06 -0700)] 
Merge pull request #1559 from shakeelrao/reject-dict

[CLI] ensure dictionary and input file are different

6 years agoAdd whitespace to test case 1559/head
shakeelrao [Sun, 24 Mar 2019 10:42:11 +0000 (03:42 -0700)] 
Add whitespace to test case

6 years agoRename test
shakeelrao [Sun, 24 Mar 2019 10:40:03 +0000 (03:40 -0700)] 
Rename test

6 years agoAdd CLI test to validate error
shakeelrao [Sun, 24 Mar 2019 07:47:13 +0000 (00:47 -0700)] 
Add CLI test to validate error

6 years agoAdd NULL check for dict
shakeelrao [Sun, 24 Mar 2019 07:23:50 +0000 (00:23 -0700)] 
Add NULL check for dict

6 years agoModify error msg
shakeelrao [Sun, 24 Mar 2019 04:59:30 +0000 (21:59 -0700)] 
Modify error msg

6 years agoImplement file check
shakeelrao [Sun, 24 Mar 2019 04:53:13 +0000 (21:53 -0700)] 
Implement file check

6 years agoExtract file comparison into utility func
shakeelrao [Sun, 24 Mar 2019 02:04:56 +0000 (19:04 -0700)] 
Extract file comparison into utility func

6 years ago[examples] Update streaming_compression to the new API 1557/head
Nick Terrell [Fri, 22 Mar 2019 21:57:23 +0000 (14:57 -0700)] 
[examples] Update streaming_compression to the new API

6 years agoMerge pull request #1558 from nehaljwani/fix-version-soversion-libzstd
Nick Terrell [Sat, 23 Mar 2019 20:32:39 +0000 (13:32 -0700)] 
Merge pull request #1558 from nehaljwani/fix-version-soversion-libzstd

[libzstd] Specify soversion and version corectly for CMake build

6 years ago[libzstd] Specify soversion and version correctly for CMake build 1558/head
Nehal J Wani [Sat, 23 Mar 2019 12:03:25 +0000 (17:33 +0530)] 
[libzstd] Specify soversion and version correctly for CMake build

Fixes #1512

6 years ago[cover] Improvements for small or homogeneous data 1556/head
Nick Terrell [Fri, 22 Mar 2019 19:28:55 +0000 (12:28 -0700)] 
[cover] Improvements for small or homogeneous data

* The algorithm would bail as soon as it found one epoch that
  contained no new segments. Change it so it now has to fail
  >= 10 times in a row (10 for fastcover, 10-100 for cover).
* The algorithm uses the `maxDict` size to decide the epoch size.
  When this size is absurdly large, it causes tiny epochs. Lower
  bound the epoch size at 10x the segment size, and warn the user
  that their training set is too small.

Fixes #1554

6 years agoMerge pull request #1555 from terrelln/load-dict
Nick Terrell [Fri, 22 Mar 2019 00:52:57 +0000 (17:52 -0700)] 
Merge pull request #1555 from terrelln/load-dict

[lib] Allow ZSTD_CCtx_loadDictionary() to be called before parameters are set

6 years ago[lib] Allow ZSTD_CCtx_loadDictionary() to be called before parameters are set 1555/head
Nick Terrell [Thu, 21 Mar 2019 22:17:41 +0000 (15:17 -0700)] 
[lib] Allow ZSTD_CCtx_loadDictionary() to be called before parameters are set

* After loading a dictionary only create the cdict once we've started the
  compression job. This allows the user to pass the dictionary before they
  set other settings, and is in line with the rest of the API.
* Add tests that mix the 3 dictionary loading APIs.
* Add extra tests for `ZSTD_CCtx_loadDictionary()`.
* The first 2 tests added fail before this patch.
* Run the regression test suite.

6 years agoMerge pull request #1551 from terrelln/stream-wrap
Nick Terrell [Thu, 21 Mar 2019 23:10:00 +0000 (16:10 -0700)] 
Merge pull request #1551 from terrelln/stream-wrap

Refactor old stream API to completely wrap the advanced API

6 years agoUpdate documentation to tell how to replace the old streaming API with the new one. 1551/head
Nick Terrell [Sat, 16 Mar 2019 01:03:31 +0000 (18:03 -0700)] 
Update documentation to tell how to replace the old streaming API with the new one.

6 years agoWrap the new advanced api completely
Nick Terrell [Wed, 13 Mar 2019 21:05:18 +0000 (14:05 -0700)] 
Wrap the new advanced api completely

6 years ago[regression] Add more streaming tests
Nick Terrell [Thu, 21 Mar 2019 04:20:14 +0000 (21:20 -0700)] 
[regression] Add more streaming tests

* Test all of the `ZSTD_initCStream*()` variants.
* Fix a typo in the zstdcli method.

6 years agoMerge pull request #1553 from shakeelrao/legacy-bound
Nick Terrell [Tue, 19 Mar 2019 17:53:12 +0000 (10:53 -0700)] 
Merge pull request #1553 from shakeelrao/legacy-bound

Add legacy support to decompressBound

6 years agoFix typo in legacy documentation 1553/head
shakeelrao [Tue, 19 Mar 2019 08:44:08 +0000 (01:44 -0700)] 
Fix typo in legacy documentation

6 years agoRemove extraneous spacing in comments
shakeelrao [Tue, 19 Mar 2019 04:05:35 +0000 (21:05 -0700)] 
Remove extraneous spacing in comments

6 years agoAdd legacy mode in documentation
shakeelrao [Tue, 19 Mar 2019 03:33:15 +0000 (20:33 -0700)] 
Add legacy mode in documentation

6 years agoStylistic changes
shakeelrao [Mon, 18 Mar 2019 02:35:43 +0000 (19:35 -0700)] 
Stylistic changes

6 years agoUpdate documentation for ZSTD_frameSizeInfo
shakeelrao [Mon, 18 Mar 2019 00:41:27 +0000 (17:41 -0700)] 
Update documentation for ZSTD_frameSizeInfo

6 years agoTest new ZSTD_findFrameCompressedSize and update documentation
shakeelrao [Sat, 16 Mar 2019 01:04:19 +0000 (18:04 -0700)] 
Test new ZSTD_findFrameCompressedSize and update documentation

6 years agoReorder declaration in ZSTD_findFrameSizeInfoLegacy
shakeelrao [Fri, 15 Mar 2019 23:20:34 +0000 (16:20 -0700)] 
Reorder declaration in ZSTD_findFrameSizeInfoLegacy

6 years agoAdd legacy support to decompressBound
shakeelrao [Fri, 15 Mar 2019 23:10:37 +0000 (16:10 -0700)] 
Add legacy support to decompressBound

6 years agoMerge pull request #1547 from shakeelrao/fix-error
Nick Terrell [Fri, 15 Mar 2019 17:57:49 +0000 (10:57 -0700)] 
Merge pull request #1547 from shakeelrao/fix-error

Fix incorrect error code in ZSTD_errorFrameSizeInfo

6 years agoAdd static linking to legacy tests 1547/head
shakeelrao [Fri, 15 Mar 2019 12:13:55 +0000 (05:13 -0700)] 
Add static linking to legacy tests

6 years agoAdd test to validate patch
shakeelrao [Fri, 15 Mar 2019 10:59:03 +0000 (03:59 -0700)] 
Add test to validate patch

6 years agoMerge pull request #1550 from terrelln/cparams-cdict
Nick Terrell [Thu, 14 Mar 2019 02:17:22 +0000 (19:17 -0700)] 
Merge pull request #1550 from terrelln/cparams-cdict

[libzstd] Allow compression parameters to be set with a cdict

6 years ago[zstreamtest] Remove outdated test 1550/head
Nick Terrell [Thu, 14 Mar 2019 00:01:23 +0000 (17:01 -0700)] 
[zstreamtest] Remove outdated test

6 years ago[libzstd] Allow compression parameters to be set with a cdict
Nick Terrell [Wed, 13 Mar 2019 22:23:24 +0000 (15:23 -0700)] 
[libzstd] Allow compression parameters to be set with a cdict

The order you set parameters in the advanced API is not supposed to matter.
However, once you call `ZSTD_CCtx_refCDict()` the compression parameters
cannot be changed. Remove that restriction, and document what parameters
are used when using a CDict.

If the CCtx is in dictionary mode, then the CDict's parameters are used.
If the CCtx is not in dictionary mode, then its requested parameters are
used.

6 years agoMerge pull request #1549 from terrelln/ref-cdict-free
Nick Terrell [Wed, 13 Mar 2019 23:08:54 +0000 (16:08 -0700)] 
Merge pull request #1549 from terrelln/ref-cdict-free

[libzstd] Free local cdict when referencing cdict

6 years ago[libzstd] Free local cdict when referencing cdict 1549/head
Nick Terrell [Wed, 13 Mar 2019 21:54:31 +0000 (14:54 -0700)] 
[libzstd] Free local cdict when referencing cdict

We no longer care about the `cdictLocal` after calling
`ZSTD_CCtx_refCDict()`, so we should free it to save some
memory.

6 years agoAdd unit test to validate the error case
shakeelrao [Wed, 13 Mar 2019 08:43:40 +0000 (01:43 -0700)] 
Add unit test to validate the error case

6 years agoFix incorrectly assigned value in ZSTD_errorFrameSizeInfo
shakeelrao [Wed, 13 Mar 2019 08:23:07 +0000 (01:23 -0700)] 
Fix incorrectly assigned value in ZSTD_errorFrameSizeInfo

As documented in `zstd.h`, ZSTD_decompressBound returns `ZSTD_CONTENTSIZE_ERROR`
if an error occurs (not `ZSTD_CONTENTSIZE_UNKNOWN`). This is consistent with
the error checking made in ZSTD_decompressBound, particularly line 545.

6 years agoMerge pull request #1543 from shakeelrao/dev
Nick Terrell [Mon, 4 Mar 2019 16:00:47 +0000 (08:00 -0800)] 
Merge pull request #1543 from shakeelrao/dev

Provide a function to estimate decompressed size.

6 years agoupdate documentation for decompressBound 1543/head
shakeelrao [Sun, 3 Mar 2019 01:56:10 +0000 (17:56 -0800)] 
update documentation for decompressBound

6 years agoupdate formatting
shakeelrao [Sat, 2 Mar 2019 07:11:15 +0000 (23:11 -0800)] 
update formatting

6 years agoadd missing size content test
shakeelrao [Sat, 2 Mar 2019 05:27:30 +0000 (21:27 -0800)] 
add missing size content test

6 years agoadd stylistic changes
shakeelrao [Sat, 2 Mar 2019 02:29:35 +0000 (18:29 -0800)] 
add stylistic changes

6 years agoupdate missing error case to CONTENTSIZE_ERROR
shakeelrao [Fri, 1 Mar 2019 08:12:16 +0000 (00:12 -0800)] 
update missing error case to CONTENTSIZE_ERROR

6 years agochange nbBlocks to size_t for consistency
shakeelrao [Fri, 1 Mar 2019 08:05:59 +0000 (00:05 -0800)] 
change nbBlocks to size_t for consistency

6 years agochange compressedBound to ULL
shakeelrao [Fri, 1 Mar 2019 08:03:50 +0000 (00:03 -0800)] 
change compressedBound to ULL

6 years agoimplement API-level changes
shakeelrao [Fri, 1 Mar 2019 06:55:18 +0000 (22:55 -0800)] 
implement API-level changes

6 years agoMerge pull request #1541 from terrelln/fuzz
Nick Terrell [Thu, 28 Feb 2019 19:25:27 +0000 (11:25 -0800)] 
Merge pull request #1541 from terrelln/fuzz

[fuzz] Add --enable-fuzzer for clang fuzzing

6 years agoinitialize local vars in decompressBound
shakeelrao [Thu, 28 Feb 2019 11:01:21 +0000 (03:01 -0800)] 
initialize local vars in decompressBound

6 years agoswitch frameBound type to ULL
shakeelrao [Thu, 28 Feb 2019 10:10:17 +0000 (02:10 -0800)] 
switch frameBound type to ULL

6 years agochange return type to ULL
shakeelrao [Thu, 28 Feb 2019 09:52:01 +0000 (01:52 -0800)] 
change return type to ULL

6 years agoRemove autogenerated test file
shakeelrao [Thu, 28 Feb 2019 09:28:29 +0000 (01:28 -0800)] 
Remove autogenerated test file

6 years agoFix decl-after-stmnt build error
shakeelrao [Thu, 28 Feb 2019 09:24:54 +0000 (01:24 -0800)] 
Fix decl-after-stmnt build error

6 years agoProvide an API function to estimate decompressed size.
shakeelrao [Thu, 28 Feb 2019 08:42:49 +0000 (00:42 -0800)] 
Provide an API function to estimate decompressed size.

Introduces a new utility function `ZSTD_findFrameCompressedSize_internal` which
is equivalent to `ZSTD_findFrameCompressSize`, but accepts an additional output
parameter `bound` that computes an upper-bound for the compressed data in the frame.

The new API function is named `ZSTD_decompressBound` to be consistent with
`zstd_compressBound` (the inverse operation). Clients will now be able to compute an upper-bound for
their compressed payloads instead of guessing a large size.

Implements https://github.com/facebook/zstd/issues/1536.

6 years ago[fuzz] Add --enable-fuzzer for clang fuzzing 1541/head
Nick Terrell [Thu, 28 Feb 2019 01:15:27 +0000 (17:15 -0800)] 
[fuzz] Add --enable-fuzzer for clang fuzzing