multi_compress 0.3.2 → 0.3.4

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.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -3
  3. data/GET_STARTED.md +3 -3
  4. data/README.md +75 -66
  5. data/THIRD_PARTY_NOTICES.md +24 -0
  6. data/ext/multi_compress/brotli_dec_static_init.c +3 -0
  7. data/ext/multi_compress/brotli_enc_static_init.c +3 -0
  8. data/ext/multi_compress/extconf.rb +79 -3
  9. data/ext/multi_compress/multi_compress.c +199 -120
  10. data/ext/multi_compress/vendor/.vendored +2 -2
  11. data/ext/multi_compress/vendor/brotli/LICENSE +19 -0
  12. data/ext/multi_compress/vendor/brotli/c/common/constants.c +7 -7
  13. data/ext/multi_compress/vendor/brotli/c/common/constants.h +2 -5
  14. data/ext/multi_compress/vendor/brotli/c/common/context.c +2 -2
  15. data/ext/multi_compress/vendor/brotli/c/common/context.h +1 -2
  16. data/ext/multi_compress/vendor/brotli/c/common/dictionary.c +4 -5856
  17. data/ext/multi_compress/vendor/brotli/c/common/dictionary.h +1 -2
  18. data/ext/multi_compress/vendor/brotli/c/common/dictionary_inc.h +5847 -0
  19. data/ext/multi_compress/vendor/brotli/c/common/platform.c +0 -4
  20. data/ext/multi_compress/vendor/brotli/c/common/platform.h +182 -43
  21. data/ext/multi_compress/vendor/brotli/c/common/shared_dictionary.c +3 -7
  22. data/ext/multi_compress/vendor/brotli/c/common/shared_dictionary_internal.h +1 -1
  23. data/ext/multi_compress/vendor/brotli/c/common/static_init.h +56 -0
  24. data/ext/multi_compress/vendor/brotli/c/common/transform.c +6 -4
  25. data/ext/multi_compress/vendor/brotli/c/common/transform.h +1 -2
  26. data/ext/multi_compress/vendor/brotli/c/common/version.h +3 -3
  27. data/ext/multi_compress/vendor/brotli/c/dec/bit_reader.c +2 -3
  28. data/ext/multi_compress/vendor/brotli/c/dec/bit_reader.h +0 -4
  29. data/ext/multi_compress/vendor/brotli/c/dec/decode.c +128 -39
  30. data/ext/multi_compress/vendor/brotli/c/dec/huffman.c +2 -5
  31. data/ext/multi_compress/vendor/brotli/c/dec/huffman.h +0 -2
  32. data/ext/multi_compress/vendor/brotli/c/dec/prefix.c +67 -0
  33. data/ext/multi_compress/vendor/brotli/c/dec/prefix.h +18 -708
  34. data/ext/multi_compress/vendor/brotli/c/dec/prefix_inc.h +707 -0
  35. data/ext/multi_compress/vendor/brotli/c/dec/state.c +18 -15
  36. data/ext/multi_compress/vendor/brotli/c/dec/state.h +2 -6
  37. data/ext/multi_compress/vendor/brotli/c/dec/static_init.c +53 -0
  38. data/ext/multi_compress/vendor/brotli/c/dec/static_init.h +30 -0
  39. data/ext/multi_compress/vendor/brotli/c/enc/backward_references.c +32 -8
  40. data/ext/multi_compress/vendor/brotli/c/enc/backward_references.h +1 -5
  41. data/ext/multi_compress/vendor/brotli/c/enc/backward_references_hq.c +15 -15
  42. data/ext/multi_compress/vendor/brotli/c/enc/backward_references_hq.h +1 -5
  43. data/ext/multi_compress/vendor/brotli/c/enc/bit_cost.c +28 -4
  44. data/ext/multi_compress/vendor/brotli/c/enc/bit_cost.h +8 -40
  45. data/ext/multi_compress/vendor/brotli/c/enc/bit_cost_inc.h +1 -1
  46. data/ext/multi_compress/vendor/brotli/c/enc/block_splitter.c +9 -12
  47. data/ext/multi_compress/vendor/brotli/c/enc/block_splitter.h +0 -3
  48. data/ext/multi_compress/vendor/brotli/c/enc/block_splitter_inc.h +14 -8
  49. data/ext/multi_compress/vendor/brotli/c/enc/brotli_bit_stream.c +10 -9
  50. data/ext/multi_compress/vendor/brotli/c/enc/brotli_bit_stream.h +0 -6
  51. data/ext/multi_compress/vendor/brotli/c/enc/cluster.c +0 -2
  52. data/ext/multi_compress/vendor/brotli/c/enc/cluster.h +0 -2
  53. data/ext/multi_compress/vendor/brotli/c/enc/command.c +1 -1
  54. data/ext/multi_compress/vendor/brotli/c/enc/command.h +8 -10
  55. data/ext/multi_compress/vendor/brotli/c/enc/compound_dictionary.c +3 -5
  56. data/ext/multi_compress/vendor/brotli/c/enc/compound_dictionary.h +1 -4
  57. data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment.c +3 -13
  58. data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment.h +0 -2
  59. data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment_two_pass.c +5 -15
  60. data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment_two_pass.h +0 -2
  61. data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash.c +127 -1830
  62. data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash.h +23 -3
  63. data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash_inc.h +1829 -0
  64. data/ext/multi_compress/vendor/brotli/c/enc/encode.c +77 -52
  65. data/ext/multi_compress/vendor/brotli/c/enc/encoder_dict.c +9 -7
  66. data/ext/multi_compress/vendor/brotli/c/enc/encoder_dict.h +2 -4
  67. data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode.c +3 -6
  68. data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode.h +2 -4
  69. data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode_static.h +18 -12
  70. data/ext/multi_compress/vendor/brotli/c/enc/fast_log.c +1 -1
  71. data/ext/multi_compress/vendor/brotli/c/enc/fast_log.h +2 -3
  72. data/ext/multi_compress/vendor/brotli/c/enc/find_match_length.h +0 -2
  73. data/ext/multi_compress/vendor/brotli/c/enc/hash.h +38 -31
  74. data/ext/multi_compress/vendor/brotli/c/enc/hash_base.h +38 -0
  75. data/ext/multi_compress/vendor/brotli/c/enc/hash_forgetful_chain_inc.h +11 -1
  76. data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match64_inc.h +24 -7
  77. data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match64_simd_inc.h +304 -0
  78. data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_inc.h +30 -11
  79. data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_quickly_inc.h +4 -0
  80. data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_simd_inc.h +278 -0
  81. data/ext/multi_compress/vendor/brotli/c/enc/histogram.c +1 -0
  82. data/ext/multi_compress/vendor/brotli/c/enc/histogram.h +0 -4
  83. data/ext/multi_compress/vendor/brotli/c/enc/literal_cost.c +4 -6
  84. data/ext/multi_compress/vendor/brotli/c/enc/literal_cost.h +0 -2
  85. data/ext/multi_compress/vendor/brotli/c/enc/matching_tag_mask.h +69 -0
  86. data/ext/multi_compress/vendor/brotli/c/enc/memory.c +0 -5
  87. data/ext/multi_compress/vendor/brotli/c/enc/memory.h +0 -4
  88. data/ext/multi_compress/vendor/brotli/c/enc/metablock.c +7 -9
  89. data/ext/multi_compress/vendor/brotli/c/enc/metablock.h +3 -3
  90. data/ext/multi_compress/vendor/brotli/c/enc/metablock_inc.h +4 -4
  91. data/ext/multi_compress/vendor/brotli/c/enc/params.h +0 -1
  92. data/ext/multi_compress/vendor/brotli/c/enc/prefix.h +0 -2
  93. data/ext/multi_compress/vendor/brotli/c/enc/quality.h +17 -10
  94. data/ext/multi_compress/vendor/brotli/c/enc/ringbuffer.h +1 -4
  95. data/ext/multi_compress/vendor/brotli/c/enc/state.h +2 -2
  96. data/ext/multi_compress/vendor/brotli/c/enc/static_dict.c +5 -11
  97. data/ext/multi_compress/vendor/brotli/c/enc/static_dict.h +1 -3
  98. data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut.c +224 -0
  99. data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut.h +20 -5837
  100. data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut_inc.h +5830 -0
  101. data/ext/multi_compress/vendor/brotli/c/enc/static_init.c +59 -0
  102. data/ext/multi_compress/vendor/brotli/c/enc/static_init.h +30 -0
  103. data/ext/multi_compress/vendor/brotli/c/enc/static_init_lazy.cc +26 -0
  104. data/ext/multi_compress/vendor/brotli/c/enc/utf8_util.c +1 -1
  105. data/ext/multi_compress/vendor/brotli/c/enc/utf8_util.h +0 -2
  106. data/ext/multi_compress/vendor/brotli/c/enc/write_bits.h +0 -2
  107. data/ext/multi_compress/vendor/brotli/c/include/brotli/decode.h +1 -1
  108. data/ext/multi_compress/vendor/brotli/c/include/brotli/encode.h +5 -1
  109. data/ext/multi_compress/vendor/brotli/c/include/brotli/port.h +4 -7
  110. data/ext/multi_compress/vendor/brotli/c/include/brotli/types.h +2 -2
  111. data/ext/multi_compress/vendor/lz4/LICENSE +12 -0
  112. data/ext/multi_compress/vendor/zstd/COPYING +339 -0
  113. data/ext/multi_compress/vendor/zstd/LICENSE +30 -0
  114. data/ext/multi_compress/vendor/zstd/lib/Makefile +67 -35
  115. data/ext/multi_compress/vendor/zstd/lib/README.md +33 -2
  116. data/ext/multi_compress/vendor/zstd/lib/common/allocations.h +55 -0
  117. data/ext/multi_compress/vendor/zstd/lib/common/bits.h +205 -0
  118. data/ext/multi_compress/vendor/zstd/lib/common/bitstream.h +84 -108
  119. data/ext/multi_compress/vendor/zstd/lib/common/compiler.h +170 -41
  120. data/ext/multi_compress/vendor/zstd/lib/common/cpu.h +37 -1
  121. data/ext/multi_compress/vendor/zstd/lib/common/debug.c +7 -1
  122. data/ext/multi_compress/vendor/zstd/lib/common/debug.h +21 -21
  123. data/ext/multi_compress/vendor/zstd/lib/common/entropy_common.c +12 -40
  124. data/ext/multi_compress/vendor/zstd/lib/common/error_private.c +10 -2
  125. data/ext/multi_compress/vendor/zstd/lib/common/error_private.h +46 -47
  126. data/ext/multi_compress/vendor/zstd/lib/common/fse.h +8 -100
  127. data/ext/multi_compress/vendor/zstd/lib/common/fse_decompress.c +28 -116
  128. data/ext/multi_compress/vendor/zstd/lib/common/huf.h +79 -166
  129. data/ext/multi_compress/vendor/zstd/lib/common/mem.h +46 -66
  130. data/ext/multi_compress/vendor/zstd/lib/common/pool.c +27 -11
  131. data/ext/multi_compress/vendor/zstd/lib/common/pool.h +8 -11
  132. data/ext/multi_compress/vendor/zstd/lib/common/portability_macros.h +45 -11
  133. data/ext/multi_compress/vendor/zstd/lib/common/threading.c +74 -14
  134. data/ext/multi_compress/vendor/zstd/lib/common/threading.h +5 -18
  135. data/ext/multi_compress/vendor/zstd/lib/common/xxhash.c +5 -11
  136. data/ext/multi_compress/vendor/zstd/lib/common/xxhash.h +2411 -1003
  137. data/ext/multi_compress/vendor/zstd/lib/common/zstd_common.c +1 -36
  138. data/ext/multi_compress/vendor/zstd/lib/common/zstd_deps.h +13 -1
  139. data/ext/multi_compress/vendor/zstd/lib/common/zstd_internal.h +13 -182
  140. data/ext/multi_compress/vendor/zstd/lib/common/zstd_trace.h +6 -13
  141. data/ext/multi_compress/vendor/zstd/lib/compress/clevels.h +1 -1
  142. data/ext/multi_compress/vendor/zstd/lib/compress/fse_compress.c +15 -131
  143. data/ext/multi_compress/vendor/zstd/lib/compress/hist.c +11 -1
  144. data/ext/multi_compress/vendor/zstd/lib/compress/hist.h +8 -1
  145. data/ext/multi_compress/vendor/zstd/lib/compress/huf_compress.c +283 -189
  146. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress.c +2419 -903
  147. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_internal.h +423 -245
  148. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_literals.c +116 -40
  149. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_literals.h +16 -8
  150. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_sequences.c +10 -10
  151. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_sequences.h +8 -7
  152. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_superblock.c +254 -139
  153. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_superblock.h +1 -1
  154. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_cwksp.h +184 -95
  155. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_double_fast.c +163 -81
  156. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_double_fast.h +18 -14
  157. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_fast.c +507 -197
  158. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_fast.h +7 -14
  159. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_lazy.c +579 -484
  160. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_lazy.h +133 -65
  161. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm.c +61 -40
  162. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm.h +7 -15
  163. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm_geartab.h +1 -1
  164. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_opt.c +352 -218
  165. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_opt.h +37 -21
  166. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_preSplit.c +238 -0
  167. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_preSplit.h +33 -0
  168. data/ext/multi_compress/vendor/zstd/lib/compress/zstdmt_compress.c +239 -175
  169. data/ext/multi_compress/vendor/zstd/lib/compress/zstdmt_compress.h +5 -16
  170. data/ext/multi_compress/vendor/zstd/lib/decompress/huf_decompress.c +543 -488
  171. data/ext/multi_compress/vendor/zstd/lib/decompress/huf_decompress_amd64.S +78 -61
  172. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_ddict.c +4 -4
  173. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_ddict.h +1 -1
  174. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress.c +295 -115
  175. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_block.c +430 -293
  176. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_block.h +7 -2
  177. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_internal.h +11 -7
  178. data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff.h +1 -1
  179. data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_common.c +1 -1
  180. data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_compress.c +1 -1
  181. data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_decompress.c +3 -1
  182. data/ext/multi_compress/vendor/zstd/lib/dictBuilder/cover.c +95 -46
  183. data/ext/multi_compress/vendor/zstd/lib/dictBuilder/cover.h +3 -9
  184. data/ext/multi_compress/vendor/zstd/lib/dictBuilder/divsufsort.h +0 -10
  185. data/ext/multi_compress/vendor/zstd/lib/dictBuilder/fastcover.c +4 -4
  186. data/ext/multi_compress/vendor/zstd/lib/dictBuilder/zdict.c +25 -97
  187. data/ext/multi_compress/vendor/zstd/lib/dll/example/Makefile +1 -1
  188. data/ext/multi_compress/vendor/zstd/lib/dll/example/README.md +1 -1
  189. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_legacy.h +38 -1
  190. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v01.c +19 -50
  191. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v01.h +1 -1
  192. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v02.c +27 -80
  193. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v02.h +1 -1
  194. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v03.c +28 -83
  195. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v03.h +1 -1
  196. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v04.c +25 -74
  197. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v04.h +1 -1
  198. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v05.c +31 -76
  199. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v05.h +1 -1
  200. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v06.c +44 -88
  201. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v06.h +1 -1
  202. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v07.c +33 -84
  203. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v07.h +1 -1
  204. data/ext/multi_compress/vendor/zstd/lib/libzstd.mk +65 -33
  205. data/ext/multi_compress/vendor/zstd/lib/libzstd.pc.in +5 -5
  206. data/ext/multi_compress/vendor/zstd/lib/module.modulemap +13 -3
  207. data/ext/multi_compress/vendor/zstd/lib/zdict.h +65 -36
  208. data/ext/multi_compress/vendor/zstd/lib/zstd.h +890 -267
  209. data/ext/multi_compress/vendor/zstd/lib/zstd_errors.h +28 -16
  210. data/lib/multi_compress/version.rb +1 -1
  211. data/lib/multi_compress.rb +80 -41
  212. metadata +29 -2
