Go to the documentation of this file.
27 const int16_t *low, ptrdiff_t low_stride,
28 const int16_t *high, ptrdiff_t high_stride,
34 tmp = (11*low[0*low_stride] - 4*low[1*low_stride] + low[2*low_stride] + 4) >> 3;
35 output[(2*0+0)*out_stride] = (
tmp + high[0*high_stride]) >> 1;
39 tmp = ( 5*low[0*low_stride] + 4*low[1*low_stride] - low[2*low_stride] + 4) >> 3;
40 output[(2*0+1)*out_stride] = (
tmp - high[0*high_stride]) >> 1;
44 for (
i = 1;
i <
len - 1;
i++) {
45 tmp = (low[(
i-1)*low_stride] - low[(
i+1)*low_stride] + 4) >> 3;
46 output[(2*
i+0)*out_stride] = (
tmp + low[
i*low_stride] + high[
i*high_stride]) >> 1;
50 tmp = (low[(
i+1)*low_stride] - low[(
i-1)*low_stride] + 4) >> 3;
51 output[(2*
i+1)*out_stride] = (
tmp + low[
i*low_stride] - high[
i*high_stride]) >> 1;
56 tmp = ( 5*low[
i*low_stride] + 4*low[(
i-1)*low_stride] - low[(
i-2)*low_stride] + 4) >> 3;
57 output[(2*
i+0)*out_stride] = (
tmp + high[
i*high_stride]) >> 1;
61 tmp = (11*low[
i*low_stride] - 4*low[(
i-1)*low_stride] + low[(
i-2)*low_stride] + 4) >> 3;
62 output[(2*
i+1)*out_stride] = (
tmp - high[
i*high_stride]) >> 1;
68 const int16_t *low, ptrdiff_t low_stride,
69 const int16_t *high, ptrdiff_t high_stride,
81 const int16_t *low, ptrdiff_t lstride,
82 const int16_t *high, ptrdiff_t hstride,
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
Clip a signed integer to an unsigned power of two range.
static void horiz_filter_clip(int16_t *output, const int16_t *low, const int16_t *high, int width, int clip)
static void vert_filter(int16_t *output, ptrdiff_t out_stride, const int16_t *low, ptrdiff_t low_stride, const int16_t *high, ptrdiff_t high_stride, int width, int height)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
#define i(width, name, range_min, range_max)
static void horiz_filter_clip_bayer(int16_t *output, const int16_t *low, const int16_t *high, int width, int clip)
static void horiz_filter(int16_t *output, ptrdiff_t ostride, const int16_t *low, ptrdiff_t lstride, const int16_t *high, ptrdiff_t hstride, int width, int height)
static av_always_inline void filter(int16_t *output, ptrdiff_t out_stride, const int16_t *low, ptrdiff_t low_stride, const int16_t *high, ptrdiff_t high_stride, int len, int clip)
av_cold void ff_cfhddsp_init(CFHDDSPContext *c, int depth, int bayer)
void ff_cfhddsp_init_x86(CFHDDSPContext *c, int format, int bayer)
static double clip(void *opaque, double val)
Clip value val in the minval - maxval range.