add alpha dithering for lossy

new options:
 dwebp -alpha_dither
 vwebp -noalphadither

When the source was marked as quantized, we use a threshold-averaging
filter to smooth the decoded alpha plane.
Note: this option forces the decoding of alpha data in one pass, and
might slow the decoding a bit.

The new field in WebPDecoderOptions struct is 'alpha_dithering_strength'
(0 by default, means: off). Max strength value is '100'.

Change-Id: I218e21af96360d4781587fede95f8ea4e2b7287a
This commit is contained in:
skal
2014-06-14 00:06:16 +02:00
parent 790207679d
commit bbe32df1e3
11 changed files with 308 additions and 21 deletions

View File

@ -443,11 +443,12 @@ struct WebPDecoderOptions {
int use_threads; // if true, use multi-threaded decoding
int dithering_strength; // dithering strength (0=Off, 100=full)
int flip; // flip output vertically
int alpha_dithering_strength; // alpha dithering strength in [0..100]
// Unused for now:
int force_rotation; // forced rotation (to be applied _last_)
int no_enhancement; // if true, discard enhancement layer
uint32_t pad[4]; // padding for later use
uint32_t pad[3]; // padding for later use
};
// Main object storing the configuration for advanced decoding.