]> git.ipfire.org Git - thirdparty/zstd.git/commit
Approximate FSE encoding costs for selection
authorNick Terrell <terrelln@fb.com>
Mon, 16 Apr 2018 22:37:27 +0000 (15:37 -0700)
committerNick Terrell <terrelln@fb.com>
Tue, 22 May 2018 21:33:22 +0000 (14:33 -0700)
commit49cf880513c124e1116f80f4ca0c860ffe937151
tree6619a5498d7126b48c1342c8f814ab32633bff01
parent27af35c110c3e01b9a3c0b6de03368d480eb0a29
Approximate FSE encoding costs for selection

Estimate the cost for using FSE modes `set_basic`, `set_compressed`, and
`set_repeat`, and select the one with the lowest cost.

* The cost of `set_basic` is computed using the cross-entropy cost
  function `ZSTD_crossEntropyCost()`, using the normalized default count
  and the count.
* The cost of `set_repeat` is computed using `FSE_bitCost()`. We check the
  previous table to see if it is able to represent the distribution.
* The cost of `set_compressed` is computed with the entropy cost function
  `ZSTD_entropyCost()`, together with the cost of writing the normalized
  count `ZSTD_NCountCost()`.
lib/common/fse.h
lib/compress/zstd_compress.c
lib/compress/zstd_compress_internal.h