From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id ED1E74A4DB for ; Thu, 28 Mar 2024 23:12:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EA11868D776; Fri, 29 Mar 2024 01:11:27 +0200 (EET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2063.outbound.protection.outlook.com [40.92.90.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B10A868D756 for ; Fri, 29 Mar 2024 01:11:20 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aIT4nNeNIkCrmJGs6citv5KE2ECvMA9mnTeb+wQbeAFu2tQPxJu3BeNvOfqejBAbkfcPWTpQHXzLAzEGNdEZTDMRrOG2Dkngb6ZFbH4zlwAuwyA1Eao9wcr3fsCD9rt/dTH9cM6AcF+n2/zcO07wb97CBU0GbguVXkXqTxUMofFigizvwIDZINPLUo31AuW08gtnNsgjWpGJDSN4j5vusHj1fSmiFpOeSMUdxn+QyS+xdq5bNPkyAS2zzb+9ZfhYLbFKs7iBY4Tz6iQmIWNuPzWzt6KxooEYJJkJJk4Q3X0ZiKx0R8+ry+pwPICKrA6EpuYPYZMNIDiBdySvF7Vj/A== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sqTxE2+9CxqehvSDhufsG6kharO4TjmYdQ46aqi9yjA=; b=LGCNIPxmI5LhxdWJz5pl0hPd5g9ThiMAdP3D++gz6pWA5Ip2mZntSsGePXck45zXs7kfAnOcjTpZtAD7uKZGPThcGrSINNRXggK2V+vJlsRjz1G3cXDcHyCcCCZ/M0VYyAA1nG+h8vjFPaQxgpH+O319W5UIcWR7qh+OzmRzOXgIi0xvacno7IMhrY/xC5JO34owsJ4cgtq1kEfgLY0+CFXIguaTE2ssYGVS7OwIyk1OARsPFBYt+DalKnml88AJ19W9MW36QKi6OJhPJiYbAKJsyFkQ4OfbZJYGsOOJJ0VPj1ZDDjvWBSo0CuR64RkWxSWDKD0XZibC8ScJvcaw6A== 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=sqTxE2+9CxqehvSDhufsG6kharO4TjmYdQ46aqi9yjA=; b=ojdfEme7rF/4ktjqiTlAUYiZ/5ZjKmtM+7U8MawLIjdLCYTBEDNbel5/Tnqakz8ovXl+aFxU0/t/8L3BenDMDvNFRSPUdJDbTIRJUrA683C9jX+GLbOAR2fftqHCOULhJFGceMYL/kV1h3Ev+shq1pPkp6e8W5ANYaHUgPm1I5mEZ6bNLUAgyQdN+uJOUAuMeBEXds+6oQyd4OhSHKM7zQUH1mMODz+TffkNtdySYZ+Xc5t2kwERaXYJQ4neiYtnb1Mw4lqijmc+8qQVXyb28ZvGe3FqHDN1vCnp5VMDevJc4cWnT6we8wEzjye70BXpCLDOmup4hLuSbQNy8acyyQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS1P250MB0553.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:4af::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.31; Thu, 28 Mar 2024 23:11:17 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::1f29:8206:b8c3:45bb]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::1f29:8206:b8c3:45bb%3]) with mapi id 15.20.7409.039; Thu, 28 Mar 2024 23:11:17 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Mar 2024 00:10:39 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [BIaOGG8s6KefmyTZsvErvNDQgTVemrQ1Iyv5oaBy2Lk=] X-ClientProxiedBy: ZR0P278CA0093.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::8) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240328231047.2202386-9-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AS1P250MB0553:EE_ X-MS-Office365-Filtering-Correlation-Id: e158d76c-f589-4485-9ab0-08dc4f7c5f84 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XQyAJCa0k6j3ujDLn5kb8cF/priiHs2+npBewnUMNK+15LzoDXSTO1S2B3COrwNaMJwMOzZ3aMWq4ogCaCT0uo1VTCWu64V83b927N9ZA8XGUFNic912xsJWsfB2qtbYWWQ87sEN3zZ75U0cLX52M/OpnKEMP1W1s56slOIRSsE8voBn1f9XRyxpt9GdJCjFkU8/D14oufgXLtqpYh8itWezrnHNJhUme+u1hY9kr6MsH6XnqrmZzdginERlIJ3X8GHxGG3cOkrbL9LmJjzL6GA2IYh7UFpeq06Op/mADY/KYq4Fe+bTM7feP2N7asVAsv/f9MpXgr8MIzb+7nQEVS7xvWdpIDeuPnoUirU1b98Kpv0ukx0rPXjLhhbTxkZaueo6U9BUXGpEDykziszBiFe5IgIoxptyjSdvFeTNmQuCX3V3S+PnNtDXKDRStqrCwdgcTOr2bjOA2L6+zz5PmOYYghKxYhZhoDF1jFyY2fnbsc7Ipvj0G09gYvt95cpHR8gr5XPeTmyhrIUCCDI94LlQsR10Rs38VFswEwVonWau6T2PNdOq6dqOvs6Te/gR8xDTVuUHjiNtHuje644TDFG/SIwc3J0FcQgp66z0QfNBQMQQH6oxQtTZ33EaYkJa X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?NrQEfTfauVWLTllsWeCf6Bi7fwpkI+9s/oELhKjXUyRtolMANK/HMc8F6s5m?= =?us-ascii?Q?93NvKcN5FbcKeeuoYevILvYiNpaHYXCxMfD6mnUJ3FHfSqIEvyn9nDUL3m3m?= =?us-ascii?Q?YUg6GQn6V7e2ppR1G0/TqTrwBb341LyJf/gJBykIVGaK6405v+BTnCvsRavy?= =?us-ascii?Q?yNSeCXRQGJfTYrZsG/qpBnF9PDqnGGvfkA2+0sThsoEsoOY4Rma5djbLxyb6?= =?us-ascii?Q?+p0FFttq7ILAKEdaDSLAJbDOaqnEUk5FORzDZ3DMIZ5PAIOGUB49LckTbF1D?= =?us-ascii?Q?9oYL1ott+yEgkk5V/xLAPqpT3zq8w7xYJXZgU7VdO6PmGnDJ2D1uD9SZWJLe?= =?us-ascii?Q?e9/gDjf49z0exAoM/vM0hT5L9/xsCnlCsu/Dq0fpKO/L8iMVbMoiyGVfiP7T?= =?us-ascii?Q?HPzCKefndhwa9dRvdwp7fDQKiU7r2qMzJIxnWfX5lbx7XD52fk5AYEVlP5ib?= =?us-ascii?Q?OwkN1lxNxrNZO8xs324ewQh/w5gC6ccD869clXnNP73y67BvK5Yx2AqJte4K?= =?us-ascii?Q?R9jw27uTmaC5YDywRn/mKACVTLZpL0bmpwa07aBh2rb0l5zmj6DxpP5v+mxv?= =?us-ascii?Q?0VTnJc2eg4CxfcPb2fKOc0ODG2jPoPDPC2GN+/Uz7ecQ6FRupOx/v9+ao+5F?= =?us-ascii?Q?jBBRp6mUtgCyNGHOJfFMGg9JNnXPL4gc2Q8G75RWXylVORpFf/Z3iUqNjkQX?= =?us-ascii?Q?jm3FO5A0yjRiOkRG8ZuwAnhKqgoilzm+uCxyKAD+SPN68bzEWhu3NrSzR/wi?= =?us-ascii?Q?+f9VgkON9XuhS3i+BxbAmsryPCpav5g4Lgaw4V+DukCUrgcfdeIh6HI+L7+Z?= =?us-ascii?Q?QGo9Zf+QJxqSSLFKmIoCvnfls/NdCp+JIjejbnE3n+ISRnURlLmRZ7cnwRxd?= =?us-ascii?Q?ZYuVX7oHyVBiz1RAg1QVzg2EHoyhOf9Bxb0a780xBLIBetIqkxCl20AZrWkp?= =?us-ascii?Q?Xb+iEPFG2wbj4GD3rcHD4QTOokH+TeFODO0HdoLCVRuBjftzcTaOOL7uyh2i?= =?us-ascii?Q?GUbW/+jpMMAl2fT3tgkszWxkHQc52qs/vvDx0lTvwb1sQXDNdXFnRsf02/I5?= =?us-ascii?Q?5gkbhj03x48Th0hW3qAwG6LThnDk59+xLhddKjnU4BKwn4Qw2nn2afWcZfd+?= =?us-ascii?Q?VKlDT2BFhxJYBxlq40hZl3fnv2HXkYlrzqpYRtoqnNmsHBeSv6kqkUBlfgG6?= =?us-ascii?Q?vayovPlbR29aOBKno8RBTEkKI/Dv0mJjmlMIYwk/K355uQK7S313JU7P4hBh?= =?us-ascii?Q?QGZEsISfjBZvfJtlxm7qjfl4/Xx0Ub8NmTQPTPNH0g=3D=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e158d76c-f589-4485-9ab0-08dc4f7c5f84 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2024 23:11:17.8477 (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: AS1P250MB0553 Subject: [FFmpeg-devel] [PATCH 10/18] swscale/swscale_internal: Don't export internal function 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: sws_alloc_set_opts() can actually be made internal to utils.c. This commit does so. Signed-off-by: Andreas Rheinhardt --- libswscale/swscale_internal.h | 11 ----- libswscale/utils.c | 83 ++++++++++++++++++----------------- 2 files changed, 43 insertions(+), 51 deletions(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index d7faa5e165..c2cc736dd2 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -1003,17 +1003,6 @@ void ff_hcscale_fast_mmxext(SwsContext *c, int16_t *dst1, int16_t *dst2, int dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc); -/** - * Allocate and return an SwsContext. - * This is like sws_getContext() but does not perform the init step, allowing - * the user to set additional AVOptions. - * - * @see sws_getContext() - */ -struct SwsContext *sws_alloc_set_opts(int srcW, int srcH, enum AVPixelFormat srcFormat, - int dstW, int dstH, enum AVPixelFormat dstFormat, - int flags, const double *param); - int ff_sws_alphablendaway(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]); diff --git a/libswscale/utils.c b/libswscale/utils.c index ab8a68e241..cb6e91db06 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -269,6 +269,34 @@ static const FormatEntry format_entries[] = { [AV_PIX_FMT_XV36LE] = { 1, 1 }, }; +/** + * Allocate and return an SwsContext without performing initialization. + */ +static SwsContext *alloc_set_opts(int srcW, int srcH, enum AVPixelFormat srcFormat, + int dstW, int dstH, enum AVPixelFormat dstFormat, + int flags, const double *param) +{ + SwsContext *c = sws_alloc_context(); + + if (!c) + return NULL; + + c->flags = flags; + c->srcW = srcW; + c->srcH = srcH; + c->dstW = dstW; + c->dstH = dstH; + c->srcFormat = srcFormat; + c->dstFormat = dstFormat; + + if (param) { + c->param[0] = param[0]; + c->param[1] = param[1]; + } + + return c; +} + int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos, int filterSize, int16_t *filter, int dstW) @@ -1101,9 +1129,9 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], if (ret < 0) return ret; - c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, c->srcFormat, - tmp_width, tmp_height, tmp_format, - c->flags, c->param); + c->cascaded_context[0] = alloc_set_opts(srcW, srcH, c->srcFormat, + tmp_width, tmp_height, tmp_format, + c->flags, c->param); if (!c->cascaded_context[0]) return -1; @@ -1116,9 +1144,9 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], srcRange, table, dstRange, brightness, contrast, saturation); - c->cascaded_context[1] = sws_alloc_set_opts(tmp_width, tmp_height, tmp_format, - dstW, dstH, c->dstFormat, - c->flags, c->param); + c->cascaded_context[1] = alloc_set_opts(tmp_width, tmp_height, tmp_format, + dstW, dstH, c->dstFormat, + c->flags, c->param); if (!c->cascaded_context[1]) return -1; c->cascaded_context[1]->srcRange = srcRange; @@ -1682,9 +1710,9 @@ static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter, if (ret < 0) return ret; - c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, srcFormat, - srcW, srcH, tmpFormat, - flags, c->param); + c->cascaded_context[0] = alloc_set_opts(srcW, srcH, srcFormat, + srcW, srcH, tmpFormat, + flags, c->param); if (!c->cascaded_context[0]) return AVERROR(EINVAL); c->cascaded_context[0]->alphablend = c->alphablend; @@ -1692,9 +1720,9 @@ static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter, if (ret < 0) return ret; - c->cascaded_context[1] = sws_alloc_set_opts(srcW, srcH, tmpFormat, - dstW, dstH, dstFormat, - flags, c->param); + c->cascaded_context[1] = alloc_set_opts(srcW, srcH, tmpFormat, + dstW, dstH, dstFormat, + flags, c->param); if (!c->cascaded_context[1]) return AVERROR(EINVAL); @@ -2066,31 +2094,6 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, return sws_init_single_context(c, srcFilter, dstFilter); } -SwsContext *sws_alloc_set_opts(int srcW, int srcH, enum AVPixelFormat srcFormat, - int dstW, int dstH, enum AVPixelFormat dstFormat, - int flags, const double *param) -{ - SwsContext *c; - - if (!(c = sws_alloc_context())) - return NULL; - - c->flags = flags; - c->srcW = srcW; - c->srcH = srcH; - c->dstW = dstW; - c->dstH = dstH; - c->srcFormat = srcFormat; - c->dstFormat = dstFormat; - - if (param) { - c->param[0] = param[0]; - c->param[1] = param[1]; - } - - return c; -} - SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, @@ -2098,9 +2101,9 @@ SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, { SwsContext *c; - c = sws_alloc_set_opts(srcW, srcH, srcFormat, - dstW, dstH, dstFormat, - flags, param); + c = alloc_set_opts(srcW, srcH, srcFormat, + dstW, dstH, dstFormat, + flags, param); if (!c) return NULL; -- 2.40.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".