FFmpeg  4.4.8
vf_avgblur.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Paul B Mahol
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20  * SOFTWARE.
21  */
22 
23 #include "libavutil/imgutils.h"
24 #include "libavutil/opt.h"
25 #include "libavutil/pixdesc.h"
26 #include "avfilter.h"
27 #include "filters.h"
28 #include "formats.h"
29 #include "internal.h"
30 #include "video.h"
31 
32 typedef struct AverageBlurContext {
33  const AVClass *class;
34 
35  int radius;
36  int radiusV;
37  int planes;
38 
39  int depth;
40  int planewidth[4];
41  int planeheight[4];
42  float *buffer;
43  int nb_planes;
44 
45  int (*filter_horizontally)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
46  int (*filter_vertically)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
48 
49 #define OFFSET(x) offsetof(AverageBlurContext, x)
50 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
51 
52 static const AVOption avgblur_options[] = {
53  { "sizeX", "set horizontal size", OFFSET(radius), AV_OPT_TYPE_INT, {.i64=1}, 1, 1024, FLAGS },
54  { "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS },
55  { "sizeY", "set vertical size", OFFSET(radiusV), AV_OPT_TYPE_INT, {.i64=0}, 0, 1024, FLAGS },
56  { NULL }
57 };
58 
60 
61 typedef struct ThreadData {
62  int height;
63  int width;
65  int linesize;
66 } ThreadData;
67 
68 #define HORIZONTAL_FILTER(name, type) \
69 static int filter_horizontally_##name(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)\
70 { \
71  AverageBlurContext *s = ctx->priv; \
72  ThreadData *td = arg; \
73  const int height = td->height; \
74  const int width = td->width; \
75  const int slice_start = ff_slice_pos(height, jobnr, nb_jobs); \
76  const int slice_end = ff_slice_pos(height, jobnr + 1, nb_jobs); \
77  const int radius = FFMIN(s->radius, width / 2); \
78  const int linesize = td->linesize / sizeof(type); \
79  float *buffer = s->buffer; \
80  const type *src; \
81  float *ptr; \
82  int y, x; \
83  \
84  /* Filter horizontally along each row */ \
85  for (y = slice_start; y < slice_end; y++) { \
86  float acc = 0; \
87  int count = 0; \
88  \
89  src = (const type *)td->ptr + linesize * y; \
90  ptr = buffer + width * y; \
91  \
92  for (x = 0; x < radius; x++) { \
93  acc += src[x]; \
94  } \
95  count += radius; \
96  \
97  for (x = 0; x <= radius; x++) { \
98  acc += src[x + radius]; \
99  count++; \
100  ptr[x] = acc / count; \
101  } \
102  \
103  for (; x < width - radius; x++) { \
104  acc += src[x + radius] - src[x - radius - 1]; \
105  ptr[x] = acc / count; \
106  } \
107  \
108  for (; x < width; x++) { \
109  acc -= src[x - radius]; \
110  count--; \
111  ptr[x] = acc / count; \
112  } \
113  } \
114  \
115  return 0; \
116 }
117 
119 HORIZONTAL_FILTER(16, uint16_t)
120 
121 #define VERTICAL_FILTER(name, type) \
122 static int filter_vertically_##name(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) \
123 { \
124  AverageBlurContext *s = ctx->priv; \
125  ThreadData *td = arg; \
126  const int height = td->height; \
127  const int width = td->width; \
128  const int slice_start = ff_slice_pos(width, jobnr, nb_jobs); \
129  const int slice_end = ff_slice_pos(width, jobnr + 1, nb_jobs); \
130  const int radius = FFMIN(s->radiusV, height / 2); \
131  const int linesize = td->linesize / sizeof(type); \
132  type *buffer = (type *)td->ptr; \
133  const float *src; \
134  type *ptr; \
135  int i, x; \
136  \
137  /* Filter vertically along each column */ \
138  for (x = slice_start; x < slice_end; x++) { \
139  float acc = 0; \
140  int count = 0; \
141  \
142  src = s->buffer + x; \
143  \
144  for (i = 0; i < radius; i++) { \
145  acc += src[0]; \
146  src += width; \
147  } \
148  count += radius; \
149  \
150  src = s->buffer + x; \
151  ptr = buffer + x; \
152  for (i = 0; i + radius < height && i <= radius; i++) { \
153  acc += src[(i + radius) * width]; \
154  count++; \
155  ptr[i * linesize] = acc / count; \
156  } \
157  \
158  for (; i < height - radius; i++) { \
159  acc += src[(i + radius) * width] - src[(i - radius - 1) * width]; \
160  ptr[i * linesize] = acc / count; \
161  } \
162  \
163  for (; i < height; i++) { \
164  acc -= src[(i - radius) * width]; \
165  count--; \
166  ptr[i * linesize] = acc / count; \
167  } \
168  } \
169  \
170  return 0; \
171 }
172 
174 VERTICAL_FILTER(16, uint16_t)
175 
176 static int config_input(AVFilterLink *inlink)
177 {
178  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
179  AverageBlurContext *s = inlink->dst->priv;
180 
181  s->depth = desc->comp[0].depth;
182  s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
183  s->planewidth[0] = s->planewidth[3] = inlink->w;
184  s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
185  s->planeheight[0] = s->planeheight[3] = inlink->h;
186 
187  s->nb_planes = av_pix_fmt_count_planes(inlink->format);
188 
189  s->buffer = av_malloc_array(inlink->w, inlink->h * sizeof(*s->buffer));
190  if (!s->buffer)
191  return AVERROR(ENOMEM);
192 
193  if (s->radiusV <= 0) {
194  s->radiusV = s->radius;
195  }
196 
197  if (s->depth == 8) {
198  s->filter_horizontally = filter_horizontally_8;
199  s->filter_vertically = filter_vertically_8;
200  } else {
201  s->filter_horizontally = filter_horizontally_16;
202  s->filter_vertically = filter_vertically_16;
203  }
204 
205  return 0;
206 }
207 
208 static void averageiir2d(AVFilterContext *ctx, AVFrame *in, AVFrame *out, int plane)
209 {
210  AverageBlurContext *s = ctx->priv;
211  const int width = s->planewidth[plane];
212  const int height = s->planeheight[plane];
213  const int nb_threads = ff_filter_get_nb_threads(ctx);
214  ThreadData td;
215 
216  td.width = width;
217  td.height = height;
218  td.ptr = in->data[plane];
219  td.linesize = in->linesize[plane];
220  ctx->internal->execute(ctx, s->filter_horizontally, &td, NULL, FFMIN(height, nb_threads));
221  td.ptr = out->data[plane];
222  td.linesize = out->linesize[plane];
223  ctx->internal->execute(ctx, s->filter_vertically, &td, NULL, FFMIN(width, nb_threads));
224 }
225 
227 {
228  static const enum AVPixelFormat pix_fmts[] = {
248  };
249 
251 }
252 
253 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
254 {
255  AVFilterContext *ctx = inlink->dst;
256  AverageBlurContext *s = ctx->priv;
257  AVFilterLink *outlink = ctx->outputs[0];
258  AVFrame *out;
259  int plane;
260 
261  if (av_frame_is_writable(in)) {
262  out = in;
263  } else {
264  out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
265  if (!out) {
266  av_frame_free(&in);
267  return AVERROR(ENOMEM);
268  }
270  }
271 
272  for (plane = 0; plane < s->nb_planes; plane++) {
273  const int height = s->planeheight[plane];
274  const int width = s->planewidth[plane];
275 
276  if (!(s->planes & (1 << plane))) {
277  if (out->data[plane] != in->data[plane])
278  av_image_copy_plane(out->data[plane], out->linesize[plane],
279  in->data[plane], in->linesize[plane],
280  width * ((s->depth + 7) / 8), height);
281  continue;
282  }
283 
284  averageiir2d(ctx, in, out, plane);
285  }
286 
287  if (out != in)
288  av_frame_free(&in);
289  return ff_filter_frame(outlink, out);
290 }
291 
293 {
294  AverageBlurContext *s = ctx->priv;
295 
296  av_freep(&s->buffer);
297 }
298 
299 static const AVFilterPad avgblur_inputs[] = {
300  {
301  .name = "default",
302  .type = AVMEDIA_TYPE_VIDEO,
303  .config_props = config_input,
304  .filter_frame = filter_frame,
305  },
306  { NULL }
307 };
308 
309 static const AVFilterPad avgblur_outputs[] = {
310  {
311  .name = "default",
312  .type = AVMEDIA_TYPE_VIDEO,
313  },
314  { NULL }
315 };
316 
318  .name = "avgblur",
319  .description = NULL_IF_CONFIG_SMALL("Apply Average Blur filter."),
320  .priv_size = sizeof(AverageBlurContext),
321  .priv_class = &avgblur_class,
322  .uninit = uninit,
328 };
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_acrusher.c:336
#define av_cold
Definition: attributes.h:88
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
uint8_t
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1096
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:882
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition: avfilter.c:802
Main libavfilter public API header.
#define flags(name, subs,...)
Definition: cbs_av1.c:572
#define s(width, name)
Definition: cbs_vp9.c:257
#define FFMIN(a, b)
Definition: common.h:105
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58
#define NULL
Definition: coverity.c:32
int
int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:587
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:286
@ AV_OPT_TYPE_INT
Definition: opt.h:225
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:126
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:117
#define AVERROR(e)
Definition: error.h:43
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
Definition: frame.c:594
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:203
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:658
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
Definition: imgutils.c:373
misc image utilities
const char * arg
Definition: jacosubdec.c:66
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:309
const char * desc
Definition: libsvtav1.c:79
static const struct @322 planes[]
AVOptions.
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2613
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2573
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:420
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:410
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:406
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:398
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:399
#define AV_PIX_FMT_YUV440P12
Definition: pixfmt.h:405
#define AV_PIX_FMT_GRAY9
Definition: pixfmt.h:379
#define AV_PIX_FMT_GBRAP16
Definition: pixfmt.h:421
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:414
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:397
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:438
#define AV_PIX_FMT_YUVA420P16
Definition: pixfmt.h:441
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:403
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:436
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:434
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:404
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:415
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:400
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:381
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:416
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:396
#define AV_PIX_FMT_YUVA420P9
Definition: pixfmt.h:433
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:437
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:407
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition: pixfmt.h:100
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:73
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:177
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:258
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:215
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:176
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
#define AV_PIX_FMT_YUVA422P12
Definition: pixfmt.h:439
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:408
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:380
#define AV_PIX_FMT_GRAY14
Definition: pixfmt.h:382
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:411
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:383
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:419
#define AV_PIX_FMT_YUVA444P16
Definition: pixfmt.h:443
#define AV_PIX_FMT_YUVA422P16
Definition: pixfmt.h:442
#define AV_PIX_FMT_GBRP16
Definition: pixfmt.h:418
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:409
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:435
#define AV_PIX_FMT_GBRP14
Definition: pixfmt.h:417
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:440
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:412
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:402
#define td
Definition: regdef.h:70
Describe the class of an AVClass context structure.
Definition: log.h:67
An instance of a filter.
Definition: avfilter.h:341
A filter pad used for either input or output.
Definition: internal.h:54
const char * name
Pad name.
Definition: internal.h:60
Filter definition.
Definition: avfilter.h:145
const char * name
Filter name.
Definition: avfilter.h:149
AVFormatInternal * internal
An opaque field for libavformat internal usage.
Definition: avformat.h:1699
This structure describes decoded (raw) audio or video data.
Definition: frame.h:318
AVOption.
Definition: opt.h:248
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
int(* filter_horizontally)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_avgblur.c:45
int(* filter_vertically)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_avgblur.c:46
Used for passing data between threads.
Definition: dsddec.c:67
int height
Definition: vf_avgblur.c:62
uint8_t * ptr
Definition: vf_avgblur.c:64
int linesize
Definition: vf_avgblur.c:65
#define av_malloc_array(a, b)
#define av_freep(p)
FILE * out
Definition: movenc.c:54
AVFormatContext * ctx
Definition: movenc.c:48
#define height
#define width
#define HORIZONTAL_FILTER(name, type)
Definition: vf_avgblur.c:68
AVFILTER_DEFINE_CLASS(avgblur)
static const AVFilterPad avgblur_outputs[]
Definition: vf_avgblur.c:309
static int query_formats(AVFilterContext *ctx)
Definition: vf_avgblur.c:226
static int config_input(AVFilterLink *inlink)
Definition: vf_avgblur.c:176
#define FLAGS
Definition: vf_avgblur.c:50
static const AVOption avgblur_options[]
Definition: vf_avgblur.c:52
static const AVFilterPad avgblur_inputs[]
Definition: vf_avgblur.c:299
AVFilter ff_vf_avgblur
Definition: vf_avgblur.c:317
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_avgblur.c:253
#define VERTICAL_FILTER(name, type)
Definition: vf_avgblur.c:121
static void averageiir2d(AVFilterContext *ctx, AVFrame *in, AVFrame *out, int plane)
Definition: vf_avgblur.c:208
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_avgblur.c:292
#define OFFSET(x)
Definition: vf_avgblur.c:49
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:104