microsoft / lepton_jpeg_rust

Port of DropBox Lepton compression to Rust
Apache License 2.0
85 stars 9 forks source link

Use "division-by-multiplication" scheme to fasten division #83

Open Melirius opened 1 month ago

Melirius commented 1 month ago

@mcroomp, unfortunately this is not working, not enough precision for all u16 range https://github.com/microsoft/lepton_jpeg_rust/blob/2f8c32420e3c67462afa459ece898b001794ce2e/src/structs/quantization_tables.rs#L88

Even 2^32 fails - first at 17215. A classical scheme from Warren should work, but it has variable shifts.

Melirius commented 1 month ago

I wanted to make this, but you are faster :)