]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/BrotliCompress/tools/brotli.md
BaseTools: Update Brotli Compress to the latest one 1.0.6
[mirror_edk2.git] / BaseTools / Source / C / BrotliCompress / tools / brotli.md
CommitLineData
dd4f667e
LG
1brotli(1) -- brotli, unbrotli - compress or decompress files
2================================================================
3
4SYNOPSIS
5--------
6
7`brotli` [*OPTION|FILE*]...
8
9`unbrotli` is equivalent to `brotli --decompress`
10
11DESCRIPTION
12-----------
13`brotli` is a generic-purpose lossless compression algorithm that compresses
14data using a combination of a modern variant of the **LZ77** algorithm, Huffman
15coding and 2-nd order context modeling, with a compression ratio comparable to
16the best currently available general-purpose compression methods. It is similar
17in speed with deflate but offers more dense compression.
18
19`brotli` command line syntax similar to `gzip (1)` and `zstd (1)`.
20Unlike `gzip (1)`, source files are preserved by default. It is possible to
21remove them after processing by using the `--rm` _option_.
22
23Arguments that look like "`--name`" or "`--name=value`" are _options_. Every
24_option_ has a short form "`-x`" or "`-x value`". Multiple short form _options_
25could be coalesced:
26
27* "`--decompress --stdout --suffix=.b`" works the same as
28* "`-d -s -S .b`" and
29* "`-dsS .b`"
30
31`brotli` has 3 operation modes:
32
33* default mode is compression;
34* `--decompress` option activates decompression mode;
35* `--test` option switches to integrity test mode; this option is equivalent to
36 "`--decompress --stdout`" except that the decompressed data is discarded
37 instead of being written to standard output.
38
39Every non-option argument is a _file_ entry. If no _files_ are given or _file_
40is "`-`", `brotli` reads from standard input. All arguments after "`--`" are
41_file_ entries.
42
43Unless `--stdout` or `--output` is specified, _files_ are written to a new file
44whose name is derived from the source _file_ name:
45
46* when compressing, a suffix is appended to the source filename to
47 get the target filename
48* when decompressing, a suffix is removed from the source filename to
49 get the target filename
50
51Default suffix is `.br`, but it could be specified with `--suffix` option.
52
53Conflicting or duplicate _options_ are not allowed.
54
55OPTIONS
56-------
57
58* `-#`:
59 compression level (0-9); bigger values cause denser, but slower compression
60* `-c`, `--stdout`:
61 write on standard output
62* `-d`, `--decompress`:
63 decompress mode
64* `-f`, `--force`:
65 force output file overwrite
66* `-h`, `--help`:
67 display this help and exit
68* `-j`, `--rm`:
69 remove source file(s); `gzip (1)`-like behaviour
70* `-k`, `--keep`:
71 keep source file(s); `zstd (1)`-like behaviour
72* `-n`, `--no-copy-stat`:
73 do not copy source file(s) attributes
74* `-o FILE`, `--output=FILE`
75 output file; valid only if there is a single input entry
76* `-q NUM`, `--quality=NUM`:
77 compression level (0-11); bigger values cause denser, but slower compression
78* `-t`, `--test`:
79 test file integrity mode
80* `-v`, `--verbose`:
81 increase output verbosity
82* `-w NUM`, `--lgwin=NUM`:
83 set LZ77 window size (0, 10-24) (default: 22); window size is
84 `(2**NUM - 16)`; 0 lets compressor decide over the optimal value; bigger
85 windows size improve density; decoder might require up to window size
86 memory to operate
87* `-S SUF`, `--suffix=SUF`:
88 output file suffix (default: `.br`)
89* `-V`, `--version`:
90 display version and exit
91* `-Z`, `--best`:
92 use best compression level (default); same as "`-q 11`"
93
94SEE ALSO
95--------
96
97`brotli` file format is defined in
98[RFC 7932](https://www.ietf.org/rfc/rfc7932.txt).
99
100`brotli` is open-sourced under the
101[MIT License](https://opensource.org/licenses/MIT).
102
103Mailing list: https://groups.google.com/forum/#!forum/brotli
104
105BUGS
106----
107Report bugs at: https://github.com/google/brotli/issues