jassub 1.7.13 → 1.7.15

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 (172) hide show
  1. package/dist/jassub-worker.js +6 -6
  2. package/package.json +4 -2
  3. package/dist/js/jassub-worker-modern.js +0 -128
  4. package/dist/js/jassub-worker-modern.wasm +0 -0
  5. package/dist/js/jassub-worker.js +0 -128
  6. package/dist/js/jassub-worker.wasm +0 -0
  7. package/dist/js/jassub-worker.wasm.js +0 -84
  8. package/dist/js/jassub.js +0 -832
  9. package/dist/libraries/bin/brotli.js +0 -1
  10. package/dist/libraries/include/ass/ass.h +0 -812
  11. package/dist/libraries/include/ass/ass_types.h +0 -292
  12. package/dist/libraries/include/brotli/decode.h +0 -344
  13. package/dist/libraries/include/brotli/encode.h +0 -448
  14. package/dist/libraries/include/brotli/port.h +0 -288
  15. package/dist/libraries/include/brotli/types.h +0 -83
  16. package/dist/libraries/include/expat.h +0 -1064
  17. package/dist/libraries/include/expat_config.h +0 -115
  18. package/dist/libraries/include/expat_external.h +0 -165
  19. package/dist/libraries/include/fontconfig/fcfreetype.h +0 -59
  20. package/dist/libraries/include/fontconfig/fcprivate.h +0 -134
  21. package/dist/libraries/include/fontconfig/fontconfig.h +0 -1154
  22. package/dist/libraries/include/freetype2/freetype/config/ftconfig.h +0 -63
  23. package/dist/libraries/include/freetype2/freetype/config/ftheader.h +0 -824
  24. package/dist/libraries/include/freetype2/freetype/config/ftmodule.h +0 -20
  25. package/dist/libraries/include/freetype2/freetype/config/ftoption.h +0 -1011
  26. package/dist/libraries/include/freetype2/freetype/config/ftstdlib.h +0 -175
  27. package/dist/libraries/include/freetype2/freetype/config/integer-types.h +0 -245
  28. package/dist/libraries/include/freetype2/freetype/config/mac-support.h +0 -49
  29. package/dist/libraries/include/freetype2/freetype/config/public-macros.h +0 -120
  30. package/dist/libraries/include/freetype2/freetype/freetype.h +0 -4833
  31. package/dist/libraries/include/freetype2/freetype/ftadvanc.h +0 -188
  32. package/dist/libraries/include/freetype2/freetype/ftbbox.h +0 -101
  33. package/dist/libraries/include/freetype2/freetype/ftbdf.h +0 -212
  34. package/dist/libraries/include/freetype2/freetype/ftbitmap.h +0 -329
  35. package/dist/libraries/include/freetype2/freetype/ftbzip2.h +0 -102
  36. package/dist/libraries/include/freetype2/freetype/ftcache.h +0 -1087
  37. package/dist/libraries/include/freetype2/freetype/ftchapters.h +0 -147
  38. package/dist/libraries/include/freetype2/freetype/ftcid.h +0 -167
  39. package/dist/libraries/include/freetype2/freetype/ftcolor.h +0 -1609
  40. package/dist/libraries/include/freetype2/freetype/ftdriver.h +0 -1193
  41. package/dist/libraries/include/freetype2/freetype/fterrdef.h +0 -279
  42. package/dist/libraries/include/freetype2/freetype/fterrors.h +0 -296
  43. package/dist/libraries/include/freetype2/freetype/ftfntfmt.h +0 -93
  44. package/dist/libraries/include/freetype2/freetype/ftgasp.h +0 -143
  45. package/dist/libraries/include/freetype2/freetype/ftglyph.h +0 -664
  46. package/dist/libraries/include/freetype2/freetype/ftgxval.h +0 -354
  47. package/dist/libraries/include/freetype2/freetype/ftgzip.h +0 -151
  48. package/dist/libraries/include/freetype2/freetype/ftimage.h +0 -1276
  49. package/dist/libraries/include/freetype2/freetype/ftincrem.h +0 -348
  50. package/dist/libraries/include/freetype2/freetype/ftlcdfil.h +0 -323
  51. package/dist/libraries/include/freetype2/freetype/ftlist.h +0 -296
  52. package/dist/libraries/include/freetype2/freetype/ftlogging.h +0 -184
  53. package/dist/libraries/include/freetype2/freetype/ftlzw.h +0 -100
  54. package/dist/libraries/include/freetype2/freetype/ftmac.h +0 -289
  55. package/dist/libraries/include/freetype2/freetype/ftmm.h +0 -752
  56. package/dist/libraries/include/freetype2/freetype/ftmodapi.h +0 -806
  57. package/dist/libraries/include/freetype2/freetype/ftmoderr.h +0 -204
  58. package/dist/libraries/include/freetype2/freetype/ftotval.h +0 -206
  59. package/dist/libraries/include/freetype2/freetype/ftoutln.h +0 -586
  60. package/dist/libraries/include/freetype2/freetype/ftparams.h +0 -203
  61. package/dist/libraries/include/freetype2/freetype/ftpfr.h +0 -179
  62. package/dist/libraries/include/freetype2/freetype/ftrender.h +0 -244
  63. package/dist/libraries/include/freetype2/freetype/ftsizes.h +0 -159
  64. package/dist/libraries/include/freetype2/freetype/ftsnames.h +0 -272
  65. package/dist/libraries/include/freetype2/freetype/ftstroke.h +0 -773
  66. package/dist/libraries/include/freetype2/freetype/ftsynth.h +0 -83
  67. package/dist/libraries/include/freetype2/freetype/ftsystem.h +0 -352
  68. package/dist/libraries/include/freetype2/freetype/fttrigon.h +0 -350
  69. package/dist/libraries/include/freetype2/freetype/fttypes.h +0 -615
  70. package/dist/libraries/include/freetype2/freetype/ftwinfnt.h +0 -276
  71. package/dist/libraries/include/freetype2/freetype/t1tables.h +0 -773
  72. package/dist/libraries/include/freetype2/freetype/ttnameid.h +0 -1235
  73. package/dist/libraries/include/freetype2/freetype/tttables.h +0 -855
  74. package/dist/libraries/include/freetype2/freetype/tttags.h +0 -123
  75. package/dist/libraries/include/freetype2/ft2build.h +0 -42
  76. package/dist/libraries/include/fribidi/fribidi-arabic.h +0 -81
  77. package/dist/libraries/include/fribidi/fribidi-begindecls.h +0 -3
  78. package/dist/libraries/include/fribidi/fribidi-bidi-types-list.h +0 -96
  79. package/dist/libraries/include/fribidi/fribidi-bidi-types.h +0 -405
  80. package/dist/libraries/include/fribidi/fribidi-bidi.h +0 -142
  81. package/dist/libraries/include/fribidi/fribidi-brackets.h +0 -89
  82. package/dist/libraries/include/fribidi/fribidi-char-sets-list.h +0 -54
  83. package/dist/libraries/include/fribidi/fribidi-char-sets.h +0 -106
  84. package/dist/libraries/include/fribidi/fribidi-common.h +0 -158
  85. package/dist/libraries/include/fribidi/fribidi-config.h +0 -23
  86. package/dist/libraries/include/fribidi/fribidi-deprecated.h +0 -175
  87. package/dist/libraries/include/fribidi/fribidi-enddecls.h +0 -3
  88. package/dist/libraries/include/fribidi/fribidi-flags.h +0 -72
  89. package/dist/libraries/include/fribidi/fribidi-joining-types-list.h +0 -44
  90. package/dist/libraries/include/fribidi/fribidi-joining-types.h +0 -249
  91. package/dist/libraries/include/fribidi/fribidi-joining.h +0 -74
  92. package/dist/libraries/include/fribidi/fribidi-mirroring.h +0 -86
  93. package/dist/libraries/include/fribidi/fribidi-shape.h +0 -71
  94. package/dist/libraries/include/fribidi/fribidi-types.h +0 -79
  95. package/dist/libraries/include/fribidi/fribidi-unicode-version.h +0 -10
  96. package/dist/libraries/include/fribidi/fribidi-unicode.h +0 -105
  97. package/dist/libraries/include/fribidi/fribidi.h +0 -129
  98. package/dist/libraries/include/harfbuzz/hb-aat-layout.h +0 -795
  99. package/dist/libraries/include/harfbuzz/hb-aat.h +0 -38
  100. package/dist/libraries/include/harfbuzz/hb-blob.h +0 -160
  101. package/dist/libraries/include/harfbuzz/hb-buffer.h +0 -799
  102. package/dist/libraries/include/harfbuzz/hb-common.h +0 -902
  103. package/dist/libraries/include/harfbuzz/hb-cplusplus.hh +0 -221
  104. package/dist/libraries/include/harfbuzz/hb-deprecated.h +0 -251
  105. package/dist/libraries/include/harfbuzz/hb-draw.h +0 -325
  106. package/dist/libraries/include/harfbuzz/hb-face.h +0 -181
  107. package/dist/libraries/include/harfbuzz/hb-font.h +0 -1108
  108. package/dist/libraries/include/harfbuzz/hb-ft.h +0 -145
  109. package/dist/libraries/include/harfbuzz/hb-map.h +0 -124
  110. package/dist/libraries/include/harfbuzz/hb-ot-color.h +0 -146
  111. package/dist/libraries/include/harfbuzz/hb-ot-deprecated.h +0 -141
  112. package/dist/libraries/include/harfbuzz/hb-ot-font.h +0 -45
  113. package/dist/libraries/include/harfbuzz/hb-ot-layout.h +0 -503
  114. package/dist/libraries/include/harfbuzz/hb-ot-math.h +0 -333
  115. package/dist/libraries/include/harfbuzz/hb-ot-meta.h +0 -72
  116. package/dist/libraries/include/harfbuzz/hb-ot-metrics.h +0 -129
  117. package/dist/libraries/include/harfbuzz/hb-ot-name.h +0 -158
  118. package/dist/libraries/include/harfbuzz/hb-ot-shape.h +0 -53
  119. package/dist/libraries/include/harfbuzz/hb-ot-var.h +0 -191
  120. package/dist/libraries/include/harfbuzz/hb-ot.h +0 -49
  121. package/dist/libraries/include/harfbuzz/hb-set.h +0 -200
  122. package/dist/libraries/include/harfbuzz/hb-shape-plan.h +0 -122
  123. package/dist/libraries/include/harfbuzz/hb-shape.h +0 -62
  124. package/dist/libraries/include/harfbuzz/hb-style.h +0 -81
  125. package/dist/libraries/include/harfbuzz/hb-subset-repacker.h +0 -81
  126. package/dist/libraries/include/harfbuzz/hb-subset.h +0 -234
  127. package/dist/libraries/include/harfbuzz/hb-unicode.h +0 -643
  128. package/dist/libraries/include/harfbuzz/hb-version.h +0 -95
  129. package/dist/libraries/include/harfbuzz/hb.h +0 -50
  130. package/dist/libraries/lib/cmake/expat-2.4.7/expat-config-version.cmake +0 -70
  131. package/dist/libraries/lib/cmake/expat-2.4.7/expat-config.cmake +0 -99
  132. package/dist/libraries/lib/cmake/expat-2.4.7/expat-noconfig.cmake +0 -19
  133. package/dist/libraries/lib/cmake/expat-2.4.7/expat.cmake +0 -99
  134. package/dist/libraries/lib/libass.a +0 -0
  135. package/dist/libraries/lib/libass.la +0 -41
  136. package/dist/libraries/lib/libbrotlicommon.a +0 -0
  137. package/dist/libraries/lib/libbrotlidec.a +0 -0
  138. package/dist/libraries/lib/libbrotlienc.a +0 -0
  139. package/dist/libraries/lib/libexpat.a +0 -0
  140. package/dist/libraries/lib/libfontconfig.a +0 -0
  141. package/dist/libraries/lib/libfontconfig.la +0 -41
  142. package/dist/libraries/lib/libfreetype.a +0 -0
  143. package/dist/libraries/lib/libfreetype.la +0 -41
  144. package/dist/libraries/lib/libfribidi.a +0 -0
  145. package/dist/libraries/lib/libfribidi.la +0 -41
  146. package/dist/libraries/lib/libharfbuzz-subset.a +0 -0
  147. package/dist/libraries/lib/libharfbuzz-subset.la +0 -41
  148. package/dist/libraries/lib/libharfbuzz.a +0 -0
  149. package/dist/libraries/lib/libharfbuzz.la +0 -41
  150. package/dist/libraries/lib/pkgconfig/expat.pc +0 -11
  151. package/dist/libraries/lib/pkgconfig/fontconfig.pc +0 -18
  152. package/dist/libraries/lib/pkgconfig/freetype2.pc +0 -14
  153. package/dist/libraries/lib/pkgconfig/fribidi.pc +0 -13
  154. package/dist/libraries/lib/pkgconfig/harfbuzz-subset.pc +0 -12
  155. package/dist/libraries/lib/pkgconfig/harfbuzz.pc +0 -13
  156. package/dist/libraries/lib/pkgconfig/libass.pc +0 -13
  157. package/dist/libraries/lib/pkgconfig/libbrotlicommon.pc +0 -11
  158. package/dist/libraries/lib/pkgconfig/libbrotlidec.pc +0 -12
  159. package/dist/libraries/lib/pkgconfig/libbrotlienc.pc +0 -12
  160. package/dist/libraries/share/aclocal/freetype2.m4 +0 -194
  161. package/dist/libraries/share/doc/expat/AUTHORS +0 -10
  162. package/dist/libraries/share/doc/expat/changelog +0 -1161
  163. package/dist/license/all +0 -951
  164. package/dist/license/all.tmp +0 -307
  165. package/dist/license/brotli +0 -12
  166. package/dist/license/expat +0 -71
  167. package/dist/license/fontconfig +0 -46
  168. package/dist/license/freetype +0 -92
  169. package/dist/license/fribidi +0 -15
  170. package/dist/license/harfbuzz +0 -32
  171. package/dist/license/jassub +0 -0
  172. package/dist/license/libass +0 -28
