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.
- package/dist/jassub-worker.js +6 -6
- package/package.json +4 -2
- package/dist/js/jassub-worker-modern.js +0 -128
- package/dist/js/jassub-worker-modern.wasm +0 -0
- package/dist/js/jassub-worker.js +0 -128
- package/dist/js/jassub-worker.wasm +0 -0
- package/dist/js/jassub-worker.wasm.js +0 -84
- package/dist/js/jassub.js +0 -832
- package/dist/libraries/bin/brotli.js +0 -1
- package/dist/libraries/include/ass/ass.h +0 -812
- package/dist/libraries/include/ass/ass_types.h +0 -292
- package/dist/libraries/include/brotli/decode.h +0 -344
- package/dist/libraries/include/brotli/encode.h +0 -448
- package/dist/libraries/include/brotli/port.h +0 -288
- package/dist/libraries/include/brotli/types.h +0 -83
- package/dist/libraries/include/expat.h +0 -1064
- package/dist/libraries/include/expat_config.h +0 -115
- package/dist/libraries/include/expat_external.h +0 -165
- package/dist/libraries/include/fontconfig/fcfreetype.h +0 -59
- package/dist/libraries/include/fontconfig/fcprivate.h +0 -134
- package/dist/libraries/include/fontconfig/fontconfig.h +0 -1154
- package/dist/libraries/include/freetype2/freetype/config/ftconfig.h +0 -63
- package/dist/libraries/include/freetype2/freetype/config/ftheader.h +0 -824
- package/dist/libraries/include/freetype2/freetype/config/ftmodule.h +0 -20
- package/dist/libraries/include/freetype2/freetype/config/ftoption.h +0 -1011
- package/dist/libraries/include/freetype2/freetype/config/ftstdlib.h +0 -175
- package/dist/libraries/include/freetype2/freetype/config/integer-types.h +0 -245
- package/dist/libraries/include/freetype2/freetype/config/mac-support.h +0 -49
- package/dist/libraries/include/freetype2/freetype/config/public-macros.h +0 -120
- package/dist/libraries/include/freetype2/freetype/freetype.h +0 -4833
- package/dist/libraries/include/freetype2/freetype/ftadvanc.h +0 -188
- package/dist/libraries/include/freetype2/freetype/ftbbox.h +0 -101
- package/dist/libraries/include/freetype2/freetype/ftbdf.h +0 -212
- package/dist/libraries/include/freetype2/freetype/ftbitmap.h +0 -329
- package/dist/libraries/include/freetype2/freetype/ftbzip2.h +0 -102
- package/dist/libraries/include/freetype2/freetype/ftcache.h +0 -1087
- package/dist/libraries/include/freetype2/freetype/ftchapters.h +0 -147
- package/dist/libraries/include/freetype2/freetype/ftcid.h +0 -167
- package/dist/libraries/include/freetype2/freetype/ftcolor.h +0 -1609
- package/dist/libraries/include/freetype2/freetype/ftdriver.h +0 -1193
- package/dist/libraries/include/freetype2/freetype/fterrdef.h +0 -279
- package/dist/libraries/include/freetype2/freetype/fterrors.h +0 -296
- package/dist/libraries/include/freetype2/freetype/ftfntfmt.h +0 -93
- package/dist/libraries/include/freetype2/freetype/ftgasp.h +0 -143
- package/dist/libraries/include/freetype2/freetype/ftglyph.h +0 -664
- package/dist/libraries/include/freetype2/freetype/ftgxval.h +0 -354
- package/dist/libraries/include/freetype2/freetype/ftgzip.h +0 -151
- package/dist/libraries/include/freetype2/freetype/ftimage.h +0 -1276
- package/dist/libraries/include/freetype2/freetype/ftincrem.h +0 -348
- package/dist/libraries/include/freetype2/freetype/ftlcdfil.h +0 -323
- package/dist/libraries/include/freetype2/freetype/ftlist.h +0 -296
- package/dist/libraries/include/freetype2/freetype/ftlogging.h +0 -184
- package/dist/libraries/include/freetype2/freetype/ftlzw.h +0 -100
- package/dist/libraries/include/freetype2/freetype/ftmac.h +0 -289
- package/dist/libraries/include/freetype2/freetype/ftmm.h +0 -752
- package/dist/libraries/include/freetype2/freetype/ftmodapi.h +0 -806
- package/dist/libraries/include/freetype2/freetype/ftmoderr.h +0 -204
- package/dist/libraries/include/freetype2/freetype/ftotval.h +0 -206
- package/dist/libraries/include/freetype2/freetype/ftoutln.h +0 -586
- package/dist/libraries/include/freetype2/freetype/ftparams.h +0 -203
- package/dist/libraries/include/freetype2/freetype/ftpfr.h +0 -179
- package/dist/libraries/include/freetype2/freetype/ftrender.h +0 -244
- package/dist/libraries/include/freetype2/freetype/ftsizes.h +0 -159
- package/dist/libraries/include/freetype2/freetype/ftsnames.h +0 -272
- package/dist/libraries/include/freetype2/freetype/ftstroke.h +0 -773
- package/dist/libraries/include/freetype2/freetype/ftsynth.h +0 -83
- package/dist/libraries/include/freetype2/freetype/ftsystem.h +0 -352
- package/dist/libraries/include/freetype2/freetype/fttrigon.h +0 -350
- package/dist/libraries/include/freetype2/freetype/fttypes.h +0 -615
- package/dist/libraries/include/freetype2/freetype/ftwinfnt.h +0 -276
- package/dist/libraries/include/freetype2/freetype/t1tables.h +0 -773
- package/dist/libraries/include/freetype2/freetype/ttnameid.h +0 -1235
- package/dist/libraries/include/freetype2/freetype/tttables.h +0 -855
- package/dist/libraries/include/freetype2/freetype/tttags.h +0 -123
- package/dist/libraries/include/freetype2/ft2build.h +0 -42
- package/dist/libraries/include/fribidi/fribidi-arabic.h +0 -81
- package/dist/libraries/include/fribidi/fribidi-begindecls.h +0 -3
- package/dist/libraries/include/fribidi/fribidi-bidi-types-list.h +0 -96
- package/dist/libraries/include/fribidi/fribidi-bidi-types.h +0 -405
- package/dist/libraries/include/fribidi/fribidi-bidi.h +0 -142
- package/dist/libraries/include/fribidi/fribidi-brackets.h +0 -89
- package/dist/libraries/include/fribidi/fribidi-char-sets-list.h +0 -54
- package/dist/libraries/include/fribidi/fribidi-char-sets.h +0 -106
- package/dist/libraries/include/fribidi/fribidi-common.h +0 -158
- package/dist/libraries/include/fribidi/fribidi-config.h +0 -23
- package/dist/libraries/include/fribidi/fribidi-deprecated.h +0 -175
- package/dist/libraries/include/fribidi/fribidi-enddecls.h +0 -3
- package/dist/libraries/include/fribidi/fribidi-flags.h +0 -72
- package/dist/libraries/include/fribidi/fribidi-joining-types-list.h +0 -44
- package/dist/libraries/include/fribidi/fribidi-joining-types.h +0 -249
- package/dist/libraries/include/fribidi/fribidi-joining.h +0 -74
- package/dist/libraries/include/fribidi/fribidi-mirroring.h +0 -86
- package/dist/libraries/include/fribidi/fribidi-shape.h +0 -71
- package/dist/libraries/include/fribidi/fribidi-types.h +0 -79
- package/dist/libraries/include/fribidi/fribidi-unicode-version.h +0 -10
- package/dist/libraries/include/fribidi/fribidi-unicode.h +0 -105
- package/dist/libraries/include/fribidi/fribidi.h +0 -129
- package/dist/libraries/include/harfbuzz/hb-aat-layout.h +0 -795
- package/dist/libraries/include/harfbuzz/hb-aat.h +0 -38
- package/dist/libraries/include/harfbuzz/hb-blob.h +0 -160
- package/dist/libraries/include/harfbuzz/hb-buffer.h +0 -799
- package/dist/libraries/include/harfbuzz/hb-common.h +0 -902
- package/dist/libraries/include/harfbuzz/hb-cplusplus.hh +0 -221
- package/dist/libraries/include/harfbuzz/hb-deprecated.h +0 -251
- package/dist/libraries/include/harfbuzz/hb-draw.h +0 -325
- package/dist/libraries/include/harfbuzz/hb-face.h +0 -181
- package/dist/libraries/include/harfbuzz/hb-font.h +0 -1108
- package/dist/libraries/include/harfbuzz/hb-ft.h +0 -145
- package/dist/libraries/include/harfbuzz/hb-map.h +0 -124
- package/dist/libraries/include/harfbuzz/hb-ot-color.h +0 -146
- package/dist/libraries/include/harfbuzz/hb-ot-deprecated.h +0 -141
- package/dist/libraries/include/harfbuzz/hb-ot-font.h +0 -45
- package/dist/libraries/include/harfbuzz/hb-ot-layout.h +0 -503
- package/dist/libraries/include/harfbuzz/hb-ot-math.h +0 -333
- package/dist/libraries/include/harfbuzz/hb-ot-meta.h +0 -72
- package/dist/libraries/include/harfbuzz/hb-ot-metrics.h +0 -129
- package/dist/libraries/include/harfbuzz/hb-ot-name.h +0 -158
- package/dist/libraries/include/harfbuzz/hb-ot-shape.h +0 -53
- package/dist/libraries/include/harfbuzz/hb-ot-var.h +0 -191
- package/dist/libraries/include/harfbuzz/hb-ot.h +0 -49
- package/dist/libraries/include/harfbuzz/hb-set.h +0 -200
- package/dist/libraries/include/harfbuzz/hb-shape-plan.h +0 -122
- package/dist/libraries/include/harfbuzz/hb-shape.h +0 -62
- package/dist/libraries/include/harfbuzz/hb-style.h +0 -81
- package/dist/libraries/include/harfbuzz/hb-subset-repacker.h +0 -81
- package/dist/libraries/include/harfbuzz/hb-subset.h +0 -234
- package/dist/libraries/include/harfbuzz/hb-unicode.h +0 -643
- package/dist/libraries/include/harfbuzz/hb-version.h +0 -95
- package/dist/libraries/include/harfbuzz/hb.h +0 -50
- package/dist/libraries/lib/cmake/expat-2.4.7/expat-config-version.cmake +0 -70
- package/dist/libraries/lib/cmake/expat-2.4.7/expat-config.cmake +0 -99
- package/dist/libraries/lib/cmake/expat-2.4.7/expat-noconfig.cmake +0 -19
- package/dist/libraries/lib/cmake/expat-2.4.7/expat.cmake +0 -99
- package/dist/libraries/lib/libass.a +0 -0
- package/dist/libraries/lib/libass.la +0 -41
- package/dist/libraries/lib/libbrotlicommon.a +0 -0
- package/dist/libraries/lib/libbrotlidec.a +0 -0
- package/dist/libraries/lib/libbrotlienc.a +0 -0
- package/dist/libraries/lib/libexpat.a +0 -0
- package/dist/libraries/lib/libfontconfig.a +0 -0
- package/dist/libraries/lib/libfontconfig.la +0 -41
- package/dist/libraries/lib/libfreetype.a +0 -0
- package/dist/libraries/lib/libfreetype.la +0 -41
- package/dist/libraries/lib/libfribidi.a +0 -0
- package/dist/libraries/lib/libfribidi.la +0 -41
- package/dist/libraries/lib/libharfbuzz-subset.a +0 -0
- package/dist/libraries/lib/libharfbuzz-subset.la +0 -41
- package/dist/libraries/lib/libharfbuzz.a +0 -0
- package/dist/libraries/lib/libharfbuzz.la +0 -41
- package/dist/libraries/lib/pkgconfig/expat.pc +0 -11
- package/dist/libraries/lib/pkgconfig/fontconfig.pc +0 -18
- package/dist/libraries/lib/pkgconfig/freetype2.pc +0 -14
- package/dist/libraries/lib/pkgconfig/fribidi.pc +0 -13
- package/dist/libraries/lib/pkgconfig/harfbuzz-subset.pc +0 -12
- package/dist/libraries/lib/pkgconfig/harfbuzz.pc +0 -13
- package/dist/libraries/lib/pkgconfig/libass.pc +0 -13
- package/dist/libraries/lib/pkgconfig/libbrotlicommon.pc +0 -11
- package/dist/libraries/lib/pkgconfig/libbrotlidec.pc +0 -12
- package/dist/libraries/lib/pkgconfig/libbrotlienc.pc +0 -12
- package/dist/libraries/share/aclocal/freetype2.m4 +0 -194
- package/dist/libraries/share/doc/expat/AUTHORS +0 -10
- package/dist/libraries/share/doc/expat/changelog +0 -1161
- package/dist/license/all +0 -951
- package/dist/license/all.tmp +0 -307
- package/dist/license/brotli +0 -12
- package/dist/license/expat +0 -71
- package/dist/license/fontconfig +0 -46
- package/dist/license/freetype +0 -92
- package/dist/license/fribidi +0 -15
- package/dist/license/harfbuzz +0 -32
- package/dist/license/jassub +0 -0
- package/dist/license/libass +0 -28
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
|
|
3
|
-
* Copyright (C) 2011 Grigori Goronzy <greg@chown.ath.cx>
|
|
4
|
-
*
|
|
5
|
-
* This file is part of libass.
|
|
6
|
-
*
|
|
7
|
-
* Permission to use, copy, modify, and distribute this software for any
|
|
8
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
9
|
-
* copyright notice and this permission notice appear in all copies.
|
|
10
|
-
*
|
|
11
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
12
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
13
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
14
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
15
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
16
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
17
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
#ifndef LIBASS_TYPES_H
|
|
21
|
-
#define LIBASS_TYPES_H
|
|
22
|
-
|
|
23
|
-
#include <stdint.h>
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* GENERAL NOTE regarding the definitions exposed by this header
|
|
27
|
-
*
|
|
28
|
-
* The main use case for this is _reading_ the track fields, especially
|
|
29
|
-
* track->YCbCrMatrix, to correctly display the rendering results.
|
|
30
|
-
*
|
|
31
|
-
* Furthermore, the exposed definitions also open up the possibility to _modify_
|
|
32
|
-
* the exposed structs, working closer to library internals and bypassing
|
|
33
|
-
* e.g. creation of intermediate ASS-text buffers when creating dynamic events.
|
|
34
|
-
* This is an advanced use case and should only be done when well-versed in ASS
|
|
35
|
-
* and aware of the effects and legal values of _all_ fields of the structs.
|
|
36
|
-
* The burden of sanitising and correctly initialising fields is then also
|
|
37
|
-
* placed on the API user.
|
|
38
|
-
* By nature of direct struct modifications working closer to library internals,
|
|
39
|
-
* workflows that make use of this possibility are also more likely to be
|
|
40
|
-
* affected by future API breaks than those which do not.
|
|
41
|
-
*
|
|
42
|
-
* To avoid desynchronisation with internal states, there are some restrictions
|
|
43
|
-
* on when and how direct struct modification can be performed.
|
|
44
|
-
* Ignoring them may lead to undefined behaviour. See the following listing:
|
|
45
|
-
*
|
|
46
|
-
* - Manual struct edits and track-modifying (including modification to the
|
|
47
|
-
* event and style elements of the track) API calls cannot be freely mixed:
|
|
48
|
-
* - Before manual changes are performed, it is allowed to call any such API,
|
|
49
|
-
* unless the documentation of the funtion says otherwise.
|
|
50
|
-
* - After manual changes have been performed, no track-modifying API may be
|
|
51
|
-
* invoked, except for ass_track_set_feature and ass_flush_events.
|
|
52
|
-
* - After the first call to ass_render_frame, existing array members
|
|
53
|
-
* (e.g. members of events) and non-array track fields (e.g. PlayResX
|
|
54
|
-
* or event_format) must not be modified. Adding new members to arrays
|
|
55
|
-
* and updating the corresponding counter remains allowed.
|
|
56
|
-
* - Adding and removing members to array fields, like events or styles,
|
|
57
|
-
* must be done through the corresponding API function, e.g. ass_alloc_event.
|
|
58
|
-
* See the documentation of these functions.
|
|
59
|
-
* - The memory pointed to by string fields (char *) must be
|
|
60
|
-
* free'able by the implementation of free used by libass.
|
|
61
|
-
*
|
|
62
|
-
* A non-exhaustive list of examples of track-modifying API functions:
|
|
63
|
-
* ass_process_data, ass_process_codec_private,
|
|
64
|
-
* ass_process_chunk, ass_read_styles, ...
|
|
65
|
-
*
|
|
66
|
-
* Direct struct modification can be done safely, but it is also easy to
|
|
67
|
-
* miss an initialisation or violate these restrictions, thus introducing bugs
|
|
68
|
-
* that may not manifest immediately. It should be carefully considered
|
|
69
|
-
* whether this is worthwhile for the desired use-case.
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
|
-
#define VALIGN_SUB 0
|
|
73
|
-
#define VALIGN_CENTER 8
|
|
74
|
-
#define VALIGN_TOP 4
|
|
75
|
-
#define HALIGN_LEFT 1
|
|
76
|
-
#define HALIGN_CENTER 2
|
|
77
|
-
#define HALIGN_RIGHT 3
|
|
78
|
-
#define ASS_JUSTIFY_AUTO 0
|
|
79
|
-
#define ASS_JUSTIFY_LEFT 1
|
|
80
|
-
#define ASS_JUSTIFY_CENTER 2
|
|
81
|
-
#define ASS_JUSTIFY_RIGHT 3
|
|
82
|
-
|
|
83
|
-
#define FONT_WEIGHT_LIGHT 300
|
|
84
|
-
#define FONT_WEIGHT_MEDIUM 400
|
|
85
|
-
#define FONT_WEIGHT_BOLD 700
|
|
86
|
-
#define FONT_SLANT_NONE 0
|
|
87
|
-
#define FONT_SLANT_ITALIC 100
|
|
88
|
-
#define FONT_SLANT_OBLIQUE 110
|
|
89
|
-
#define FONT_WIDTH_CONDENSED 75
|
|
90
|
-
#define FONT_WIDTH_NORMAL 100
|
|
91
|
-
#define FONT_WIDTH_EXPANDED 125
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
/* Opaque objects internally used by libass. Contents are private. */
|
|
95
|
-
typedef struct ass_renderer ASS_Renderer;
|
|
96
|
-
typedef struct render_priv ASS_RenderPriv;
|
|
97
|
-
typedef struct parser_priv ASS_ParserPriv;
|
|
98
|
-
typedef struct ass_library ASS_Library;
|
|
99
|
-
|
|
100
|
-
/* ASS Style: line */
|
|
101
|
-
typedef struct ass_style {
|
|
102
|
-
char *Name; //must be a valid non-NULL string pointer; may be an empty string
|
|
103
|
-
char *FontName; //must be a valid non-NULL string pointer; may be an empty string
|
|
104
|
-
double FontSize;
|
|
105
|
-
uint32_t PrimaryColour;
|
|
106
|
-
uint32_t SecondaryColour;
|
|
107
|
-
uint32_t OutlineColour;
|
|
108
|
-
uint32_t BackColour;
|
|
109
|
-
int Bold; // 0 or 1 (boolean)
|
|
110
|
-
int Italic; // 0 or 1 (boolean)
|
|
111
|
-
int Underline; // 0 or 1 (boolean)
|
|
112
|
-
int StrikeOut; // 0 or 1 (boolean)
|
|
113
|
-
double ScaleX; // positive with 1.0 representing 100%
|
|
114
|
-
double ScaleY; // positive with 1.0 representing 100%
|
|
115
|
-
double Spacing;
|
|
116
|
-
double Angle;
|
|
117
|
-
int BorderStyle;
|
|
118
|
-
double Outline;
|
|
119
|
-
double Shadow;
|
|
120
|
-
int Alignment; // use `VALIGN_* | HALIGN_*` as value
|
|
121
|
-
int MarginL;
|
|
122
|
-
int MarginR;
|
|
123
|
-
int MarginV;
|
|
124
|
-
int Encoding;
|
|
125
|
-
int treat_fontname_as_pattern; // does nothing (left in place for ABI-compatibility)
|
|
126
|
-
double Blur; // sets a default \blur for the event; same values as \blur
|
|
127
|
-
int Justify; // sets text justification independent of event alignment; use ASS_JUSTIFY_*
|
|
128
|
-
} ASS_Style;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
/*
|
|
132
|
-
* ASS_Event corresponds to a single Dialogue line;
|
|
133
|
-
* text is stored as-is, style overrides will be parsed later.
|
|
134
|
-
*/
|
|
135
|
-
typedef struct ass_event {
|
|
136
|
-
long long Start; // ms
|
|
137
|
-
long long Duration; // ms
|
|
138
|
-
|
|
139
|
-
int ReadOrder;
|
|
140
|
-
int Layer;
|
|
141
|
-
int Style;
|
|
142
|
-
char *Name;
|
|
143
|
-
int MarginL;
|
|
144
|
-
int MarginR;
|
|
145
|
-
int MarginV;
|
|
146
|
-
char *Effect;
|
|
147
|
-
char *Text;
|
|
148
|
-
|
|
149
|
-
ASS_RenderPriv *render_priv;
|
|
150
|
-
} ASS_Event;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Support for (xy-)VSFilter mangled colors
|
|
154
|
-
*
|
|
155
|
-
* Generally, xy-VSFilter emulates the classic VSFilter behavior of
|
|
156
|
-
* rendering directly into the (usually YCbCr) video. Classic
|
|
157
|
-
* guliverkli(2)-VSFilter is hardcoded to use BT.601(TV) as target colorspace
|
|
158
|
-
* when converting the subtitle RGB color to the video colorspace.
|
|
159
|
-
* This led to odd results when other colorspaces were used, particular
|
|
160
|
-
* once those became more common with the rise of HDTV video:
|
|
161
|
-
* HDTV typically uses BT.709(TV), but VSFilter continued assuming
|
|
162
|
-
* BT.601(TV) for conversion.
|
|
163
|
-
*
|
|
164
|
-
* This means classic vsfilter will mangle colors as follows:
|
|
165
|
-
*
|
|
166
|
-
* screen_rgb = video_csp_to_rgb(rgb_to_bt601tv(ass_rgb))
|
|
167
|
-
*
|
|
168
|
-
* where video_csp is the colorspace of the video with which the
|
|
169
|
-
* subtitle was muxed.
|
|
170
|
-
*
|
|
171
|
-
* Subtitle authors worked around this issue by adjusting the color
|
|
172
|
-
* to look as intended *after* going through the mangling process. Still,
|
|
173
|
-
* this behaviour isn't great and also limits the color range. Yet,
|
|
174
|
-
* for backwards compatibility with existing files, the classic mangling
|
|
175
|
-
* must be preserved for existing files to not break the display of
|
|
176
|
-
* color-matched typesets created with older VSFilter versions. Thus,
|
|
177
|
-
* on iniative of xy-VSFilter/XYSubFilter a new explicit "YCbCr Matrix"
|
|
178
|
-
* header was introduced to allow new files to avoid this color mangling.
|
|
179
|
-
* However due to a limitation of VSFilter API, VSFilters don't actually
|
|
180
|
-
* know the real colorspace of the video they're rendering to, so the
|
|
181
|
-
* header wasn't created as a simple "Use ColourMangling: yes/no", but instead
|
|
182
|
-
* specifies exactly which colorspace to use for the initial conversion
|
|
183
|
-
* from the subtitle's RGB values to the video's YCbCr. So we now got
|
|
184
|
-
*
|
|
185
|
-
* screen_rgb = video_csp_to_rgb(rgb_to_ycbcr_header_csp(ass_rgb))
|
|
186
|
-
*
|
|
187
|
-
* with rgb_to_ycbcr_header_csp defaulting to TV-range BT.601.
|
|
188
|
-
*
|
|
189
|
-
* XySubFilter, whose API was planned during introduction of this header,
|
|
190
|
-
* is not affected by this VSFilter-API limitation, so for it and other
|
|
191
|
-
* renderers like libass an additional special value "None" was also added.
|
|
192
|
-
* "None" tells the renderer to directly use untouched RGB values without
|
|
193
|
-
* any conversion.
|
|
194
|
-
*
|
|
195
|
-
* If the video itself is already in RGB natively, then no color mangling
|
|
196
|
-
* happens regardless of the presence or value of a "YCbCr Matrix" header.
|
|
197
|
-
*
|
|
198
|
-
* The above mangling process with special value "None" to opt out
|
|
199
|
-
* of any color mangling is the recommended default behaviour.
|
|
200
|
-
*
|
|
201
|
-
* Keep in mind though, that xy-VSFilter cannot accurately implement this and
|
|
202
|
-
* will instead resort to a guessing the video colorspace based on resolution
|
|
203
|
-
* and then convert RGB to the guessed space.
|
|
204
|
-
* Also some versions of MPC-HC's Internal Subtitle Renderer don't implement
|
|
205
|
-
* "None" and use TV.601 for unknown, but the video colorspace for no or an
|
|
206
|
-
* empty header (which can break old subtitles).
|
|
207
|
-
*
|
|
208
|
-
* Aegisub's (the main application to produce ASS subtitle scripts) behaviour
|
|
209
|
-
* regarding colorspaces is unfortunately a bit confusing.
|
|
210
|
-
* As of time of writing there still is a config option to force BT.601(TV)
|
|
211
|
-
* in some active forks (which should not be used to author subs and serves
|
|
212
|
-
* at most as a tool to check how now ancient VSFilters would have rendered the
|
|
213
|
-
* subs), the automatically chosen colorspace may depend on the fork and the
|
|
214
|
-
* videoprovider used and furthermore Aegisub likes to override
|
|
215
|
-
* "YCbCr Matrix: None" with the autodetected space of a loaded video.
|
|
216
|
-
* Supposedly some Aegisub versions had an option that "tries not to mangle the
|
|
217
|
-
* colors". It was said that if the header is not set to BT.601(TV), the colors
|
|
218
|
-
* were supposed not to be mangled, even if the header was not set to "None".
|
|
219
|
-
*
|
|
220
|
-
* In general, misinterpreting this header or not using it will lead to
|
|
221
|
-
* slightly different subtitle colors, which can matter if the subtitle
|
|
222
|
-
* attempts to match solid colored areas in the video.
|
|
223
|
-
* It is recommended to stick to XySubFilter-like behaviour described above.
|
|
224
|
-
* A highly motivated application may also expose options to users to emulate
|
|
225
|
-
* xy-VSFilter's resolution-depended guess or other (historic) mangling modes.
|
|
226
|
-
* Completly ignoring the color mangling is likely to give bad results.
|
|
227
|
-
*
|
|
228
|
-
* Note that libass doesn't change colors based on this header. It
|
|
229
|
-
* absolutely can't do that, because the video colorspace is required
|
|
230
|
-
* in order to handle this as intended. API users must use the exposed
|
|
231
|
-
* information to perform color mangling as described above.
|
|
232
|
-
*/
|
|
233
|
-
typedef enum ASS_YCbCrMatrix {
|
|
234
|
-
YCBCR_DEFAULT = 0, // Header missing
|
|
235
|
-
YCBCR_UNKNOWN, // Header could not be parsed correctly
|
|
236
|
-
YCBCR_NONE, // "None" special value
|
|
237
|
-
YCBCR_BT601_TV,
|
|
238
|
-
YCBCR_BT601_PC,
|
|
239
|
-
YCBCR_BT709_TV,
|
|
240
|
-
YCBCR_BT709_PC,
|
|
241
|
-
YCBCR_SMPTE240M_TV,
|
|
242
|
-
YCBCR_SMPTE240M_PC,
|
|
243
|
-
YCBCR_FCC_TV,
|
|
244
|
-
YCBCR_FCC_PC
|
|
245
|
-
// New enum values can be added here in new ABI-compatible library releases.
|
|
246
|
-
} ASS_YCbCrMatrix;
|
|
247
|
-
|
|
248
|
-
/*
|
|
249
|
-
* ass track represent either an external script or a matroska subtitle stream
|
|
250
|
-
* (no real difference between them); it can be used in rendering after the
|
|
251
|
-
* headers are parsed (i.e. events format line read).
|
|
252
|
-
*/
|
|
253
|
-
typedef struct ass_track {
|
|
254
|
-
int n_styles; // amount used
|
|
255
|
-
int max_styles; // amount allocated
|
|
256
|
-
int n_events;
|
|
257
|
-
int max_events;
|
|
258
|
-
ASS_Style *styles; // array of styles, max_styles length, n_styles used
|
|
259
|
-
ASS_Event *events; // the same as styles
|
|
260
|
-
|
|
261
|
-
char *style_format; // style format line (everything after "Format: ")
|
|
262
|
-
char *event_format; // event format line
|
|
263
|
-
|
|
264
|
-
enum {
|
|
265
|
-
TRACK_TYPE_UNKNOWN = 0,
|
|
266
|
-
TRACK_TYPE_ASS,
|
|
267
|
-
TRACK_TYPE_SSA
|
|
268
|
-
} track_type;
|
|
269
|
-
|
|
270
|
-
// Script header fields
|
|
271
|
-
int PlayResX;
|
|
272
|
-
int PlayResY;
|
|
273
|
-
double Timer;
|
|
274
|
-
int WrapStyle;
|
|
275
|
-
int ScaledBorderAndShadow; // 0 or 1 (boolean)
|
|
276
|
-
int Kerning; // 0 or 1 (boolean)
|
|
277
|
-
char *Language; // zero-terminated ISO-639-1 code
|
|
278
|
-
ASS_YCbCrMatrix YCbCrMatrix;
|
|
279
|
-
|
|
280
|
-
int default_style; // index of default style
|
|
281
|
-
char *name; // file name in case of external subs, 0 for streams
|
|
282
|
-
|
|
283
|
-
ASS_Library *library;
|
|
284
|
-
ASS_ParserPriv *parser_priv;
|
|
285
|
-
|
|
286
|
-
int LayoutResX; // overrides values from ass_set_storage_size and
|
|
287
|
-
int LayoutResY; // also takes precendence over ass_set_pixel_aspect
|
|
288
|
-
|
|
289
|
-
// New fields can be added here in new ABI-compatible library releases.
|
|
290
|
-
} ASS_Track;
|
|
291
|
-
|
|
292
|
-
#endif /* LIBASS_TYPES_H */
|
|
@@ -1,344 +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 decompression.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
#ifndef BROTLI_DEC_DECODE_H_
|
|
13
|
-
#define BROTLI_DEC_DECODE_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
|
-
/**
|
|
23
|
-
* Opaque structure that holds decoder state.
|
|
24
|
-
*
|
|
25
|
-
* Allocated and initialized with ::BrotliDecoderCreateInstance.
|
|
26
|
-
* Cleaned up and deallocated with ::BrotliDecoderDestroyInstance.
|
|
27
|
-
*/
|
|
28
|
-
typedef struct BrotliDecoderStateStruct BrotliDecoderState;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Result type for ::BrotliDecoderDecompress and
|
|
32
|
-
* ::BrotliDecoderDecompressStream functions.
|
|
33
|
-
*/
|
|
34
|
-
typedef enum {
|
|
35
|
-
/** Decoding error, e.g. corrupted input or memory allocation problem. */
|
|
36
|
-
BROTLI_DECODER_RESULT_ERROR = 0,
|
|
37
|
-
/** Decoding successfully completed. */
|
|
38
|
-
BROTLI_DECODER_RESULT_SUCCESS = 1,
|
|
39
|
-
/** Partially done; should be called again with more input. */
|
|
40
|
-
BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT = 2,
|
|
41
|
-
/** Partially done; should be called again with more output. */
|
|
42
|
-
BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT = 3
|
|
43
|
-
} BrotliDecoderResult;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Template that evaluates items of ::BrotliDecoderErrorCode.
|
|
47
|
-
*
|
|
48
|
-
* Example: @code {.cpp}
|
|
49
|
-
* // Log Brotli error code.
|
|
50
|
-
* switch (brotliDecoderErrorCode) {
|
|
51
|
-
* #define CASE_(PREFIX, NAME, CODE) \
|
|
52
|
-
* case BROTLI_DECODER ## PREFIX ## NAME: \
|
|
53
|
-
* LOG(INFO) << "error code:" << #NAME; \
|
|
54
|
-
* break;
|
|
55
|
-
* #define NEWLINE_
|
|
56
|
-
* BROTLI_DECODER_ERROR_CODES_LIST(CASE_, NEWLINE_)
|
|
57
|
-
* #undef CASE_
|
|
58
|
-
* #undef NEWLINE_
|
|
59
|
-
* default: LOG(FATAL) << "unknown brotli error code";
|
|
60
|
-
* }
|
|
61
|
-
* @endcode
|
|
62
|
-
*/
|
|
63
|
-
#define BROTLI_DECODER_ERROR_CODES_LIST(BROTLI_ERROR_CODE, SEPARATOR) \
|
|
64
|
-
BROTLI_ERROR_CODE(_, NO_ERROR, 0) SEPARATOR \
|
|
65
|
-
/* Same as BrotliDecoderResult values */ \
|
|
66
|
-
BROTLI_ERROR_CODE(_, SUCCESS, 1) SEPARATOR \
|
|
67
|
-
BROTLI_ERROR_CODE(_, NEEDS_MORE_INPUT, 2) SEPARATOR \
|
|
68
|
-
BROTLI_ERROR_CODE(_, NEEDS_MORE_OUTPUT, 3) SEPARATOR \
|
|
69
|
-
\
|
|
70
|
-
/* Errors caused by invalid input */ \
|
|
71
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, EXUBERANT_NIBBLE, -1) SEPARATOR \
|
|
72
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, RESERVED, -2) SEPARATOR \
|
|
73
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, EXUBERANT_META_NIBBLE, -3) SEPARATOR \
|
|
74
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, SIMPLE_HUFFMAN_ALPHABET, -4) SEPARATOR \
|
|
75
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, SIMPLE_HUFFMAN_SAME, -5) SEPARATOR \
|
|
76
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, CL_SPACE, -6) SEPARATOR \
|
|
77
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, HUFFMAN_SPACE, -7) SEPARATOR \
|
|
78
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, CONTEXT_MAP_REPEAT, -8) SEPARATOR \
|
|
79
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, BLOCK_LENGTH_1, -9) SEPARATOR \
|
|
80
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, BLOCK_LENGTH_2, -10) SEPARATOR \
|
|
81
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, TRANSFORM, -11) SEPARATOR \
|
|
82
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, DICTIONARY, -12) SEPARATOR \
|
|
83
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, WINDOW_BITS, -13) SEPARATOR \
|
|
84
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_1, -14) SEPARATOR \
|
|
85
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_2, -15) SEPARATOR \
|
|
86
|
-
BROTLI_ERROR_CODE(_ERROR_FORMAT_, DISTANCE, -16) SEPARATOR \
|
|
87
|
-
\
|
|
88
|
-
/* -17..-18 codes are reserved */ \
|
|
89
|
-
\
|
|
90
|
-
BROTLI_ERROR_CODE(_ERROR_, DICTIONARY_NOT_SET, -19) SEPARATOR \
|
|
91
|
-
BROTLI_ERROR_CODE(_ERROR_, INVALID_ARGUMENTS, -20) SEPARATOR \
|
|
92
|
-
\
|
|
93
|
-
/* Memory allocation problems */ \
|
|
94
|
-
BROTLI_ERROR_CODE(_ERROR_ALLOC_, CONTEXT_MODES, -21) SEPARATOR \
|
|
95
|
-
/* Literal, insert and distance trees together */ \
|
|
96
|
-
BROTLI_ERROR_CODE(_ERROR_ALLOC_, TREE_GROUPS, -22) SEPARATOR \
|
|
97
|
-
/* -23..-24 codes are reserved for distinct tree groups */ \
|
|
98
|
-
BROTLI_ERROR_CODE(_ERROR_ALLOC_, CONTEXT_MAP, -25) SEPARATOR \
|
|
99
|
-
BROTLI_ERROR_CODE(_ERROR_ALLOC_, RING_BUFFER_1, -26) SEPARATOR \
|
|
100
|
-
BROTLI_ERROR_CODE(_ERROR_ALLOC_, RING_BUFFER_2, -27) SEPARATOR \
|
|
101
|
-
/* -28..-29 codes are reserved for dynamic ring-buffer allocation */ \
|
|
102
|
-
BROTLI_ERROR_CODE(_ERROR_ALLOC_, BLOCK_TYPE_TREES, -30) SEPARATOR \
|
|
103
|
-
\
|
|
104
|
-
/* "Impossible" states */ \
|
|
105
|
-
BROTLI_ERROR_CODE(_ERROR_, UNREACHABLE, -31)
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Error code for detailed logging / production debugging.
|
|
109
|
-
*
|
|
110
|
-
* See ::BrotliDecoderGetErrorCode and ::BROTLI_LAST_ERROR_CODE.
|
|
111
|
-
*/
|
|
112
|
-
typedef enum {
|
|
113
|
-
#define BROTLI_COMMA_ ,
|
|
114
|
-
#define BROTLI_ERROR_CODE_ENUM_ITEM_(PREFIX, NAME, CODE) \
|
|
115
|
-
BROTLI_DECODER ## PREFIX ## NAME = CODE
|
|
116
|
-
BROTLI_DECODER_ERROR_CODES_LIST(BROTLI_ERROR_CODE_ENUM_ITEM_, BROTLI_COMMA_)
|
|
117
|
-
} BrotliDecoderErrorCode;
|
|
118
|
-
#undef BROTLI_ERROR_CODE_ENUM_ITEM_
|
|
119
|
-
#undef BROTLI_COMMA_
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* The value of the last error code, negative integer.
|
|
123
|
-
*
|
|
124
|
-
* All other error code values are in the range from ::BROTLI_LAST_ERROR_CODE
|
|
125
|
-
* to @c -1. There are also 4 other possible non-error codes @c 0 .. @c 3 in
|
|
126
|
-
* ::BrotliDecoderErrorCode enumeration.
|
|
127
|
-
*/
|
|
128
|
-
#define BROTLI_LAST_ERROR_CODE BROTLI_DECODER_ERROR_UNREACHABLE
|
|
129
|
-
|
|
130
|
-
/** Options to be used with ::BrotliDecoderSetParameter. */
|
|
131
|
-
typedef enum BrotliDecoderParameter {
|
|
132
|
-
/**
|
|
133
|
-
* Disable "canny" ring buffer allocation strategy.
|
|
134
|
-
*
|
|
135
|
-
* Ring buffer is allocated according to window size, despite the real size of
|
|
136
|
-
* the content.
|
|
137
|
-
*/
|
|
138
|
-
BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION = 0,
|
|
139
|
-
/**
|
|
140
|
-
* Flag that determines if "Large Window Brotli" is used.
|
|
141
|
-
*/
|
|
142
|
-
BROTLI_DECODER_PARAM_LARGE_WINDOW = 1
|
|
143
|
-
} BrotliDecoderParameter;
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Sets the specified parameter to the given decoder instance.
|
|
147
|
-
*
|
|
148
|
-
* @param state decoder instance
|
|
149
|
-
* @param param parameter to set
|
|
150
|
-
* @param value new parameter value
|
|
151
|
-
* @returns ::BROTLI_FALSE if parameter is unrecognized, or value is invalid
|
|
152
|
-
* @returns ::BROTLI_TRUE if value is accepted
|
|
153
|
-
*/
|
|
154
|
-
BROTLI_DEC_API BROTLI_BOOL BrotliDecoderSetParameter(
|
|
155
|
-
BrotliDecoderState* state, BrotliDecoderParameter param, uint32_t value);
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Creates an instance of ::BrotliDecoderState and initializes it.
|
|
159
|
-
*
|
|
160
|
-
* The instance can be used once for decoding and should then be destroyed with
|
|
161
|
-
* ::BrotliDecoderDestroyInstance, it cannot be reused for a new decoding
|
|
162
|
-
* session.
|
|
163
|
-
*
|
|
164
|
-
* @p alloc_func and @p free_func @b MUST be both zero or both non-zero. In the
|
|
165
|
-
* case they are both zero, default memory allocators are used. @p opaque is
|
|
166
|
-
* passed to @p alloc_func and @p free_func when they are called. @p free_func
|
|
167
|
-
* has to return without doing anything when asked to free a NULL pointer.
|
|
168
|
-
*
|
|
169
|
-
* @param alloc_func custom memory allocation function
|
|
170
|
-
* @param free_func custom memory free function
|
|
171
|
-
* @param opaque custom memory manager handle
|
|
172
|
-
* @returns @c 0 if instance can not be allocated or initialized
|
|
173
|
-
* @returns pointer to initialized ::BrotliDecoderState otherwise
|
|
174
|
-
*/
|
|
175
|
-
BROTLI_DEC_API BrotliDecoderState* BrotliDecoderCreateInstance(
|
|
176
|
-
brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque);
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Deinitializes and frees ::BrotliDecoderState instance.
|
|
180
|
-
*
|
|
181
|
-
* @param state decoder instance to be cleaned up and deallocated
|
|
182
|
-
*/
|
|
183
|
-
BROTLI_DEC_API void BrotliDecoderDestroyInstance(BrotliDecoderState* state);
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Performs one-shot memory-to-memory decompression.
|
|
187
|
-
*
|
|
188
|
-
* Decompresses the data in @p encoded_buffer into @p decoded_buffer, and sets
|
|
189
|
-
* @p *decoded_size to the decompressed length.
|
|
190
|
-
*
|
|
191
|
-
* @param encoded_size size of @p encoded_buffer
|
|
192
|
-
* @param encoded_buffer compressed data buffer with at least @p encoded_size
|
|
193
|
-
* addressable bytes
|
|
194
|
-
* @param[in, out] decoded_size @b in: size of @p decoded_buffer; \n
|
|
195
|
-
* @b out: length of decompressed data written to
|
|
196
|
-
* @p decoded_buffer
|
|
197
|
-
* @param decoded_buffer decompressed data destination buffer
|
|
198
|
-
* @returns ::BROTLI_DECODER_RESULT_ERROR if input is corrupted, memory
|
|
199
|
-
* allocation failed, or @p decoded_buffer is not large enough;
|
|
200
|
-
* @returns ::BROTLI_DECODER_RESULT_SUCCESS otherwise
|
|
201
|
-
*/
|
|
202
|
-
BROTLI_DEC_API BrotliDecoderResult BrotliDecoderDecompress(
|
|
203
|
-
size_t encoded_size,
|
|
204
|
-
const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
|
|
205
|
-
size_t* decoded_size,
|
|
206
|
-
uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]);
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Decompresses the input stream to the output stream.
|
|
210
|
-
*
|
|
211
|
-
* The values @p *available_in and @p *available_out must specify the number of
|
|
212
|
-
* bytes addressable at @p *next_in and @p *next_out respectively.
|
|
213
|
-
* When @p *available_out is @c 0, @p next_out is allowed to be @c NULL.
|
|
214
|
-
*
|
|
215
|
-
* After each call, @p *available_in will be decremented by the amount of input
|
|
216
|
-
* bytes consumed, and the @p *next_in pointer will be incremented by that
|
|
217
|
-
* amount. Similarly, @p *available_out will be decremented by the amount of
|
|
218
|
-
* output bytes written, and the @p *next_out pointer will be incremented by
|
|
219
|
-
* that amount.
|
|
220
|
-
*
|
|
221
|
-
* @p total_out, if it is not a null-pointer, will be set to the number
|
|
222
|
-
* of bytes decompressed since the last @p state initialization.
|
|
223
|
-
*
|
|
224
|
-
* @note Input is never overconsumed, so @p next_in and @p available_in could be
|
|
225
|
-
* passed to the next consumer after decoding is complete.
|
|
226
|
-
*
|
|
227
|
-
* @param state decoder instance
|
|
228
|
-
* @param[in, out] available_in @b in: amount of available input; \n
|
|
229
|
-
* @b out: amount of unused input
|
|
230
|
-
* @param[in, out] next_in pointer to the next compressed byte
|
|
231
|
-
* @param[in, out] available_out @b in: length of output buffer; \n
|
|
232
|
-
* @b out: remaining size of output buffer
|
|
233
|
-
* @param[in, out] next_out output buffer cursor;
|
|
234
|
-
* can be @c NULL if @p available_out is @c 0
|
|
235
|
-
* @param[out] total_out number of bytes decompressed so far; can be @c NULL
|
|
236
|
-
* @returns ::BROTLI_DECODER_RESULT_ERROR if input is corrupted, memory
|
|
237
|
-
* allocation failed, arguments were invalid, etc.;
|
|
238
|
-
* use ::BrotliDecoderGetErrorCode to get detailed error code
|
|
239
|
-
* @returns ::BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT decoding is blocked until
|
|
240
|
-
* more input data is provided
|
|
241
|
-
* @returns ::BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT decoding is blocked until
|
|
242
|
-
* more output space is provided
|
|
243
|
-
* @returns ::BROTLI_DECODER_RESULT_SUCCESS decoding is finished, no more
|
|
244
|
-
* input might be consumed and no more output will be produced
|
|
245
|
-
*/
|
|
246
|
-
BROTLI_DEC_API BrotliDecoderResult BrotliDecoderDecompressStream(
|
|
247
|
-
BrotliDecoderState* state, size_t* available_in, const uint8_t** next_in,
|
|
248
|
-
size_t* available_out, uint8_t** next_out, size_t* total_out);
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Checks if decoder has more output.
|
|
252
|
-
*
|
|
253
|
-
* @param state decoder instance
|
|
254
|
-
* @returns ::BROTLI_TRUE, if decoder has some unconsumed output
|
|
255
|
-
* @returns ::BROTLI_FALSE otherwise
|
|
256
|
-
*/
|
|
257
|
-
BROTLI_DEC_API BROTLI_BOOL BrotliDecoderHasMoreOutput(
|
|
258
|
-
const BrotliDecoderState* state);
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Acquires pointer to internal output buffer.
|
|
262
|
-
*
|
|
263
|
-
* This method is used to make language bindings easier and more efficient:
|
|
264
|
-
* -# push data to ::BrotliDecoderDecompressStream,
|
|
265
|
-
* until ::BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT is reported
|
|
266
|
-
* -# use ::BrotliDecoderTakeOutput to peek bytes and copy to language-specific
|
|
267
|
-
* entity
|
|
268
|
-
*
|
|
269
|
-
* Also this could be useful if there is an output stream that is able to
|
|
270
|
-
* consume all the provided data (e.g. when data is saved to file system).
|
|
271
|
-
*
|
|
272
|
-
* @attention After every call to ::BrotliDecoderTakeOutput @p *size bytes of
|
|
273
|
-
* output are considered consumed for all consecutive calls to the
|
|
274
|
-
* instance methods; returned pointer becomes invalidated as well.
|
|
275
|
-
*
|
|
276
|
-
* @note Decoder output is not guaranteed to be contiguous. This means that
|
|
277
|
-
* after the size-unrestricted call to ::BrotliDecoderTakeOutput,
|
|
278
|
-
* immediate next call to ::BrotliDecoderTakeOutput may return more data.
|
|
279
|
-
*
|
|
280
|
-
* @param state decoder instance
|
|
281
|
-
* @param[in, out] size @b in: number of bytes caller is ready to take, @c 0 if
|
|
282
|
-
* any amount could be handled; \n
|
|
283
|
-
* @b out: amount of data pointed by returned pointer and
|
|
284
|
-
* considered consumed; \n
|
|
285
|
-
* out value is never greater than in value, unless it is @c 0
|
|
286
|
-
* @returns pointer to output data
|
|
287
|
-
*/
|
|
288
|
-
BROTLI_DEC_API const uint8_t* BrotliDecoderTakeOutput(
|
|
289
|
-
BrotliDecoderState* state, size_t* size);
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Checks if instance has already consumed input.
|
|
293
|
-
*
|
|
294
|
-
* Instance that returns ::BROTLI_FALSE is considered "fresh" and could be
|
|
295
|
-
* reused.
|
|
296
|
-
*
|
|
297
|
-
* @param state decoder instance
|
|
298
|
-
* @returns ::BROTLI_TRUE if decoder has already used some input bytes
|
|
299
|
-
* @returns ::BROTLI_FALSE otherwise
|
|
300
|
-
*/
|
|
301
|
-
BROTLI_DEC_API BROTLI_BOOL BrotliDecoderIsUsed(const BrotliDecoderState* state);
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Checks if decoder instance reached the final state.
|
|
305
|
-
*
|
|
306
|
-
* @param state decoder instance
|
|
307
|
-
* @returns ::BROTLI_TRUE if decoder is in a state where it reached the end of
|
|
308
|
-
* the input and produced all of the output
|
|
309
|
-
* @returns ::BROTLI_FALSE otherwise
|
|
310
|
-
*/
|
|
311
|
-
BROTLI_DEC_API BROTLI_BOOL BrotliDecoderIsFinished(
|
|
312
|
-
const BrotliDecoderState* state);
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Acquires a detailed error code.
|
|
316
|
-
*
|
|
317
|
-
* Should be used only after ::BrotliDecoderDecompressStream returns
|
|
318
|
-
* ::BROTLI_DECODER_RESULT_ERROR.
|
|
319
|
-
*
|
|
320
|
-
* See also ::BrotliDecoderErrorString
|
|
321
|
-
*
|
|
322
|
-
* @param state decoder instance
|
|
323
|
-
* @returns last saved error code
|
|
324
|
-
*/
|
|
325
|
-
BROTLI_DEC_API BrotliDecoderErrorCode BrotliDecoderGetErrorCode(
|
|
326
|
-
const BrotliDecoderState* state);
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Converts error code to a c-string.
|
|
330
|
-
*/
|
|
331
|
-
BROTLI_DEC_API const char* BrotliDecoderErrorString(BrotliDecoderErrorCode c);
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Gets a decoder library version.
|
|
335
|
-
*
|
|
336
|
-
* Look at BROTLI_VERSION for more information.
|
|
337
|
-
*/
|
|
338
|
-
BROTLI_DEC_API uint32_t BrotliDecoderVersion(void);
|
|
339
|
-
|
|
340
|
-
#if defined(__cplusplus) || defined(c_plusplus)
|
|
341
|
-
} /* extern "C" */
|
|
342
|
-
#endif
|
|
343
|
-
|
|
344
|
-
#endif /* BROTLI_DEC_DECODE_H_ */
|