Enc: add a qmin / qmax range for quality factor

This is particularly useful for multi-pass search (but not only),
to prevent the search from going over or below a reasonable threshold.
E.g.: 'cwebp -qrange 50 80 ...' will prevent any unreasonable degradation.

new cwebp option: -qrange min max

Change-Id: I59f394533535fc20b6996bc0895f4301476d5eff
This commit is contained in:
Skal
2020-01-29 09:34:26 +01:00
parent 0fa56f307f
commit 6a0ff35872
6 changed files with 64 additions and 36 deletions

View File

@ -20,7 +20,7 @@
extern "C" {
#endif
#define WEBP_ENCODER_ABI_VERSION 0x020f // MAJOR(8b) + MINOR(8b)
#define WEBP_ENCODER_ABI_VERSION 0x0210 // MAJOR(8b) + MINOR(8b)
// Note: forward declaring enumerations is not allowed in (strict) C and C++,
// the types are left here for reference.
@ -121,6 +121,8 @@ struct WebPConfig {
int alpha_quality; // Between 0 (smallest size) and 100 (lossless).
// Default is 100.
int pass; // number of entropy-analysis passes (in [1..10]).
int qmin; // minimum permissible quality factor
int qmax; // maximum permissible quality factor
int show_compressed; // if true, export the compressed picture back.
// In-loop filtering is not applied.