add compression ratio output
This commit is contained in:
parent
6fa7b62d26
commit
efd3abef9e
1 changed files with 8 additions and 1 deletions
|
|
@ -43,7 +43,14 @@ where
|
|||
bitbuf.clear();
|
||||
let header = Scheme::encode(buf, bitbuf);
|
||||
let len_freq = Scheme::header_size(&header) + bitbuf.len().div_ceil(8);
|
||||
println!("{name:>10}: {len_freq:>10}");
|
||||
|
||||
#[allow(clippy::cast_precision_loss)]
|
||||
let compression_ratio = len_freq as f32 / buf.len() as f32;
|
||||
|
||||
println!(
|
||||
"{name:>10}: {len_freq:>10} ({:5.1}%)",
|
||||
compression_ratio * 100.
|
||||
);
|
||||
if debug {
|
||||
eprintln!("{name} header: {header:#?}\n");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue