Use stronger compression in eval
This commit is contained in:
parent
129f1e6f76
commit
9d832e42b3
1 changed files with 12 additions and 2 deletions
14
src/lib.rs
14
src/lib.rs
|
|
@ -620,8 +620,18 @@ fn optimize_raw(
|
|||
deadline: Arc<Deadline>,
|
||||
max_size: Option<usize>,
|
||||
) -> Option<PngData> {
|
||||
// Must use normal (lazy) compression, as faster ones (greedy) are not representative
|
||||
let eval_compression = 5;
|
||||
// Libdeflate has four algorithms: 1-4 = 'greedy', 5-7 = 'lazy', 8-9 = 'lazy2', 10-12 = 'near-optimal'
|
||||
// 5 is the minimumm required for a decent evaluation result
|
||||
// 7 is not noticeably slower than 5 and improves evaluation of filters in 'fast' mode (o2 and lower)
|
||||
// 8 is a little slower but not noticeably when used only for reductions (o3 and higher)
|
||||
// 9 is not appreciably better than 8
|
||||
// 10 and higher are quite slow - good for filters but only good for reductions if matching the main zc level
|
||||
let eval_compression = match opts.deflate {
|
||||
Deflaters::Libdeflater { compression } => {
|
||||
if opts.fast_evaluation { 7 } else { 8 }.min(compression)
|
||||
}
|
||||
_ => 8,
|
||||
};
|
||||
// None and Bigrams work well together, especially for alpha reductions
|
||||
let eval_filters = indexset! {RowFilter::None, RowFilter::Bigrams};
|
||||
// This will collect all versions of images and pick one that compresses best
|
||||
|
|
|
|||
Loading…
Reference in a new issue