Go to the documentation of this file.
24 #define CHROMA_EXTRA_BEFORE 1
25 #define CHROMA_EXTRA 3
26 #define LUMA_EXTRA_BEFORE 3
30 const uint8_t *_src,
const ptrdiff_t _src_stride,
31 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
34 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
36 for (
int y = 0; y <
height; y++) {
37 for (
int x = 0; x <
width; x++)
45 const uint8_t *_src,
const ptrdiff_t _src_stride,
const int height,
46 const int8_t *hf,
const int8_t *vf,
const int width)
50 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
51 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
53 for (
int y = 0; y <
height; y++) {
61 const uint8_t *_src,
const ptrdiff_t _src_stride,
const int height,
62 const int denom,
const int wx,
const int _ox,
const int8_t *hf,
const int8_t *vf,
67 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
68 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
75 const int ox = _ox * (1 << (
BIT_DEPTH - 8));
77 for (
int y = 0; y <
height; y++) {
78 for (
int x = 0; x <
width; x++) {
87 #define LUMA_FILTER(src, stride) \
88 (filter[0] * src[x - 3 * stride] + \
89 filter[1] * src[x - 2 * stride] + \
90 filter[2] * src[x - stride] + \
91 filter[3] * src[x ] + \
92 filter[4] * src[x + stride] + \
93 filter[5] * src[x + 2 * stride] + \
94 filter[6] * src[x + 3 * stride] + \
95 filter[7] * src[x + 4 * stride])
97 static void FUNC(
put_luma_h)(int16_t *dst,
const uint8_t *_src,
const ptrdiff_t _src_stride,
98 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
101 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
102 const int8_t *
filter = hf;
104 for (
int y = 0; y <
height; y++) {
105 for (
int x = 0; x <
width; x++)
112 static void FUNC(
put_luma_v)(int16_t *dst,
const uint8_t *_src,
const ptrdiff_t _src_stride,
113 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
116 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
117 const int8_t *
filter = vf;
119 for (
int y = 0; y <
height; y++) {
120 for (
int x = 0; x <
width; x++)
127 static void FUNC(
put_luma_hv)(int16_t *dst,
const uint8_t *_src,
const ptrdiff_t _src_stride,
128 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
131 int16_t *
tmp = tmp_array;
133 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
134 const int8_t *
filter = hf;
138 for (
int x = 0; x <
width; x++)
146 for (
int y = 0; y <
height; y++) {
147 for (
int x = 0; x <
width; x++)
155 const uint8_t *_src,
const ptrdiff_t _src_stride,
156 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
160 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
161 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
162 const int8_t *
filter = hf;
170 for (
int y = 0; y <
height; y++) {
171 for (
int x = 0; x <
width; x++) {
181 const uint8_t *_src,
const ptrdiff_t _src_stride,
182 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
187 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
188 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
189 const int8_t *
filter = vf;
197 for (
int y = 0; y <
height; y++) {
198 for (
int x = 0; x <
width; x++) {
208 const uint8_t *_src,
const ptrdiff_t _src_stride,
209 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
212 int16_t *
tmp = tmp_array;
215 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
216 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
217 const int8_t *
filter = hf;
227 for (
int x = 0; x <
width; x++)
236 for (
int y = 0; y <
height; y++) {
237 for (
int x = 0; x <
width; x++) {
248 const uint8_t *_src,
const ptrdiff_t _src_stride,
int height,
249 const int denom,
const int wx,
const int _ox,
const int8_t *hf,
const int8_t *vf,
254 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
255 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
256 const int8_t *
filter = hf;
257 const int ox = _ox * (1 << (
BIT_DEPTH - 8));
265 for (
int y = 0; y <
height; y++) {
266 for (
int x = 0; x <
width; x++)
274 const uint8_t *_src,
const ptrdiff_t _src_stride,
const int height,
275 const int denom,
const int wx,
const int _ox,
const int8_t *hf,
const int8_t *vf,
280 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
281 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
282 const int8_t *
filter = vf;
283 const int ox = _ox * (1 << (
BIT_DEPTH - 8));
291 for (
int y = 0; y <
height; y++) {
292 for (
int x = 0; x <
width; x++)
300 const uint8_t *_src,
const ptrdiff_t _src_stride,
const int height,
const int denom,
301 const int wx,
const int _ox,
const int8_t *hf,
const int8_t *vf,
const int width)
304 int16_t *
tmp = tmp_array;
307 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
308 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
309 const int8_t *
filter = hf;
310 const int ox = _ox * (1 << (
BIT_DEPTH - 8));
320 for (
int x = 0; x <
width; x++)
328 for (
int y = 0; y <
height; y++) {
329 for (
int x = 0; x <
width; x++)
336 #define CHROMA_FILTER(src, stride) \
337 (filter[0] * src[x - stride] + \
338 filter[1] * src[x] + \
339 filter[2] * src[x + stride] + \
340 filter[3] * src[x + 2 * stride])
342 static void FUNC(
put_chroma_h)(int16_t *dst,
const uint8_t *_src,
const ptrdiff_t _src_stride,
343 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
346 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
347 const int8_t *
filter = hf;
349 for (
int y = 0; y <
height; y++) {
350 for (
int x = 0; x <
width; x++)
357 static void FUNC(
put_chroma_v)(int16_t *dst,
const uint8_t *_src,
const ptrdiff_t _src_stride,
358 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
361 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
362 const int8_t *
filter = vf;
364 for (
int y = 0; y <
height; y++) {
365 for (
int x = 0; x <
width; x++)
373 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
376 int16_t *
tmp = tmp_array;
378 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
379 const int8_t *
filter = hf;
384 for (
int x = 0; x <
width; x++)
393 for (
int y = 0; y <
height; y++) {
394 for (
int x = 0; x <
width; x++)
402 const uint8_t *_src,
const ptrdiff_t _src_stride,
403 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
407 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
408 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
409 const int8_t *
filter = hf;
417 for (
int y = 0; y <
height; y++) {
418 for (
int x = 0; x <
width; x++)
426 const uint8_t *_src,
const ptrdiff_t _src_stride,
427 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
431 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
432 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
433 const int8_t *
filter = vf;
441 for (
int y = 0; y <
height; y++) {
442 for (
int x = 0; x <
width; x++)
450 const uint8_t *_src,
const ptrdiff_t _src_stride,
451 const int height,
const int8_t *hf,
const int8_t *vf,
const int width)
454 int16_t *
tmp = tmp_array;
457 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
458 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
459 const int8_t *
filter = hf;
470 for (
int x = 0; x <
width; x++)
479 for (
int y = 0; y <
height; y++) {
480 for (
int x = 0; x <
width; x++)
488 const uint8_t *_src, ptrdiff_t _src_stride,
int height,
int denom,
int wx,
int ox,
489 const int8_t *hf,
const int8_t *vf,
int width)
493 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
494 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
495 const int8_t *
filter = hf;
504 for (
int y = 0; y <
height; y++) {
505 for (
int x = 0; x <
width; x++) {
514 const uint8_t *_src,
const ptrdiff_t _src_stride,
const int height,
515 const int denom,
const int wx,
const int _ox,
const int8_t *hf,
const int8_t *vf,
520 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
521 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
522 const int8_t *
filter = vf;
524 const int ox = _ox * (1 << (
BIT_DEPTH - 8));
531 for (
int y = 0; y <
height; y++) {
532 for (
int x = 0; x <
width; x++) {
541 const uint8_t *_src, ptrdiff_t _src_stride,
int height,
int denom,
int wx,
int ox,
542 const int8_t *hf,
const int8_t *vf,
int width)
545 int16_t *
tmp = tmp_array;
548 const ptrdiff_t src_stride = _src_stride /
sizeof(
pixel);
549 const ptrdiff_t dst_stride = _dst_stride /
sizeof(
pixel);
550 const int8_t *
filter = hf;
561 for (
int x = 0; x <
width; x++)
571 for (
int y = 0; y <
height; y++) {
572 for (
int x = 0; x <
width; x++)
static void FUNC() put_uni_luma_w_v(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int denom, const int wx, const int _ox, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_luma_h(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
#define CHROMA_FILTER(src, stride)
static void FUNC() put_uni_w_pixels(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int denom, const int wx, const int _ox, const int8_t *hf, const int8_t *vf, const int width)
#define CHROMA_EXTRA_BEFORE
static void FUNC() put_uni_chroma_w_h(uint8_t *_dst, ptrdiff_t _dst_stride, const uint8_t *_src, ptrdiff_t _src_stride, int height, int denom, int wx, int ox, const int8_t *hf, const int8_t *vf, int width)
static void FUNC() put_uni_chroma_w_v(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int denom, const int wx, const int _ox, const int8_t *hf, const int8_t *vf, const int width)
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 then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
static void FUNC() put_uni_luma_w_h(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, int height, const int denom, const int wx, const int _ox, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_uni_luma_v(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
static double val(void *priv, double ch)
static void FUNC() put_uni_chroma_v(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_uni_luma_hv(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_chroma_v(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_uni_chroma_h(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_uni_chroma_w_hv(uint8_t *_dst, ptrdiff_t _dst_stride, const uint8_t *_src, ptrdiff_t _src_stride, int height, int denom, int wx, int ox, const int8_t *hf, const int8_t *vf, int width)
static void FUNC() put_luma_v(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
#define LUMA_EXTRA_BEFORE
static int shift(int a, int b)
static void FUNC() put_uni_luma_h(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
static void FUNC() put_uni_chroma_hv(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_pixels(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_uni_pixels(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_luma_hv(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_chroma_h(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_chroma_hv(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
static void FUNC() put_uni_luma_w_hv(uint8_t *_dst, const ptrdiff_t _dst_stride, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int denom, const int wx, const int _ox, const int8_t *hf, const int8_t *vf, const int width)
#define LUMA_FILTER(src, stride)