Lines Matching refs:config
20 int WebPConfigInitInternal(WebPConfig* config, in WebPConfigInitInternal() argument
25 if (config == NULL) return 0; in WebPConfigInitInternal()
27 config->quality = quality; in WebPConfigInitInternal()
28 config->target_size = 0; in WebPConfigInitInternal()
29 config->target_PSNR = 0.; in WebPConfigInitInternal()
30 config->method = 4; in WebPConfigInitInternal()
31 config->sns_strength = 50; in WebPConfigInitInternal()
32 config->filter_strength = 60; // mid-filtering in WebPConfigInitInternal()
33 config->filter_sharpness = 0; in WebPConfigInitInternal()
34 config->filter_type = 1; // default: strong (so U/V is filtered too) in WebPConfigInitInternal()
35 config->partitions = 0; in WebPConfigInitInternal()
36 config->segments = 4; in WebPConfigInitInternal()
37 config->pass = 1; in WebPConfigInitInternal()
38 config->show_compressed = 0; in WebPConfigInitInternal()
39 config->preprocessing = 0; in WebPConfigInitInternal()
40 config->autofilter = 0; in WebPConfigInitInternal()
41 config->partition_limit = 0; in WebPConfigInitInternal()
42 config->alpha_compression = 1; in WebPConfigInitInternal()
43 config->alpha_filtering = 1; in WebPConfigInitInternal()
44 config->alpha_quality = 100; in WebPConfigInitInternal()
45 config->lossless = 0; in WebPConfigInitInternal()
46 config->exact = 0; in WebPConfigInitInternal()
47 config->image_hint = WEBP_HINT_DEFAULT; in WebPConfigInitInternal()
48 config->emulate_jpeg_size = 0; in WebPConfigInitInternal()
49 config->thread_level = 0; in WebPConfigInitInternal()
50 config->low_memory = 0; in WebPConfigInitInternal()
51 config->near_lossless = 100; in WebPConfigInitInternal()
53 config->delta_palettization = 0; in WebPConfigInitInternal()
59 config->sns_strength = 80; in WebPConfigInitInternal()
60 config->filter_sharpness = 4; in WebPConfigInitInternal()
61 config->filter_strength = 35; in WebPConfigInitInternal()
62 config->preprocessing &= ~2; // no dithering in WebPConfigInitInternal()
65 config->sns_strength = 80; in WebPConfigInitInternal()
66 config->filter_sharpness = 3; in WebPConfigInitInternal()
67 config->filter_strength = 30; in WebPConfigInitInternal()
68 config->preprocessing |= 2; in WebPConfigInitInternal()
71 config->sns_strength = 25; in WebPConfigInitInternal()
72 config->filter_sharpness = 6; in WebPConfigInitInternal()
73 config->filter_strength = 10; in WebPConfigInitInternal()
76 config->sns_strength = 0; in WebPConfigInitInternal()
77 config->filter_strength = 0; // disable filtering to retain sharpness in WebPConfigInitInternal()
78 config->preprocessing &= ~2; // no dithering in WebPConfigInitInternal()
81 config->sns_strength = 0; in WebPConfigInitInternal()
82 config->filter_strength = 0; // disable filtering to retain sharpness in WebPConfigInitInternal()
83 config->preprocessing &= ~2; // no dithering in WebPConfigInitInternal()
84 config->segments = 2; in WebPConfigInitInternal()
90 return WebPValidateConfig(config); in WebPConfigInitInternal()
93 int WebPValidateConfig(const WebPConfig* config) { in WebPValidateConfig() argument
94 if (config == NULL) return 0; in WebPValidateConfig()
95 if (config->quality < 0 || config->quality > 100) in WebPValidateConfig()
97 if (config->target_size < 0) in WebPValidateConfig()
99 if (config->target_PSNR < 0) in WebPValidateConfig()
101 if (config->method < 0 || config->method > 6) in WebPValidateConfig()
103 if (config->segments < 1 || config->segments > 4) in WebPValidateConfig()
105 if (config->sns_strength < 0 || config->sns_strength > 100) in WebPValidateConfig()
107 if (config->filter_strength < 0 || config->filter_strength > 100) in WebPValidateConfig()
109 if (config->filter_sharpness < 0 || config->filter_sharpness > 7) in WebPValidateConfig()
111 if (config->filter_type < 0 || config->filter_type > 1) in WebPValidateConfig()
113 if (config->autofilter < 0 || config->autofilter > 1) in WebPValidateConfig()
115 if (config->pass < 1 || config->pass > 10) in WebPValidateConfig()
117 if (config->show_compressed < 0 || config->show_compressed > 1) in WebPValidateConfig()
119 if (config->preprocessing < 0 || config->preprocessing > 7) in WebPValidateConfig()
121 if (config->partitions < 0 || config->partitions > 3) in WebPValidateConfig()
123 if (config->partition_limit < 0 || config->partition_limit > 100) in WebPValidateConfig()
125 if (config->alpha_compression < 0) in WebPValidateConfig()
127 if (config->alpha_filtering < 0) in WebPValidateConfig()
129 if (config->alpha_quality < 0 || config->alpha_quality > 100) in WebPValidateConfig()
131 if (config->lossless < 0 || config->lossless > 1) in WebPValidateConfig()
133 if (config->near_lossless < 0 || config->near_lossless > 100) in WebPValidateConfig()
135 if (config->image_hint >= WEBP_HINT_LAST) in WebPValidateConfig()
137 if (config->emulate_jpeg_size < 0 || config->emulate_jpeg_size > 1) in WebPValidateConfig()
139 if (config->thread_level < 0 || config->thread_level > 1) in WebPValidateConfig()
141 if (config->low_memory < 0 || config->low_memory > 1) in WebPValidateConfig()
143 if (config->exact < 0 || config->exact > 1) in WebPValidateConfig()
146 if (config->delta_palettization < 0 || config->delta_palettization > 1) in WebPValidateConfig()
165 int WebPConfigLosslessPreset(WebPConfig* config, int level) { in WebPConfigLosslessPreset() argument
166 if (config == NULL || level < 0 || level > MAX_LEVEL) return 0; in WebPConfigLosslessPreset()
167 config->lossless = 1; in WebPConfigLosslessPreset()
168 config->method = kLosslessPresets[level].method_; in WebPConfigLosslessPreset()
169 config->quality = kLosslessPresets[level].quality_; in WebPConfigLosslessPreset()