From patchwork Thu Sep 30 13:40:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 30771 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp701203iob; Thu, 30 Sep 2021 07:02:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOwSbxhfyG11NrgItRRO1rysDbf6+MJ2rHbo1gOeIfsELzjqd+pVLoG2FuIYzXdirOt6Y6 X-Received: by 2002:a50:da0a:: with SMTP id z10mr7416573edj.95.1633010568957; Thu, 30 Sep 2021 07:02:48 -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 m15si3546863ejl.105.2021.09.30.07.02.48; Thu, 30 Sep 2021 07:02:48 -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=e3qpV6Ic; 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 7BD5668AF94; Thu, 30 Sep 2021 16:49:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2085.outbound.protection.outlook.com [40.92.89.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 51C9C68A9DB for ; Thu, 30 Sep 2021 16:49:21 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gFExQ3MXv87VKvttxo2Hp79uQYge2I/3jdX3p6990ORMkNyl6rAg0GfA+hTts/1ZLsjQ9XVOCPsLBmvCapLz/C31UVvK57y5mFwwMG/qW7Jt7L0ilh0Swxl/7Ss1juRfulemujTkaIgzZ6KePO+vBP+odwKMBY66taGfSvFDItThNt88kPKud/tbJr33JSrjcfzzz9wO8ge4PDL3HraRxswNDIy58b8JpP8DpvWikYfjdpWOsM/GOVY14AF10NmIlvOXKFAcazlfVW4YZCVK/TrBwdCTixPVDBQ92h2rzYvbYsUeh4EaD25pX6EGS4J7rFbI5J1x6FXDD11q0nZOzg== 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=ZePhfsdbnwEwhW+AKWY/bN6B9TpTGJ4LtlbcE7qyV+M=; b=Nd7zJFLFx0eKJDs55ROwrdzSspuqBVpAi6oaAroO1dGi9FEXFKbAgJY2Wtb+tU9YtXjTTLw6sqegdt7fQ0Utz69RlyTLCYCGKHtaFZt7AeFIxThEnSXvA0P1Q8OqwLUIKtq2F0BsShddKS+wRCEJbiP5mWjENxQT1+XI1zMWeWUfYJCtf5MhSIGlJwelL/zZfUhGaKVlgMstOPAMKEu6CNIYv3ga5iycSinLzjv+v20GGnS6Cd5vfUHLj1Xc808fzboD3jxnui02w7mKH46kmjHocSIAOluieaBLla50T80Ouc2N7tEVmRDRLVpykXFz9XVCNUswWY/iU5f4ktiUkw== 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=ZePhfsdbnwEwhW+AKWY/bN6B9TpTGJ4LtlbcE7qyV+M=; b=e3qpV6IcQ3PWnqjVM8vttMeP8XnQ6PXiNsYFirwNC79CnhubXPsX1It3Z/VXaE/Ja+ArOulxO/e/yPkNdBSPf48f/mjlXumJSF7Qb9q+Ox2V2S/+ogxweNAPZbxBX6QJZkh9syY9b92EgtHJXPpMgboUK02bu+wKEn76eJsVV5cUNuEJgUGdDnPtwtLNW6cOh23k4KNRh6QL3FIkxt7ggxnVHwGtTcUm/PIz2PW3PoDrqlgtuZj0LyA2PObJJAimPR2qL/Ep1LAucM3aCr9P6VYnMQMNTTezaySlOrdd9cKMiHNN9gUS01umfE2H6osRw10anuJT0OXChOnrHOkAMw== Received: from PR3PR03MB6665.eurprd03.prod.outlook.com (2603:10a6:102:7d::6) by PR2PR03MB5322.eurprd03.prod.outlook.com (2603:10a6:101:21::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Thu, 30 Sep 2021 13:49:19 +0000 Received: from PR3PR03MB6665.eurprd03.prod.outlook.com ([fe80::15d4:ff2d:e607:cf68]) by PR3PR03MB6665.eurprd03.prod.outlook.com ([fe80::15d4:ff2d:e607:cf68%3]) with mapi id 15.20.4566.015; Thu, 30 Sep 2021 13:49:19 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Sep 2021 15:40:35 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [U4nPr8ukOpiGnN0kVdHtUNN9vyVcCYj+] X-ClientProxiedBy: AS9PR06CA0306.eurprd06.prod.outlook.com (2603:10a6:20b:45b::15) To PR3PR03MB6665.eurprd03.prod.outlook.com (2603:10a6:102:7d::6) X-Microsoft-Original-Message-ID: <20210930134239.2672698-93-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AS9PR06CA0306.eurprd06.prod.outlook.com (2603:10a6:20b:45b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15 via Frontend Transport; Thu, 30 Sep 2021 13:49:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38fadf34-b0e4-4db5-3034-08d9841919f7 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiQEFGYb/YN4yvKEtCzw5Q2lXO3gUSwPHe1Sfx918NVtZLLAZHbmOv6rFxN1tbnXlfbcPgrbWly/+REF5LHdkLgyywIcDTM9BkLZV061j02CseS7EqrYLW8m9nxIdxWiyEU3kPLw8DUbczfiRHW5PN7fOLK+hCU8dAY1mk9IqJ9mGdLxrgrq1BFtZ9lIWIS0prg1w/xAGk23jKTFsNYdvivK6Gh8jU+gr+0hhVIER+RQYocVuCx44EbzZw86Uha54IOvEZw0c+KCSYBitY69U6e5Dyu3DP03tAcBml/XJie4mGTZipItlmSDbR+Lmcy3URxakbbYq/t7OYVJkG1LZixB4W3bTSwW6tV9IcwHjDyKoGDa7rBJgZvAAXi/aiUdU3/wngdZ0eCcWd6LGk6Jaa+TOG89a3xD5jFsM1TreLXshP1tnIS9PRedADllOGdQ3uHEu9ZHywQlSzf93hTxg3J41WyuEN1zOPy/hHhTZiT+HU8+wkmYP4CI2HDwrir6DZc44JjNaG6bwN9dj5ZRkx09Qrkoe8SWM7B1+MiQt7yTtIdlXTmiSN0+147OQisKK7cNy69gHqYIooj6aVu2GbITDAh78BfUqsH9HqPdsrcQQpvQWW2scdNSXAcCs4Fo8FubdzGjR1JU3Bn3FGGGRwT5kahhJXKpIvyuJR70yZg1R1/ad2Pkbw4x6265MXhItSOnJYJdqxVbnDGWQHl8vOBHLxVA3638QcsRFV0ksfiE/ZL+tLOojt/yCd2EJKVOK3c= X-MS-TrafficTypeDiagnostic: PR2PR03MB5322: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vlzF7MD8i3u+KrXO0MdcN59XXj00yFB4x5CNx8F0IuiCnyXANseXdYui7lLN0YP7VFH3fxwBh9o98RUn2ImubTup7pGlXudcmrDu48jJJUEk+m9p7I5+5cz/A1f28p6WvRCxL9iKaRQFS6s2kBa/+gHWYrlNOVKuV0Y5g7QK3GslQrCDOlbFc55ZnIxZ3V7n6ltYUSvbtgijFMr6qlFFhRRmUNIJE+wYLRf8bspE4yES6ySVmz6Js10r1dWtw7uVBkTFx4rW1ALePqYbVr2Gca6FK+EiPJVVgJucNkmGuOO7zBZ9lO3K70KyiDN/s9cAQKC9Koj2rSvGUnM2eSBhMOGnP8WgQ5vFQ9GYSb5jnrNmILnvzlYlBh3T2kVnTrM9B06gVLDn7pv/5DSkSx/0Vg3ZDzUg26h4eoOQXmkRFdjbsMQiGgOowEJcxOWgxyOR X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: V9vBJlHV9tb2e8DUVLRPJyWDRxum2E3WzUUadcMqHYhVEKIP0iuCZbbh5QAgfTsTFaA44pM7OHjDMevvjmybg5HPw282svt8taNEEZmSsJt/u8NactY0C91QYwrYjV9gwBOXrc9mxOfMTVAxeXIXbg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38fadf34-b0e4-4db5-3034-08d9841919f7 X-MS-Exchange-CrossTenant-AuthSource: PR3PR03MB6665.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 13:49:19.6465 (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: PR2PR03MB5322 Subject: [FFmpeg-devel] [PATCH 094/218] avfilter/vf_vidstab(detect|transform): Deduplicate pixel formats 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: We6w4URRHXmc Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_vidstabdetect.c | 11 +---------- libavfilter/vf_vidstabtransform.c | 11 +---------- libavfilter/vidstabutils.c | 8 ++++++++ libavfilter/vidstabutils.h | 2 ++ 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/libavfilter/vf_vidstabdetect.c b/libavfilter/vf_vidstabdetect.c index 278d0f15a6..19e9ca5a42 100644 --- a/libavfilter/vf_vidstabdetect.c +++ b/libavfilter/vf_vidstabdetect.c @@ -84,16 +84,7 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - // If you add something here also add it in vidstabutils.c - static const enum AVPixelFormat pix_fmts[] = { - AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, - AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P, - AV_PIX_FMT_YUV440P, AV_PIX_FMT_GRAY8, - AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGBA, - AV_PIX_FMT_NONE - }; - - return ff_set_common_formats_from_list(ctx, pix_fmts); + return ff_set_common_formats_from_list(ctx, ff_vidstab_pix_fmts); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_vidstabtransform.c b/libavfilter/vf_vidstabtransform.c index 70fe552b59..338a5d4f8a 100644 --- a/libavfilter/vf_vidstabtransform.c +++ b/libavfilter/vf_vidstabtransform.c @@ -123,16 +123,7 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - // If you add something here also add it in vidstabutils.c - static const enum AVPixelFormat pix_fmts[] = { - AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, - AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P, - AV_PIX_FMT_YUV440P, AV_PIX_FMT_GRAY8, - AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGBA, - AV_PIX_FMT_NONE - }; - - return ff_set_common_formats_from_list(ctx, pix_fmts); + return ff_set_common_formats_from_list(ctx, ff_vidstab_pix_fmts); } diff --git a/libavfilter/vidstabutils.c b/libavfilter/vidstabutils.c index 1199dbd56e..56fbdbdb87 100644 --- a/libavfilter/vidstabutils.c +++ b/libavfilter/vidstabutils.c @@ -20,6 +20,14 @@ #include "vidstabutils.h" +const enum AVPixelFormat ff_vidstab_pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_YUV440P, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGBA, + AV_PIX_FMT_NONE +}; + /** convert AV's pixelformat to vid.stab pixelformat */ VSPixelFormat ff_av2vs_pixfmt(AVFilterContext *ctx, enum AVPixelFormat pf) { diff --git a/libavfilter/vidstabutils.h b/libavfilter/vidstabutils.h index c6d6cedb72..17e1668be6 100644 --- a/libavfilter/vidstabutils.h +++ b/libavfilter/vidstabutils.h @@ -25,6 +25,8 @@ #include "avfilter.h" +extern const enum AVPixelFormat ff_vidstab_pix_fmts[]; + /* Conversion routines between libav* and vid.stab */ /**