@@ -267,6 +267,8 @@ mod simd {
267
267
/// Compression in general benefits from repetitive data. The filter is a content-aware method of
268
268
/// compressing the range of occurring byte values to help the compression algorithm. Note that
269
269
/// this does not operate on pixels but on raw bytes of a scanline.
270
+ ///
271
+ /// Details on how each filter works can be found in the [PNG Book](http://www.libpng.org/pub/png/book/chapter09.html).
270
272
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
271
273
#[ repr( u8 ) ]
272
274
pub enum FilterType {
@@ -297,12 +299,14 @@ impl FilterType {
297
299
}
298
300
}
299
301
300
- /// The filtering method for preprocessing scanline data before compression.
302
+ /// Adaptive filtering tries every possible filter for each row and uses a heuristic to select the best one.
303
+ /// This improves compression ratio, but makes encoding slightly slower.
301
304
///
302
- /// Adaptive filtering performs additional computation in an attempt to maximize
303
- /// the compression of the data. [`NonAdaptive`] filtering is the default.
305
+ /// It is recommended to use `Adaptive` whenever you care about compression ratio.
306
+ /// Filtering is quite cheap compared to other parts of encoding, but can contribute
307
+ /// to the compression ratio significantly.
304
308
///
305
- /// [ `NonAdaptive`]: AdaptiveFilterType::NonAdaptive
309
+ /// `NonAdaptive` filtering is the default.
306
310
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
307
311
#[ repr( u8 ) ]
308
312
pub enum AdaptiveFilterType {
0 commit comments