diff mbox series

[FFmpeg-devel,20/38] avfilter/vf_lut: Deduplicate AVClasses

Message ID AM7PR03MB66601472258ACE0495DC17098FD79@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit b5be13255fa59003214c423870ac59886c6a1622
Headers show
Series [FFmpeg-devel,01/39] avfilter/vf_maskedminmax: Simplify init | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 11, 2021, 11:42 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_lut.c | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)
diff mbox series

Patch

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