History

avfilter/vf_neighbor: Deduplicate AVClasses

Andreas Rheinhardt committed 5 years ago

Commit 443706d1 parent 31adb961 file · +11 −12Browse files

Unified · Split

libavfilter/vf_neighbor.c+11−12
@@ -354,14 +354,12 @@ static const AVFilterPad neighbor_outputs[] = { · 353 unmodified lines
354#define OFFSET(x) offsetof(NContext, x)354#define OFFSET(x) offsetof(NContext, x)
355#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM355#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
356 356
357#define DEFINE_NEIGHBOR_FILTER(name_, description_) \357#define DEFINE_NEIGHBOR_FILTER(name_, description_, priv_class_) \
358AVFILTER_DEFINE_CLASS(name_); \
359 \
360const AVFilter ff_vf_##name_ = { \358const AVFilter ff_vf_##name_ = { \
361 .name = #name_, \359 .name = #name_, \
362 .description = NULL_IF_CONFIG_SMALL(description_), \360 .description = NULL_IF_CONFIG_SMALL(description_), \
361 .priv_class = &priv_class_##_class, \
363 .priv_size = sizeof(NContext), \362 .priv_size = sizeof(NContext), \
364 .priv_class = &name_##_class, \
365 .query_formats = query_formats, \363 .query_formats = query_formats, \
366 FILTER_INPUTS(neighbor_inputs), \364 FILTER_INPUTS(neighbor_inputs), \
367 FILTER_OUTPUTS(neighbor_outputs), \365 FILTER_OUTPUTS(neighbor_outputs), \
@@ -384,30 +382,31 @@ static const AVOption options[] = { · 16 unmodified lines
384 { NULL }382 { NULL }
385};383};
386 384
385AVFILTER_DEFINE_CLASS_EXT(erosion_dilation, "erosion/dilation", options);
386
387#if CONFIG_EROSION_FILTER387#if CONFIG_EROSION_FILTER
388 388
389#define erosion_options options389DEFINE_NEIGHBOR_FILTER(erosion, "Apply erosion effect.", erosion_dilation);
390DEFINE_NEIGHBOR_FILTER(erosion, "Apply erosion effect.");
391 390
392#endif /* CONFIG_EROSION_FILTER */391#endif /* CONFIG_EROSION_FILTER */
393 392
394#if CONFIG_DILATION_FILTER393#if CONFIG_DILATION_FILTER
395 394
396#define dilation_options options395DEFINE_NEIGHBOR_FILTER(dilation, "Apply dilation effect.", erosion_dilation);
397DEFINE_NEIGHBOR_FILTER(dilation, "Apply dilation effect.");
398 396
399#endif /* CONFIG_DILATION_FILTER */397#endif /* CONFIG_DILATION_FILTER */
400 398
399AVFILTER_DEFINE_CLASS_EXT(deflate_inflate, "deflate/inflate",
400 &options[DEINFLATE_OPTIONS_OFFSET]);
401
401#if CONFIG_DEFLATE_FILTER402#if CONFIG_DEFLATE_FILTER
402 403
403#define deflate_options &options[DEINFLATE_OPTIONS_OFFSET]404DEFINE_NEIGHBOR_FILTER(deflate, "Apply deflate effect.", deflate_inflate);
404DEFINE_NEIGHBOR_FILTER(deflate, "Apply deflate effect.");
405 405
406#endif /* CONFIG_DEFLATE_FILTER */406#endif /* CONFIG_DEFLATE_FILTER */
407 407
408#if CONFIG_INFLATE_FILTER408#if CONFIG_INFLATE_FILTER
409 409
410#define inflate_options &options[DEINFLATE_OPTIONS_OFFSET]410DEFINE_NEIGHBOR_FILTER(inflate, "Apply inflate effect.", deflate_inflate);
411DEFINE_NEIGHBOR_FILTER(inflate, "Apply inflate effect.");
412 411
413#endif /* CONFIG_INFLATE_FILTER */412#endif /* CONFIG_INFLATE_FILTER */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t