From patchwork Sat Aug 13 14:58:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37250 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3d0d:b0:8d:a68e:8a0e with SMTP id y13csp388491pzi; Sat, 13 Aug 2022 07:59:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR6v0s8zFnljf9RF8qsUhXXpv6JBwOtwDiUGYSRbsX1DI7dvnstzGhhVv/5XV1WI6OjgMw4P X-Received: by 2002:a05:6402:1d4c:b0:43d:debb:5667 with SMTP id dz12-20020a0564021d4c00b0043ddebb5667mr7622760edb.140.1660402765411; Sat, 13 Aug 2022 07:59:25 -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 q22-20020a170906389600b0072fc50404bdsi3517983ejd.228.2022.08.13.07.59.24; Sat, 13 Aug 2022 07:59:25 -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=ZlzUeJej; 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 510E168B825; Sat, 13 Aug 2022 17:59:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2089.outbound.protection.outlook.com [40.92.91.89]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D9A1368B6A7 for ; Sat, 13 Aug 2022 17:59:13 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SQnE7galZxfpEfeB/2SLtW97iRzzpA6OQxMqCXThHa819dWqayIZdE5V8lX48GSRmycLVkjXlp1cN1/IO3JZT84YyXJiRoZa/+FkJbrDE64CSJQoGK5rt94wxS30LlQ5zi5ixrYv/K+SHXz8P8deSSxrI7Z6Biv7ezoM+QjuDKLi6dlahGNCMpIFBlc865rluLwhAr/Y7qGOHtQZ2tkqPgh5eO8e/WHO9nm+OmGzP2++YiBmNByCMzQMHFHT7gL63WnavlrVqLYqVlgbXKUGJfNp1nbYspzCNHQpR6edcD3rYvmGeAD/LDDT49d2FnEO4qsSyUwdNke9Mc8o6wNCLA== 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=W9T87INB62zSe1O/EYCCdDdBGZ7yr89f3IMPjs+ThIg=; b=POhvbZzb/tmItojsI1meCA6gRv+Vx1IWf4OHE/ROwaSwybprMvvH1GprPxo1CDKGN9aAclvoBPzkF+ZBmpGMmybTgW2zJrDVFZu5kNPC28tYtfJHc2QkiCDE22noQSJ7D7bi+iSVB0fx8R1/FpLSVdt2gWUChErQ3wE1z6869u6l3FBvw26stH7MKv3y8erB4FpRb7TZI+XjdBBfC7T4it8TvyrPvptDk3xh7E6VWvILTOniKxirU46oB7zboJiFm5xuooAJzSe7X1DWmmlOE1SAE5KRNVosC0gI9jAh8ZAaxaIic3OPtZMvJTMX+colD/ey3TvL9EUgzc5T/xJAUw== 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=W9T87INB62zSe1O/EYCCdDdBGZ7yr89f3IMPjs+ThIg=; b=ZlzUeJejVRjGFVXfpASR7qRP1vyUObbph5+LkrvnZKvGcTp+AP0iCTzvZuH9gDYzglYzCgbVBWv9OM3kK5qFOV5v73cRT/TwSH3R4Q3sbjCHZl+9ed2ONO50WvaCHVpjQK9Jl0rMwOp/rb1SlJPKqzd4F/o73M2ibFikGaSA0ZU1A/6XZjZ86MeRL/FKwD7k1f9GthT/PkrWGPYMn7RUUQyrifFArlAV7KMwEBgkWRTGruNlsZY2opNwMfqp48NEmQUTSmPbPhzQfW8yFu88WKZs12PB630yjJ86Tc+d1Sej8gG3gdB1c45xFsgPJCKE3VwPfLVmQL5Ik+HPDEwwJw== Received: from DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) by AS1PR01MB9370.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Sat, 13 Aug 2022 14:59:12 +0000 Received: from DB6PR0101MB2214.eurprd01.prod.exchangelabs.com ([fe80::210e:b627:bcc9:8c46]) by DB6PR0101MB2214.eurprd01.prod.exchangelabs.com ([fe80::210e:b627:bcc9:8c46%11]) with mapi id 15.20.5504.025; Sat, 13 Aug 2022 14:59:12 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 13 Aug 2022 16:58:59 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [UixjUlrvJhkJhDn6bABlqTvSwFJHUogJ] X-ClientProxiedBy: AS9PR05CA0049.eurprd05.prod.outlook.com (2603:10a6:20b:489::9) To DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) X-Microsoft-Original-Message-ID: <20220813145904.1116167-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0b2e91a4-01d5-466f-cbb0-08da7d3c61aa X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNUVf4505pHrBAhYXFbRlVUGL7wJF5I792OxJRmrIY3FBD+Atr++0DYxnaeKQRHU84q7lYi/SjWw1XhcSybM0oa2uBbKV7BkAx5Fl9HbIRXh+7oKHo30nign7Kz1XzAHsvSr+tB84qq7LdWlIPtXXJ73uqbIM+qJE75ieuhFpIsM1vPHvm3FYaoqgdoANU1LVnzadvmFRKAiSMkXMm/L9paJ4QvDgVV8BQURHVxAXuYhEJ/hXKU6EOnEFQaYeMBSjj49788zaem49g+jAg2bqGKviE+C7Oy26iu2MFm72X/sLnaelOZpGLwyHBcM018gzp+AKRldvjF3l0Vrs7AgkG8pI/gIYeaOkbNBPqBu14XkvsNyACYm7RKxkRiBOjqkdlZavhg3SnOLxDyeBFDmYlTcQkggpxPcfY5kWLRx1vgA+S3gusTVBWmMmy99KTbsJS/yUbiL5k8hGaBfeI2DXNxv5joAb845C1yAhSXL85cysIcTSnpnYI5BP9uvQFxFcJHJI35dDJ8tamEBI6zEKhkmYvexWlV+A+os3oYGBjS9TvWJGXAvoTd6zUtjIp0q6NeCwVz1srs9zggu83haniAgYQbigo0zLzONigbBIe7BSWbGZsg41x2Jl6+tUS+XYECS7W054Ms8boaMq2rHbGIQ82YRuS3GjyyPVzAiopuKjzhfeN5Iq7R1buOrMgkyFkiuTslxhTDiUWjbDVnQNFt9r7Zti+c9ahM= X-MS-TrafficTypeDiagnostic: AS1PR01MB9370:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4JoXr3TZxQlPvmIxZNBo6GYN31iB9fE/m27gnzSyhiG5h/xzncWEggsQRRuIybyegBfWHg+wExuj17zlM7S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k4JHgzpwiW5bpoEGJD3Im9LLQB5XEm3xwJftfZAo2lLV32Zh0mMCXdFLWmz74b2naSAplbLfUj2FfchGXcl2UNlrxCuhDFKfmufOp4SxuO4VSYWD2BU8SRtscUkZD8WnJe7SNycEk1yfcr7ZRudW0HebPhcMd3FA9KLhB1Sl7DEXzZ+QYxD+zgXvv0m+M9Gx1cnQ2ldOo+2naC6EArSsXBzY+w5GYiiWBWaQL4NGPuClhKFRE5FPpz4DVFraEL5AJLSt9yR4063TkGMLnNkuSmMrMjgXj/jCFgpp3N1NvH04h3ySp5q6YkB4QM10aEXnQcncBCGAkjRdE2py9tvJzGykyXLHEHzYv0b4toJgxTb/U/mgNHBu1T40nTiIjvxYvfnTovzA93/s7y6fZt8LsMPnNcau9t3aveB3C92dJrY5aS9qzoS5g0AYNVDISBbepMtgjUpWiaTot6tSZoiUZ8ZfiCI59RBIEAet71Qvtwaqrkk6IWbtkZ/l17uaMbbrBjsvXE0O5h1f45XDPqnyDgRZtRUp3yl1XeZSJT+mAzCS/SneyeJfeLvimGg/3z8UAbrEZcpKptmGErWH0ZVQ5l78F0gEFNoW0gxsqQi/b5epTnDpJd7jDZ1bnR3iTiyVpCksdT36rVKXwnlvATUG/JMHdY1BF8xHvPADshpawPiaYuc9IQNKTc4HcNWNi/96j1RbeN37wgCBRq7IjEPKA5on/npqlOBVFnoYp9kCi7nuSGlLxci399Xzo8t3hzdhSm2ffOwMI8bxiVHSsbMQ+cYqaUcc6R00Gw/1+7EQ7KE7Qfae9Y1Ps0hkAhtGv1N5jx4KyBpAt8fv3fZoeJFpkPO4eFNSgrxTSUbgFS5m3e8rfETqRfHzdF+Zt67EJCUZv4s8bk3Hn4WUXyg= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b2e91a4-01d5-466f-cbb0-08da7d3c61aa X-MS-Exchange-CrossTenant-AuthSource: DB6PR0101MB2214.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2022 14:59:12.0814 (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: AS1PR01MB9370 Subject: [FFmpeg-devel] [PATCH 1/6] avcodec/avcodec: Move initializing frame-thrd encoder to encode_preinit 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: 7/aRepuFwbPj Signed-off-by: Andreas Rheinhardt --- libavcodec/avcodec.c | 6 ------ libavcodec/encode.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index f82d9e9f74..0451f57f82 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -283,12 +283,6 @@ FF_ENABLE_DEPRECATION_WARNINGS if (ret < 0) goto free_and_end; - if (CONFIG_FRAME_THREAD_ENCODER && av_codec_is_encoder(avctx->codec)) { - ret = ff_frame_thread_encoder_init(avctx); - if (ret < 0) - goto free_and_end; - } - if (HAVE_THREADS && !(avci->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))) { /* Frame-threaded decoders call FFCodec.init for their child contexts. */ diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 7919b165da..bd66f138a3 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -668,6 +668,12 @@ int ff_encode_preinit(AVCodecContext *avctx) return AVERROR(ENOMEM); } + if (CONFIG_FRAME_THREAD_ENCODER) { + ret = ff_frame_thread_encoder_init(avctx); + if (ret < 0) + return ret; + } + return 0; }