koffi 2.3.6-beta.6 → 2.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +2 -2
- package/src/cnoke/cnoke.js +3 -7
- package/src/cnoke/src/builder.js +9 -6
- package/src/cnoke/src/index.js +2 -2
- package/src/koffi/build/2.3.7/koffi_darwin_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_darwin_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_freebsd_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_freebsd_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_freebsd_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_linux_arm32hf/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_linux_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_linux_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_linux_riscv64hf64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_linux_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_openbsd_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_openbsd_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_win32_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_win32_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_win32_x64/koffi.node +0 -0
- package/src/koffi/src/ffi.cc +2 -2
- package/src/koffi/src/index.d.ts +2 -2
- package/src/koffi/src/index.js +1 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_darwin_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_darwin_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_freebsd_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_freebsd_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_freebsd_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_linux_arm32hf/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_linux_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_linux_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_linux_riscv64hf64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_linux_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_openbsd_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_openbsd_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_arm64/koffi.pdb +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_ia32/koffi.pdb +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_x64/koffi.pdb +0 -0
- package/vendor/brotli/BUILD +0 -144
- package/vendor/brotli/CMakeLists.txt +0 -421
- package/vendor/brotli/CONTRIBUTING.md +0 -27
- package/vendor/brotli/LICENSE +0 -19
- package/vendor/brotli/MANIFEST.in +0 -17
- package/vendor/brotli/Makefile +0 -55
- package/vendor/brotli/Makefile.am +0 -38
- package/vendor/brotli/README +0 -15
- package/vendor/brotli/README.md +0 -104
- package/vendor/brotli/WORKSPACE +0 -21
- package/vendor/brotli/bootstrap +0 -35
- package/vendor/brotli/c/common/constants.c +0 -15
- package/vendor/brotli/c/common/constants.h +0 -200
- package/vendor/brotli/c/common/context.c +0 -156
- package/vendor/brotli/c/common/context.h +0 -113
- package/vendor/brotli/c/common/dictionary.c +0 -5914
- package/vendor/brotli/c/common/dictionary.h +0 -64
- package/vendor/brotli/c/common/platform.c +0 -22
- package/vendor/brotli/c/common/platform.h +0 -596
- package/vendor/brotli/c/common/transform.c +0 -291
- package/vendor/brotli/c/common/transform.h +0 -85
- package/vendor/brotli/c/common/version.h +0 -26
- package/vendor/brotli/c/dec/bit_reader.c +0 -76
- package/vendor/brotli/c/dec/bit_reader.h +0 -351
- package/vendor/brotli/c/dec/decode.c +0 -2608
- package/vendor/brotli/c/dec/huffman.c +0 -339
- package/vendor/brotli/c/dec/huffman.h +0 -121
- package/vendor/brotli/c/dec/prefix.h +0 -732
- package/vendor/brotli/c/dec/state.c +0 -159
- package/vendor/brotli/c/dec/state.h +0 -365
- package/vendor/brotli/c/enc/backward_references.c +0 -145
- package/vendor/brotli/c/enc/backward_references.h +0 -39
- package/vendor/brotli/c/enc/backward_references_hq.c +0 -843
- package/vendor/brotli/c/enc/backward_references_hq.h +0 -95
- package/vendor/brotli/c/enc/backward_references_inc.h +0 -163
- package/vendor/brotli/c/enc/bit_cost.c +0 -35
- package/vendor/brotli/c/enc/bit_cost.h +0 -63
- package/vendor/brotli/c/enc/bit_cost_inc.h +0 -127
- package/vendor/brotli/c/enc/block_encoder_inc.h +0 -34
- package/vendor/brotli/c/enc/block_splitter.c +0 -194
- package/vendor/brotli/c/enc/block_splitter.h +0 -51
- package/vendor/brotli/c/enc/block_splitter_inc.h +0 -440
- package/vendor/brotli/c/enc/brotli_bit_stream.c +0 -1314
- package/vendor/brotli/c/enc/brotli_bit_stream.h +0 -84
- package/vendor/brotli/c/enc/cluster.c +0 -56
- package/vendor/brotli/c/enc/cluster.h +0 -48
- package/vendor/brotli/c/enc/cluster_inc.h +0 -320
- package/vendor/brotli/c/enc/command.c +0 -28
- package/vendor/brotli/c/enc/command.h +0 -190
- package/vendor/brotli/c/enc/compress_fragment.c +0 -790
- package/vendor/brotli/c/enc/compress_fragment.h +0 -61
- package/vendor/brotli/c/enc/compress_fragment_two_pass.c +0 -645
- package/vendor/brotli/c/enc/compress_fragment_two_pass.h +0 -54
- package/vendor/brotli/c/enc/dictionary_hash.c +0 -1846
- package/vendor/brotli/c/enc/dictionary_hash.h +0 -25
- package/vendor/brotli/c/enc/encode.c +0 -1927
- package/vendor/brotli/c/enc/encoder_dict.c +0 -33
- package/vendor/brotli/c/enc/encoder_dict.h +0 -43
- package/vendor/brotli/c/enc/entropy_encode.c +0 -503
- package/vendor/brotli/c/enc/entropy_encode.h +0 -122
- package/vendor/brotli/c/enc/entropy_encode_static.h +0 -539
- package/vendor/brotli/c/enc/fast_log.c +0 -105
- package/vendor/brotli/c/enc/fast_log.h +0 -66
- package/vendor/brotli/c/enc/find_match_length.h +0 -79
- package/vendor/brotli/c/enc/hash.h +0 -488
- package/vendor/brotli/c/enc/hash_composite_inc.h +0 -125
- package/vendor/brotli/c/enc/hash_forgetful_chain_inc.h +0 -293
- package/vendor/brotli/c/enc/hash_longest_match64_inc.h +0 -267
- package/vendor/brotli/c/enc/hash_longest_match_inc.h +0 -262
- package/vendor/brotli/c/enc/hash_longest_match_quickly_inc.h +0 -266
- package/vendor/brotli/c/enc/hash_rolling_inc.h +0 -212
- package/vendor/brotli/c/enc/hash_to_binary_tree_inc.h +0 -329
- package/vendor/brotli/c/enc/histogram.c +0 -100
- package/vendor/brotli/c/enc/histogram.h +0 -63
- package/vendor/brotli/c/enc/histogram_inc.h +0 -51
- package/vendor/brotli/c/enc/literal_cost.c +0 -175
- package/vendor/brotli/c/enc/literal_cost.h +0 -30
- package/vendor/brotli/c/enc/memory.c +0 -170
- package/vendor/brotli/c/enc/memory.h +0 -114
- package/vendor/brotli/c/enc/metablock.c +0 -663
- package/vendor/brotli/c/enc/metablock.h +0 -105
- package/vendor/brotli/c/enc/metablock_inc.h +0 -183
- package/vendor/brotli/c/enc/params.h +0 -46
- package/vendor/brotli/c/enc/prefix.h +0 -53
- package/vendor/brotli/c/enc/quality.h +0 -165
- package/vendor/brotli/c/enc/ringbuffer.h +0 -167
- package/vendor/brotli/c/enc/static_dict.c +0 -486
- package/vendor/brotli/c/enc/static_dict.h +0 -40
- package/vendor/brotli/c/enc/static_dict_lut.h +0 -5864
- package/vendor/brotli/c/enc/utf8_util.c +0 -85
- package/vendor/brotli/c/enc/utf8_util.h +0 -32
- package/vendor/brotli/c/enc/write_bits.h +0 -87
- package/vendor/brotli/c/include/brotli/decode.h +0 -344
- package/vendor/brotli/c/include/brotli/encode.h +0 -448
- package/vendor/brotli/c/include/brotli/port.h +0 -288
- package/vendor/brotli/c/include/brotli/types.h +0 -83
- package/vendor/brotli/c/tools/brotli.c +0 -1116
- package/vendor/brotli/c/tools/brotli.md +0 -107
- package/vendor/brotli/compiler_config_setting.bzl +0 -28
- package/vendor/brotli/configure +0 -8
- package/vendor/brotli/configure-cmake +0 -318
- package/vendor/brotli/configure.ac +0 -14
- package/vendor/brotli/docs/brotli.1 +0 -132
- package/vendor/brotli/docs/constants.h.3 +0 -47
- package/vendor/brotli/docs/decode.h.3 +0 -415
- package/vendor/brotli/docs/encode.h.3 +0 -586
- package/vendor/brotli/docs/types.h.3 +0 -117
- package/vendor/brotli/premake5.lua +0 -78
- package/vendor/brotli/python/Makefile +0 -57
- package/vendor/brotli/python/README.md +0 -54
- package/vendor/brotli/python/_brotli.cc +0 -753
- package/vendor/brotli/python/bro.py +0 -160
- package/vendor/brotli/python/brotli.py +0 -56
- package/vendor/brotli/python/tests/__init__.py +0 -0
- package/vendor/brotli/python/tests/_test_utils.py +0 -112
- package/vendor/brotli/python/tests/bro_test.py +0 -102
- package/vendor/brotli/python/tests/compress_test.py +0 -41
- package/vendor/brotli/python/tests/compressor_test.py +0 -94
- package/vendor/brotli/python/tests/decompress_test.py +0 -42
- package/vendor/brotli/python/tests/decompressor_test.py +0 -59
- package/vendor/brotli/scripts/libbrotlicommon.pc.in +0 -11
- package/vendor/brotli/scripts/libbrotlidec.pc.in +0 -12
- package/vendor/brotli/scripts/libbrotlienc.pc.in +0 -12
- package/vendor/brotli/scripts/sources.lst +0 -104
- package/vendor/brotli/setup.cfg +0 -5
- package/vendor/brotli/setup.py +0 -293
- package/vendor/brotli/tests/Makefile +0 -17
- package/vendor/brotli/tests/compatibility_test.sh +0 -25
- package/vendor/brotli/tests/roundtrip_test.sh +0 -36
- package/vendor/brotli/tests/run-compatibility-test.cmake +0 -31
- package/vendor/brotli/tests/run-roundtrip-test.cmake +0 -36
- package/vendor/brotli/tests/testdata/empty +0 -0
- package/vendor/brotli/tests/testdata/empty.compressed +0 -1
- package/vendor/brotli/tests/testdata/ukkonooa +0 -1
- package/vendor/brotli/tests/testdata/ukkonooa.compressed +0 -0
- package/vendor/dragonbox/CMakeLists.txt +0 -123
- package/vendor/dragonbox/LICENSE-Apache2-LLVM +0 -218
- package/vendor/dragonbox/LICENSE-Boost +0 -23
- package/vendor/dragonbox/README.md +0 -277
- package/vendor/dragonbox/cmake/dragonboxConfig.cmake +0 -1
- package/vendor/dragonbox/include/dragonbox/dragonbox.h +0 -2674
- package/vendor/dragonbox/include/dragonbox/dragonbox_to_chars.h +0 -108
- package/vendor/dragonbox/other_files/Dragonbox.pdf +0 -0
- package/vendor/dragonbox/other_files/Dragonbox_old.pdf +0 -0
- package/vendor/dragonbox/other_files/milo_benchmark.png +0 -0
- package/vendor/dragonbox/other_files/unknown_win64_vc2019.html +0 -540
- package/vendor/dragonbox/other_files/unknown_win64_vc2019_randomdigit_time.png +0 -0
- package/vendor/dragonbox/source/dragonbox_to_chars.cpp +0 -303
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/CMakeLists.txt +0 -24
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.cpp +0 -238
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.h +0 -95
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/grisu_exact.h +0 -2666
- package/vendor/dragonbox/subproject/3rdparty/ryu/CMakeLists.txt +0 -16
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/common.h +0 -114
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s.c +0 -509
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_full_table.h +0 -367
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_intrinsics.h +0 -357
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/digit_table.h +0 -35
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s.c +0 -345
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_full_table.h +0 -55
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_intrinsics.h +0 -128
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/ryu.h +0 -46
- package/vendor/dragonbox/subproject/3rdparty/schubfach/CMakeLists.txt +0 -22
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.cc +0 -699
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.h +0 -31
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.cc +0 -1354
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.h +0 -31
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/example_shaded_plots.m +0 -68
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/license.txt +0 -25
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution.m +0 -92
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution_prctile.m +0 -121
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_histogram_shaded.m +0 -99
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_shaded.m +0 -93
- package/vendor/dragonbox/subproject/benchmark/CMakeLists.txt +0 -65
- package/vendor/dragonbox/subproject/benchmark/include/benchmark.h +0 -40
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_benchmarks.m +0 -22
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_digit_benchmark.m +0 -78
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_uniform_benchmark.m +0 -95
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/source/benchmark.cpp +0 -238
- package/vendor/dragonbox/subproject/benchmark/source/dragonbox.cpp +0 -30
- package/vendor/dragonbox/subproject/benchmark/source/grisu_exact.cpp +0 -36
- package/vendor/dragonbox/subproject/benchmark/source/ryu.cpp +0 -27
- package/vendor/dragonbox/subproject/benchmark/source/schubfach.cpp +0 -31
- package/vendor/dragonbox/subproject/common/CMakeLists.txt +0 -42
- package/vendor/dragonbox/subproject/common/include/best_rational_approx.h +0 -97
- package/vendor/dragonbox/subproject/common/include/big_uint.h +0 -218
- package/vendor/dragonbox/subproject/common/include/continued_fractions.h +0 -174
- package/vendor/dragonbox/subproject/common/include/good_rational_approx.h +0 -267
- package/vendor/dragonbox/subproject/common/include/random_float.h +0 -182
- package/vendor/dragonbox/subproject/common/include/rational_continued_fractions.h +0 -57
- package/vendor/dragonbox/subproject/common/source/big_uint.cpp +0 -602
- package/vendor/dragonbox/subproject/meta/CMakeLists.txt +0 -41
- package/vendor/dragonbox/subproject/meta/results/binary32_generated_cache.txt +0 -82
- package/vendor/dragonbox/subproject/meta/results/binary64_compressed_cache_error_table.txt +0 -10
- package/vendor/dragonbox/subproject/meta/results/binary64_generated_cache.txt +0 -623
- package/vendor/dragonbox/subproject/meta/source/generate_cache.cpp +0 -126
- package/vendor/dragonbox/subproject/meta/source/live_test.cpp +0 -81
- package/vendor/dragonbox/subproject/meta/source/perf_test.cpp +0 -104
- package/vendor/dragonbox/subproject/meta/source/sandbox.cpp +0 -20
- package/vendor/dragonbox/subproject/test/CMakeLists.txt +0 -70
- package/vendor/dragonbox/subproject/test/results/binary32.csv +0 -255
- package/vendor/dragonbox/subproject/test/results/binary64.csv +0 -2047
- package/vendor/dragonbox/subproject/test/results/plot_required_bits.m +0 -18
- package/vendor/dragonbox/subproject/test/source/test_all_shorter_interval_cases.cpp +0 -88
- package/vendor/dragonbox/subproject/test/source/uniform_random_test.cpp +0 -95
- package/vendor/dragonbox/subproject/test/source/verify_cache_precision.cpp +0 -338
- package/vendor/dragonbox/subproject/test/source/verify_compressed_cache.cpp +0 -154
- package/vendor/dragonbox/subproject/test/source/verify_fast_multiplication.cpp +0 -168
- package/vendor/dragonbox/subproject/test/source/verify_log_computation.cpp +0 -251
- package/vendor/dragonbox/subproject/test/source/verify_magic_division.cpp +0 -113
- package/vendor/miniz/ChangeLog.md +0 -239
- package/vendor/miniz/LICENSE +0 -22
- package/vendor/miniz/examples/example1.c +0 -105
- package/vendor/miniz/examples/example2.c +0 -164
- package/vendor/miniz/examples/example3.c +0 -269
- package/vendor/miniz/examples/example4.c +0 -102
- package/vendor/miniz/examples/example5.c +0 -327
- package/vendor/miniz/examples/example6.c +0 -166
- package/vendor/miniz/miniz.c +0 -7835
- package/vendor/miniz/miniz.h +0 -1422
- package/vendor/miniz/readme.md +0 -46
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_arm64/koffi.exp +0 -0
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_arm64/koffi.lib +0 -0
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_ia32/koffi.exp +0 -0
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_ia32/koffi.lib +0 -0
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_x64/koffi.exp +0 -0
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_x64/koffi.lib +0 -0
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
/* Copyright 2013 Google Inc. All Rights Reserved.
|
|
2
|
-
|
|
3
|
-
Distributed under MIT license.
|
|
4
|
-
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/* This class models a sequence of literals and a backward reference copy. */
|
|
8
|
-
|
|
9
|
-
#ifndef BROTLI_ENC_COMMAND_H_
|
|
10
|
-
#define BROTLI_ENC_COMMAND_H_
|
|
11
|
-
|
|
12
|
-
#include "../common/constants.h"
|
|
13
|
-
#include "../common/platform.h"
|
|
14
|
-
#include <brotli/types.h>
|
|
15
|
-
#include "./fast_log.h"
|
|
16
|
-
#include "./params.h"
|
|
17
|
-
#include "./prefix.h"
|
|
18
|
-
|
|
19
|
-
#if defined(__cplusplus) || defined(c_plusplus)
|
|
20
|
-
extern "C" {
|
|
21
|
-
#endif
|
|
22
|
-
|
|
23
|
-
BROTLI_INTERNAL extern const uint32_t
|
|
24
|
-
kBrotliInsBase[BROTLI_NUM_INS_COPY_CODES];
|
|
25
|
-
BROTLI_INTERNAL extern const uint32_t
|
|
26
|
-
kBrotliInsExtra[BROTLI_NUM_INS_COPY_CODES];
|
|
27
|
-
BROTLI_INTERNAL extern const uint32_t
|
|
28
|
-
kBrotliCopyBase[BROTLI_NUM_INS_COPY_CODES];
|
|
29
|
-
BROTLI_INTERNAL extern const uint32_t
|
|
30
|
-
kBrotliCopyExtra[BROTLI_NUM_INS_COPY_CODES];
|
|
31
|
-
|
|
32
|
-
static BROTLI_INLINE uint16_t GetInsertLengthCode(size_t insertlen) {
|
|
33
|
-
if (insertlen < 6) {
|
|
34
|
-
return (uint16_t)insertlen;
|
|
35
|
-
} else if (insertlen < 130) {
|
|
36
|
-
uint32_t nbits = Log2FloorNonZero(insertlen - 2) - 1u;
|
|
37
|
-
return (uint16_t)((nbits << 1) + ((insertlen - 2) >> nbits) + 2);
|
|
38
|
-
} else if (insertlen < 2114) {
|
|
39
|
-
return (uint16_t)(Log2FloorNonZero(insertlen - 66) + 10);
|
|
40
|
-
} else if (insertlen < 6210) {
|
|
41
|
-
return 21u;
|
|
42
|
-
} else if (insertlen < 22594) {
|
|
43
|
-
return 22u;
|
|
44
|
-
} else {
|
|
45
|
-
return 23u;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
static BROTLI_INLINE uint16_t GetCopyLengthCode(size_t copylen) {
|
|
50
|
-
if (copylen < 10) {
|
|
51
|
-
return (uint16_t)(copylen - 2);
|
|
52
|
-
} else if (copylen < 134) {
|
|
53
|
-
uint32_t nbits = Log2FloorNonZero(copylen - 6) - 1u;
|
|
54
|
-
return (uint16_t)((nbits << 1) + ((copylen - 6) >> nbits) + 4);
|
|
55
|
-
} else if (copylen < 2118) {
|
|
56
|
-
return (uint16_t)(Log2FloorNonZero(copylen - 70) + 12);
|
|
57
|
-
} else {
|
|
58
|
-
return 23u;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
static BROTLI_INLINE uint16_t CombineLengthCodes(
|
|
63
|
-
uint16_t inscode, uint16_t copycode, BROTLI_BOOL use_last_distance) {
|
|
64
|
-
uint16_t bits64 =
|
|
65
|
-
(uint16_t)((copycode & 0x7u) | ((inscode & 0x7u) << 3u));
|
|
66
|
-
if (use_last_distance && inscode < 8u && copycode < 16u) {
|
|
67
|
-
return (copycode < 8u) ? bits64 : (bits64 | 64u);
|
|
68
|
-
} else {
|
|
69
|
-
/* Specification: 5 Encoding of ... (last table) */
|
|
70
|
-
/* offset = 2 * index, where index is in range [0..8] */
|
|
71
|
-
uint32_t offset = 2u * ((copycode >> 3u) + 3u * (inscode >> 3u));
|
|
72
|
-
/* All values in specification are K * 64,
|
|
73
|
-
where K = [2, 3, 6, 4, 5, 8, 7, 9, 10],
|
|
74
|
-
i + 1 = [1, 2, 3, 4, 5, 6, 7, 8, 9],
|
|
75
|
-
K - i - 1 = [1, 1, 3, 0, 0, 2, 0, 1, 2] = D.
|
|
76
|
-
All values in D require only 2 bits to encode.
|
|
77
|
-
Magic constant is shifted 6 bits left, to avoid final multiplication. */
|
|
78
|
-
offset = (offset << 5u) + 0x40u + ((0x520D40u >> offset) & 0xC0u);
|
|
79
|
-
return (uint16_t)(offset | bits64);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
static BROTLI_INLINE void GetLengthCode(size_t insertlen, size_t copylen,
|
|
84
|
-
BROTLI_BOOL use_last_distance,
|
|
85
|
-
uint16_t* code) {
|
|
86
|
-
uint16_t inscode = GetInsertLengthCode(insertlen);
|
|
87
|
-
uint16_t copycode = GetCopyLengthCode(copylen);
|
|
88
|
-
*code = CombineLengthCodes(inscode, copycode, use_last_distance);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
static BROTLI_INLINE uint32_t GetInsertBase(uint16_t inscode) {
|
|
92
|
-
return kBrotliInsBase[inscode];
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
static BROTLI_INLINE uint32_t GetInsertExtra(uint16_t inscode) {
|
|
96
|
-
return kBrotliInsExtra[inscode];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
static BROTLI_INLINE uint32_t GetCopyBase(uint16_t copycode) {
|
|
100
|
-
return kBrotliCopyBase[copycode];
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
static BROTLI_INLINE uint32_t GetCopyExtra(uint16_t copycode) {
|
|
104
|
-
return kBrotliCopyExtra[copycode];
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
typedef struct Command {
|
|
108
|
-
uint32_t insert_len_;
|
|
109
|
-
/* Stores copy_len in low 25 bits and copy_code - copy_len in high 7 bit. */
|
|
110
|
-
uint32_t copy_len_;
|
|
111
|
-
/* Stores distance extra bits. */
|
|
112
|
-
uint32_t dist_extra_;
|
|
113
|
-
uint16_t cmd_prefix_;
|
|
114
|
-
/* Stores distance code in low 10 bits
|
|
115
|
-
and number of extra bits in high 6 bits. */
|
|
116
|
-
uint16_t dist_prefix_;
|
|
117
|
-
} Command;
|
|
118
|
-
|
|
119
|
-
/* distance_code is e.g. 0 for same-as-last short code, or 16 for offset 1. */
|
|
120
|
-
static BROTLI_INLINE void InitCommand(Command* self,
|
|
121
|
-
const BrotliDistanceParams* dist, size_t insertlen,
|
|
122
|
-
size_t copylen, int copylen_code_delta, size_t distance_code) {
|
|
123
|
-
/* Don't rely on signed int representation, use honest casts. */
|
|
124
|
-
uint32_t delta = (uint8_t)((int8_t)copylen_code_delta);
|
|
125
|
-
self->insert_len_ = (uint32_t)insertlen;
|
|
126
|
-
self->copy_len_ = (uint32_t)(copylen | (delta << 25));
|
|
127
|
-
/* The distance prefix and extra bits are stored in this Command as if
|
|
128
|
-
npostfix and ndirect were 0, they are only recomputed later after the
|
|
129
|
-
clustering if needed. */
|
|
130
|
-
PrefixEncodeCopyDistance(
|
|
131
|
-
distance_code, dist->num_direct_distance_codes,
|
|
132
|
-
dist->distance_postfix_bits, &self->dist_prefix_, &self->dist_extra_);
|
|
133
|
-
GetLengthCode(
|
|
134
|
-
insertlen, (size_t)((int)copylen + copylen_code_delta),
|
|
135
|
-
TO_BROTLI_BOOL((self->dist_prefix_ & 0x3FF) == 0), &self->cmd_prefix_);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
static BROTLI_INLINE void InitInsertCommand(Command* self, size_t insertlen) {
|
|
139
|
-
self->insert_len_ = (uint32_t)insertlen;
|
|
140
|
-
self->copy_len_ = 4 << 25;
|
|
141
|
-
self->dist_extra_ = 0;
|
|
142
|
-
self->dist_prefix_ = BROTLI_NUM_DISTANCE_SHORT_CODES;
|
|
143
|
-
GetLengthCode(insertlen, 4, BROTLI_FALSE, &self->cmd_prefix_);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
static BROTLI_INLINE uint32_t CommandRestoreDistanceCode(
|
|
147
|
-
const Command* self, const BrotliDistanceParams* dist) {
|
|
148
|
-
if ((self->dist_prefix_ & 0x3FFu) <
|
|
149
|
-
BROTLI_NUM_DISTANCE_SHORT_CODES + dist->num_direct_distance_codes) {
|
|
150
|
-
return self->dist_prefix_ & 0x3FFu;
|
|
151
|
-
} else {
|
|
152
|
-
uint32_t dcode = self->dist_prefix_ & 0x3FFu;
|
|
153
|
-
uint32_t nbits = self->dist_prefix_ >> 10;
|
|
154
|
-
uint32_t extra = self->dist_extra_;
|
|
155
|
-
uint32_t postfix_mask = (1U << dist->distance_postfix_bits) - 1U;
|
|
156
|
-
uint32_t hcode = (dcode - dist->num_direct_distance_codes -
|
|
157
|
-
BROTLI_NUM_DISTANCE_SHORT_CODES) >>
|
|
158
|
-
dist->distance_postfix_bits;
|
|
159
|
-
uint32_t lcode = (dcode - dist->num_direct_distance_codes -
|
|
160
|
-
BROTLI_NUM_DISTANCE_SHORT_CODES) & postfix_mask;
|
|
161
|
-
uint32_t offset = ((2U + (hcode & 1U)) << nbits) - 4U;
|
|
162
|
-
return ((offset + extra) << dist->distance_postfix_bits) + lcode +
|
|
163
|
-
dist->num_direct_distance_codes + BROTLI_NUM_DISTANCE_SHORT_CODES;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
static BROTLI_INLINE uint32_t CommandDistanceContext(const Command* self) {
|
|
168
|
-
uint32_t r = self->cmd_prefix_ >> 6;
|
|
169
|
-
uint32_t c = self->cmd_prefix_ & 7;
|
|
170
|
-
if ((r == 0 || r == 2 || r == 4 || r == 7) && (c <= 2)) {
|
|
171
|
-
return c;
|
|
172
|
-
}
|
|
173
|
-
return 3;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
static BROTLI_INLINE uint32_t CommandCopyLen(const Command* self) {
|
|
177
|
-
return self->copy_len_ & 0x1FFFFFF;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
static BROTLI_INLINE uint32_t CommandCopyLenCode(const Command* self) {
|
|
181
|
-
uint32_t modifier = self->copy_len_ >> 25;
|
|
182
|
-
int32_t delta = (int8_t)((uint8_t)(modifier | ((modifier & 0x40) << 1)));
|
|
183
|
-
return (uint32_t)((int32_t)(self->copy_len_ & 0x1FFFFFF) + delta);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
#if defined(__cplusplus) || defined(c_plusplus)
|
|
187
|
-
} /* extern "C" */
|
|
188
|
-
#endif
|
|
189
|
-
|
|
190
|
-
#endif /* BROTLI_ENC_COMMAND_H_ */
|