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
package/vendor/brotli/README.md
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
<p align="center"><img src="https://brotli.org/brotli.svg" alt="Brotli" width="64"></p>
|
|
2
|
-
|
|
3
|
-
# SECURITY NOTE
|
|
4
|
-
|
|
5
|
-
Please consider updating brotli to version 1.0.9 (latest).
|
|
6
|
-
|
|
7
|
-
Version 1.0.9 contains a fix to "integer overflow" problem. This happens when "one-shot" decoding API is used (or input chunk for streaming API is not limited), input size (chunk size) is larger than 2GiB, and input contains uncompressed blocks. After the overflow happens, `memcpy` is invoked with a gigantic `num` value, that will likely cause the crash.
|
|
8
|
-
|
|
9
|
-
### Introduction
|
|
10
|
-
|
|
11
|
-
Brotli is a generic-purpose lossless compression algorithm that compresses data
|
|
12
|
-
using a combination of a modern variant of the LZ77 algorithm, Huffman coding
|
|
13
|
-
and 2nd order context modeling, with a compression ratio comparable to the best
|
|
14
|
-
currently available general-purpose compression methods. It is similar in speed
|
|
15
|
-
with deflate but offers more dense compression.
|
|
16
|
-
|
|
17
|
-
The specification of the Brotli Compressed Data Format is defined in [RFC 7932](https://tools.ietf.org/html/rfc7932).
|
|
18
|
-
|
|
19
|
-
Brotli is open-sourced under the MIT License, see the LICENSE file.
|
|
20
|
-
|
|
21
|
-
Brotli mailing list:
|
|
22
|
-
https://groups.google.com/forum/#!forum/brotli
|
|
23
|
-
|
|
24
|
-
[](https://travis-ci.org/google/brotli)
|
|
25
|
-
[](https://ci.appveyor.com/project/szabadka/brotli)
|
|
26
|
-
[](https://oss-fuzz-build-logs.storage.googleapis.com/index.html#brotli)
|
|
27
|
-
|
|
28
|
-
### Build instructions
|
|
29
|
-
|
|
30
|
-
#### Vcpkg
|
|
31
|
-
|
|
32
|
-
You can download and install brotli using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
|
|
33
|
-
|
|
34
|
-
git clone https://github.com/Microsoft/vcpkg.git
|
|
35
|
-
cd vcpkg
|
|
36
|
-
./bootstrap-vcpkg.sh
|
|
37
|
-
./vcpkg integrate install
|
|
38
|
-
vcpkg install brotli
|
|
39
|
-
|
|
40
|
-
The brotli port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
|
41
|
-
|
|
42
|
-
#### Autotools-style CMake
|
|
43
|
-
|
|
44
|
-
[configure-cmake](https://github.com/nemequ/configure-cmake) is an
|
|
45
|
-
autotools-style configure script for CMake-based projects (not supported on Windows).
|
|
46
|
-
|
|
47
|
-
The basic commands to build, test and install brotli are:
|
|
48
|
-
|
|
49
|
-
$ mkdir out && cd out
|
|
50
|
-
$ ../configure-cmake
|
|
51
|
-
$ make
|
|
52
|
-
$ make test
|
|
53
|
-
$ make install
|
|
54
|
-
|
|
55
|
-
By default, debug binaries are built. To generate "release" `Makefile` specify `--disable-debug` option to `configure-cmake`.
|
|
56
|
-
|
|
57
|
-
#### Bazel
|
|
58
|
-
|
|
59
|
-
See [Bazel](http://www.bazel.build/)
|
|
60
|
-
|
|
61
|
-
#### CMake
|
|
62
|
-
|
|
63
|
-
The basic commands to build and install brotli are:
|
|
64
|
-
|
|
65
|
-
$ mkdir out && cd out
|
|
66
|
-
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./installed ..
|
|
67
|
-
$ cmake --build . --config Release --target install
|
|
68
|
-
|
|
69
|
-
You can use other [CMake](https://cmake.org/) configuration.
|
|
70
|
-
|
|
71
|
-
#### Premake5
|
|
72
|
-
|
|
73
|
-
See [Premake5](https://premake.github.io/)
|
|
74
|
-
|
|
75
|
-
#### Python
|
|
76
|
-
|
|
77
|
-
To install the latest release of the Python module, run the following:
|
|
78
|
-
|
|
79
|
-
$ pip install brotli
|
|
80
|
-
|
|
81
|
-
To install the tip-of-the-tree version, run:
|
|
82
|
-
|
|
83
|
-
$ pip install --upgrade git+https://github.com/google/brotli
|
|
84
|
-
|
|
85
|
-
See the [Python readme](python/README.md) for more details on installing
|
|
86
|
-
from source, development, and testing.
|
|
87
|
-
|
|
88
|
-
### Benchmarks
|
|
89
|
-
* [Squash Compression Benchmark](https://quixdb.github.io/squash-benchmark/) / [Unstable Squash Compression Benchmark](https://quixdb.github.io/squash-benchmark/unstable/)
|
|
90
|
-
* [Large Text Compression Benchmark](http://mattmahoney.net/dc/text.html)
|
|
91
|
-
* [Lzturbo Benchmark](https://sites.google.com/site/powturbo/home/benchmark)
|
|
92
|
-
|
|
93
|
-
### Related projects
|
|
94
|
-
> **Disclaimer:** Brotli authors take no responsibility for the third party projects mentioned in this section.
|
|
95
|
-
|
|
96
|
-
Independent [decoder](https://github.com/madler/brotli) implementation by Mark Adler, based entirely on format specification.
|
|
97
|
-
|
|
98
|
-
JavaScript port of brotli [decoder](https://github.com/devongovett/brotli.js). Could be used directly via `npm install brotli`
|
|
99
|
-
|
|
100
|
-
Hand ported [decoder / encoder](https://github.com/dominikhlbg/BrotliHaxe) in haxe by Dominik Homberger. Output source code: JavaScript, PHP, Python, Java and C#
|
|
101
|
-
|
|
102
|
-
7Zip [plugin](https://github.com/mcmilk/7-Zip-Zstd)
|
|
103
|
-
|
|
104
|
-
Dart [native bindings](https://github.com/thosakwe/brotli)
|
package/vendor/brotli/WORKSPACE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
workspace(name = "org_brotli")
|
|
2
|
-
|
|
3
|
-
local_repository(
|
|
4
|
-
name = "ignore_org_brotli_go",
|
|
5
|
-
path = "go",
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
local_repository(
|
|
9
|
-
name = "ignore_org_brotli_java",
|
|
10
|
-
path = "java",
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
local_repository(
|
|
14
|
-
name = "ignore_org_brotli_js",
|
|
15
|
-
path = "js",
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
local_repository(
|
|
19
|
-
name = "ignore_org_brotli_research",
|
|
20
|
-
path = "research",
|
|
21
|
-
)
|
package/vendor/brotli/bootstrap
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# !/bin/sh -e
|
|
2
|
-
|
|
3
|
-
if [ `uname -s` = "Darwin" ]; then
|
|
4
|
-
echo "WARNING: OSX autogen build is not supported"
|
|
5
|
-
fi
|
|
6
|
-
|
|
7
|
-
REQUIRED='is required, but not installed.'
|
|
8
|
-
bc -v >/dev/null 2>&1 || { echo >&2 "'bc' $REQUIRED"; exit 1; }
|
|
9
|
-
if [ `uname -s` != "FreeBSD" ]; then
|
|
10
|
-
sed --version >/dev/null 2>&1 || { echo >&2 "'sed' $REQUIRED"; exit 1; }
|
|
11
|
-
fi
|
|
12
|
-
autoreconf --version >/dev/null 2>&1 || { echo >&2 "'autoconf' $REQUIRED"; exit 1; }
|
|
13
|
-
|
|
14
|
-
# If libtool is not installed -> "error: Libtool library used but 'LIBTOOL' is undefined"
|
|
15
|
-
|
|
16
|
-
mkdir m4 2>/dev/null
|
|
17
|
-
|
|
18
|
-
BROTLI_ABI_HEX=`sed -n 's/#define BROTLI_ABI_VERSION 0x//p' c/common/version.h`
|
|
19
|
-
BROTLI_ABI_INT=`echo "ibase=16;$BROTLI_ABI_HEX" | bc`
|
|
20
|
-
BROTLI_ABI_CURRENT=`expr $BROTLI_ABI_INT / 16777216`
|
|
21
|
-
BROTLI_ABI_REVISION=`expr $BROTLI_ABI_INT / 4096 % 4096`
|
|
22
|
-
BROTLI_ABI_AGE=`expr $BROTLI_ABI_INT % 4096`
|
|
23
|
-
BROTLI_ABI_INFO="$BROTLI_ABI_CURRENT:$BROTLI_ABI_REVISION:$BROTLI_ABI_AGE"
|
|
24
|
-
|
|
25
|
-
BROTLI_VERSION_HEX=`sed -n 's/#define BROTLI_VERSION 0x//p' c/common/version.h`
|
|
26
|
-
BROTLI_VERSION_INT=`echo "ibase=16;$BROTLI_VERSION_HEX" | bc`
|
|
27
|
-
BROTLI_VERSION_MAJOR=`expr $BROTLI_VERSION_INT / 16777216`
|
|
28
|
-
BROTLI_VERSION_MINOR=`expr $BROTLI_VERSION_INT / 4096 % 4096`
|
|
29
|
-
BROTLI_VERSION_PATCH=`expr $BROTLI_VERSION_INT % 4096`
|
|
30
|
-
BROTLI_VERSION="$BROTLI_VERSION_MAJOR.$BROTLI_VERSION_MINOR.$BROTLI_VERSION_PATCH"
|
|
31
|
-
|
|
32
|
-
sed -i.bak -r "s/[0-9]+:[0-9]+:[0-9]+/$BROTLI_ABI_INFO/" Makefile.am
|
|
33
|
-
sed -i.bak -r "s/\[[0-9]+\.[0-9]+\.[0-9]+\]/[$BROTLI_VERSION]/" configure.ac
|
|
34
|
-
|
|
35
|
-
autoreconf --install --force --symlink || exit $
|
|
@@ -1,15 +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
|
-
#include "./constants.h"
|
|
8
|
-
|
|
9
|
-
const BrotliPrefixCodeRange
|
|
10
|
-
_kBrotliPrefixCodeRanges[BROTLI_NUM_BLOCK_LEN_SYMBOLS] = {
|
|
11
|
-
{1, 2}, {5, 2}, {9, 2}, {13, 2}, {17, 3}, {25, 3},
|
|
12
|
-
{33, 3}, {41, 3}, {49, 4}, {65, 4}, {81, 4}, {97, 4},
|
|
13
|
-
{113, 5}, {145, 5}, {177, 5}, {209, 5}, {241, 6}, {305, 6},
|
|
14
|
-
{369, 7}, {497, 8}, {753, 9}, {1265, 10}, {2289, 11}, {4337, 12},
|
|
15
|
-
{8433, 13}, {16625, 24}};
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
/* Copyright 2016 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
|
-
/**
|
|
8
|
-
* @file
|
|
9
|
-
* Common constants used in decoder and encoder API.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
#ifndef BROTLI_COMMON_CONSTANTS_H_
|
|
13
|
-
#define BROTLI_COMMON_CONSTANTS_H_
|
|
14
|
-
|
|
15
|
-
#include "./platform.h"
|
|
16
|
-
#include <brotli/port.h>
|
|
17
|
-
#include <brotli/types.h>
|
|
18
|
-
|
|
19
|
-
/* Specification: 7.3. Encoding of the context map */
|
|
20
|
-
#define BROTLI_CONTEXT_MAP_MAX_RLE 16
|
|
21
|
-
|
|
22
|
-
/* Specification: 2. Compressed representation overview */
|
|
23
|
-
#define BROTLI_MAX_NUMBER_OF_BLOCK_TYPES 256
|
|
24
|
-
|
|
25
|
-
/* Specification: 3.3. Alphabet sizes: insert-and-copy length */
|
|
26
|
-
#define BROTLI_NUM_LITERAL_SYMBOLS 256
|
|
27
|
-
#define BROTLI_NUM_COMMAND_SYMBOLS 704
|
|
28
|
-
#define BROTLI_NUM_BLOCK_LEN_SYMBOLS 26
|
|
29
|
-
#define BROTLI_MAX_CONTEXT_MAP_SYMBOLS (BROTLI_MAX_NUMBER_OF_BLOCK_TYPES + \
|
|
30
|
-
BROTLI_CONTEXT_MAP_MAX_RLE)
|
|
31
|
-
#define BROTLI_MAX_BLOCK_TYPE_SYMBOLS (BROTLI_MAX_NUMBER_OF_BLOCK_TYPES + 2)
|
|
32
|
-
|
|
33
|
-
/* Specification: 3.5. Complex prefix codes */
|
|
34
|
-
#define BROTLI_REPEAT_PREVIOUS_CODE_LENGTH 16
|
|
35
|
-
#define BROTLI_REPEAT_ZERO_CODE_LENGTH 17
|
|
36
|
-
#define BROTLI_CODE_LENGTH_CODES (BROTLI_REPEAT_ZERO_CODE_LENGTH + 1)
|
|
37
|
-
/* "code length of 8 is repeated" */
|
|
38
|
-
#define BROTLI_INITIAL_REPEATED_CODE_LENGTH 8
|
|
39
|
-
|
|
40
|
-
/* "Large Window Brotli" */
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The theoretical maximum number of distance bits specified for large window
|
|
44
|
-
* brotli, for 64-bit encoders and decoders. Even when in practice 32-bit
|
|
45
|
-
* encoders and decoders only support up to 30 max distance bits, the value is
|
|
46
|
-
* set to 62 because it affects the large window brotli file format.
|
|
47
|
-
* Specifically, it affects the encoding of simple huffman tree for distances,
|
|
48
|
-
* see Specification RFC 7932 chapter 3.4.
|
|
49
|
-
*/
|
|
50
|
-
#define BROTLI_LARGE_MAX_DISTANCE_BITS 62U
|
|
51
|
-
#define BROTLI_LARGE_MIN_WBITS 10
|
|
52
|
-
/**
|
|
53
|
-
* The maximum supported large brotli window bits by the encoder and decoder.
|
|
54
|
-
* Large window brotli allows up to 62 bits, however the current encoder and
|
|
55
|
-
* decoder, designed for 32-bit integers, only support up to 30 bits maximum.
|
|
56
|
-
*/
|
|
57
|
-
#define BROTLI_LARGE_MAX_WBITS 30
|
|
58
|
-
|
|
59
|
-
/* Specification: 4. Encoding of distances */
|
|
60
|
-
#define BROTLI_NUM_DISTANCE_SHORT_CODES 16
|
|
61
|
-
/**
|
|
62
|
-
* Maximal number of "postfix" bits.
|
|
63
|
-
*
|
|
64
|
-
* Number of "postfix" bits is stored as 2 bits in meta-block header.
|
|
65
|
-
*/
|
|
66
|
-
#define BROTLI_MAX_NPOSTFIX 3
|
|
67
|
-
#define BROTLI_MAX_NDIRECT 120
|
|
68
|
-
#define BROTLI_MAX_DISTANCE_BITS 24U
|
|
69
|
-
#define BROTLI_DISTANCE_ALPHABET_SIZE(NPOSTFIX, NDIRECT, MAXNBITS) ( \
|
|
70
|
-
BROTLI_NUM_DISTANCE_SHORT_CODES + (NDIRECT) + \
|
|
71
|
-
((MAXNBITS) << ((NPOSTFIX) + 1)))
|
|
72
|
-
/* BROTLI_NUM_DISTANCE_SYMBOLS == 1128 */
|
|
73
|
-
#define BROTLI_NUM_DISTANCE_SYMBOLS \
|
|
74
|
-
BROTLI_DISTANCE_ALPHABET_SIZE( \
|
|
75
|
-
BROTLI_MAX_NDIRECT, BROTLI_MAX_NPOSTFIX, BROTLI_LARGE_MAX_DISTANCE_BITS)
|
|
76
|
-
|
|
77
|
-
/* ((1 << 26) - 4) is the maximal distance that can be expressed in RFC 7932
|
|
78
|
-
brotli stream using NPOSTFIX = 0 and NDIRECT = 0. With other NPOSTFIX and
|
|
79
|
-
NDIRECT values distances up to ((1 << 29) + 88) could be expressed. */
|
|
80
|
-
#define BROTLI_MAX_DISTANCE 0x3FFFFFC
|
|
81
|
-
|
|
82
|
-
/* ((1 << 31) - 4) is the safe distance limit. Using this number as a limit
|
|
83
|
-
allows safe distance calculation without overflows, given the distance
|
|
84
|
-
alphabet size is limited to corresponding size
|
|
85
|
-
(see kLargeWindowDistanceCodeLimits). */
|
|
86
|
-
#define BROTLI_MAX_ALLOWED_DISTANCE 0x7FFFFFFC
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/* Specification: 4. Encoding of Literal Insertion Lengths and Copy Lengths */
|
|
90
|
-
#define BROTLI_NUM_INS_COPY_CODES 24
|
|
91
|
-
|
|
92
|
-
/* 7.1. Context modes and context ID lookup for literals */
|
|
93
|
-
/* "context IDs for literals are in the range of 0..63" */
|
|
94
|
-
#define BROTLI_LITERAL_CONTEXT_BITS 6
|
|
95
|
-
|
|
96
|
-
/* 7.2. Context ID for distances */
|
|
97
|
-
#define BROTLI_DISTANCE_CONTEXT_BITS 2
|
|
98
|
-
|
|
99
|
-
/* 9.1. Format of the Stream Header */
|
|
100
|
-
/* Number of slack bytes for window size. Don't confuse
|
|
101
|
-
with BROTLI_NUM_DISTANCE_SHORT_CODES. */
|
|
102
|
-
#define BROTLI_WINDOW_GAP 16
|
|
103
|
-
#define BROTLI_MAX_BACKWARD_LIMIT(W) (((size_t)1 << (W)) - BROTLI_WINDOW_GAP)
|
|
104
|
-
|
|
105
|
-
typedef struct BrotliDistanceCodeLimit {
|
|
106
|
-
uint32_t max_alphabet_size;
|
|
107
|
-
uint32_t max_distance;
|
|
108
|
-
} BrotliDistanceCodeLimit;
|
|
109
|
-
|
|
110
|
-
/* This function calculates maximal size of distance alphabet, such that the
|
|
111
|
-
distances greater than the given values can not be represented.
|
|
112
|
-
|
|
113
|
-
This limits are designed to support fast and safe 32-bit decoders.
|
|
114
|
-
"32-bit" means that signed integer values up to ((1 << 31) - 1) could be
|
|
115
|
-
safely expressed.
|
|
116
|
-
|
|
117
|
-
Brotli distance alphabet symbols do not represent consecutive distance
|
|
118
|
-
ranges. Each distance alphabet symbol (excluding direct distances and short
|
|
119
|
-
codes), represent interleaved (for NPOSTFIX > 0) range of distances.
|
|
120
|
-
A "group" of consecutive (1 << NPOSTFIX) symbols represent non-interleaved
|
|
121
|
-
range. Two consecutive groups require the same amount of "extra bits".
|
|
122
|
-
|
|
123
|
-
It is important that distance alphabet represents complete "groups".
|
|
124
|
-
To avoid complex logic on encoder side about interleaved ranges
|
|
125
|
-
it was decided to restrict both sides to complete distance code "groups".
|
|
126
|
-
*/
|
|
127
|
-
BROTLI_UNUSED_FUNCTION BrotliDistanceCodeLimit BrotliCalculateDistanceCodeLimit(
|
|
128
|
-
uint32_t max_distance, uint32_t npostfix, uint32_t ndirect) {
|
|
129
|
-
BrotliDistanceCodeLimit result;
|
|
130
|
-
/* Marking this function as unused, because not all files
|
|
131
|
-
including "constants.h" use it -> compiler warns about that. */
|
|
132
|
-
BROTLI_UNUSED(&BrotliCalculateDistanceCodeLimit);
|
|
133
|
-
if (max_distance <= ndirect) {
|
|
134
|
-
/* This case never happens / exists only for the sake of completeness. */
|
|
135
|
-
result.max_alphabet_size = max_distance + BROTLI_NUM_DISTANCE_SHORT_CODES;
|
|
136
|
-
result.max_distance = max_distance;
|
|
137
|
-
return result;
|
|
138
|
-
} else {
|
|
139
|
-
/* The first prohibited value. */
|
|
140
|
-
uint32_t forbidden_distance = max_distance + 1;
|
|
141
|
-
/* Subtract "directly" encoded region. */
|
|
142
|
-
uint32_t offset = forbidden_distance - ndirect - 1;
|
|
143
|
-
uint32_t ndistbits = 0;
|
|
144
|
-
uint32_t tmp;
|
|
145
|
-
uint32_t half;
|
|
146
|
-
uint32_t group;
|
|
147
|
-
/* Postfix for the last dcode in the group. */
|
|
148
|
-
uint32_t postfix = (1u << npostfix) - 1;
|
|
149
|
-
uint32_t extra;
|
|
150
|
-
uint32_t start;
|
|
151
|
-
/* Remove postfix and "head-start". */
|
|
152
|
-
offset = (offset >> npostfix) + 4;
|
|
153
|
-
/* Calculate the number of distance bits. */
|
|
154
|
-
tmp = offset / 2;
|
|
155
|
-
/* Poor-man's log2floor, to avoid extra dependencies. */
|
|
156
|
-
while (tmp != 0) {ndistbits++; tmp = tmp >> 1;}
|
|
157
|
-
/* One bit is covered with subrange addressing ("half"). */
|
|
158
|
-
ndistbits--;
|
|
159
|
-
/* Find subrange. */
|
|
160
|
-
half = (offset >> ndistbits) & 1;
|
|
161
|
-
/* Calculate the "group" part of dcode. */
|
|
162
|
-
group = ((ndistbits - 1) << 1) | half;
|
|
163
|
-
/* Calculated "group" covers the prohibited distance value. */
|
|
164
|
-
if (group == 0) {
|
|
165
|
-
/* This case is added for correctness; does not occur for limit > 128. */
|
|
166
|
-
result.max_alphabet_size = ndirect + BROTLI_NUM_DISTANCE_SHORT_CODES;
|
|
167
|
-
result.max_distance = ndirect;
|
|
168
|
-
return result;
|
|
169
|
-
}
|
|
170
|
-
/* Decrement "group", so it is the last permitted "group". */
|
|
171
|
-
group--;
|
|
172
|
-
/* After group was decremented, ndistbits and half must be recalculated. */
|
|
173
|
-
ndistbits = (group >> 1) + 1;
|
|
174
|
-
/* The last available distance in the subrange has all extra bits set. */
|
|
175
|
-
extra = (1u << ndistbits) - 1;
|
|
176
|
-
/* Calculate region start. NB: ndistbits >= 1. */
|
|
177
|
-
start = (1u << (ndistbits + 1)) - 4;
|
|
178
|
-
/* Move to subregion. */
|
|
179
|
-
start += (group & 1) << ndistbits;
|
|
180
|
-
/* Calculate the alphabet size. */
|
|
181
|
-
result.max_alphabet_size = ((group << npostfix) | postfix) + ndirect +
|
|
182
|
-
BROTLI_NUM_DISTANCE_SHORT_CODES + 1;
|
|
183
|
-
/* Calculate the maximal distance representable by alphabet. */
|
|
184
|
-
result.max_distance = ((start + extra) << npostfix) + postfix + ndirect + 1;
|
|
185
|
-
return result;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/* Represents the range of values belonging to a prefix code:
|
|
190
|
-
[offset, offset + 2^nbits) */
|
|
191
|
-
typedef struct {
|
|
192
|
-
uint16_t offset;
|
|
193
|
-
uint8_t nbits;
|
|
194
|
-
} BrotliPrefixCodeRange;
|
|
195
|
-
|
|
196
|
-
/* "Soft-private", it is exported, but not "advertised" as API. */
|
|
197
|
-
BROTLI_COMMON_API extern const BrotliPrefixCodeRange
|
|
198
|
-
_kBrotliPrefixCodeRanges[BROTLI_NUM_BLOCK_LEN_SYMBOLS];
|
|
199
|
-
|
|
200
|
-
#endif /* BROTLI_COMMON_CONSTANTS_H_ */
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
#include "./context.h"
|
|
2
|
-
|
|
3
|
-
#include <brotli/types.h>
|
|
4
|
-
|
|
5
|
-
/* Common context lookup table for all context modes. */
|
|
6
|
-
const uint8_t _kBrotliContextLookupTable[2048] = {
|
|
7
|
-
/* CONTEXT_LSB6, last byte. */
|
|
8
|
-
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
|
9
|
-
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
|
10
|
-
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
|
11
|
-
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
|
|
12
|
-
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
|
13
|
-
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
|
14
|
-
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
|
15
|
-
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
|
|
16
|
-
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
|
17
|
-
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
|
18
|
-
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
|
19
|
-
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
|
|
20
|
-
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
|
21
|
-
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
|
22
|
-
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
|
23
|
-
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
|
|
24
|
-
|
|
25
|
-
/* CONTEXT_LSB6, second last byte, */
|
|
26
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
27
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
28
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
29
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
30
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
31
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
32
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
33
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
34
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
35
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
36
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
37
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
38
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
39
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
40
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
41
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
42
|
-
|
|
43
|
-
/* CONTEXT_MSB6, last byte. */
|
|
44
|
-
0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
|
|
45
|
-
4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
|
|
46
|
-
8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11,
|
|
47
|
-
12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15,
|
|
48
|
-
16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19,
|
|
49
|
-
20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23,
|
|
50
|
-
24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27,
|
|
51
|
-
28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31,
|
|
52
|
-
32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35,
|
|
53
|
-
36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39,
|
|
54
|
-
40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43,
|
|
55
|
-
44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47,
|
|
56
|
-
48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51,
|
|
57
|
-
52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55,
|
|
58
|
-
56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59,
|
|
59
|
-
60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63,
|
|
60
|
-
|
|
61
|
-
/* CONTEXT_MSB6, second last byte, */
|
|
62
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
63
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
64
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
65
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
66
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
67
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
68
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
69
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
70
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
71
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
72
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
73
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
74
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
75
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
76
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
77
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
78
|
-
|
|
79
|
-
/* CONTEXT_UTF8, last byte. */
|
|
80
|
-
/* ASCII range. */
|
|
81
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0,
|
|
82
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
83
|
-
8, 12, 16, 12, 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12,
|
|
84
|
-
44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12,
|
|
85
|
-
12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48,
|
|
86
|
-
52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12,
|
|
87
|
-
12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56,
|
|
88
|
-
60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0,
|
|
89
|
-
/* UTF8 continuation byte range. */
|
|
90
|
-
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
|
|
91
|
-
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
|
|
92
|
-
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
|
|
93
|
-
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
|
|
94
|
-
/* UTF8 lead byte range. */
|
|
95
|
-
2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
|
|
96
|
-
2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
|
|
97
|
-
2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
|
|
98
|
-
2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
|
|
99
|
-
|
|
100
|
-
/* CONTEXT_UTF8 second last byte. */
|
|
101
|
-
/* ASCII range. */
|
|
102
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
103
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
104
|
-
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
105
|
-
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1,
|
|
106
|
-
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
107
|
-
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,
|
|
108
|
-
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
109
|
-
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0,
|
|
110
|
-
/* UTF8 continuation byte range. */
|
|
111
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
112
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
113
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
114
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
115
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
116
|
-
/* UTF8 lead byte range. */
|
|
117
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
118
|
-
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
119
|
-
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
120
|
-
|
|
121
|
-
/* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */
|
|
122
|
-
0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
|
123
|
-
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
|
|
124
|
-
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
|
|
125
|
-
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
|
|
126
|
-
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
127
|
-
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
128
|
-
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
129
|
-
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
130
|
-
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
|
|
131
|
-
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
|
|
132
|
-
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
|
|
133
|
-
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
|
|
134
|
-
40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
|
|
135
|
-
40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
|
|
136
|
-
40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
|
|
137
|
-
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56,
|
|
138
|
-
|
|
139
|
-
/* CONTEXT_SIGNED, second last byte. */
|
|
140
|
-
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
141
|
-
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
142
|
-
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
143
|
-
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
144
|
-
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
145
|
-
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
146
|
-
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
147
|
-
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
148
|
-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
|
149
|
-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
|
150
|
-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
|
151
|
-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
|
152
|
-
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
|
153
|
-
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
|
154
|
-
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
|
155
|
-
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,
|
|
156
|
-
};
|
|
@@ -1,113 +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
|
-
/* Lookup table to map the previous two bytes to a context id.
|
|
8
|
-
|
|
9
|
-
There are four different context modeling modes defined here:
|
|
10
|
-
CONTEXT_LSB6: context id is the least significant 6 bits of the last byte,
|
|
11
|
-
CONTEXT_MSB6: context id is the most significant 6 bits of the last byte,
|
|
12
|
-
CONTEXT_UTF8: second-order context model tuned for UTF8-encoded text,
|
|
13
|
-
CONTEXT_SIGNED: second-order context model tuned for signed integers.
|
|
14
|
-
|
|
15
|
-
If |p1| and |p2| are the previous two bytes, and |mode| is current context
|
|
16
|
-
mode, we calculate the context as:
|
|
17
|
-
|
|
18
|
-
context = ContextLut(mode)[p1] | ContextLut(mode)[p2 + 256].
|
|
19
|
-
|
|
20
|
-
For CONTEXT_UTF8 mode, if the previous two bytes are ASCII characters
|
|
21
|
-
(i.e. < 128), this will be equivalent to
|
|
22
|
-
|
|
23
|
-
context = 4 * context1(p1) + context2(p2),
|
|
24
|
-
|
|
25
|
-
where context1 is based on the previous byte in the following way:
|
|
26
|
-
|
|
27
|
-
0 : non-ASCII control
|
|
28
|
-
1 : \t, \n, \r
|
|
29
|
-
2 : space
|
|
30
|
-
3 : other punctuation
|
|
31
|
-
4 : " '
|
|
32
|
-
5 : %
|
|
33
|
-
6 : ( < [ {
|
|
34
|
-
7 : ) > ] }
|
|
35
|
-
8 : , ; :
|
|
36
|
-
9 : .
|
|
37
|
-
10 : =
|
|
38
|
-
11 : number
|
|
39
|
-
12 : upper-case vowel
|
|
40
|
-
13 : upper-case consonant
|
|
41
|
-
14 : lower-case vowel
|
|
42
|
-
15 : lower-case consonant
|
|
43
|
-
|
|
44
|
-
and context2 is based on the second last byte:
|
|
45
|
-
|
|
46
|
-
0 : control, space
|
|
47
|
-
1 : punctuation
|
|
48
|
-
2 : upper-case letter, number
|
|
49
|
-
3 : lower-case letter
|
|
50
|
-
|
|
51
|
-
If the last byte is ASCII, and the second last byte is not (in a valid UTF8
|
|
52
|
-
stream it will be a continuation byte, value between 128 and 191), the
|
|
53
|
-
context is the same as if the second last byte was an ASCII control or space.
|
|
54
|
-
|
|
55
|
-
If the last byte is a UTF8 lead byte (value >= 192), then the next byte will
|
|
56
|
-
be a continuation byte and the context id is 2 or 3 depending on the LSB of
|
|
57
|
-
the last byte and to a lesser extent on the second last byte if it is ASCII.
|
|
58
|
-
|
|
59
|
-
If the last byte is a UTF8 continuation byte, the second last byte can be:
|
|
60
|
-
- continuation byte: the next byte is probably ASCII or lead byte (assuming
|
|
61
|
-
4-byte UTF8 characters are rare) and the context id is 0 or 1.
|
|
62
|
-
- lead byte (192 - 207): next byte is ASCII or lead byte, context is 0 or 1
|
|
63
|
-
- lead byte (208 - 255): next byte is continuation byte, context is 2 or 3
|
|
64
|
-
|
|
65
|
-
The possible value combinations of the previous two bytes, the range of
|
|
66
|
-
context ids and the type of the next byte is summarized in the table below:
|
|
67
|
-
|
|
68
|
-
|--------\-----------------------------------------------------------------|
|
|
69
|
-
| \ Last byte |
|
|
70
|
-
| Second \---------------------------------------------------------------|
|
|
71
|
-
| last byte \ ASCII | cont. byte | lead byte |
|
|
72
|
-
| \ (0-127) | (128-191) | (192-) |
|
|
73
|
-
|=============|===================|=====================|==================|
|
|
74
|
-
| ASCII | next: ASCII/lead | not valid | next: cont. |
|
|
75
|
-
| (0-127) | context: 4 - 63 | | context: 2 - 3 |
|
|
76
|
-
|-------------|-------------------|---------------------|------------------|
|
|
77
|
-
| cont. byte | next: ASCII/lead | next: ASCII/lead | next: cont. |
|
|
78
|
-
| (128-191) | context: 4 - 63 | context: 0 - 1 | context: 2 - 3 |
|
|
79
|
-
|-------------|-------------------|---------------------|------------------|
|
|
80
|
-
| lead byte | not valid | next: ASCII/lead | not valid |
|
|
81
|
-
| (192-207) | | context: 0 - 1 | |
|
|
82
|
-
|-------------|-------------------|---------------------|------------------|
|
|
83
|
-
| lead byte | not valid | next: cont. | not valid |
|
|
84
|
-
| (208-) | | context: 2 - 3 | |
|
|
85
|
-
|-------------|-------------------|---------------------|------------------|
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
#ifndef BROTLI_COMMON_CONTEXT_H_
|
|
89
|
-
#define BROTLI_COMMON_CONTEXT_H_
|
|
90
|
-
|
|
91
|
-
#include <brotli/port.h>
|
|
92
|
-
#include <brotli/types.h>
|
|
93
|
-
|
|
94
|
-
typedef enum ContextType {
|
|
95
|
-
CONTEXT_LSB6 = 0,
|
|
96
|
-
CONTEXT_MSB6 = 1,
|
|
97
|
-
CONTEXT_UTF8 = 2,
|
|
98
|
-
CONTEXT_SIGNED = 3
|
|
99
|
-
} ContextType;
|
|
100
|
-
|
|
101
|
-
/* "Soft-private", it is exported, but not "advertised" as API. */
|
|
102
|
-
/* Common context lookup table for all context modes. */
|
|
103
|
-
BROTLI_COMMON_API extern const uint8_t _kBrotliContextLookupTable[2048];
|
|
104
|
-
|
|
105
|
-
typedef const uint8_t* ContextLut;
|
|
106
|
-
|
|
107
|
-
/* typeof(MODE) == ContextType; returns ContextLut */
|
|
108
|
-
#define BROTLI_CONTEXT_LUT(MODE) (&_kBrotliContextLookupTable[(MODE) << 9])
|
|
109
|
-
|
|
110
|
-
/* typeof(LUT) == ContextLut */
|
|
111
|
-
#define BROTLI_CONTEXT(P1, P2, LUT) ((LUT)[P1] | ((LUT) + 256)[P2])
|
|
112
|
-
|
|
113
|
-
#endif /* BROTLI_COMMON_CONTEXT_H_ */
|