@@ -4,10 +4,6 @@
4
4
  See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5
5
  */
6
6
 
7
- #include <stdlib.h>
8
-
9
- #include <brotli/types.h>
10
-
11
7
  #include "platform.h"
12
8
 
13
9
  /* Default brotli_alloc_func */
@@ -24,22 +24,12 @@
24
24
  #ifndef BROTLI_COMMON_PLATFORM_H_
25
25
  #define BROTLI_COMMON_PLATFORM_H_
26
26
 
27
- #include <string.h> /* memcpy */
27
+ #include <string.h> /* IWYU pragma: export memcmp, memcpy, memset */
28
+ #include <stdlib.h> /* IWYU pragma: export exit, free, malloc */
29
+ #include <sys/types.h> /* should include endian.h for us */
28
30
 
29
- #include <brotli/port.h>
30
- #include <brotli/types.h>
31
-
32
- #if defined(OS_LINUX) || defined(OS_CYGWIN) || defined(__EMSCRIPTEN__)
33
- #include <endian.h>
34
- #elif defined(OS_FREEBSD)
35
- #include <machine/endian.h>
36
- #elif defined(OS_MACOSX)
37
- #include <machine/endian.h>
38
- /* Let's try and follow the Linux convention */
39
- #define BROTLI_X_BYTE_ORDER BYTE_ORDER
40
- #define BROTLI_X_LITTLE_ENDIAN LITTLE_ENDIAN
41
- #define BROTLI_X_BIG_ENDIAN BIG_ENDIAN
42
- #endif
31
+ #include <brotli/port.h> /* IWYU pragma: export */
32
+ #include <brotli/types.h> /* IWYU pragma: export */
43
33
 
