OLD | NEW |
1 // Copyright 2011 Google Inc. All Rights Reserved. | 1 // Copyright 2011 Google Inc. All Rights Reserved. |
2 // | 2 // |
3 // This code is licensed under the same terms as WebM: | 3 // This code is licensed under the same terms as WebM: |
4 // Software License Agreement: http://www.webmproject.org/license/software/ | 4 // Software License Agreement: http://www.webmproject.org/license/software/ |
5 // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ | 5 // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ |
6 // ----------------------------------------------------------------------------- | 6 // ----------------------------------------------------------------------------- |
7 // | 7 // |
8 // Spatial prediction using various filters | 8 // Spatial prediction using various filters |
9 // | 9 // |
10 // Author: Urvang (urvang@google.com) | 10 // Author: Urvang (urvang@google.com) |
(...skipping 12 matching lines...) Expand all Loading... |
23 WEBP_FILTER_NONE = 0, | 23 WEBP_FILTER_NONE = 0, |
24 WEBP_FILTER_HORIZONTAL, | 24 WEBP_FILTER_HORIZONTAL, |
25 WEBP_FILTER_VERTICAL, | 25 WEBP_FILTER_VERTICAL, |
26 WEBP_FILTER_GRADIENT, | 26 WEBP_FILTER_GRADIENT, |
27 WEBP_FILTER_LAST = WEBP_FILTER_GRADIENT + 1, // end marker | 27 WEBP_FILTER_LAST = WEBP_FILTER_GRADIENT + 1, // end marker |
28 WEBP_FILTER_BEST, | 28 WEBP_FILTER_BEST, |
29 WEBP_FILTER_FAST | 29 WEBP_FILTER_FAST |
30 } WEBP_FILTER_TYPE; | 30 } WEBP_FILTER_TYPE; |
31 | 31 |
32 typedef void (*WebPFilterFunc)(const uint8_t* in, int width, int height, | 32 typedef void (*WebPFilterFunc)(const uint8_t* in, int width, int height, |
33 int bpp, int stride, uint8_t* out); | 33 int stride, uint8_t* out); |
| 34 typedef void (*WebPUnfilterFunc)(int width, int height, int stride, |
| 35 uint8_t* data); |
34 | 36 |
35 // Filter the given data using the given predictor. | 37 // Filter the given data using the given predictor. |
36 // 'in' corresponds to a 2-dimensional pixel array of size (stride * height) | 38 // 'in' corresponds to a 2-dimensional pixel array of size (stride * height) |
37 // in raster order. | 39 // in raster order. |
38 // 'bpp' is number of bytes per pixel, and | |
39 // 'stride' is number of bytes per scan line (with possible padding). | 40 // 'stride' is number of bytes per scan line (with possible padding). |
40 // 'out' should be pre-allocated. | 41 // 'out' should be pre-allocated. |
41 extern const WebPFilterFunc WebPFilters[WEBP_FILTER_LAST]; | 42 extern const WebPFilterFunc WebPFilters[WEBP_FILTER_LAST]; |
42 | 43 |
43 // Reconstruct the original data from the given filtered data. | 44 // In-place reconstruct the original data from the given filtered data. |
44 extern const WebPFilterFunc WebPUnfilters[WEBP_FILTER_LAST]; | 45 extern const WebPUnfilterFunc WebPUnfilters[WEBP_FILTER_LAST]; |
45 | 46 |
46 // Fast estimate of a potentially good filter. | 47 // Fast estimate of a potentially good filter. |
47 extern WEBP_FILTER_TYPE EstimateBestFilter(const uint8_t* data, | 48 extern WEBP_FILTER_TYPE EstimateBestFilter(const uint8_t* data, |
48 int width, int height, int stride); | 49 int width, int height, int stride); |
49 | 50 |
50 #if defined(__cplusplus) || defined(c_plusplus) | 51 #if defined(__cplusplus) || defined(c_plusplus) |
51 } // extern "C" | 52 } // extern "C" |
52 #endif | 53 #endif |
53 | 54 |
54 #endif /* WEBP_UTILS_FILTERS_H_ */ | 55 #endif /* WEBP_UTILS_FILTERS_H_ */ |
OLD | NEW |