microsoft / lepton_jpeg_rust

Port of DropBox Lepton compression to Rust
Apache License 2.0
129 stars 10 forks source link

optimize branch update with small lookup tables #13

Closed mcroomp closed 1 year ago

mcroomp commented 1 year ago

Use small lookup table to avoid branching during probability updates

mcroomp commented 1 year ago

@danielrh might find this amusing... finally figured out a way to handle the zero probability corner case without an extra branch

danielrh commented 1 year ago

I love this! :-) Did you have a microbenchmark comparison? Does it end up helping in practice