44
34
  #if BROTLI_MSVC_VERSION_CHECK(18, 0, 0)
45
35
  #include <intrin.h>
@@ -213,9 +203,19 @@ OR:
213
203
  #define BROTLI_TARGET_LOONGARCH64
214
204
  #endif
215
205
 
206
+ /* This does not seem to be an indicator of z/Architecture (64-bit); neither
207
+ that allows to use unaligned loads. */
208
+ #if defined(__s390x__)
209
+ #define BROTLI_TARGET_S390X
210
+ #endif
211
+
212
+ #if defined(__mips64)
213
+ #define BROTLI_TARGET_MIPS64
214
+ #endif
215
+
216
216
  #if defined(BROTLI_TARGET_X64) || defined(BROTLI_TARGET_ARMV8_64) || \
217
217
  defined(BROTLI_TARGET_POWERPC64) || defined(BROTLI_TARGET_RISCV64) || \
218
- defined(BROTLI_TARGET_LOONGARCH64)
218
+ defined(BROTLI_TARGET_LOONGARCH64) || defined(BROTLI_TARGET_MIPS64)
219
219
  #define BROTLI_TARGET_64_BITS 1
220
220
  #else
221
221
  #define BROTLI_TARGET_64_BITS 0
@@ -248,13 +248,12 @@ OR:
248
248
  #define BROTLI_LITTLE_ENDIAN 1
