| Index: third_party/libwebp/enc/config_enc.c
|
| diff --git a/third_party/libwebp/enc/config.c b/third_party/libwebp/enc/config_enc.c
|
| similarity index 71%
|
| rename from third_party/libwebp/enc/config.c
|
| rename to third_party/libwebp/enc/config_enc.c
|
| index f9f7961d58816cf996bd3dfef035d43cd8ac789e..4589dc0619e0cc6eac5dd621967c994ce59aef01 100644
|
| --- a/third_party/libwebp/enc/config.c
|
| +++ b/third_party/libwebp/enc/config_enc.c
|
| @@ -11,6 +11,10 @@
|
| //
|
| // Author: Skal (pascal.massimino@gmail.com)
|
|
|
| +#ifdef HAVE_CONFIG_H
|
| +#include "../webp/config.h"
|
| +#endif
|
| +
|
| #include "../webp/encode.h"
|
|
|
| //------------------------------------------------------------------------------
|
| @@ -49,9 +53,8 @@ int WebPConfigInitInternal(WebPConfig* config,
|
| config->thread_level = 0;
|
| config->low_memory = 0;
|
| config->near_lossless = 100;
|
| -#ifdef WEBP_EXPERIMENTAL_FEATURES
|
| - config->delta_palettization = 0;
|
| -#endif // WEBP_EXPERIMENTAL_FEATURES
|
| + config->use_delta_palette = 0;
|
| + config->use_sharp_yuv = 0;
|
|
|
| // TODO(skal): tune.
|
| switch (preset) {
|
| @@ -92,60 +95,36 @@ int WebPConfigInitInternal(WebPConfig* config,
|
|
|
| int WebPValidateConfig(const WebPConfig* config) {
|
| if (config == NULL) return 0;
|
| - if (config->quality < 0 || config->quality > 100)
|
| - return 0;
|
| - if (config->target_size < 0)
|
| - return 0;
|
| - if (config->target_PSNR < 0)
|
| - return 0;
|
| - if (config->method < 0 || config->method > 6)
|
| - return 0;
|
| - if (config->segments < 1 || config->segments > 4)
|
| - return 0;
|
| - if (config->sns_strength < 0 || config->sns_strength > 100)
|
| - return 0;
|
| - if (config->filter_strength < 0 || config->filter_strength > 100)
|
| - return 0;
|
| - if (config->filter_sharpness < 0 || config->filter_sharpness > 7)
|
| - return 0;
|
| - 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->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)
|
| + if (config->quality < 0 || config->quality > 100) return 0;
|
| + if (config->target_size < 0) return 0;
|
| + if (config->target_PSNR < 0) return 0;
|
| + if (config->method < 0 || config->method > 6) return 0;
|
| + if (config->segments < 1 || config->segments > 4) return 0;
|
| + if (config->sns_strength < 0 || config->sns_strength > 100) return 0;
|
| + if (config->filter_strength < 0 || config->filter_strength > 100) return 0;
|
| + if (config->filter_sharpness < 0 || config->filter_sharpness > 7) return 0;
|
| + 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->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;
|
| + if (config->partition_limit < 0 || config->partition_limit > 100) return 0;
|
| + if (config->alpha_compression < 0) return 0;
|
| + if (config->alpha_filtering < 0) return 0;
|
| + if (config->alpha_quality < 0 || config->alpha_quality > 100) return 0;
|
| + if (config->lossless < 0 || config->lossless > 1) return 0;
|
| + if (config->near_lossless < 0 || config->near_lossless > 100) return 0;
|
| + if (config->image_hint >= WEBP_HINT_LAST) return 0;
|
| + if (config->emulate_jpeg_size < 0 || config->emulate_jpeg_size > 1) return 0;
|
| + if (config->thread_level < 0 || config->thread_level > 1) return 0;
|
| + if (config->low_memory < 0 || config->low_memory > 1) return 0;
|
| + if (config->exact < 0 || config->exact > 1) return 0;
|
| + if (config->use_delta_palette < 0 || config->use_delta_palette > 1) {
|
| return 0;
|
| - if (config->partition_limit < 0 || config->partition_limit > 100)
|
| - return 0;
|
| - if (config->alpha_compression < 0)
|
| - return 0;
|
| - if (config->alpha_filtering < 0)
|
| - return 0;
|
| - if (config->alpha_quality < 0 || config->alpha_quality > 100)
|
| - return 0;
|
| - if (config->lossless < 0 || config->lossless > 1)
|
| - return 0;
|
| - if (config->near_lossless < 0 || config->near_lossless > 100)
|
| - return 0;
|
| - if (config->image_hint >= WEBP_HINT_LAST)
|
| - return 0;
|
| - if (config->emulate_jpeg_size < 0 || config->emulate_jpeg_size > 1)
|
| - return 0;
|
| - if (config->thread_level < 0 || config->thread_level > 1)
|
| - return 0;
|
| - if (config->low_memory < 0 || config->low_memory > 1)
|
| - return 0;
|
| - if (config->exact < 0 || config->exact > 1)
|
| - return 0;
|
| -#ifdef WEBP_EXPERIMENTAL_FEATURES
|
| - if (config->delta_palettization < 0 || config->delta_palettization > 1)
|
| - return 0;
|
| -#endif // WEBP_EXPERIMENTAL_FEATURES
|
| + }
|
| + if (config->use_sharp_yuv < 0 || config->use_sharp_yuv > 1) return 0;
|
| +
|
| return 1;
|
| }
|
|
|
|
|