压缩器选项
¥Compressor options
可以在 Brotli 编码器上设置几个选项,影响压缩效率和速度。键和值都可以作为 zlib.constants 对象的属性访问。
¥There are several options that can be set on Brotli encoders, affecting
compression efficiency and speed. Both the keys and the values can be accessed
as properties of the zlib.constants object.
最重要的选项是:
¥The most important options are:
-
BROTLI_PARAM_MODE-
BROTLI_MODE_GENERIC(默认)¥
BROTLI_MODE_GENERIC(default) -
BROTLI_MODE_TEXT,针对 UTF-8 文本进行了调整¥
BROTLI_MODE_TEXT, adjusted for UTF-8 text -
BROTLI_MODE_FONT,针对 WOFF 2.0 字体进行了调整¥
BROTLI_MODE_FONT, adjusted for WOFF 2.0 fonts
-
-
BROTLI_PARAM_QUALITY-
范围从
BROTLI_MIN_QUALITY到BROTLI_MAX_QUALITY,默认为BROTLI_DEFAULT_QUALITY。¥Ranges from
BROTLI_MIN_QUALITYtoBROTLI_MAX_QUALITY, with a default ofBROTLI_DEFAULT_QUALITY.
-
-
BROTLI_PARAM_SIZE_HINT-
表示预期输入大小的整数值;对于未知的输入大小,默认为
0。¥Integer value representing the expected input size; defaults to
0for an unknown input size.
-
可以设置以下标志以对压缩算法和内存使用调整进行高级控制:
¥The following flags can be set for advanced control over the compression algorithm and memory usage tuning:
-
BROTLI_PARAM_LGWIN-
范围从
BROTLI_MIN_WINDOW_BITS到BROTLI_MAX_WINDOW_BITS,默认为BROTLI_DEFAULT_WINDOW,如果设置了BROTLI_PARAM_LARGE_WINDOW标志,则最高可达BROTLI_LARGE_MAX_WINDOW_BITS。¥Ranges from
BROTLI_MIN_WINDOW_BITStoBROTLI_MAX_WINDOW_BITS, with a default ofBROTLI_DEFAULT_WINDOW, or up toBROTLI_LARGE_MAX_WINDOW_BITSif theBROTLI_PARAM_LARGE_WINDOWflag is set.
-
-
BROTLI_PARAM_LGBLOCK-
范围从
BROTLI_MIN_INPUT_BLOCK_BITS到BROTLI_MAX_INPUT_BLOCK_BITS。¥Ranges from
BROTLI_MIN_INPUT_BLOCK_BITStoBROTLI_MAX_INPUT_BLOCK_BITS.
-
-
BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING-
降低压缩率以提高解压速度的布尔标志。
¥Boolean flag that decreases compression ratio in favour of decompression speed.
-
-
BROTLI_PARAM_LARGE_WINDOW -
BROTLI_PARAM_NPOSTFIX-
范围从
0到BROTLI_MAX_NPOSTFIX。¥Ranges from
0toBROTLI_MAX_NPOSTFIX.
-
-
BROTLI_PARAM_NDIRECT-
范围从
0到15 << NPOSTFIX,步长为1 << NPOSTFIX。¥Ranges from
0to15 << NPOSTFIXin steps of1 << NPOSTFIX.
-