249
249
  #elif defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
250
250
  #define BROTLI_BIG_ENDIAN 1
251
- #elif defined(BROTLI_X_BYTE_ORDER)
252
- #if BROTLI_X_BYTE_ORDER == BROTLI_X_LITTLE_ENDIAN
251
+ /* Likely target platform is iOS / OSX. */
252
+ #elif defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN)
253
253
  #define BROTLI_LITTLE_ENDIAN 1
254
- #elif BROTLI_X_BYTE_ORDER == BROTLI_X_BIG_ENDIAN
254
+ #elif defined(BYTE_ORDER) && (BYTE_ORDER == BIG_ENDIAN)
255
255
  #define BROTLI_BIG_ENDIAN 1
256
256
  #endif
257
- #endif /* BROTLI_X_BYTE_ORDER */
258
257
 
259
258
  #if !defined(BROTLI_LITTLE_ENDIAN)
260
259
  #define BROTLI_LITTLE_ENDIAN 0
@@ -264,12 +263,6 @@ OR:
264
263
  #define BROTLI_BIG_ENDIAN 0
265
264
  #endif
266
265
 
267
- #if defined(BROTLI_X_BYTE_ORDER)
268
- #undef BROTLI_X_BYTE_ORDER
269
- #undef BROTLI_X_LITTLE_ENDIAN
270
- #undef BROTLI_X_BIG_ENDIAN
271
- #endif
272
-
273
266
  #if defined(BROTLI_BUILD_NO_UNALIGNED_READ_FAST)
274
267
  #define BROTLI_UNALIGNED_READ_FAST (!!0)
275
268
  #elif defined(BROTLI_TARGET_X86) || defined(BROTLI_TARGET_X64) || \
@@ -284,6 +277,46 @@ OR:
284
277
  #endif
285
278
 
286
279
  /* Portable unaligned memory access: read / write values via memcpy. */
280
+ #if !defined(BROTLI_USE_PACKED_FOR_UNALIGNED)
281
+ #if defined(__mips__) && (!defined(__mips_isa_rev) || __mips_isa_rev < 6)
282
+ #define BROTLI_USE_PACKED_FOR_UNALIGNED 1
283
+ #else
284
+ #define BROTLI_USE_PACKED_FOR_UNALIGNED 0
285
+ #endif
286
+ #endif /* defined(BROTLI_USE_PACKED_FOR_UNALIGNED) */
287
+
288
+ #if BROTLI_USE_PACKED_FOR_UNALIGNED
289
+
290
+ typedef union BrotliPackedValue {
291
+ uint16_t u16;
292
+ uint32_t u32;
293
+ uint64_t u64;
294
+ size_t szt;
295
+ } __attribute__ ((packed)) BrotliPackedValue;
296
+
297
+ static BROTLI_INLINE uint16_t BrotliUnalignedRead16(const void* p) {
298
+ const BrotliPackedValue* address = (const BrotliPackedValue*)p;
299
+ return address->u16;
300
+ }
301
+ static BROTLI_INLINE uint32_t BrotliUnalignedRead32(const void* p) {
302
+ const BrotliPackedValue* address = (const BrotliPackedValue*)p;
303
+ return address->u32;
304
+ }
305
+ static BROTLI_INLINE uint64_t BrotliUnalignedRead64(const void* p) {
306
+ const BrotliPackedValue* address = (const BrotliPackedValue*)p;
307
+ return address->u64;
308
+ }
309
+ static BROTLI_INLINE size_t BrotliUnalignedReadSizeT(const void* p) {
310
+ const BrotliPackedValue* address = (const BrotliPackedValue*)p;
311
+ return address->szt;
312
+ }
313
+ static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) {
314
+ BrotliPackedValue* address = (BrotliPackedValue*)p;
315
+ address->u64 = v;
316
+ }
317
+
318
+ #else /* not BROTLI_USE_PACKED_FOR_UNALIGNED */
319
+
287
320
  static BROTLI_INLINE uint16_t BrotliUnalignedRead16(const void* p) {
288
321
  uint16_t t;
289
322
  memcpy(&t, p, sizeof t);
@@ -299,10 +332,43 @@ static BROTLI_INLINE uint64_t BrotliUnalignedRead64(const void* p) {
299
332
  memcpy(&t, p, sizeof t);
300
333
  return t;
301
334
  }
335
+ static BROTLI_INLINE size_t BrotliUnalignedReadSizeT(const void* p) {
336
+ size_t t;
337
+ memcpy(&t, p, sizeof t);
338
+ return t;
339
+ }
302
340
  static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) {
303
341
  memcpy(p, &v, sizeof v);
304
342
  }
