1 // Copyright 2011 Google Inc. All Rights Reserved.
3 // This code is licensed under the same terms as WebM:
4 // Software License Agreement: http://www.webmproject.org/license/software/
5 // Additional IP Rights Grant: http://www.webmproject.org/license/additional/
6 // -----------------------------------------------------------------------------
8 // Spatial prediction using various filters
10 // Author: Urvang (urvang@google.com)
12 #ifndef WEBP_UTILS_FILTERS_H_
13 #define WEBP_UTILS_FILTERS_H_
15 #include "../webp/types.h"
17 #if defined(__cplusplus) || defined(c_plusplus)
24 WEBP_FILTER_HORIZONTAL,
27 WEBP_FILTER_LAST = WEBP_FILTER_GRADIENT + 1, // end marker
32 typedef void (*WebPFilterFunc)(const uint8_t* in, int width, int height,
33 int stride, uint8_t* out);
34 typedef void (*WebPUnfilterFunc)(int width, int height, int stride,
37 // Filter the given data using the given predictor.
38 // 'in' corresponds to a 2-dimensional pixel array of size (stride * height)
40 // 'stride' is number of bytes per scan line (with possible padding).
41 // 'out' should be pre-allocated.
42 extern const WebPFilterFunc WebPFilters[WEBP_FILTER_LAST];
44 // In-place reconstruct the original data from the given filtered data.
45 extern const WebPUnfilterFunc WebPUnfilters[WEBP_FILTER_LAST];
47 // Fast estimate of a potentially good filter.
48 extern WEBP_FILTER_TYPE EstimateBestFilter(const uint8_t* data,
49 int width, int height, int stride);
51 #if defined(__cplusplus) || defined(c_plusplus)
55 #endif /* WEBP_UTILS_FILTERS_H_ */