mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-19 07:20:02 +02:00
add a -partition_limit option to limit the number of bits used by intra4x4
Although it degrades quality, this option is useful to avoid the 512k limit for partition #0. If not enough to reach the lower bound of 4bits per macroblock header, one should also limit the number of segments used (down to -segments 1) See the man file for extra details. Change-Id: Ia59ffac13176c85b809ddd6340d37b54ee9487ea
This commit is contained in:
@ -42,6 +42,7 @@ int WebPConfigInitInternal(WebPConfig* const config,
|
||||
config->preprocessing = 0;
|
||||
config->autofilter = 0;
|
||||
config->alpha_compression = 0;
|
||||
config->partition_limit = 0;
|
||||
|
||||
// TODO(skal): tune.
|
||||
switch (preset) {
|
||||
@ -106,6 +107,8 @@ int WebPValidateConfig(const WebPConfig* const config) {
|
||||
return 0;
|
||||
if (config->partitions < 0 || config->partitions > 3)
|
||||
return 0;
|
||||
if (config->partition_limit < 0 || config->partition_limit > 100)
|
||||
return 0;
|
||||
if (config->alpha_compression < 0)
|
||||
return 0;
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user