305
343
 
344
+ #endif /* BROTLI_USE_PACKED_FOR_UNALIGNED */
345
+
346
+ #if BROTLI_GNUC_HAS_BUILTIN(__builtin_bswap16, 4, 3, 0)
347
+ #define BROTLI_BSWAP16(V) ((uint16_t)__builtin_bswap16(V))
348
+ #else
349
+ #define BROTLI_BSWAP16(V) ((uint16_t)( \
350
+ (((V) & 0xFFU) << 8) | \
351
+ (((V) >> 8) & 0xFFU)))
352
+ #endif
353
+
354
+ #if BROTLI_GNUC_HAS_BUILTIN(__builtin_bswap32, 4, 3, 0)
355
+ #define BROTLI_BSWAP32(V) ((uint32_t)__builtin_bswap32(V))
356
+ #else
357
+ #define BROTLI_BSWAP32(V) ((uint32_t)( \
358
+ (((V) & 0xFFU) << 24) | (((V) & 0xFF00U) << 8) | \
359
+ (((V) >> 8) & 0xFF00U) | (((V) >> 24) & 0xFFU)))
360
+ #endif
361
+
362
+ #if BROTLI_GNUC_HAS_BUILTIN(__builtin_bswap64, 4, 3, 0)
363
+ #define BROTLI_BSWAP64(V) ((uint64_t)__builtin_bswap64(V))
364
+ #else
365
+ #define BROTLI_BSWAP64(V) ((uint64_t)( \
366
+ (((V) & 0xFFU) << 56) | (((V) & 0xFF00U) << 40) | \
367
+ (((V) & 0xFF0000U) << 24) | (((V) & 0xFF000000U) << 8) | \
368
+ (((V) >> 8) & 0xFF000000U) | (((V) >> 24) & 0xFF0000U) | \
369
+ (((V) >> 40) & 0xFF00U) | (((V) >> 56) & 0xFFU)))
370
+ #endif
371
+
306
372
  #if BROTLI_LITTLE_ENDIAN
307
373
  /* Straight endianness. Just read / write values. */
308
374
  #define BROTLI_UNALIGNED_LOAD16LE BrotliUnalignedRead16
@@ -310,32 +376,20 @@ static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) {
310
376
  #define BROTLI_UNALIGNED_LOAD64LE BrotliUnalignedRead64
311
377
  #define BROTLI_UNALIGNED_STORE64LE BrotliUnalignedWrite64
312
378
  #elif BROTLI_BIG_ENDIAN /* BROTLI_LITTLE_ENDIAN */
313
- /* Explain compiler to byte-swap values. */
314
- #define BROTLI_BSWAP16_(V) ((uint16_t)( \
315
- (((V) & 0xFFU) << 8) | \
316
- (((V) >> 8) & 0xFFU)))
317
379
  static BROTLI_INLINE uint16_t BROTLI_UNALIGNED_LOAD16LE(const void* p) {
318
380
  uint16_t value = BrotliUnalignedRead16(p);
319
- return BROTLI_BSWAP16_(value);
381
+ return BROTLI_BSWAP16(value);
320
382
  }
321
- #define BROTLI_BSWAP32_(V) ( \
322
- (((V) & 0xFFU) << 24) | (((V) & 0xFF00U) << 8) | \
323
- (((V) >> 8) & 0xFF00U) | (((V) >> 24) & 0xFFU))
324
383
  static BROTLI_INLINE uint32_t BROTLI_UNALIGNED_LOAD32LE(const void* p) {
325
384
  uint32_t value = BrotliUnalignedRead32(p);
326
- return BROTLI_BSWAP32_(value);
385
+ return BROTLI_BSWAP32(value);
327
386
  }
328
- #define BROTLI_BSWAP64_(V) ( \
329
- (((V) & 0xFFU) << 56) | (((V) & 0xFF00U) << 40) | \
330
- (((V) & 0xFF0000U) << 24) | (((V) & 0xFF000000U) << 8) | \
331
- (((V) >> 8) & 0xFF000000U) | (((V) >> 24) & 0xFF0000U) | \
332
- (((V) >> 40) & 0xFF00U) | (((V) >> 56) & 0xFFU))
333
387
  static BROTLI_INLINE uint64_t BROTLI_UNALIGNED_LOAD64LE(const void* p) {
334
388
  uint64_t value = BrotliUnalignedRead64(p);
335
- return BROTLI_BSWAP64_(value);
389
+ return BROTLI_BSWAP64(value);
336
390
  }
337
391
  static BROTLI_INLINE void BROTLI_UNALIGNED_STORE64LE(void* p, uint64_t v) {
338
- uint64_t value = BROTLI_BSWAP64_(v);
392
+ uint64_t value = BROTLI_BSWAP64(v);
339
393
  BrotliUnalignedWrite64(p, value);
340
394
  }
341
395
  #else /* BROTLI_LITTLE_ENDIAN */
