From patchwork Mon Nov 21 00:26:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 39361 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp1816225pzb; Sun, 20 Nov 2022 16:27:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf7OAjHwZfsfhBBxc80na7FcRR3Uj9F5rT9N90pp+W57zfKCbqM504x9n/8MlboHyKy6U9UQ X-Received: by 2002:a17:906:1445:b0:7a1:6786:444f with SMTP id q5-20020a170906144500b007a16786444fmr3605488ejc.409.1668990420301; Sun, 20 Nov 2022 16:27:00 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id nb11-20020a1709071c8b00b007add62d9f38si8442267ejc.330.2022.11.20.16.26.59; Sun, 20 Nov 2022 16:27:00 -0800 (PST) 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=s3WCQnQp; 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 8EEDB68BC8D; Mon, 21 Nov 2022 02:26:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075081.outbound.protection.outlook.com [40.92.75.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1ACFB68B9EC for ; Mon, 21 Nov 2022 02:26:51 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WmIpgigzu+x0ajKuzEXn5pszoYCnkwQ6YLhJjmTgbHm6hn0SOXhpBYFDeFBqAPIeb4CV5Lkib9ESFjZCcLbwYwwQHbPSGr5psv7gGMfNTxKa1JA0frEDRo1jADGYs8aaeO7Iqlyqi8jK92xdEXeEy9Ad73g5tVS/g2zvsq25IyKe1zpMpPGJ9F4YJ51QDAMOwQnRxwi/1vhVOtPbDWje+lt3iNrhv/wA4Ayo9KJ/gXzUiXYdSsw4Q7EepK37XwgHT5em/sk6DhT5sec+prqWjbLDI7qiZFI6ChPKW2qRbnoBwPGpddfIyfZAdMvVl5HNjEB8w1oT6jqjuD3kkjVR8w== 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=LKK4xQr9LgiBZz1PuuRctG0IQ7/xCTr9H+r/XPOwQVc=; b=HnxoL1m0OBvcmaslxqZJ5I4Vk9Su+CohSDkAHRUlMzqPi71CgeosVUko8X0bIpfPR3/nTiswkoRkj8EjFFhYAa/1eOHf5zekl9ae8FTDfzg8hGKt5OAx7LXkSA0/e6OKhjq6L8ig6YuIvwxLBv/S0y6ccTu27jXkWYS27kw0KiWLqhBs1UmkDm1Yw0gopi09vxo8eXIrovBFAItwkC81tc0xWzEQasv8QF2FokR1n5D2pU0FPDFELxaC/NLMDjuQplW/1/Nn5VuxsgKRQvX8f+ec1lUPQO+zcboFGXiYGzb/zWLGBA6YO5t2yje6eYQy+59VKehERPCJufR+3yWv5w== 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=LKK4xQr9LgiBZz1PuuRctG0IQ7/xCTr9H+r/XPOwQVc=; b=s3WCQnQpxRhw5k7jdiu48CmNAjXwhJ9ZiDZvKbcFSz2GVEs3mlpkJ1081cRXLhmb6XPI3VjBpTHhDQplX0kyF4lPw3ywsyW1RCumcXpfQl5j4BcwXXN3kh39TMPGKAB8nqZf2jmhfK61M+v7pf1O4PIyAijtNSH+UFymDZCljl3ewANisjh3iBEAmUTXn8nnMjKOcz4VKgV5JqQClzSSqlF5UyEmMNctfTIdHcu1XMKAvLb3OtHuax/bcAIpEABLUe5whb1DsBdGBBrhkGwrvvUkAQDntOotwc97aHkIc2e3j7DhsBmbDmRmx0bw2nAiCiYSExKO0Ud/soN2RqlZSA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AM8P250MB0198.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:325::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9; Mon, 21 Nov 2022 00:26:49 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::c37:cabe:316a:60b2]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::c37:cabe:316a:60b2%4]) with mapi id 15.20.5834.011; Mon, 21 Nov 2022 00:26:49 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 21 Nov 2022 01:26:57 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [gkg+FVSHnKwfnVevf2k2lA9aJ5Cj0hEGGNAcYpfYMA8=] X-ClientProxiedBy: FR3P281CA0100.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a1::18) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221121002701.2127898-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AM8P250MB0198:EE_ X-MS-Office365-Filtering-Correlation-Id: 9eded023-5a0d-4bda-a8b5-08dacb57148f X-MS-Exchange-SLBlob-MailProps: Z9TzpHVL8qoWG4by+SzHSgwd64ohRCfOU/NJXU/kTcKfKoYov2QvqRls6EtN/ucxioXCT0Fr75UiI1B5sDOeo5WpwTAKhzIqNFFwVngGrOcl55y39ZxIvJkJ/MyGiSVZ5VSkxiu29HmHWuMcczc9xxh4+Pr131O2yJqyA0Jqs8LZQNe2LAOkBtQkvyGAr+yVzjVnxl1rvgwc0OFLnYCGE080u3pE8jwAfuGR+Hi2eW1MDXpAn5QheOv85phSOTS/TldjWZ+l/IdbHcnyD8VaNGMZXDAJYEifWxNWPTmgv/Pau0VvDawXt2ZTt2TFKE3uf4pWGR0MHqWBSbK2LB3HhKuLjkWMOG8waxQTYnPr9DTqIVVg9rd7OVoTp+1NlT2lD8zChF4pjI3NCanqqQiXju0wgD8XMJHT67dTOozkLuZKCLh0d9J11Sk7ebVkEZvsOH9P/UoKadbyR8z3mD1BaU40ahkJAwVkBtBCsOuweGB+aTPgvofEIWd5Jjh1Jucyioh6+JwDXzhdX2HFCLi+6ou1DVDL4Np+U81NaN00jhWy1GYs+kTcaYRt6S33BWiBFLldzFjY/O/MujXVv76f01muh6L8csgnF8IIHhkJRYmHjprUM+7gL/WGeq2Spi7ZDAeax+Xbo15XYEjOE3I+vTB6WpSox0uHfRYeD6X66T5n+RnkXyLBnYZQGtR7HRV6gy+JfuTCwOPFfbsVAIx4t0j9Wu/cOpFo7NpCxYvjpT/gjziIsB8fZOYSFcCwQd46Hf2tH04UVjI8B/r+iHIy+FlqGJtU2zQw48X6UxpkgQ9wYxNMcci8vgkTQNkkPtNYH4kRw30RFBCCCnQzZ+UMWz73ndfSW07Us93xd4hUjafliRL1A/Vdkg== X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MCBEFL6+Al9dWVp/7yIgkopdOr0NOm+eC0sZ6iC1AKPOL9976HJpWlRpVGur3Hy1ZsVk1b7z5P91My+Bre/4DMT1gDP+ThCqW1RIMRf1zywCQYcgm7am6xQFdEjNLKsdkBMxVMmD4xXep1bkF99/9kGSQ/81PA+6b1TC7b5logNf9U6Gm6CGo3iLAJ7FDgRlfS2gWYt0RQIcoCjFY6uwVk8JMSzcPCjU2NL6wPRHI9uiLNkU2UxCTogbDkM6QTiAS4v/bRgkslRg93BRGDdWLsZfonH3px8sdAEpZScEetc480q3JoAcd08p1gaTRbQ3lpwudEub00pwwklq13oWAyGLQRG/mDKAEDrI2aquPQv8/v7qOoDgFUfHqy7AjwjGPcJgfbNItM+TPHnLCMcrl/viIsrlofws41l8GXo8COkN41nN7VfjXZjfp4gIPD9k9opWHYFM/vqyXB6RRTApjWTaHYRjxucntkaQaNaKX9qVHJaGFUwnP4XrKlk0Gxsqy+S27UXNwVzi/iYappHOqzLyqit4LCQ+kqfuJZQX0lbFwY1m6luT5rXDQtmYe9aBTZDmt51Yb0tDzxkegfU4NgHENmY8Qrv36tf52qS7xyo4nBh/Oab4HUeLH4lU3OsN4ikQpKMhFG0/b7sbHo9v1KP/+F8QAI11nj+65SjGB98= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MGZlVpgZMWqWwPQ4qAPsJDE6QSJG2HpmkHRE3DbOJDyOkYCRqFkiuQyLRoXyQi+f1aUtcRsx7YrjM1IS6YqpfG43G8xPBLs019udb/eU2RwmPLhSS0Oi3xk8CRYiDSGtjlmE599xpmnUTWRGKqR35X1yIljke7dmZC31M5AVBbAgk0IXFY7Lp1bLxYqTFPGlwbvBHTget3kA/5wlndoMaFHH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n2qgMCWishHiUPmxwSJVjjvV X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9eded023-5a0d-4bda-a8b5-08dacb57148f X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2022 00:26:49.5618 (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: AM8P250MB0198 Subject: [FFmpeg-devel] [PATCH 2/6] swscale/utils: Don't allocate AVFrames for slice contexts 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: khamUSLabMsk Only the parent context's AVFrames are ever used. Signed-off-by: Andreas Rheinhardt --- libswscale/utils.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libswscale/utils.c b/libswscale/utils.c index c6fa07f752..053c6bb76b 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1317,11 +1317,6 @@ static int context_init_threaded(SwsContext *c, } } - c->frame_src = av_frame_alloc(); - c->frame_dst = av_frame_alloc(); - if (!c->frame_src || !c->frame_dst) - return AVERROR(ENOMEM); - return 0; } @@ -1581,11 +1576,6 @@ static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter, if (!FF_ALLOCZ_TYPED_ARRAY(c->formatConvBuffer, FFALIGN(srcW * 2 + 78, 16) * 2)) goto nomem; - c->frame_src = av_frame_alloc(); - c->frame_dst = av_frame_alloc(); - if (!c->frame_src || !c->frame_dst) - goto nomem; - c->srcBpc = desc_src->comp[0].depth; if (c->srcBpc < 8) c->srcBpc = 8; @@ -2055,6 +2045,11 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, { int ret; + c->frame_src = av_frame_alloc(); + c->frame_dst = av_frame_alloc(); + if (!c->frame_src || !c->frame_dst) + return AVERROR(ENOMEM); + if (c->nb_threads != 1) { ret = context_init_threaded(c, srcFilter, dstFilter); if (ret < 0 || c->nb_threads > 1)