diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2018-10-25 20:22:59 +0300 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2018-10-29 19:16:56 +0300 |
commit | 8007c79fee9bf1745c3e789b5123c42d470b20e2 (patch) | |
tree | 2866954a54bd194f1c79455b446902983a75416c /src/cdef.h | |
parent | ba08e37cd28515055edd42d092835ac142ca8114 (diff) |
Simplify/rewrite cdef filtering code
Diffstat (limited to 'src/cdef.h')
-rw-r--r-- | src/cdef.h | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -40,14 +40,21 @@ enum CdefEdgeFlags { HAVE_BOTTOM = 1 << 3, }; +#ifdef BITDEPTH +typedef const pixel (*const_left_pixel_row_2px)[2]; +#else +typedef const void *const_left_pixel_row_2px; +#endif + // CDEF operates entirely on pre-filter data; if bottom/right edges are // present (according to $edges), then the pre-filter data is located in // $dst. However, the edge pixels above $dst may be post-filter, so in // order to get access to pre-filter top pixels, use $top. -typedef void (*cdef_fn)(pixel *dst, ptrdiff_t stride, - /*const*/ pixel *const top[2], - int pri_strength, int sec_strength, - int dir, int damping, enum CdefEdgeFlags edges); +#define decl_cdef_fn(name) \ +void (name)(pixel *dst, ptrdiff_t stride, const_left_pixel_row_2px left, \ + /*const*/ pixel *const top[2], int pri_strength, int sec_strength, \ + int dir, int damping, enum CdefEdgeFlags edges) +typedef decl_cdef_fn(*cdef_fn); #define decl_cdef_dir_fn(name) \ int (name)(const pixel *dst, ptrdiff_t dst_stride, unsigned *var) |