28 const int16_t *low, ptrdiff_t low_stride,
29 const int16_t *high, ptrdiff_t high_stride,
35 tmp = (11*low[0*low_stride] - 4*low[1*low_stride] + low[2*low_stride] + 4) >> 3;
36 output[(2*0+0)*out_stride] = (tmp + high[0*high_stride]) >> 1;
40 tmp = ( 5*low[0*low_stride] + 4*low[1*low_stride] - low[2*low_stride] + 4) >> 3;
41 output[(2*0+1)*out_stride] = (tmp - high[0*high_stride]) >> 1;
45 for (i = 1; i < len - 1; i++) {
46 tmp = (low[(i-1)*low_stride] - low[(i+1)*low_stride] + 4) >> 3;
47 output[(2*i+0)*out_stride] = (tmp + low[i*low_stride] + high[i*high_stride]) >> 1;
51 tmp = (low[(i+1)*low_stride] - low[(i-1)*low_stride] + 4) >> 3;
52 output[(2*i+1)*out_stride] = (tmp + low[i*low_stride] - high[i*high_stride]) >> 1;
57 tmp = ( 5*low[i*low_stride] + 4*low[(i-1)*low_stride] - low[(i-2)*low_stride] + 4) >> 3;
58 output[(2*i+0)*out_stride] = (tmp + high[i*high_stride]) >> 1;
62 tmp = (11*low[i*low_stride] - 4*low[(i-1)*low_stride] + low[(i-2)*low_stride] + 4) >> 3;
63 output[(2*i+1)*out_stride] = (tmp - high[i*high_stride]) >> 1;
69 const int16_t *low, ptrdiff_t low_stride,
70 const int16_t *high, ptrdiff_t high_stride,
74 filter(output, out_stride, low, low_stride, high, high_stride, height, 0);
82 const int16_t *low, ptrdiff_t lstride,
83 const int16_t *high, ptrdiff_t hstride,
87 filter(output, 1, low, 1, high, 1, width, 0);
90 output += ostride * 2;
97 filter(output, 1, low, 1, high, 1, width, clip);
103 filter(output, 2, low, 1, high, 1, width, clip);
void ff_cfhddsp_init_x86(CFHDDSPContext *c, int format, int bayer)
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)
Macro definitions for various function/variable attributes.
void(* horiz_filter_clip)(int16_t *output, const int16_t *low, const int16_t *high, int width, int bpc)
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
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 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)
simple assert() macros that are a bit more flexible than ISO C assert().
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)
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)
av_cold void ff_cfhddsp_init(CFHDDSPContext *c, int depth, int bayer)
static void horiz_filter_clip_bayer(int16_t *output, const int16_t *low, const int16_t *high, int width, int clip)
void(* horiz_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)
common internal and external API header
static double clip(void *opaque, double val)
Clip value val in the minval - maxval range.
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.