@@ -1,448 +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
- /**
8
- * @file
9
- * API for Brotli compression.
10
- */
11
-
12
- #ifndef BROTLI_ENC_ENCODE_H_
13
- #define BROTLI_ENC_ENCODE_H_
14
-
15
- #include <brotli/port.h>
16
- #include <brotli/types.h>
17
-
18
- #if defined(__cplusplus) || defined(c_plusplus)
19
- extern "C" {
20
- #endif
21
-
22
- /** Minimal value for ::BROTLI_PARAM_LGWIN parameter. */
23
- #define BROTLI_MIN_WINDOW_BITS 10
24
- /**
25
- * Maximal value for ::BROTLI_PARAM_LGWIN parameter.
26
- *
27
- * @note equal to @c BROTLI_MAX_DISTANCE_BITS constant.
28
- */
29
- #define BROTLI_MAX_WINDOW_BITS 24
30
- /**
31
- * Maximal value for ::BROTLI_PARAM_LGWIN parameter
32
- * in "Large Window Brotli" (32-bit).
33
- */
34
- #define BROTLI_LARGE_MAX_WINDOW_BITS 30
35
- /** Minimal value for ::BROTLI_PARAM_LGBLOCK parameter. */
36
- #define BROTLI_MIN_INPUT_BLOCK_BITS 16
37
- /** Maximal value for ::BROTLI_PARAM_LGBLOCK parameter. */
38
- #define BROTLI_MAX_INPUT_BLOCK_BITS 24
39
- /** Minimal value for ::BROTLI_PARAM_QUALITY parameter. */
40
- #define BROTLI_MIN_QUALITY 0
41
- /** Maximal value for ::BROTLI_PARAM_QUALITY parameter. */
42
- #define BROTLI_MAX_QUALITY 11
43
-
44
- /** Options for ::BROTLI_PARAM_MODE parameter. */
45
- typedef enum BrotliEncoderMode {
46
- /**
47
- * Default compression mode.
48
- *
49
- * In this mode compressor does not know anything in advance about the
50
- * properties of the input.
51
- */
52
- BROTLI_MODE_GENERIC = 0,
53
- /** Compression mode for UTF-8 formatted text input. */
54
- BROTLI_MODE_TEXT = 1,
55
- /** Compression mode used in WOFF 2.0. */
56
- BROTLI_MODE_FONT = 2
57
- } BrotliEncoderMode;
58
-
59
- /** Default value for ::BROTLI_PARAM_QUALITY parameter. */
60
- #define BROTLI_DEFAULT_QUALITY 11
61
- /** Default value for ::BROTLI_PARAM_LGWIN parameter. */
62
- #define BROTLI_DEFAULT_WINDOW 22
63
- /** Default value for ::BROTLI_PARAM_MODE parameter. */
64
- #define BROTLI_DEFAULT_MODE BROTLI_MODE_GENERIC
65
-
66
- /** Operations that can be performed by streaming encoder. */
67
- typedef enum BrotliEncoderOperation {
68
- /**
69
- * Process input.
70
- *
71
- * Encoder may postpone producing output, until it has processed enough input.
72
- */
73
- BROTLI_OPERATION_PROCESS = 0,
74
- /**
75
- * Produce output for all processed input.
76
- *
77
- * Actual flush is performed when input stream is depleted and there is enough
78
- * space in output stream. This means that client should repeat
79
- * ::BROTLI_OPERATION_FLUSH operation until @p available_in becomes @c 0, and
80
- * ::BrotliEncoderHasMoreOutput returns ::BROTLI_FALSE. If output is acquired
81
- * via ::BrotliEncoderTakeOutput, then operation should be repeated after
82
- * output buffer is drained.
83
- *
84
- * @warning Until flush is complete, client @b SHOULD @b NOT swap,
85
- * reduce or extend input stream.
86
- *
87
- * When flush is complete, output data will be sufficient for decoder to
88
- * reproduce all the given input.
89
- */
90
- BROTLI_OPERATION_FLUSH = 1,
91
- /**
92
- * Finalize the stream.
93
- *
94
- * Actual finalization is performed when input stream is depleted and there is
95
- * enough space in output stream. This means that client should repeat
96
- * ::BROTLI_OPERATION_FINISH operation until @p available_in becomes @c 0, and
97
- * ::BrotliEncoderHasMoreOutput returns ::BROTLI_FALSE. If output is acquired
98
- * via ::BrotliEncoderTakeOutput, then operation should be repeated after
99
- * output buffer is drained.
100
- *
101
- * @warning Until finalization is complete, client @b SHOULD @b NOT swap,
102
- * reduce or extend input stream.
103
- *
104
- * Helper function ::BrotliEncoderIsFinished checks if stream is finalized and
105
- * output fully dumped.
106
- *
107
- * Adding more input data to finalized stream is impossible.
108
- */
109
- BROTLI_OPERATION_FINISH = 2,
110
- /**
111
- * Emit metadata block to stream.
112
- *
113
- * Metadata is opaque to Brotli: neither encoder, nor decoder processes this
114
- * data or relies on it. It may be used to pass some extra information from
115
- * encoder client to decoder client without interfering with main data stream.
116
- *
117
- * @note Encoder may emit empty metadata blocks internally, to pad encoded
118
- * stream to byte boundary.
119
- *
120
- * @warning Until emitting metadata is complete client @b SHOULD @b NOT swap,
121
- * reduce or extend input stream.
122
- *
123
- * @warning The whole content of input buffer is considered to be the content
124
- * of metadata block. Do @b NOT @e append metadata to input stream,
125
- * before it is depleted with other operations.
126
- *
127
- * Stream is soft-flushed before metadata block is emitted. Metadata block
128
- * @b MUST be no longer than than 16MiB.
129
- */
130
- BROTLI_OPERATION_EMIT_METADATA = 3
131
- } BrotliEncoderOperation;
132
-
133
- /** Options to be used with ::BrotliEncoderSetParameter. */
134
- typedef enum BrotliEncoderParameter {
135
- /**
136
- * Tune encoder for specific input.
137
- *
138
- * ::BrotliEncoderMode enumerates all available values.
139
- */
140
- BROTLI_PARAM_MODE = 0,
141
- /**
142
- * The main compression speed-density lever.
143
- *
144
- * The higher the quality, the slower the compression. Range is
145
- * from ::BROTLI_MIN_QUALITY to ::BROTLI_MAX_QUALITY.
146
- */
147
- BROTLI_PARAM_QUALITY = 1,
148
- /**
149
- * Recommended sliding LZ77 window size.
150
- *
151
- * Encoder may reduce this value, e.g. if input is much smaller than
152
- * window size.
153
- *
154
- * Window size is `(1 << value) - 16`.
155
- *
156
- * Range is from ::BROTLI_MIN_WINDOW_BITS to ::BROTLI_MAX_WINDOW_BITS.
157
- */
158
- BROTLI_PARAM_LGWIN = 2,
159
- /**
160
- * Recommended input block size.
161
- *
162
- * Encoder may reduce this value, e.g. if input is much smaller than input
163
- * block size.
164
- *
165
- * Range is from ::BROTLI_MIN_INPUT_BLOCK_BITS to
166
- * ::BROTLI_MAX_INPUT_BLOCK_BITS.
167
- *
168
- * @note Bigger input block size allows better compression, but consumes more
169
- * memory. \n The rough formula of memory used for temporary input
170
- * storage is `3 << lgBlock`.
171
- */
172
- BROTLI_PARAM_LGBLOCK = 3,
173
- /**
174
- * Flag that affects usage of "literal context modeling" format feature.
175
- *
176
- * This flag is a "decoding-speed vs compression ratio" trade-off.
177
- */
178
- BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING = 4,
179
- /**
180
- * Estimated total input size for all ::BrotliEncoderCompressStream calls.
181
- *
182
- * The default value is 0, which means that the total input size is unknown.
183
- */
184
- BROTLI_PARAM_SIZE_HINT = 5,
185
- /**
186
- * Flag that determines if "Large Window Brotli" is used.
187
- */
188
- BROTLI_PARAM_LARGE_WINDOW = 6,
189
- /**
190
- * Recommended number of postfix bits (NPOSTFIX).
191
- *
192
- * Encoder may change this value.
193
- *
194
- * Range is from 0 to ::BROTLI_MAX_NPOSTFIX.
195
- */
196
- BROTLI_PARAM_NPOSTFIX = 7,
197
- /**
198
- * Recommended number of direct distance codes (NDIRECT).
199
- *
200
- * Encoder may change this value.
201
- *
202
- * Range is from 0 to (15 << NPOSTFIX) in steps of (1 << NPOSTFIX).
203
- */
204
- BROTLI_PARAM_NDIRECT = 8,
205
- /**
206
- * Number of bytes of input stream already processed by a different instance.
207
- *
208
- * @note It is important to configure all the encoder instances with same
209
- * parameters (except this one) in order to allow all the encoded parts
210
- * obey the same restrictions implied by header.
211
- *
212
- * If offset is not 0, then stream header is omitted.
213
- * In any case output start is byte aligned, so for proper streams stitching
214
- * "predecessor" stream must be flushed.
215
- *
216
- * Range is not artificially limited, but all the values greater or equal to
217
- * maximal window size have the same effect. Values greater than 2**30 are not
218
- * allowed.
219
- */
220
- BROTLI_PARAM_STREAM_OFFSET = 9
221
- } BrotliEncoderParameter;
222
-
223
- /**
224
- * Opaque structure that holds encoder state.
225
- *
226
- * Allocated and initialized with ::BrotliEncoderCreateInstance.
227
- * Cleaned up and deallocated with ::BrotliEncoderDestroyInstance.
228
- */
229
- typedef struct BrotliEncoderStateStruct BrotliEncoderState;
230
-
231
- /**
232
- * Sets the specified parameter to the given encoder instance.
233
- *
234
- * @param state encoder instance
235
- * @param param parameter to set
236
- * @param value new parameter value
237
- * @returns ::BROTLI_FALSE if parameter is unrecognized, or value is invalid
238
- * @returns ::BROTLI_FALSE if value of parameter can not be changed at current
239
- * encoder state (e.g. when encoding is started, window size might be
240
- * already encoded and therefore it is impossible to change it)
241
- * @returns ::BROTLI_TRUE if value is accepted
242
- * @warning invalid values might be accepted in case they would not break
243
- * encoding process.
244
- */
245
- BROTLI_ENC_API BROTLI_BOOL BrotliEncoderSetParameter(
246
- BrotliEncoderState* state, BrotliEncoderParameter param, uint32_t value);
247
-
248
- /**
249
- * Creates an instance of ::BrotliEncoderState and initializes it.
250
- *
251
- * @p alloc_func and @p free_func @b MUST be both zero or both non-zero. In the
252
- * case they are both zero, default memory allocators are used. @p opaque is
253
- * passed to @p alloc_func and @p free_func when they are called. @p free_func
254
- * has to return without doing anything when asked to free a NULL pointer.
255
- *
256
- * @param alloc_func custom memory allocation function
257
- * @param free_func custom memory free function
258
- * @param opaque custom memory manager handle
259
- * @returns @c 0 if instance can not be allocated or initialized
260
- * @returns pointer to initialized ::BrotliEncoderState otherwise
261
- */
262
- BROTLI_ENC_API BrotliEncoderState* BrotliEncoderCreateInstance(
263
- brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque);
264
-
265
- /**
266
- * Deinitializes and frees ::BrotliEncoderState instance.
267
- *
268
- * @param state decoder instance to be cleaned up and deallocated
269
- */
270
- BROTLI_ENC_API void BrotliEncoderDestroyInstance(BrotliEncoderState* state);
271
-
272
- /**
273
- * Calculates the output size bound for the given @p input_size.
274
- *
275
- * @warning Result is only valid if quality is at least @c 2 and, in
276
- * case ::BrotliEncoderCompressStream was used, no flushes
277
- * (::BROTLI_OPERATION_FLUSH) were performed.
278
- *
279
- * @param input_size size of projected input
280
- * @returns @c 0 if result does not fit @c size_t
281
- */
282
- BROTLI_ENC_API size_t BrotliEncoderMaxCompressedSize(size_t input_size);
283
-
284
- /**
285
- * Performs one-shot memory-to-memory compression.
286
- *
287
- * Compresses the data in @p input_buffer into @p encoded_buffer, and sets
288
- * @p *encoded_size to the compressed length.
289
- *
290
- * @note If ::BrotliEncoderMaxCompressedSize(@p input_size) returns non-zero
291
- * value, then output is guaranteed to be no longer than that.
292
- *
293
- * @note If @p lgwin is greater than ::BROTLI_MAX_WINDOW_BITS then resulting
294
- * stream might be incompatible with RFC 7932; to decode such streams,
295
- * decoder should be configured with
296
- * ::BROTLI_DECODER_PARAM_LARGE_WINDOW = @c 1
297
- *
298
- * @param quality quality parameter value, e.g. ::BROTLI_DEFAULT_QUALITY
299
- * @param lgwin lgwin parameter value, e.g. ::BROTLI_DEFAULT_WINDOW
300
- * @param mode mode parameter value, e.g. ::BROTLI_DEFAULT_MODE
301
- * @param input_size size of @p input_buffer
302
- * @param input_buffer input data buffer with at least @p input_size
303
- * addressable bytes
304
- * @param[in, out] encoded_size @b in: size of @p encoded_buffer; \n
305
- * @b out: length of compressed data written to
306
- * @p encoded_buffer, or @c 0 if compression fails
307
- * @param encoded_buffer compressed data destination buffer
308
- * @returns ::BROTLI_FALSE in case of compression error
309
- * @returns ::BROTLI_FALSE if output buffer is too small
310
- * @returns ::BROTLI_TRUE otherwise
311
- */
312
- BROTLI_ENC_API BROTLI_BOOL BrotliEncoderCompress(
313
- int quality, int lgwin, BrotliEncoderMode mode, size_t input_size,
314
- const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
315
- size_t* encoded_size,
316
- uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]);
317
-
318
- /**
319
- * Compresses input stream to output stream.
320
- *
321
- * The values @p *available_in and @p *available_out must specify the number of
322
- * bytes addressable at @p *next_in and @p *next_out respectively.
323
- * When @p *available_out is @c 0, @p next_out is allowed to be @c NULL.
324
- *
325
- * After each call, @p *available_in will be decremented by the amount of input
326
- * bytes consumed, and the @p *next_in pointer will be incremented by that
327
- * amount. Similarly, @p *available_out will be decremented by the amount of
328
- * output bytes written, and the @p *next_out pointer will be incremented by
329
- * that amount.
330
- *
331
- * @p total_out, if it is not a null-pointer, will be set to the number
332
- * of bytes compressed since the last @p state initialization.
333
- *
334
- *
335
- *
336
- * Internally workflow consists of 3 tasks:
337
- * -# (optionally) copy input data to internal buffer
338
- * -# actually compress data and (optionally) store it to internal buffer
339
- * -# (optionally) copy compressed bytes from internal buffer to output stream
340
- *
341
- * Whenever all 3 tasks can't move forward anymore, or error occurs, this
342
- * method returns the control flow to caller.
343
- *
344
- * @p op is used to perform flush, finish the stream, or inject metadata block.
345
- * See ::BrotliEncoderOperation for more information.
346
- *
347
- * Flushing the stream means forcing encoding of all input passed to encoder and
348
- * completing the current output block, so it could be fully decoded by stream
349
- * decoder. To perform flush set @p op to ::BROTLI_OPERATION_FLUSH.
350
- * Under some circumstances (e.g. lack of output stream capacity) this operation
351
- * would require several calls to ::BrotliEncoderCompressStream. The method must
352
- * be called again until both input stream is depleted and encoder has no more
353
- * output (see ::BrotliEncoderHasMoreOutput) after the method is called.
354
- *
355
- * Finishing the stream means encoding of all input passed to encoder and
356
- * adding specific "final" marks, so stream decoder could determine that stream
357
- * is complete. To perform finish set @p op to ::BROTLI_OPERATION_FINISH.
358
- * Under some circumstances (e.g. lack of output stream capacity) this operation
359
- * would require several calls to ::BrotliEncoderCompressStream. The method must
360
- * be called again until both input stream is depleted and encoder has no more
361
- * output (see ::BrotliEncoderHasMoreOutput) after the method is called.
362
- *
363
- * @warning When flushing and finishing, @p op should not change until operation
364
- * is complete; input stream should not be swapped, reduced or
365
- * extended as well.
366
- *
367
- * @param state encoder instance
368
- * @param op requested operation
369
- * @param[in, out] available_in @b in: amount of available input; \n
370
- * @b out: amount of unused input
371
- * @param[in, out] next_in pointer to the next input byte
372
- * @param[in, out] available_out @b in: length of output buffer; \n
373
- * @b out: remaining size of output buffer
374
- * @param[in, out] next_out compressed output buffer cursor;
375
- * can be @c NULL if @p available_out is @c 0
376
- * @param[out] total_out number of bytes produced so far; can be @c NULL
377
- * @returns ::BROTLI_FALSE if there was an error
378
- * @returns ::BROTLI_TRUE otherwise
379
- */
380
- BROTLI_ENC_API BROTLI_BOOL BrotliEncoderCompressStream(
381
- BrotliEncoderState* state, BrotliEncoderOperation op, size_t* available_in,
382
- const uint8_t** next_in, size_t* available_out, uint8_t** next_out,
383
- size_t* total_out);
384
-
385
- /**
386
- * Checks if encoder instance reached the final state.
387
- *
388
- * @param state encoder instance
389
- * @returns ::BROTLI_TRUE if encoder is in a state where it reached the end of
390
- * the input and produced all of the output
391
- * @returns ::BROTLI_FALSE otherwise
392
- */
393
- BROTLI_ENC_API BROTLI_BOOL BrotliEncoderIsFinished(BrotliEncoderState* state);
394
-
395
- /**
396
- * Checks if encoder has more output.
397
- *
398
- * @param state encoder instance
399
- * @returns ::BROTLI_TRUE, if encoder has some unconsumed output
400
- * @returns ::BROTLI_FALSE otherwise
401
- */
402
- BROTLI_ENC_API BROTLI_BOOL BrotliEncoderHasMoreOutput(
403
- BrotliEncoderState* state);
404
-
405
- /**
406
- * Acquires pointer to internal output buffer.
407
- *
408
- * This method is used to make language bindings easier and more efficient:
409
- * -# push data to ::BrotliEncoderCompressStream,
410
- * until ::BrotliEncoderHasMoreOutput returns BROTL_TRUE
411
- * -# use ::BrotliEncoderTakeOutput to peek bytes and copy to language-specific
412
- * entity
413
- *
414
- * Also this could be useful if there is an output stream that is able to
415
- * consume all the provided data (e.g. when data is saved to file system).
416
- *
417
- * @attention After every call to ::BrotliEncoderTakeOutput @p *size bytes of
418
- * output are considered consumed for all consecutive calls to the
419
- * instance methods; returned pointer becomes invalidated as well.
420
- *
421
- * @note Encoder output is not guaranteed to be contiguous. This means that
422
- * after the size-unrestricted call to ::BrotliEncoderTakeOutput,
423
- * immediate next call to ::BrotliEncoderTakeOutput may return more data.
424
- *
425
- * @param state encoder instance
426
- * @param[in, out] size @b in: number of bytes caller is ready to take, @c 0 if
427
- * any amount could be handled; \n
428
- * @b out: amount of data pointed by returned pointer and
429
- * considered consumed; \n
430
- * out value is never greater than in value, unless it is @c 0
431
- * @returns pointer to output data
432
- */
433
- BROTLI_ENC_API const uint8_t* BrotliEncoderTakeOutput(
434
- BrotliEncoderState* state, size_t* size);
435
-
436
-
437
- /**
438
- * Gets an encoder library version.
439
- *
440
- * Look at BROTLI_VERSION for more information.
441
- */
442
- BROTLI_ENC_API uint32_t BrotliEncoderVersion(void);
443
-
444
- #if defined(__cplusplus) || defined(c_plusplus)
445
- } /* extern "C" */
446
- #endif
447
-
448
- #endif /* BROTLI_ENC_ENCODE_H_ */