image-rs / deflate-rs

An implementation of a DEFLATE encoder in rust
Apache License 2.0
53 stars 14 forks source link

Deal with incompressible data #7

Closed oyvindln closed 7 years ago

oyvindln commented 7 years ago

We want to avoid the compressed stream expanding more than needed when encountering incompressible (high entropy) data. Ideally, stored blocks should be output if compressing a block fails to reduce the size, but we want to do this without having to keep an excessively large input buffer