Adjust command line presets to take advantage of the 50% speedup gained by removing memory options

This commit is contained in:
Josh Holmer 2018-01-31 14:07:03 -05:00
parent 66c1662537
commit d614bba3ac
3 changed files with 20 additions and 12 deletions

View file

@ -6,6 +6,9 @@
- This improves decompression speed by 15%. Compression speed is not affected.
- [SEMVER_MAJOR] This also obsoletes the `-zm` command line option and the `memory` key on the `Options` struct.
- Presets will be updated automatically. This means that presets 3 and higher will run significantly more quickly.
- Adjust the presets, now that memory is no longer an option.
- `-o3` now tests all filter types. This will result in 50% more trials than before, but may give up to 10% more compression gain.
- `-o4` and higher now test all alpha optimization types. This adds 5 trials specific to the alpha channel. Only transparent images are affected.
### Version 0.19.0
- [SEMVER_MAJOR] Default to overwriting the input file if `out_file` is not set.

View file

@ -188,14 +188,19 @@ impl Options {
self
}
fn apply_preset_3(self) -> Self {
self.apply_preset_2()
}
fn apply_preset_4(mut self) -> Self {
fn apply_preset_3(mut self) -> Self {
for i in 1..5 {
self.filter.insert(i);
}
self
}
fn apply_preset_4(mut self) -> Self {
self.alphas.insert(AlphaOptim::White);
self.alphas.insert(AlphaOptim::Up);
self.alphas.insert(AlphaOptim::Down);
self.alphas.insert(AlphaOptim::Left);
self.alphas.insert(AlphaOptim::Right);
self.apply_preset_3()
}

View file

@ -200,13 +200,13 @@ fn main() {
}
}))
.after_help("Optimization levels:
-o 0 => --zc 3 --nz (0 or 1 trials)
-o 1 => --zc 9 (1 trial, determined heuristically)
-o 2 => --zc 9 --zs 0-3 -f 0,5 (8 trials)
-o 3 => --zc 9 --zs 0-3 -f 0,5 (8 trials, currently identical to preset 3)
-o 4 => --zc 9 --zs 0-3 -f 0-5 (24 trials)
-o 5 => --zc 3-9 --zs 0-3 -f 0-5 (96 trials)
-o 6 => --zc 1-9 --zs 0-3 -f 0-5 (180 trials)
-o 0 => --zc 3 --nz (0 or 1 trials)
-o 1 => --zc 9 (1 trial, determined heuristically)
-o 2 => --zc 9 --zs 0-3 -f 0,5 (8 trials)
-o 3 => --zc 9 --zs 0-3 -f 0-5 (24 trials)
-o 4 => --zc 9 --zs 0-3 -f 0-5 -a (24 trials + 6 alpha trials)
-o 5 => --zc 3-9 --zs 0-3 -f 0-5 -a (96 trials + 6 alpha trials)
-o 6 => --zc 1-9 --zs 0-3 -f 0-5 -a (180 trials + 6 alpha trials)
Manually specifying a compression option (zc, zs, etc.) will override the optimization preset,
regardless of the order you write the arguments.")