@@ -475,7 +529,7 @@ BROTLI_MIN_MAX(size_t) BROTLI_MIN_MAX(uint32_t) BROTLI_MIN_MAX(uint8_t)
475
529
  BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
476
530
  #define BROTLI_TZCNT64 __builtin_ctzll
477
531
  #elif BROTLI_MSVC_VERSION_CHECK(18, 0, 0)
478
- #if defined(BROTLI_TARGET_X64)
532
+ #if defined(BROTLI_TARGET_X64) && !defined(_M_ARM64EC)
479
533
  #define BROTLI_TZCNT64 _tzcnt_u64
480
534
  #else /* BROTLI_TARGET_X64 */
481
535
  static BROTLI_INLINE uint32_t BrotliBsf64Msvc(uint64_t x) {
@@ -506,11 +560,29 @@ BROTLI_COMMON_API void* BrotliDefaultAllocFunc(void* opaque, size_t size);
506
560
  /* Default brotli_free_func */
507
561
  BROTLI_COMMON_API void BrotliDefaultFreeFunc(void* opaque, void* address);
508
562
 
563
+ /* Circular logical rotates. */
564
+ static BROTLI_INLINE uint16_t BrotliRotateRight16(uint16_t const value,
565
+ size_t count) {
566
+ count &= 0x0F; /* for fickle pattern recognition */
567
+ return (value >> count) | (uint16_t)(value << ((0U - count) & 0x0F));
568
+ }
569
+ static BROTLI_INLINE uint32_t BrotliRotateRight32(uint32_t const value,
570
+ size_t count) {
571
+ count &= 0x1F; /* for fickle pattern recognition */
572
+ return (value >> count) | (uint32_t)(value << ((0U - count) & 0x1F));
573
+ }
574
+ static BROTLI_INLINE uint64_t BrotliRotateRight64(uint64_t const value,
575
+ size_t count) {
576
+ count &= 0x3F; /* for fickle pattern recognition */
577
+ return (value >> count) | (uint64_t)(value << ((0U - count) & 0x3F));
578
+ }
579
+
509
580
  BROTLI_UNUSED_FUNCTION void BrotliSuppressUnusedFunctions(void) {
510
581
  BROTLI_UNUSED(&BrotliSuppressUnusedFunctions);
511
582
  BROTLI_UNUSED(&BrotliUnalignedRead16);
512
583
  BROTLI_UNUSED(&BrotliUnalignedRead32);
513
584
  BROTLI_UNUSED(&BrotliUnalignedRead64);
585
+ BROTLI_UNUSED(&BrotliUnalignedReadSizeT);
514
586
  BROTLI_UNUSED(&BrotliUnalignedWrite64);
515
587
  BROTLI_UNUSED(&BROTLI_UNALIGNED_LOAD16LE);
516
588
  BROTLI_UNUSED(&BROTLI_UNALIGNED_LOAD32LE);
@@ -533,9 +605,76 @@ BROTLI_UNUSED_FUNCTION void BrotliSuppressUnusedFunctions(void) {
533
605
  BROTLI_UNUSED(&brotli_max_uint8_t);
534
606
  BROTLI_UNUSED(&BrotliDefaultAllocFunc);
535
607
  BROTLI_UNUSED(&BrotliDefaultFreeFunc);
608
+ BROTLI_UNUSED(&BrotliRotateRight16);
609
+ BROTLI_UNUSED(&BrotliRotateRight32);
610
+ BROTLI_UNUSED(&BrotliRotateRight64);
536
611
  #if BROTLI_ENABLE_DUMP
537
612
  BROTLI_UNUSED(&BrotliDump);
538
613
  #endif
614
+
615
+ #if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86)) && \
616
+ !defined(_M_ARM64EC)
617
+ /* _mm_prefetch() is not defined outside of x86/x64 */
618
+ /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */
619
+ #include <mmintrin.h>
620
+ #define PREFETCH_L1(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T0)
621
+ #define PREFETCH_L2(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T1)
622
+ #elif BROTLI_GNUC_HAS_BUILTIN(__builtin_prefetch, 3, 1, 0)
623
+ #define PREFETCH_L1(ptr) \
624
+ __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
625
+ #define PREFETCH_L2(ptr) \
626
+ __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
627
+ #elif defined(__aarch64__)
628
+ #define PREFETCH_L1(ptr) \
629
+ do { \
630
+ __asm__ __volatile__("prfm pldl1keep, %0" ::"Q"(*(ptr))); \
631
+ } while (0)
632
+ #define PREFETCH_L2(ptr) \
633
+ do { \
634
+ __asm__ __volatile__("prfm pldl2keep, %0" ::"Q"(*(ptr))); \
635
+ } while (0)
636
+ #else
637
+ #define PREFETCH_L1(ptr) \
638
+ do { \
639
+ (void)(ptr); \
640
+ } while (0) /* disabled */
641
+ #define PREFETCH_L2(ptr) \
642
+ do { \
643
+ (void)(ptr); \
644
+ } while (0) /* disabled */
645
+ #endif
646
+
647
+ /* The SIMD matchers are only faster at certain quality levels. */
648
+ #if defined(_M_X64) && defined(BROTLI_TZCNT64)
649
+ #define BROTLI_MAX_SIMD_QUALITY 7
650
+ #elif defined(BROTLI_TZCNT64)
651
+ #define BROTLI_MAX_SIMD_QUALITY 6
652
+ #endif
539
653
  }
540
654
 
655
+ #if defined(_MSC_VER)
656
+ #define BROTLI_CRASH() __debugbreak(), (void)abort()
657
+ #elif BROTLI_GNUC_HAS_BUILTIN(__builtin_trap, 3, 0, 0)
658
+ #define BROTLI_CRASH() (void)__builtin_trap()
659
+ #else
660
+ #define BROTLI_CRASH() (void)abort()
661
+ #endif
662
+
663
+ /* Make BROTLI_TEST=0 act same as undefined. */
664
+ #if defined(BROTLI_TEST) && ((1-BROTLI_TEST-1) == 0)
665
+ #undef BROTLI_TEST
666
+ #endif
667
+
668
+ #if BROTLI_GNUC_HAS_ATTRIBUTE(model, 3, 0, 3)
669
+ #define BROTLI_MODEL(M) __attribute__((model(M)))
670
+ #else
671
+ #define BROTLI_MODEL(M) /* M */
672
+ #endif
673
+
674
+ #if BROTLI_GNUC_HAS_ATTRIBUTE(cold, 4, 3, 0)
675
+ #define BROTLI_COLD __attribute__((cold))
676
+ #else
677
+ #define BROTLI_COLD /* cold */
678
+ #endif
679
+
541
680
  #endif /* BROTLI_COMMON_PLATFORM_H_ */
@@ -8,10 +8,6 @@
8
8
 
9
9
  #include <brotli/shared_dictionary.h>
10
10
 
11
- #include <memory.h>
12
- #include <stdlib.h> /* malloc, free */
13
- #include <stdio.h>
14
-
15
11
  #include "dictionary.h"
16
12
  #include "platform.h"
17
13
  #include "shared_dictionary_internal.h"
@@ -279,7 +275,7 @@ static BROTLI_BOOL ParseDictionary(const uint8_t* encoded, size_t size,
279
275
  size_t pos = 0;
280
276
  uint32_t chunk_size = 0;
281
277
  size_t total_prefix_suffix_count = 0;
282
- size_t trasform_list_start[SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS];
278
+ size_t transform_list_start[SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS];
283
279
  uint16_t temporary_prefix_suffix_table[256];
284
280
 
285
281
  /* Skip magic header bytes. */
@@ -333,7 +329,7 @@ static BROTLI_BOOL ParseDictionary(const uint8_t* encoded, size_t size,
333
329
  for (i = 0; i < dict->num_transform_lists; i++) {
334
330
  BROTLI_BOOL ok = BROTLI_FALSE;
335
331
  size_t prefix_suffix_count = 0;
336
- trasform_list_start[i] = pos;
332
+ transform_list_start[i] = pos;
337
333
  dict->transforms_instances[i].prefix_suffix_map =
338
334
  temporary_prefix_suffix_table;
339
335
  ok = ParseTransformsList(
@@ -351,7 +347,7 @@ static BROTLI_BOOL ParseDictionary(const uint8_t* encoded, size_t size,
351
347
  total_prefix_suffix_count = 0;
352
348
  for (i = 0; i < dict->num_transform_lists; i++) {
353
349
  size_t prefix_suffix_count = 0;
354
- size_t position = trasform_list_start[i];
350
+ size_t position = transform_list_start[i];
355
351
  uint16_t* prefix_suffix_map =
356
352
  &dict->prefix_suffix_maps[total_prefix_suffix_count];
357
353
  BROTLI_BOOL ok = ParsePrefixSuffixTable(
@@ -10,9 +10,9 @@
10
10
  #define BROTLI_COMMON_SHARED_DICTIONARY_INTERNAL_H_
11
11
 
12
12
  #include <brotli/shared_dictionary.h>
13
- #include <brotli/types.h>
14
13
 
15
14
  #include "dictionary.h"
15
+ #include "platform.h"
16
16
  #include "transform.h"
17
17
 
18
18
  #if defined(__cplusplus) || defined(c_plusplus)
@@ -0,0 +1,56 @@
1
+ /* Copyright 2025 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
+ Central point for static initialization.
9
+
10
+ In case of "lazy" mode `BrotliXxxLazyStaticInit` is not provided by the
11
+ library. Embedder is responsible for providing it. This function should call
12
+ `BrotliXxxLazyStaticInitInner` on the first invocation. This function should
13
+ not return until execution of `BrotliXxxLazyStaticInitInner` is finished.
14
+ In C or before C++11 it is possible to call `BrotliXxxLazyStaticInitInner`
15
+ on start-up path and then `BrotliEncoderLazyStaticInit` is could be no-op;
16
+ another option is to use available thread execution controls to meet the
17
+ requirements. For possible C++11 implementation see static_init_lazy.cc.
18
+ */
19
+
20
+ #ifndef THIRD_PARTY_BROTLI_COMMON_STATIC_INIT_H_
21
+ #define THIRD_PARTY_BROTLI_COMMON_STATIC_INIT_H_
22
+
23
+ #if defined(__cplusplus) || defined(c_plusplus)
24
+ extern "C" {
25
+ #endif
26
+
27
+ /* Static data is "initialized" in compile time. */
28
+ #define BROTLI_STATIC_INIT_NONE 0
29
+ /* Static data is initialized before "main". */
30
+ #define BROTLI_STATIC_INIT_EARLY 1
31
+ /* Static data is initialized when first encoder is created. */
32
+ #define BROTLI_STATIC_INIT_LAZY 2
33
+
34
+ #define BROTLI_STATIC_INIT_DEFAULT BROTLI_STATIC_INIT_NONE
35
+
36
+ #if !defined(BROTLI_STATIC_INIT)
37
+ #define BROTLI_STATIC_INIT BROTLI_STATIC_INIT_DEFAULT
38
+ #endif
39
+
40
+ #if (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_NONE) && \
41
+ (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_EARLY) && \
42
+ (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_LAZY)
43
+ #error Invalid value for BROTLI_STATIC_INIT
44
+ #endif
45
+
46
+ #if (BROTLI_STATIC_INIT == BROTLI_STATIC_INIT_EARLY)
47
+ #if defined(BROTLI_EXTERNAL_DICTIONARY_DATA)
48
+ #error BROTLI_STATIC_INIT_EARLY will fail with BROTLI_EXTERNAL_DICTIONARY_DATA
49
+ #endif
50
+ #endif /* BROTLI_STATIC_INIT */
51
+
52
+ #if defined(__cplusplus) || defined(c_plusplus)
53
+ } /* extern "C" */
54
+ #endif
55
+
56
+ #endif // THIRD_PARTY_BROTLI_COMMON_STATIC_INIT_H_
@@ -4,6 +4,7 @@
4
4
  See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5
5
  */
6
6
 
7
+ #include "platform.h"
7
8
  #include "transform.h"
8
9
 
9
10
  #if defined(__cplusplus) || defined(c_plusplus)
@@ -11,7 +12,7 @@ extern "C" {
11
12
  #endif
12
13
 
13
14
  /* RFC 7932 transforms string data */
14
- static const char kPrefixSuffix[217] =
15
+ static const BROTLI_MODEL("small") char kPrefixSuffix[217] =
15
16
  "\1 \2, \10 of the \4 of \2s \1.\5 and \4 "
16
17
  /* 0x _0 _2 __5 _E _3 _6 _8 _E */
17
18
  "in \1\"\4 to \2\">\1\n\2. \1]\5 for \3 a \6 "
@@ -27,7 +28,7 @@ static const char kPrefixSuffix[217] =
27
28
  "t \4ize \2\xc2\xa0\4ous \5 the \2e "; /* \0 - implicit trailing zero. */
28
29
  /* Cx _2 _7___ ___ _A _F _5 _8 */
29
30
 
30
- static const uint16_t kPrefixSuffixMap[50] = {
31
+ static const BROTLI_MODEL("small") uint16_t kPrefixSuffixMap[50] = {
31
32
  0x00, 0x02, 0x05, 0x0E, 0x13, 0x16, 0x18, 0x1E, 0x23, 0x25,
32
33
  0x2A, 0x2D, 0x2F, 0x32, 0x34, 0x3A, 0x3E, 0x45, 0x47, 0x4E,
33
34
  0x55, 0x5A, 0x5C, 0x63, 0x68, 0x6D, 0x72, 0x77, 0x7A, 0x7C,
@@ -36,7 +37,7 @@ static const uint16_t kPrefixSuffixMap[50] = {
36
37
  };
37
38
 
38
39
  /* RFC 7932 transforms */
39
- static const uint8_t kTransformsData[] = {
40
+ static const BROTLI_MODEL("small") uint8_t kTransformsData[] = {
40
41
  49, BROTLI_TRANSFORM_IDENTITY, 49,
41
42
  49, BROTLI_TRANSFORM_IDENTITY, 0,
42
43
  0, BROTLI_TRANSFORM_IDENTITY, 0,
@@ -160,7 +161,8 @@ static const uint8_t kTransformsData[] = {
160
161
  0, BROTLI_TRANSFORM_UPPERCASE_FIRST, 34,
161
162
  };
162
163
 
163
- static const BrotliTransforms kBrotliTransforms = {
164
+ static const BROTLI_MODEL("small")
165
+ BrotliTransforms kBrotliTransforms = {
164
166
  sizeof(kPrefixSuffix),
165
167
  (const uint8_t*)kPrefixSuffix,
166
168
  kPrefixSuffixMap,
@@ -8,8 +8,7 @@
8
8
  #ifndef BROTLI_COMMON_TRANSFORM_H_
9
9
  #define BROTLI_COMMON_TRANSFORM_H_
10
10
 
11
- #include <brotli/port.h>
12
- #include <brotli/types.h>
11
+ #include "platform.h"
13
12
 
14
13
  #if defined(__cplusplus) || defined(c_plusplus)
15
14
  extern "C" {
@@ -18,7 +18,7 @@
18
18
  BrotliEncoderVersion methods. */
19
19
 
20
20
  #define BROTLI_VERSION_MAJOR 1
21
- #define BROTLI_VERSION_MINOR 1
21
+ #define BROTLI_VERSION_MINOR 2
22
22
  #define BROTLI_VERSION_PATCH 0
23
23
 
24
24
  #define BROTLI_VERSION BROTLI_MAKE_HEX_VERSION( \
@@ -32,9 +32,9 @@
32
32
  - interfaces not changed -> current:revision+1:age
33
33
  */
34
34
 
35
- #define BROTLI_ABI_CURRENT 2
35
+ #define BROTLI_ABI_CURRENT 3
36
36
  #define BROTLI_ABI_REVISION 0
37
- #define BROTLI_ABI_AGE 1
37
+ #define BROTLI_ABI_AGE 2
38
38
 
39
39
  #if BROTLI_VERSION_MAJOR != (BROTLI_ABI_CURRENT - BROTLI_ABI_AGE)
40
40
  #error ABI/API version inconsistency
@@ -8,15 +8,14 @@
8
8
 
9
9
  #include "bit_reader.h"
10
10
 
11
- #include <brotli/types.h>
12
-
13
11
  #include "../common/platform.h"
14
12
 
15
13
  #if defined(__cplusplus) || defined(c_plusplus)
16
14
  extern "C" {
17
15
  #endif
18
16
 
19
- const brotli_reg_t kBrotliBitMask[33] = { 0x00000000,
17
+ const BROTLI_MODEL("small")
18
+ brotli_reg_t kBrotliBitMask[33] = { 0x00000000,
20
19
  0x00000001, 0x00000003, 0x00000007, 0x0000000F,
21
20
  0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF,
22
21
  0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF,
@@ -9,10 +9,6 @@
9
9
  #ifndef BROTLI_DEC_BIT_READER_H_
10
10
  #define BROTLI_DEC_BIT_READER_H_
11
11
 
12
- #include <string.h> /* memcpy */
13
-
14
- #include <brotli/types.h>
15
-
16
12
  #include "../common/constants.h"
17
13
  #include "../common/platform.h"
18
14