Lines Matching refs:config
24 int WebPConfigInitInternal(WebPConfig* config, in WebPConfigInitInternal() argument
29 if (config == NULL) return 0; in WebPConfigInitInternal()
31 config->quality = quality; in WebPConfigInitInternal()
32 config->target_size = 0; in WebPConfigInitInternal()
33 config->target_PSNR = 0.; in WebPConfigInitInternal()
34 config->method = 4; in WebPConfigInitInternal()
35 config->sns_strength = 50; in WebPConfigInitInternal()
36 config->filter_strength = 60; // mid-filtering in WebPConfigInitInternal()
37 config->filter_sharpness = 0; in WebPConfigInitInternal()
38 config->filter_type = 1; // default: strong (so U/V is filtered too) in WebPConfigInitInternal()
39 config->partitions = 0; in WebPConfigInitInternal()
40 config->segments = 4; in WebPConfigInitInternal()
41 config->pass = 1; in WebPConfigInitInternal()
42 config->show_compressed = 0; in WebPConfigInitInternal()
43 config->preprocessing = 0; in WebPConfigInitInternal()
44 config->autofilter = 0; in WebPConfigInitInternal()
45 config->partition_limit = 0; in WebPConfigInitInternal()
46 config->alpha_compression = 1; in WebPConfigInitInternal()
47 config->alpha_filtering = 1; in WebPConfigInitInternal()
48 config->alpha_quality = 100; in WebPConfigInitInternal()
49 config->lossless = 0; in WebPConfigInitInternal()
50 config->exact = 0; in WebPConfigInitInternal()
51 config->image_hint = WEBP_HINT_DEFAULT; in WebPConfigInitInternal()
52 config->emulate_jpeg_size = 0; in WebPConfigInitInternal()
53 config->thread_level = 0; in WebPConfigInitInternal()
54 config->low_memory = 0; in WebPConfigInitInternal()
55 config->near_lossless = 100; in WebPConfigInitInternal()
56 config->use_delta_palette = 0; in WebPConfigInitInternal()
57 config->use_sharp_yuv = 0; in WebPConfigInitInternal()
62 config->sns_strength = 80; in WebPConfigInitInternal()
63 config->filter_sharpness = 4; in WebPConfigInitInternal()
64 config->filter_strength = 35; in WebPConfigInitInternal()
65 config->preprocessing &= ~2; // no dithering in WebPConfigInitInternal()
68 config->sns_strength = 80; in WebPConfigInitInternal()
69 config->filter_sharpness = 3; in WebPConfigInitInternal()
70 config->filter_strength = 30; in WebPConfigInitInternal()
71 config->preprocessing |= 2; in WebPConfigInitInternal()
74 config->sns_strength = 25; in WebPConfigInitInternal()
75 config->filter_sharpness = 6; in WebPConfigInitInternal()
76 config->filter_strength = 10; in WebPConfigInitInternal()
79 config->sns_strength = 0; in WebPConfigInitInternal()
80 config->filter_strength = 0; // disable filtering to retain sharpness in WebPConfigInitInternal()
81 config->preprocessing &= ~2; // no dithering in WebPConfigInitInternal()
84 config->sns_strength = 0; in WebPConfigInitInternal()
85 config->filter_strength = 0; // disable filtering to retain sharpness in WebPConfigInitInternal()
86 config->preprocessing &= ~2; // no dithering in WebPConfigInitInternal()
87 config->segments = 2; in WebPConfigInitInternal()
93 return WebPValidateConfig(config); in WebPConfigInitInternal()
96 int WebPValidateConfig(const WebPConfig* config) { in WebPValidateConfig() argument
97 if (config == NULL) return 0; in WebPValidateConfig()
98 if (config->quality < 0 || config->quality > 100) return 0; in WebPValidateConfig()
99 if (config->target_size < 0) return 0; in WebPValidateConfig()
100 if (config->target_PSNR < 0) return 0; in WebPValidateConfig()
101 if (config->method < 0 || config->method > 6) return 0; in WebPValidateConfig()
102 if (config->segments < 1 || config->segments > 4) return 0; in WebPValidateConfig()
103 if (config->sns_strength < 0 || config->sns_strength > 100) return 0; in WebPValidateConfig()
104 if (config->filter_strength < 0 || config->filter_strength > 100) return 0; in WebPValidateConfig()
105 if (config->filter_sharpness < 0 || config->filter_sharpness > 7) return 0; in WebPValidateConfig()
106 if (config->filter_type < 0 || config->filter_type > 1) return 0; in WebPValidateConfig()
107 if (config->autofilter < 0 || config->autofilter > 1) return 0; in WebPValidateConfig()
108 if (config->pass < 1 || config->pass > 10) return 0; in WebPValidateConfig()
109 if (config->show_compressed < 0 || config->show_compressed > 1) return 0; in WebPValidateConfig()
110 if (config->preprocessing < 0 || config->preprocessing > 7) return 0; in WebPValidateConfig()
111 if (config->partitions < 0 || config->partitions > 3) return 0; in WebPValidateConfig()
112 if (config->partition_limit < 0 || config->partition_limit > 100) return 0; in WebPValidateConfig()
113 if (config->alpha_compression < 0) return 0; in WebPValidateConfig()
114 if (config->alpha_filtering < 0) return 0; in WebPValidateConfig()
115 if (config->alpha_quality < 0 || config->alpha_quality > 100) return 0; in WebPValidateConfig()
116 if (config->lossless < 0 || config->lossless > 1) return 0; in WebPValidateConfig()
117 if (config->near_lossless < 0 || config->near_lossless > 100) return 0; in WebPValidateConfig()
118 if (config->image_hint >= WEBP_HINT_LAST) return 0; in WebPValidateConfig()
119 if (config->emulate_jpeg_size < 0 || config->emulate_jpeg_size > 1) return 0; in WebPValidateConfig()
120 if (config->thread_level < 0 || config->thread_level > 1) return 0; in WebPValidateConfig()
121 if (config->low_memory < 0 || config->low_memory > 1) return 0; in WebPValidateConfig()
122 if (config->exact < 0 || config->exact > 1) return 0; in WebPValidateConfig()
123 if (config->use_delta_palette < 0 || config->use_delta_palette > 1) { in WebPValidateConfig()
126 if (config->use_sharp_yuv < 0 || config->use_sharp_yuv > 1) return 0; in WebPValidateConfig()
144 int WebPConfigLosslessPreset(WebPConfig* config, int level) { in WebPConfigLosslessPreset() argument
145 if (config == NULL || level < 0 || level > MAX_LEVEL) return 0; in WebPConfigLosslessPreset()
146 config->lossless = 1; in WebPConfigLosslessPreset()
147 config->method = kLosslessPresets[level].method_; in WebPConfigLosslessPreset()
148 config->quality = kLosslessPresets[level].quality_; in WebPConfigLosslessPreset()