What is a default quality of brotli command? #260

Closed
opened 2026-01-29 20:41:00 +00:00 by claunia · 2 comments
Owner

Originally created by @stokito on GitHub (Oct 27, 2018).

Nor in brotli --help nor in man brotli is not mentioned what is a default compression quality.
It just said that quality can be in range of 0-9 but later it said that -q param can be in range 0-11.

$ brotli -h
Usage: brotli [OPTION]... [FILE]...
Options:
  -#                          compression level (0-9)
  -q NUM, --quality=NUM       compression level (0-11)
  -Z, --best                  use best compression level (11) (default)

What I see from sources in brotli.c in main method:

int main(int argc, char** argv) {
  Command command;
  Context context;
  context.quality = 11;

So it looks like the default quality is 11 i.e. best.

  1. Could you mention this somewhere?
  2. Can we set the maximum quality by -11 param?
Originally created by @stokito on GitHub (Oct 27, 2018). Nor in `brotli --help` nor in `man brotli` is not mentioned what is a default compression quality. It just said that quality can be in range of 0-9 but later it said that -q param can be in range 0-11. ``` $ brotli -h Usage: brotli [OPTION]... [FILE]... Options: -# compression level (0-9) -q NUM, --quality=NUM compression level (0-11) -Z, --best use best compression level (11) (default) ``` What I see from sources in [brotli.c](./c/tools/brotli.c) in `main` method: ```c int main(int argc, char** argv) { Command command; Context context; context.quality = 11; ``` So it looks like the default quality is 11 i.e. best. 1. Could you mention this somewhere? 2. Can we set the maximum quality by `-11` param?
Author
Owner

@chylex commented on GitHub (Oct 31, 2018):

The default quality is mentioned:

  -Z, --best                  use best compression level (11) (default)

I think the single dash (-0 to -9) quality parameters are just for convenience, the problem is that by convention a single dash parameter can only by followed by a single character, so -10 or -11 would break the convention.

@chylex commented on GitHub (Oct 31, 2018): The default quality is mentioned: ``` -Z, --best use best compression level (11) (default) ``` I think the single dash (`-0` to `-9`) quality parameters are just for convenience, the problem is that by [convention](https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html) a single dash parameter can only by followed by a single character, so `-10` or `-11` would break the convention.
Author
Owner

@eustas commented on GitHub (Jul 2, 2020):

@chylex Thanks for the answer.

@eustas commented on GitHub (Jul 2, 2020): @chylex Thanks for the answer.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#260