summaryrefslogtreecommitdiff
path: root/libavfilter/vf_lut.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-10 22:44:14 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-19 04:30:38 +0200
commitb5be13255fa59003214c423870ac59886c6a1622 (patch)
treeada2c6e7d58a41aafb509f0e73aaf52a3891ed67 /libavfilter/vf_lut.c
parent57f6c23f299a138d74a84371f3523fb6d25ae92c (diff)
avfilter/vf_lut: Deduplicate AVClasses
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/vf_lut.c')
-rw-r--r--libavfilter/vf_lut.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index 812a5c1ee1..bc9af9f609 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -587,12 +587,12 @@ static const AVFilterPad outputs[] = {
},
};
-#define DEFINE_LUT_FILTER(name_, description_) \
+#define DEFINE_LUT_FILTER(name_, description_, priv_class_) \
const AVFilter ff_vf_##name_ = { \
.name = #name_, \
.description = NULL_IF_CONFIG_SMALL(description_), \
+ .priv_class = &priv_class_ ## _class, \
.priv_size = sizeof(LutContext), \
- .priv_class = &name_ ## _class, \
.init = name_##_init, \
.uninit = uninit, \
.query_formats = query_formats, \
@@ -603,24 +603,21 @@ static const AVFilterPad outputs[] = {
.process_command = process_command, \
}
-#if CONFIG_LUT_FILTER
+AVFILTER_DEFINE_CLASS_EXT(lut, "lut/lutyuv/lutrgb", options);
-#define lut_options options
-AVFILTER_DEFINE_CLASS(lut);
+#if CONFIG_LUT_FILTER
static int lut_init(AVFilterContext *ctx)
{
return 0;
}
-DEFINE_LUT_FILTER(lut, "Compute and apply a lookup table to the RGB/YUV input video.");
+DEFINE_LUT_FILTER(lut, "Compute and apply a lookup table to the RGB/YUV input video.",
+ lut);
#endif
#if CONFIG_LUTYUV_FILTER
-#define lutyuv_options options
-AVFILTER_DEFINE_CLASS(lutyuv);
-
static av_cold int lutyuv_init(AVFilterContext *ctx)
{
LutContext *s = ctx->priv;
@@ -630,14 +627,12 @@ static av_cold int lutyuv_init(AVFilterContext *ctx)
return 0;
}
-DEFINE_LUT_FILTER(lutyuv, "Compute and apply a lookup table to the YUV input video.");
+DEFINE_LUT_FILTER(lutyuv, "Compute and apply a lookup table to the YUV input video.",
+ lut);
#endif
#if CONFIG_LUTRGB_FILTER
-#define lutrgb_options options
-AVFILTER_DEFINE_CLASS(lutrgb);
-
static av_cold int lutrgb_init(AVFilterContext *ctx)
{
LutContext *s = ctx->priv;
@@ -647,7 +642,8 @@ static av_cold int lutrgb_init(AVFilterContext *ctx)
return 0;
}
-DEFINE_LUT_FILTER(lutrgb, "Compute and apply a lookup table to the RGB input video.");
+DEFINE_LUT_FILTER(lutrgb, "Compute and apply a lookup table to the RGB input video.",
+ lut);
#endif
#if CONFIG_NEGATE_FILTER
@@ -673,6 +669,6 @@ static av_cold int negate_init(AVFilterContext *ctx)
return 0;
}
-DEFINE_LUT_FILTER(negate, "Negate input video.");
+DEFINE_LUT_FILTER(negate, "Negate input video.", negate);
#endif