From patchwork Sat Sep 11 23:42:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 30192 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:dc8a:0:0:0:0:0 with SMTP id y132csp2721577ybe; Sat, 11 Sep 2021 16:44:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn6zT/aevOPf7kJB+eXf7s/BpOzZerokJbraiYWKUI5EPXCg6NUGbJFGk8l8PmkfzWoeyj X-Received: by 2002:aa7:c64c:: with SMTP id z12mr5303444edr.228.1631403854459; Sat, 11 Sep 2021 16:44:14 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 2si2871390ejh.749.2021.09.11.16.44.14; Sat, 11 Sep 2021 16:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=EJfEW2n7; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4320568A9ED; Sun, 12 Sep 2021 02:43:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-oln040092068087.outbound.protection.outlook.com [40.92.68.87]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BCA7768A8B9 for ; Sun, 12 Sep 2021 02:43:04 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cq4OBGbOdFurBX8xjwwXLWv2iabp7t7WLoeRvrmOWzJbP+aSW3q0V3oNc3RxZeDB7sr18Co0zXgKetxrryIY+AXftRqIm9T7gZwbm3NZH46seHqsAPUhxpnxOWftPdUADRiZD2YkPEDB7afPOPqwD3TgQvbLzC1leSTR7naL46a4HNQPnEJCr64OutprKtZZrez99YxV8A4HTRq13ld4qAzewC72yAHagPuhI2CD29KeCmAJDwwf56SQC8aGloG8NunxSJDdLnZwv5f6gNxIvkSHtG5O+fEyudsslJd2G3NCOKaMxSxkGlIMUqpDb0+N72QMu59vSXlum4Mc5yqxcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=c90dp1h1ftfrKsAwm+lbarCUJjqlioqBwe0SdKcHEDM=; b=itiBNnJwAJ+WGTzF+c+ArVIh0Hl7ZBjYGlTnbJ4ckx4cvT5gM/uLpM2PtnDUv0It8ddjWEbE+bYLN4kzLAvwoFM8uTFeDQWtRTXaWXZjP4ENrh3F2RIil1KNxQ/qLAna9HI24ez3NpHnh+u8Txf2lTz+b55waZIqeQGtG0lDS0GI2lu1ZbCFBdRyyV1PhKsLzxqsCDiBeFC402UmNk30q7KquHr3dQd5AnE958UCbP4gg2RTmSL6MQH5ORhn8s2JZR3/PY1ZLB6V83hzwLtwaiU9LtuqqErOHSxT+hoJM7P/qGUNIFP7mubJyqoXmpDAH1lmO+ADJEBZj7C384nhBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c90dp1h1ftfrKsAwm+lbarCUJjqlioqBwe0SdKcHEDM=; b=EJfEW2n7cFJTL9wZ7vJq/FU2YgOomFe7lrZkIBCP0nnt4kczgynTyhz+v+lok8xxU/8t5pHHGBJwjOtdVu+HPSe7B8SrlAMXtuS0ftsba17w5fWaRIwr2VgcqJeqjQIaLHzJqMJWIkqFPOWbDWFBArkOkKwKs95ubZXdg13S0V2i2xgVwR1oTfL2QDXAPA0pR/n3Qs6xkP2+Qkqa9A2pJiTFUkEdOVgCAvXIsX8YBjrO8/qY1HQEQN4nMXik8Hlv4qVgS/rqQazdpnlHU1C2jo/AG1lJVIj4b8xlFK3+9oriwzH/Jn0o7C2c36dg43ffofs5NDkLlvKs3ToJBid4RQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR0302MB3399.eurprd03.prod.outlook.com (2603:10a6:209:20::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Sat, 11 Sep 2021 23:43:04 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::787b:2156:ca99:fe00]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::787b:2156:ca99:fe00%4]) with mapi id 15.20.4500.018; Sat, 11 Sep 2021 23:43:04 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 12 Sep 2021 01:42:26 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [IM4klK1E06WvqYx+pAcZrqcd5GjYheCm] X-ClientProxiedBy: PR0P264CA0107.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::23) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210911234244.2306938-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by PR0P264CA0107.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sat, 11 Sep 2021 23:43:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: efc0e1f1-89db-4cb8-6317-08d9757de5e8 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNVv/2++Uk5pM+AmDHCluBYMUUNkrzYmJisnEY6r473l5njnrfPudQx4mVZdpI0YI4sKweTqyIANQyvtf76OLqzKpsoC/6EKmHc+T0BlWlaZi5gcr36cZleP0KRmvaUA+y20X981sQTbamTRHvGRB695oE4wPO8p8aENVIGfeyEkrYmeq8SpRUJewndzLBYfEIJqHiS/CAunMf8gd+Yc6lQ0GxICr2NSaGJOtU9VWQsqTC6RubH0hdwPOtTX2gagbn38pM9QBW/aVm5SFi0Ol0MVmWsJ8KubTlak3vQcNQzABCukPSvXeNC20LJnLkrd5xebJkrQDeKzJJ0vBB7wBpgGgKevjiSfeZ0QH0fCT4lLHRDkaLDJGcNoq6M8X6cqU0k4bjC7FPFOpOfjD/L7aiC0+zYAK2ZPJAStNaV9IgTT8R/AKfYPhhfitunmtfOLlA7lXauFqOfZpdcEHPgFCmEkEzUKlvIR5niG2wFjsgN0OkjGVdrw2PLz4ryv3DRr3fqzlsst/KugHNhYyN6oqB7ifVa26jPjTXzI4SbLG93IwhgHrJk2dxX6tAIGFGkqtKGN6W8gO6SbRECOOgNaxxE/YYpN7DJfxa9JgdGvu413GKPzZUBKed9IjLUl5r0DRHq7peK1xuTkAEYlGYx6t1siXuuY4BdK3BARKNU+gj7LgMijZ+3NskvQpxUFpwLQNUYdQks+UVUYZRnbGV90nJJhaqn85hWMmTY= X-MS-TrafficTypeDiagnostic: AM6PR0302MB3399: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2vaiEsEQRJJldg7nj6MAjX9dSejfcwfogqRX4cKor4M5JwUZFtw8Y+9+9dyUkGztCxIMOqtlBx9KpIznQhTK9HjvSGv0NaF/e7K+7pDR70d/MPMhiC5PDR6f6R8TLeoKRcdF+02oVv4xOehe3C+GTKDhQLIwAAsUBvnCpIRZ1PYLKfUrds30l6umxFyD+FLFIHBv9cY4Wg/aShXMcSXe94x+S4FQIpv94NmIMPdQbnumWQjEoHob6g0S4PNsOzrX9hN5xOZ4pPwIJV4A64Ry+fkft4G45Zy6zRsoimtq7AlRQYojtKr8iWslHb0xa5rptXSB8KQRFAwWCEXo4Q2VE0MEo7x7ROIho0iFG40o5WRk5JhzBdgNpNKnW3OMhBD8Ul8UJ/3qDaqPwHMIXIIC/ltrraGlnZ6GsuWhrIdhwn9QWtQvG/GU0PYXglLDCH7J X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RXD0VU1Fzvw/wDSFCz7OZIGbNWMy9hPycMzDtIPvs8ptZYnTiUhqAJWOpamdTqyNwhVDIJDeTxbT9dNh34tvHiu+FYIdILxGMG18U10bwC2RYtqEKYa+eEMLTj9c4aKcp2HsP6wz3fSzXHkk8gbkMQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: efc0e1f1-89db-4cb8-6317-08d9757de5e8 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2021 23:43:04.0091 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0302MB3399 Subject: [FFmpeg-devel] [PATCH 20/38] avfilter/vf_lut: Deduplicate AVClasses X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: agsWSI6NAtcm Content-Length: 3294 Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_lut.c | 26 +++++++++++--------------- 1 file 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