mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-14 21:09:55 +02:00
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:
@ -39,6 +39,8 @@ int WebPConfigInitInternal(WebPConfig* config,
|
||||
config->partitions = 0;
|
||||
config->segments = 4;
|
||||
config->pass = 1;
|
||||
config->qmin = 0;
|
||||
config->qmax = 100;
|
||||
config->show_compressed = 0;
|
||||
config->preprocessing = 0;
|
||||
config->autofilter = 0;
|
||||
@ -106,6 +108,9 @@ int WebPValidateConfig(const WebPConfig* config) {
|
||||
if (config->filter_type < 0 || config->filter_type > 1) return 0;
|
||||
if (config->autofilter < 0 || config->autofilter > 1) return 0;
|
||||
if (config->pass < 1 || config->pass > 10) return 0;
|
||||
if (config->qmin < 0 || config->qmax > 100 || config->qmin > config->qmax) {
|
||||
return 0;
|
||||
}
|
||||
if (config->show_compressed < 0 || config->show_compressed > 1) return 0;
|
||||
if (config->preprocessing < 0 || config->preprocessing > 7) return 0;
|
||||
if (config->partitions < 0 || config->partitions > 3) return 0;
|
||||
|
Reference in New Issue
Block a user