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; } From patchwork Sat Aug 13 15:03:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37251 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3d0d:b0:8d:a68e:8a0e with SMTP id y13csp390793pzi; Sat, 13 Aug 2022 08:03:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR4s31LhPca71fRackkzdIkyi4n+fEWYowyl8pnHNIjkZ5n2suuGin6At0e96U4uO8EBDqdF X-Received: by 2002:a17:906:5a6f:b0:730:ba7c:6bb5 with SMTP id my47-20020a1709065a6f00b00730ba7c6bb5mr5814385ejc.720.1660403006488; Sat, 13 Aug 2022 08:03:26 -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 sa25-20020a1709076d1900b0073317952891si4291835ejc.777.2022.08.13.08.03.24; Sat, 13 Aug 2022 08:03:26 -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=tRoR3o1l; 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 B008168B8C1; Sat, 13 Aug 2022 18:03:21 +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-oln040092068024.outbound.protection.outlook.com [40.92.68.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A9B3768AE59 for ; Sat, 13 Aug 2022 18:03:15 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C6wKoW1a0ZBlQhR1/UgETm5/XcvlKW7HrU6Vv023kcjCtwQh0cAb3fqu+TSogQbV2cEDNpo9YN3RTqse6BKTVW77BDwKEnKfjMTJkI3VnsX+YidnKf507Sqenz/9QFyZb38KEJ6Yztzwp3sSWEDsfjtmZ9Py69Zgk3dl54pndx8XAuBMnJZniFZZlq5ygcUwzbZ1Dz1S4n2BVEt1YL/UwyhO5rEFWx9KC3tEizRplj4j/NYtl1b/y5TJ/aNOGeouEanH6cvD6clOGi0F3VK5XnAzwijd49kXuDvQdO4ET4FrtVKc+DCq0yLe2Z3pZcX9q+HbmEFb+yQcE4BImSug9A== 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=blqG+niS56xZMMTHt0xG6xewmgIGfUKUASUYXo7zejk=; b=hXx2pLpg7m0wNzxWz1ULWVKS9w7V1wbw3+sY4rQfwylqlrvQAxZN10v7/YUqh6AzeDm9dnfkyJNijOOqY5y6EzSrvzRNX/oMBp6wX9kcQ9Stvbj/u4AUa+Bb9UsXSeQJlUP4mORqSUn0jTX+70hTYSQK8rBEgMkFnwtp85utswPX2uHE2O3hi8NVASQUqqwT5ZUjQBrO8I2V/pu2uGnvR8V0RZfEfybZIU460WMALQaj7zGZEkTRvplp32EXoZiy3Tw91rI12nxmk8A9i87tBKJB6tBretLTfTe7AARQOScs47s9VBCVLYknNw3pEgOvBLFIDVzWWhofeO1TXZIuUA== 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=blqG+niS56xZMMTHt0xG6xewmgIGfUKUASUYXo7zejk=; b=tRoR3o1lzrPVDFPVzUXnaNi4nbZ1X6HGr4zesok/YiFGndQ7PpBqooNanTw+Wy26+oBM7vUAsm580zPGAzmuMts+/pU4mC/p0vR9wBhTYXdwjYRuqFRbF3vJjqwdnki/gbs6bAx/BktNWQz6LlP1g8qe+99QgZy6+GDoVzJ2wXWrRH9DhAHAot0VV5XtTTfDD26CLAQbULJciCUdI2W04IookLNKVPUHyovSQjBKGCd75L78yi2HQpra7ftNum8V8XFn0/zha2JBQ3BqPu/a/e4n7ndkKomD+3zfA0SlsjOG6K8nZMGqqz/WIUmAV5laCqobJRtfUZKtbfCceKZxyw== 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 15:03:14 +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 15:03:14 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 13 Aug 2022 17:03:02 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [5EB/O2v/W1RyuVo3O4bMW0+XHjGC/lEJ] X-ClientProxiedBy: AS9PR0301CA0034.eurprd03.prod.outlook.com (2603:10a6:20b:469::23) To DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) X-Microsoft-Original-Message-ID: <20220813150306.1116206-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 069edbab-23b8-424c-1d38-08da7d3cf203 X-MS-Exchange-SLBlob-MailProps: dEG5jEBie8mMamuGb261gBblBkR8QZSDWHDSZ/6CzEWHkco/YiBzwWIbYwRlIPs2exABmhikpk5oucf6bmgcS71D8iq23HnYZLTn4DldXWzCg8X6DCbui3P8NKqMnHHCCk/53CYqDHRYSk+nkB6i4SbluO67s1KoTdnkIgFK8+qTeoilqBDDf+ofooZPZPJJSUPwAfGnuXajzjeHm79J/e/OG2OIA5fj4KPkTV+gTxdIL51aJ3WK963zxeFVfq+UmK3nDrT5HKQembwbdGTZ26/xtpbXQE2tTjEclbGKrEpGWm7z2AHZiZgb+RXbt1fDaNj2DtI53PFuT8aQjsS01fFJ1OK0dQrUmzNvojskyqrKWnoZZVQTucSeQZmhcI+rfVi06joLTmWkZ0ebcDf1Y1fzTpGdnslmvUy4NNsritB8lBG0cuavrY5hgIcQ0XRE7WDfNtu0wiUelB0fcI5dTSMDbiV9XqZQ/jXBpMz2QQZ7VkIhPU5YtgAiwmZpbA6r0iEmnqEy5KemSxANgZoeANorgCD7AtlIcs1SEC/hVuIW7LtgYdt1ZDjzVfB8bFQ3DLM6+g6ZmOMdqnSQFdnGB7Q6EA+a8TMI5HFmrywUdMJQ8f59KsAhEUPN801cYH0bbK9mOgkIg/7TopxB4h0ScQVI8r/r9xHPEX4DMP1ebM9R+aM+nDmN9g== X-MS-TrafficTypeDiagnostic: AS1PR01MB9370:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: psWRaUxuTPVUWb0mZ36R19rj8Uzz0WBMASctwHAu4y6pHcZQuHga93dGIgJ7CoqicD7o7wu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qzN9Km9Og5mscRGJoKol3hxNIZX/lPujFytw/qoQuLcoY5nnEEXk3J/lwy2ZfmhfXu+kjhWwbARLw8JFlgSaotmAIRrkX6D8++0LynZ5p9O1SeSSUtD2mbnh7RCdYVy2SZ0szC13HKub8RPBdrcbaceV+N7UvovckuR1hMhdxuolCvAyzxBYsgkHJgcm8ZqDtCSQyoKFLdmnglLo14Ov3PJuby2tAIqTlBZQ5swB+2ttuMSQSjkrexSlwxrRQMbgw+od3WIU/WrFs9zaZz2lcKXljAy7Ds7Ug7Iimy6BryLMwJ1MAE3JxKaP00cx1+oz6qct5qjvrhisXZyj2G3i+ywbmxTueTYTYbfwyDDcF3c465VbSdsRU5eQghbZ+t4yX7uaK68gFqGraA1ynKq55wfrowo9ZrNuE0b+hpdmmepBcL0jtTRT5Khf3oXVC0iPmNVFyfGhl9tK/GFxLB/AjnXeb2P+7Kr3odR9EmC1hfYC6ZVKe3R0U0vWskp8dJWvbjAi6DRvSDcAwqViMOFm2fnYxAocQZH3DQNKuorQ8UjOF0PxRiuCl9Ropgg/1SE4qyJDMQ7L3DHMGd2zspk1CHd/LkNtCtDAMm3FTv5cVXFt0dT4T4VdOo/vN/1pLdj7bsWrOVzL3VpdPZIZwMsvWRM8HuKNv57wlUH6r0I5nFT4ZlQpOhcGTgtARTeOve5rgqAHE0+jI29uLe5MDPNsxLOmZVixTem1v/lKjsyAzPWc23nT130qOr+n9y/OkC54+F5N8qIqtcMELxzZ/OGOR0xxMGGFOwGuVX9K+OanngVl/4jakOF+AlI4OJH1Erhmiq6P1gH8ypyjXA944xkwDY2MdkaPisShoqi9DdOc3H7FXj0Me+N/mLxGUmnPNloETfX6OX/Fg= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 069edbab-23b8-424c-1d38-08da7d3cf203 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0101MB2214.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2022 15:03:14.1115 (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 2/6] avcodec/avcodec: Remove redundant check 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: YQVv1f5JPbNL At this point active_thread_type is set iff active_thread_type is set to FF_THREAD_FRAME iff AVCodecInternal.frame_thread_encoder is set. Signed-off-by: Andreas Rheinhardt --- libavcodec/avcodec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index 0451f57f82..29643199be 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -283,8 +283,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (ret < 0) goto free_and_end; - if (HAVE_THREADS - && !(avci->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))) { + if (HAVE_THREADS && !avci->frame_thread_encoder) { /* Frame-threaded decoders call FFCodec.init for their child contexts. */ lock_avcodec(codec2); ret = ff_thread_init(avctx); From patchwork Sat Aug 13 15:03:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37252 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3d0d:b0:8d:a68e:8a0e with SMTP id y13csp390907pzi; Sat, 13 Aug 2022 08:03:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR6K10t84TzDXJEcQYDjMTx8xcKW4afeqConySl7p0PRHsvyf4WbTukh94HTbuixgiLSeIM5 X-Received: by 2002:a17:907:738a:b0:730:6d62:4ec8 with SMTP id er10-20020a170907738a00b007306d624ec8mr5780378ejc.590.1660403015938; Sat, 13 Aug 2022 08:03:35 -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 b6-20020a056402278600b0043e898f7840si5183045ede.449.2022.08.13.08.03.35; Sat, 13 Aug 2022 08:03:35 -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=ZyAF39fg; 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 B255F68B8FD; Sat, 13 Aug 2022 18:03:27 +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-oln040092068024.outbound.protection.outlook.com [40.92.68.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EAE0568B8C5 for ; Sat, 13 Aug 2022 18:03:20 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JKPIvaotTrS/Lah1cd8eb5xf/tXvzHW2gAvAAHAzIS2Qw2FtB1eHAWniyyoDSPqlORTyzBBq/egJ7cTe45dAV+BKBRbsrUsjRDybZpWU6OLAZw1nEqAgo6vPr7Pof4VhqNlEhmF6EwUEpNsExxfzk4Qj1vDj6ma+RkSZdRS34wyXWEPcTaTaijCgPBX8X7rvUKftyXwxHloK5Uo0xTkJ2rvp4t0RD/Ib5ci4UJMeM0JA+9KxukYeS4gV+FpH9ZLvBd8x68VU0K2flfbXVyyyc9J9REmxhCMp9CgRlhPaJUwogHbhImxPtQeD/dbI+2t3kmT8DO6c3c+Nde4F4pRDzA== 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=17dcaTg82vjSoX9vum5yhEfLxWHIdyLxVnw3LCWzqOM=; b=Qhd+rnQP8GgLj2j7GQwEnQXP5ZJECqNK8+uuguI2Xb+uOkgD8S+Iwn9HqGSpfFhRBFwweeAXqJpWRdIFr/wnkeiAHro9ZSE6a1Y/7LG+6WNzcNQAMERIA1VPV3A25BdYFtFBrrUpo9Fyi3K2EcwjRjDyOdGofKppqzZQMjMHr9e5moxEUazo0E2WfBrbpDJtLcM5P5VVuWnZlkYRkKDKTfDF0VV05muBOvih5E7ccrL7PJ9Fm90ioqBdnTBmM1plr0kwnXkgDMis642UYe82mQtkQVQbngtXimZ3uNuWCDYirFTTjbarM9PQ6pR9xy1N+pEyjle/B3JKZ0L7oMJG2A== 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=17dcaTg82vjSoX9vum5yhEfLxWHIdyLxVnw3LCWzqOM=; b=ZyAF39fgsjCA6w89r+xVJ15cPLiQV5uRVZzH2gKbGHIXcx6j47Wiokde8r/H5bQKHqX3exRQ7Gb1EkHbm2Qd00R+mjBy1kX45tFuchW58DdWe8530+XAF2OvQmzzgiMHpoUZz2CkLHorYk6QWpyUglmSjhpUE57hHftU11nlfTwIJ3e3/5zp4qFY7TxRd3V7k7md/KnCf8I5G1HbQ0E/n2ERxgvxNX26+6pbjlWtHfs0N3o09bNZTmzcigsk8BdO38vCPw+j1huRXkugHTnMWEp+bRwF007QUGSXtbJftftndH0LmUaswOFN6SxPBFx+mY+uyC5MLTNSHIld7b0cjw== 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 15:03:17 +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 15:03:17 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 13 Aug 2022 17:03:03 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [Yt9IYSKOkE+heF+vJKzpcKhxcHTeMqcu] X-ClientProxiedBy: AS9PR0301CA0034.eurprd03.prod.outlook.com (2603:10a6:20b:469::23) To DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) X-Microsoft-Original-Message-ID: <20220813150306.1116206-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0f75d64-2dfe-4249-c420-08da7d3cf3d8 X-MS-Exchange-SLBlob-MailProps: q+fD6XS3/UIgFldYn+1hidqnuJOerZ4lL8xu8pgkQ0eT4cEirPSCFFh8NbPYwvMLi7Rb3WsjhPb6U349zZ1EGCACpllacmt7ofpzJwz8tKiv4DL1NTumVKARNvVfCOXBwIj2BMOxHvrt3VQwFyHTxlIdIB61/eIFseohwz4QPXgaFgtwskcurmKCqYgAi+xBx3VbNUamdktfmGyheyVPkcAx2wLGVrMFify1fIYMyEEzcowc84NcgMeUn4UeJB7phbSPmlyT13gt8Xm2JYKG4D+jgZunTb6LbXFKz+WuFoitN08BPHRO/TyBYHJpzY96ywB0B8zIw5FrouSsQ9ICyvZdjUdRp6CQeZC/dbdqqkScLex0tMEgEApWdKTf6qbKeFetPuOfoEU3JY7wP/KzrRhFp2sMMwLAX2xUxfpOJRz6r6uIDkbAVo6CwbKyS0ygyfEPVd3mRhAoCMcfmUolN50sldn70mqwv3RHEloi5C+PUBWXwcW/6PU31KD+m2L4TITIuKS8ilOG4IipRcKZHkeBUQMrLfShG1OYBeqPLtXZOMKsiPNDQtufZnDy7bpjTGT+G2iVmG1WXFGtug78lVzdJS6M+kzr5pCr0df3wKlOV4rX7O9I5DYKop/RrPCSkWK+MH4n1+VP5bmMJn2fFrK8IgBIrapmCQt5IQUR1Bua3P3H3pah91J6ja63ADutAMADRtKfB9VrNecVEdM/sA== X-MS-TrafficTypeDiagnostic: AS1PR01MB9370:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GQVG9PY1+Cfn8oDHdQIEX+000Txhj/U22FRCGFQk4RIK0ocdVm1x7BWkq7GIOlr7mtOyzcJUGa1//ZZedbJx/vrO3JtO5ggq1Q+WkMZ65ubE7T+1yXxui2WWKGuKi4GtB0Y5nyRG0+QeG6XQUy5W7vci9wlCZhDYj8SNxM8yjXbm/rC08zW5sliw4/deq/CXz5QyIbKFAYEM4DPA4P+Ca6yN8ARwLHhUOAa+AOqpySOHxVYTvLWfCfVRuzKiBHgd3bzAkCaWlAep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QyE8mWM2pRR7WdStyQ2LTymy+61D1AT4rdqYS6loHNE8OcPNp7RphPnnna1tNHF5CW71mwv2V7adBp/WaCVGIhB/pzDMiqDyC2fw92BLztX6yGWkjLBfo4Z9Jh5N6XpZIRsDGnn/tNWfdpl6F4OPiegH+fuhhUPBbq2EcC9XFcf76vGzP0YYXRsighdty1oFlhEoglz07elt/SinBDQWlKTR5KJZu6rDA42fO/yA9U1wIOAX5ihJ8T2O6t+dGuEU+Bz3h+JexrWKzZD3W5+M0EUZp6tIHNxqZAfKibu2agQ2Uje/CBIdGFbp01eqZvihq037GK9yqM68pRvhixmv6VCXAAGtPPioeSJTEqIxRxLkCcopY3rcoIZ86zWtsZ0wysdk2xO6AOQncn65NmXBoM49SWf5pF653Jca+pXVLQZDuBfezxEugRioQnjSHJopI10M8afYbp40W+E5NVMWnZG39RKHeu6QlHGyJ7ThrZeaVcpNWWmbxvHqIYcUIcVTMMFEVrt2zom8OANAOCyJKgjZnBgf5/IZqSXCUMLGNGMfS/nvHE+NrsAS0NzJrUo9cZFZYAYEmKaGwuJDM2VnMCJdf5wghVI5TW8XY8To7yZdqZI2DK475fcn0ywyfalqngaErSzS8GR+ahUAQ6/yAtOSokvnTZrpV5XI1NqCJ+McIofYzVWbmsUils= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0f75d64-2dfe-4249-c420-08da7d3cf3d8 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0101MB2214.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2022 15:03:17.2206 (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 3/6] avcodec/mpegpicture: Always reset motion val buffer 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: AwkITc4mRbAC Codecs call ff_find_unused_picture() to get the index of an unused picture; said picture may have buffers left from using it previously (these buffers are intentionally not unreferenced so that it might be possible to reuse them; this is mpegvideo's version of a bufferpool). They should not make any assumptions about which picture they get. Yet somehow this is not true when decoding OBMC: Returning random empty pictures (instead of the first one) leads to nondeterministic results; similarly, explicitly rezeroing the buffer before handing it over to the codec changes the outcome of the h263-obmc tests, but it makes it independent of the returned pictures. Therefore this commit does so. (No, this commit is not intended to be applied. I just hope to arouse the interest of people familiar with H.263 to look at this issue.) Signed-off-by: Andreas Rheinhardt --- I still don't intend to apply this. If no one looks into this, I will just add the necessary changes to the h263-obmc ref-files in the next commit and leave this one out. libavcodec/mpegpicture.c | 4 ++++ tests/ref/vsynth/vsynth1-h263-obmc | 4 ++-- tests/ref/vsynth/vsynth2-h263-obmc | 4 ++-- tests/ref/vsynth/vsynth_lena-h263-obmc | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c index c57f149752..2192f74cea 100644 --- a/libavcodec/mpegpicture.c +++ b/libavcodec/mpegpicture.c @@ -280,6 +280,10 @@ int ff_alloc_picture(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, for (i = 0; i < 2; i++) { pic->motion_val[i] = (int16_t (*)[2])pic->motion_val_buf[i]->data + 4; pic->ref_index[i] = pic->ref_index_buf[i]->data; + /* FIXME: The output of H.263 with OBMC depends upon + * the earlier content of the buffer; therefore we + * reset it here. */ + memset(pic->motion_val_buf[i]->data, 0, pic->motion_val_buf[i]->size); } } diff --git a/tests/ref/vsynth/vsynth1-h263-obmc b/tests/ref/vsynth/vsynth1-h263-obmc index b7a267a8cb..aed283ed53 100644 --- a/tests/ref/vsynth/vsynth1-h263-obmc +++ b/tests/ref/vsynth/vsynth1-h263-obmc @@ -1,4 +1,4 @@ 7dec64380f375e5118b66f3baaaa1e24 *tests/data/fate/vsynth1-h263-obmc.avi 657320 tests/data/fate/vsynth1-h263-obmc.avi -844f7ee27fa122e199fe20987b41a15c *tests/data/fate/vsynth1-h263-obmc.out.rawvideo -stddev: 8.16 PSNR: 29.89 MAXDIFF: 113 bytes: 7603200/ 7603200 +2a69f6b37378aa34418dfd04ec98c1c8 *tests/data/fate/vsynth1-h263-obmc.out.rawvideo +stddev: 8.38 PSNR: 29.66 MAXDIFF: 116 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth2-h263-obmc b/tests/ref/vsynth/vsynth2-h263-obmc index 2cef7f551b..c0dcc3239e 100644 --- a/tests/ref/vsynth/vsynth2-h263-obmc +++ b/tests/ref/vsynth/vsynth2-h263-obmc @@ -1,4 +1,4 @@ 2d8a58b295e03f94e6a41468b2d3909e *tests/data/fate/vsynth2-h263-obmc.avi 208522 tests/data/fate/vsynth2-h263-obmc.avi -4a939ef99fc759293f2e609bfcacd2a4 *tests/data/fate/vsynth2-h263-obmc.out.rawvideo -stddev: 6.10 PSNR: 32.41 MAXDIFF: 90 bytes: 7603200/ 7603200 +3500b4227c1e6309ca5213414599266f *tests/data/fate/vsynth2-h263-obmc.out.rawvideo +stddev: 6.19 PSNR: 32.29 MAXDIFF: 111 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth_lena-h263-obmc b/tests/ref/vsynth/vsynth_lena-h263-obmc index 5b963107f6..78d7cc7277 100644 --- a/tests/ref/vsynth/vsynth_lena-h263-obmc +++ b/tests/ref/vsynth/vsynth_lena-h263-obmc @@ -1,4 +1,4 @@ 3c6946f808412ac320be9e0c36051ea2 *tests/data/fate/vsynth_lena-h263-obmc.avi 154730 tests/data/fate/vsynth_lena-h263-obmc.avi -588d992d9d8096da8bdc5027268da914 *tests/data/fate/vsynth_lena-h263-obmc.out.rawvideo -stddev: 5.39 PSNR: 33.49 MAXDIFF: 82 bytes: 7603200/ 7603200 +737af7fb166e2260ba049ae6bc30673d *tests/data/fate/vsynth_lena-h263-obmc.out.rawvideo +stddev: 5.42 PSNR: 33.44 MAXDIFF: 77 bytes: 7603200/ 7603200 From patchwork Sat Aug 13 15:03:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37253 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3d0d:b0:8d:a68e:8a0e with SMTP id y13csp391055pzi; Sat, 13 Aug 2022 08:03:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR7uFvx+DSz+Yj4evMF0jwIPKBklKVQC/qC9bqWgrb1p8BuQCCOW0sqUrOxhoBpwsZ5CFLLC X-Received: by 2002:a17:907:2c68:b0:730:9272:8c7f with SMTP id ib8-20020a1709072c6800b0073092728c7fmr5811398ejc.528.1660403030323; Sat, 13 Aug 2022 08:03:50 -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 f12-20020a1709062c4c00b007331498ad9bsi3377389ejh.540.2022.08.13.08.03.49; Sat, 13 Aug 2022 08:03:50 -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=SDI7WHno; 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 9787E68B939; Sat, 13 Aug 2022 18:03:32 +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-oln040092068024.outbound.protection.outlook.com [40.92.68.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1E33768B825 for ; Sat, 13 Aug 2022 18:03:26 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K+gKmMiDpdrvyUYY3X+PX6W5Ze9Nkx33yz+NUGYKqPteMX6amanx+xDYy1z5dwHpfyrbCOm5C+yd1FYB4zepQ5Do7NUcIsKs/WF0swKQnSm7GUL5xTKiCp0tH6XN+E4xuRwslXDZNJeDQnVjgwu2pFoIjO/fOMCs8TgDIYNbGxAH5N3Fa8jXA8p7zrZTRoM1MF5uzDTQQa2citCHP6NHmtKOZ/39tkK7EDG55lpgCBZf9bf60/Lo0XR9IN+uIfWZpWUe65UlKsTfSfxQo5HnW0CBM+mx4L66DMBr6q2YxzCL6VF3LT6pRBz/F/a28paPSiYpx/PDj5CCR4fFKo3PZA== 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=WbL/b6TTm46odjScJ4FTBKf4v31f1ZcT7IdPT1OmNFw=; b=aTjNtW6ayrXsoeSpvYjNVWy9WaADD48sNergODWdD4CVusl4ami3VahNZ+BFYqeVUQYN5kpLlGKkktpUxtbGuJvc1qY5GVif3zUtiplDIIlsYhDVl3m5IgiwZHCrbOc3ZMhRFBUj/+Yi4cNWauY6GUPmr5N5r/U5a2MB1oFpKyGtW7RRkjkwrpzL+8dGEtr7gZyQboWKZR0zoI3+3Prfn6Oe0gBZV2hH8Fe/LTtkG9LVRdqf/EfKiYBzwHBhdETjkqhF8NpNGuBCfKNt8Z8XdePnmwiAcV0rC0lfUbydBR+P8W/mnc80xfdEKCjk7zIClvyDMbw8RiQ7DD2Ux5HqhA== 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=WbL/b6TTm46odjScJ4FTBKf4v31f1ZcT7IdPT1OmNFw=; b=SDI7WHno1dzDnBz34jYZrBxWpqpDK3minneB/E9zkjZ78mg4Q4IuL4tl5iiUpCh/V4j0yaQEtrNjwEdXv8wo8OsIkqm35mTfOSyeMSR45UmSe3ZMMWY6/p5OB8Q5I3RdNwp+LwX87DWE6f5VL220ElcLFGh+YXzAu7l86BuN0Tgb3dzciSeJeX2NEj3vBk5EkY+98BxhWCCp4yODzdobiHAmQJ5UHvnNpV8OA0HUcimbVYHbpIuiXOnWSX7x3BhbtIl7qDRCugXbyq+LOs0/bzFW/Kw1S164R1GIj0tly/rhfT5QDZoUAiQCCJJCPm9Gegh41ySgZ2Fx94zoFXqwTg== 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 15:03:19 +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 15:03:19 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 13 Aug 2022 17:03:04 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [NhwvnxAvmE+uzX0OG0fYppfuYaBLi/tE] X-ClientProxiedBy: AS9PR0301CA0034.eurprd03.prod.outlook.com (2603:10a6:20b:469::23) To DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) X-Microsoft-Original-Message-ID: <20220813150306.1116206-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c4562916-2f9b-4c43-d741-08da7d3cf515 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNUVf4505pHrBAhYXFbRlVUGyJXY0X9N6vGUaWBfq1hKFmU/Mt/SaJtZ14DKKOuKPGVtLgF4ctXj1/2y4pGnMzCo15JNmhzhPar+D94awwo2e62Kx7gaesN4JhbQxwYOU4R95qE4qcAv6Ts/glIw6rcusnBY5DIE9Or/XNaGpX5wri4bjrPg3+UHg4hLAzsGSEouNhPMifkJmMLu4Ozdpb4pKEHJvrbgBrDUf+Huyn3Rg0btS4O7N5MjwMKTusP7ZxXuWycH8evmyngNaGgTa9BrMQMd9OQvVyICdPX7/SNRxhyYk91FcZCmElSU6LLWF+Z79Ise0yjJ8lszZGLI8jQ6hCinILFSmB940bsHT2HvPT9KuH42GW0tXwttobclnKd1BOF9XAgxyiUK9rFd9+xpkOwRS7FrAj9h9fWu/lNQeztRpWKRj8Ts/1i28rBwdGdQFJFgGR5ltIiEHTjnjJJPLQVSb6XXnpV/Q3S09r1lI15v0Zjji3NH3b+fKSZZfAG4KvjbhsrsCHTb/8nA1qJ8FPKFicRwOPUVT3T+MA7/HPaqcgBSS0FQwO9Dn14jZkd5UYBGBrNTSTBwC6oxQoq2ezgUX3UVAT6qL/KsHihrOnYEdVmrlH4MhrNCwJFfGOUAxpSSuX2KK2ys7TL0kbQR1yQ0PP77IAwS0On9L9M3sV33NvZjIrX9XsZtQ26KmgPgqrxaivNQkgLTV0kY33ssWEHQ0m44ijo= X-MS-TrafficTypeDiagnostic: AS1PR01MB9370:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lLxSg5HXx9IuQRN+/UV820c4CznxGVv6KJOyUkQArX0erFCloYhs03t9if0ap8CLkY3nKUsmmbg970LXOhGEHe2bE+0MheyT0bbVCg5XbUybat7O6NLeOgnvD/l4MqY93hqiqugt0nZlDUQ4gccC3YDjtj+igsQnbbuMdOvary5RBZCsJQZlNgmj4LoqRrX7B/xp04RxzOY0QfNMdPaKjCdnN3R2xWWrVkBQFLgP4dC2Pu8Cttk0p5PYcfiy0x7B/xa7JnOf1/1A+q31W9Mpj0jcdp6IC8uGwUhZrvih2wNHbOF9CWmZebIBoIXbiCdvk2z0TeiBleZ+eI+ZRueSTM/iq+LCm+PNkicpzNRiWnyZ2aicIIMhq2eFcgRB1P3qofOenrW4XZ0YcMWYm494DF04Vx/enSK2mG5jeqtY5twajutxfLxl//5edVL9azAuLF6HICLhYmJ8G1iwockERY47IgXH+bkwj5uS60r9mUMC5HMNndL16lnm3FNYHwpjVCjmWqV2b+POibjQnU3ZkJBDUReWsoGueuwC/buNuXPhotZNvRH8+Oc6Z9hShK+oCz1cHLYV4JShwSfmxFv4U+RVb5g0yKBKVRh0wNJ7Rg7+Nzwsvyoc4oNUVvQpYc8MEXkDxOZjBrclmqsqNyG0gw== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 03dqnHhAZYPacI7FReRIafMdRBcx1SWjW1FdIs10gltb7NkYwridyTAJCnH4MXcwHfpX69GOoUtHnl74ha0S+V8bvJ7OtrB+sjpZ7NXoFwXMKz408ZFq0De3CVRFOEY+dk0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FMyW8yKcVB7ud8bSYIGwmTgQzDYAuvyLA3NUXt6ndp557RBMaWhtUDyGT2buzJvk99RL9nht/WRGSuXVpUEzvg3ieQ0RTLeq22UcvNNA= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4562916-2f9b-4c43-d741-08da7d3cf515 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0101MB2214.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2022 15:03:19.2986 (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 4/6] avcodec/mpegpicture: Don't copy unnecessarily, fix race 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: C2VKT6x4yVMh mpegvideo uses an array of Pictures and when it is done with using them, it only unreferences them incompletely: Some buffers are kept so that they can be reused lateron if the same slot in the Picture array is reused, making this a sort of a bufferpool. (Basically, a Picture is considered used if the AVFrame's buf is set.) Yet given that other pieces of the decoder may have a reference to these buffers, they need not be writable and are made writable using av_buffer_make_writable() when preparing a new Picture. This involves reading the buffer's data, although the old content of the buffer need not be retained. Worse, this read can be racy, because the buffer can be used by another thread at the same time. This happens for Real Video 3 and 4. This commit fixes this race by no longer copying the data; instead the old buffer is replaced by a new, zero-allocated buffer. (Here are the details of what happens with three or more decoding threads when decoding rv30.rm from the FATE-suite as happens in the rv30 test: The first decoding thread uses the first slot of its picture array to store its current pic; update_thread_context copies this for the second thread that decodes a P-frame. It uses the second slot in its Picture array to store its P-frame. This arrangement is then copied to the third decode thread, which decodes a B-frame. It uses the third slot in its Picture array for its current frame. update_thread_context copies this to the next thread. It unreferences the third slot containing the other B-frame and then it reuses this slot for its current frame. Because the pic array slots are only incompletely unreferenced, the buffers of the previous B-frame are still in there and they are not writable; in fact the previous thread is concurrently writing to them, causing races when making the buffer writable.) Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegpicture.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c index 2192f74cea..ed96abbe2d 100644 --- a/libavcodec/mpegpicture.c +++ b/libavcodec/mpegpicture.c @@ -47,11 +47,25 @@ static void av_noinline free_picture_tables(Picture *pic) } } +static int make_table_writable(AVBufferRef **ref) +{ + AVBufferRef *old = *ref, *new; + + if (av_buffer_is_writable(old)) + return 0; + new = av_buffer_allocz(old->size); + if (!new) + return AVERROR(ENOMEM); + av_buffer_unref(ref); + *ref = new; + return 0; +} + static int make_tables_writable(Picture *pic) { #define MAKE_WRITABLE(table) \ do {\ - int ret = av_buffer_make_writable(&pic->table); \ + int ret = make_table_writable(&pic->table); \ if (ret < 0) \ return ret; \ } while (0) From patchwork Sat Aug 13 15:03:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37254 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3d0d:b0:8d:a68e:8a0e with SMTP id y13csp391274pzi; Sat, 13 Aug 2022 08:04:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR59TJn1v6IgGmwPZPITOE08iXlpRXoNjKqhb0Lk23xPIYL/npzEsizwwO9zMY3s0VKv4sT1 X-Received: by 2002:a05:6402:612:b0:43d:5049:4d0f with SMTP id n18-20020a056402061200b0043d50494d0fmr7602483edv.127.1660403050708; Sat, 13 Aug 2022 08:04:10 -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 go8-20020a1709070d8800b007317ed6f18bsi4792794ejc.986.2022.08.13.08.04.04; Sat, 13 Aug 2022 08:04:10 -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=RQdJS3f6; 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 9581E68B945; Sat, 13 Aug 2022 18:03:38 +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-oln040092068024.outbound.protection.outlook.com [40.92.68.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 440BC68B825 for ; Sat, 13 Aug 2022 18:03:31 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PRKylZYNM/xGfX8Bu2B8aC6iavMg+Lj2IUCuxv3GfFQq9oEBEyr+4ahyDjXw0AxARDxkSVOQQ8J4mVD2T/HzBaOdnABUOONt6juE1A1FodQIHfLCNpjs4CsUfetUF7rYukq52j8fkEGw8fkVZ8BNl3VGy3mLg3HLdJJKKJxG/Rw+1GWgILGrFxInWzlwyPKnvXTVcMYEZO9aPvqoNfmc+ZO6hBKFWDyWAg4TsLpLgEnYpvLL0bGOdl4jsOg2T5/NIUb4eq5XTtfUVr0a8EzFYLi2of/BiSx6VbWVafgr2cORGLwK7Dt8UZUTKMatARcMbHc6KaK9KLxPLeguiubKUw== 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=ibNoHfYs72WNIz80aPPrvFCfnp2Z5N9d27NqhJegJQs=; b=bQutGOpyvdoa3pt8NjVtMhwVLTN+OJZrE8KxMs7VarvkaXJQI5/2n+6KJN3qE1j+CDC7GZjEPRFcalP8NkvUDtSnH/PfIIPKuHv6/It/uXJSJ24UV/rILLQQJK/QW4HadASTkpnOhOchfpib3Xu/E6F4D5LxvvCxQb7RSIULaZHwRFAhnDT6vA6quOFBfeMT8v61iT+X/qa0yGiUrTFxhSu3OPYq0iD8KaFtYoURLOfd8Y++XGzYrALrgAGJpo0Z7LM0rd4WsueI63AUo7/N5wXLZe3FIqgcL4DI+EC+9oQCwdEtC+xsV8sf/Wfahzhtd4XnThuAYlpkl4nOy2RATg== 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=ibNoHfYs72WNIz80aPPrvFCfnp2Z5N9d27NqhJegJQs=; b=RQdJS3f6XM8Mf3riun3iNgwiPNvI35I55BfWz7QFnh+6ZdqQr3SuaXZ2tMZdyHRDyM5wwe/dQEDn8X/cAgyBRw8Fl5UOjb3Elj8812N/j7dimnek2ehVjbCHPSU9znHzadSDrhikIVj73RHOqGNCRqaX0/0Pm1PcgeBbVX9Mak6zxPnJBb8kfaMJ1isivrbuYiNwgcloSUoHvRQ5aELWa/Otysoj28enw5HebZRIebFj4j18fpDQi7C1Rr4C1GR/rGUJFHAe36SFrwkyvAu28JiEfz+YvZPsgnm2lb64DCdjxojNWVgw3OQLAf2x40j9HQSTXK5Qv5ORFtgqDwexJg== 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 15:03:20 +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 15:03:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 13 Aug 2022 17:03:05 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [uJZySs/rKVlnueh8G5CLpwtR9xIA1Foz] X-ClientProxiedBy: AS9PR0301CA0034.eurprd03.prod.outlook.com (2603:10a6:20b:469::23) To DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) X-Microsoft-Original-Message-ID: <20220813150306.1116206-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e81bcd9b-469f-4476-a26c-08da7d3cf5e7 X-MS-Exchange-SLBlob-MailProps: dEG5jEBie8mMamuGb261gBblBkR8QZSDJq0jCDsoti8yp7kOC1QTGMtBbK0FSkJinDbEV7aqFSU71q4IfpXLXWKhkwwPHmBptODGnGfS2MXcrrixkJvWXrfOHtHQGTYfxa2mAFVtPfCza0a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P/CSKm8FAXWPAw9OzvQqPhN2sYMJ3ODAkZDbVOArUXW/gWUAYIGDVDhqDZUg8gyqddN5f4GVFIIWWeg7R+q+qya7G2vlrbRgvzIBMOMAWgwSuTrPY4gr2E2zNnBgmyRg+Qm6VgJvFhD56fA3r/9vTtuadEA/RBQCYxPpHSkqrdytIlvsr4nd3BqujThiIRPQdraBy+lj5Efp635aEb6Owrh/DgV81/vbW5icxnvkol0d/ItgpCkKS+hx0yhU8DhkBKYOOBRkMPbcRSVCW/ZksJvt6zZglUzdXFOW1F1bJo7kH6Esfrz/dKssPom9f7ELTLrt/a/ZT7yEcsNyyTm/CSqJOvOEoLrciFLcFSlxvZtonkwokzctPJcQFw3GqIbIEyqdwD8YpuV4RM5016bJAKjrLZYz+rTew9g0kWPIfxWxhC8TAZ90zoPajdEMvLBYLK4MnXvd1UgvwYSthZ1XZk9BvHXCML7CJv+PVphrD6uwev4XMHn9Bq1NLkoE6WMuiUzQyw1TzN5FuM= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e81bcd9b-469f-4476-a26c-08da7d3cf5e7 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0101MB2214.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2022 15:03:20.6579 (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 5/6] avcodec/mpegvideodec: Constify some functions 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: d+T792O9x+tC Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_dec.c | 4 ++-- libavcodec/mpegvideodec.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index 93ba4e31b3..7566fe69f9 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -497,14 +497,14 @@ void ff_mpv_frame_end(MpegEncContext *s) ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); } -void ff_print_debug_info(MpegEncContext *s, Picture *p, AVFrame *pict) +void ff_print_debug_info(const MpegEncContext *s, const Picture *p, AVFrame *pict) { ff_print_debug_info2(s->avctx, pict, s->mbskip_table, p->mb_type, p->qscale_table, p->motion_val, s->mb_width, s->mb_height, s->mb_stride, s->quarter_sample); } -int ff_mpv_export_qp_table(MpegEncContext *s, AVFrame *f, Picture *p, int qp_type) +int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, const Picture *p, int qp_type) { AVVideoEncParams *par; int mult = (qp_type == FF_MPV_QSCALE_TYPE_MPEG1) ? 2 : 1; diff --git a/libavcodec/mpegvideodec.h b/libavcodec/mpegvideodec.h index fabc1b2202..250034b486 100644 --- a/libavcodec/mpegvideodec.h +++ b/libavcodec/mpegvideodec.h @@ -53,12 +53,12 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx); void ff_mpv_report_decode_progress(MpegEncContext *s); void ff_mpv_frame_end(MpegEncContext *s); -int ff_mpv_export_qp_table(MpegEncContext *s, AVFrame *f, Picture *p, int qp_type); +int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, const Picture *p, int qp_type); int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h); void ff_mpeg_flush(AVCodecContext *avctx); -void ff_print_debug_info(MpegEncContext *s, Picture *p, AVFrame *pict); +void ff_print_debug_info(const MpegEncContext *s, const Picture *p, AVFrame *pict); static inline int mpeg_get_qscale(MpegEncContext *s) { From patchwork Sat Aug 13 15:03:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37255 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3d0d:b0:8d:a68e:8a0e with SMTP id y13csp391419pzi; Sat, 13 Aug 2022 08:04:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR7xVSJFMWPSe94BBPz3iMh+loxOv20i1l2t2ULpcwaopnYf1dWvgy9xli5h4DrnIdJvWcnk X-Received: by 2002:a05:6402:b84:b0:43d:962d:7db1 with SMTP id cf4-20020a0564020b8400b0043d962d7db1mr7514370edb.270.1660403063902; Sat, 13 Aug 2022 08:04:23 -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 i22-20020a05640242d600b0043aa27d303fsi5387009edc.226.2022.08.13.08.04.19; Sat, 13 Aug 2022 08:04:23 -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=nnhLhRqs; 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 22E6F68B959; Sat, 13 Aug 2022 18:03:43 +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-oln040092068024.outbound.protection.outlook.com [40.92.68.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6A12068B934 for ; Sat, 13 Aug 2022 18:03:36 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y/IQjBRyd+ArhcCAii84FeGvDnwapy1BvZqS8ItmS6a4qsI7/z4UxO+L0e+c3fDr73zBNCsFb/i6eEjn1ts1K5364iYwGj8laeXhOqMK2NIjhQL8hjtwHlRDSu0nZv+219lShxPlFYl9LUm1PtAO59XvKZOnzR7bCfg5qZZ34NldtjV/gFX9Lmqb3voAlB9i8kCBlXF/pZSxMc0xTLv9AOFdwjmgOr8MwYG1ghKRUlWYbuRwfE0EVS1aQBYCLJwwM06faPXSLGvQoCpQkXgpaFtpo7kGQixcOxnDs5JW40uP1WFgCmaFfZrsieeMNHPZzrZJ9UsVTC7yldJ42G1dMQ== 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=zYm+c7EZ1UuAoERyV2sqtgUFc1p7youldgenLfXGxno=; b=VoLZnJbWaK3RvjpKPdKTRR/3yfBrqoYPAzrlUUlTFQieVCNQYnKeUH8KY4EoaZgYxJ9eqh78QvVVEBVZ7vi1qYWzpBDNi5A/q3SWtlDHf3h/56VZONxq0AvnK05BYJDvJjplOaa57tU16fSOHuA0SWCYEFkJhEi0OCaTE21AVGCPFyxljaFpGXISMxf6aFE0vaaWbNk6CjlPuk+qrLh4vx255bIKgDOfLoxGWDetzjPVq1Z1KtflC51of69eXMxv2njhDukYTH/5z3rYeN/bbHbzWusMZ+v6qNfiipF22WPj/84Ldgz/nNRpcF4FzadRz4JlxtQCIY+aPbXAiAIblQ== 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=zYm+c7EZ1UuAoERyV2sqtgUFc1p7youldgenLfXGxno=; b=nnhLhRqsFbF0aeZQok/akhE7r/2ILIsWfibSxWlPTb95GK1e9RaNZc9AQzfqK7PGLaE7Ct8lHWPqDTbotx9h73afaifXkCrx0alz+tSQ6LMtqe8+5fPOY5Tmi/OXgIhnMtyGqNRslZ2Clq/gA1fqNX3pdroMKYmB45RjAcSEFueRbXHLhxU6ERiWj0ZVXoecda8UvwUTsL91v/plUpVJ42KB03NOBDCyF0UDRPWlmOtUVVDxvOlSpsRF9Ad5o2LbXT5p/Brv4c/JcJXbwfqaNH7qpHZ5sAoQfx9Cj08wh+K4Xuwzc0lRYzbIsA87mb5v3//LhKd+r0MhY9YjyUh45g== 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 15:03:21 +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 15:03:21 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 13 Aug 2022 17:03:06 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [lVmgW+BXOAORCajtZwfDBJo4kGPhTlim] X-ClientProxiedBy: AS9PR0301CA0034.eurprd03.prod.outlook.com (2603:10a6:20b:469::23) To DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) X-Microsoft-Original-Message-ID: <20220813150306.1116206-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c345d99d-de10-4cb6-5d25-08da7d3cf687 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNUVf4505pHrBAhYXFbRlVUGH9hspQz3LfYk5hzjcB1nn0bhMdaAqhclIpFEYNMVIY2gCb0+HRQxSY2FsM90EvTcY0yFqFR/gPktE+Bc4YQ9mHMp0HvltsOvjgAtCqVuAXL7qFcTmON2A8oUWNTCxXv4irlcb8wCqv+khs1Y7lcVCz6vLdsf6Kc0MQ/XUbBMxzQt6BqEXYmEu3g8W4NyBhEO+pJ5Lm6YPwBt5UZritnYnv6GliZAfRMA55S9WKj+ye5tQG9t6U5SK6/7PjzqAN2XjYYg45OPSLkApYLaFrVT/wToKDwnvMRK4YqH7OxMuanvfDjzgjilyc6e27Kc9LonKBbuwzcso9C2pOEz7W8N2xHLRCciA3dSYy8X/nr1dNrE7p0KWbPgHj/qbnABjeNZKV0T0pWPAnqTyiYFKkmervc0OuHgzztV3NQF3u4oVAeTo5cmc9JzahssG6pWaW5+Fsh4ZerdRjBHgIusqHRkxPTpSfslzjJkVuE4vFZp7k5CWutpfBFFs2P2Mn41tiqw88hthdAnh7/ZBphnFEuqn8rARdm7DdQJ44mss0kaxTrGpYcBZoBpVJXCi8hFH7VbgjwsVxAld/tufVuLPKeMlozhJCedcyPOikAVFqexMRBe9aXnqqnRpJTOyqdZtdtL1K2HJ+VMNyUCg2Qcrypahz/vvDwaYN4+LPCfFHqPuOcg33TslGMOSGAkkeAssll43wFOB9XIZNM= X-MS-TrafficTypeDiagnostic: AS1PR01MB9370:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AMgZl/pYOYSVSZbZWqQreYfh1IL9owXBS6JVT+6V2KH3H+lXPVwNLgbfqkVlIZY87Eaz4mf3fR/m8qtDX6iy/82GPR4NY4LCYY3tvXmCLuiIT0kE0AvHYJah84956q+lepNM/gO7t5syUejXukjjTtOu39XIP36dWOe7LVO4CRDW4QNx0C4AcGp4F9I+kLyNA//E8HHWOEJ5fSwGMNZde+wNFKMMrDwyM/Ca17vIQb0vC1vpboI+iiuw2pTuwMkpDJSNeG9XFhX6jhBcZJ29Xa0PQiPoM4gcIkQvJE8Kgp+7fOt8j5zlVeRBaIBitJS/a0+yyHE0YHrxZIWo37gcPXihxLM9Q5LdHbu19Sj0iCVZvY0Z8IqC+0UxmvM4550YS1b2lcvckUcaYsTfVnU7GanGnfgJd/5Pjdqubt54rffWZFcZhW0st1c8liPLvF9mJRE+bfFqWXXhwsMk3JAiRYKd4685Y8vXgVDTQbzdQxZhCuTfiMnZP9slvBzUoSV+hFBXH+Pi9CxjZnSSp1Nx2qmLcxVvc8GebzsdtDrFU0Dvq+zS0ctvUMi2n8C7Dt0eYyRaVtZo1RSyJKtzz6tTM9IXfOQ9jeT6cg5X8wmGB4UabqGzLyUrPeZ+tEkDM9nyLb0rWyrjm68kxnyCtaxW/A== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bwDkIjSwcwwfKvyuarFxfoHmq13JKpOW86Lb1sD0cx0ejDve9CLfma+/PKtkG5toic39D/G5Aw10KmXIvsSQyWJMaIc/QnEvQHZhzuJpwbiDJUgaGliPaRqQ3S8hVNzU4vufYnPHNEKOJCqEYDyJ/yaCS3gjbNn9NxYZOQqsp3AzAleRYwRg81B22fvhoRFv6KGAme2Hv196unSovc/7NkkJVKq9vRP9rrDjMHnygvs5KusEyATN5Hi+29BtgMn2zzL5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.com X-MS-Exchange-CrossTenant-Network-Message-Id: c345d99d-de10-4cb6-5d25-08da7d3cf687 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0101MB2214.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2022 15:03:21.7516 (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 6/6] avcodec/mpegvideo: Don't zero unnecessarily 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: caldkrZNVPQw Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index ff08168362..1190f29954 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -651,10 +651,10 @@ int ff_mpv_init_context_frame(MpegEncContext *s) s->dc_val_base[i] = 1024; } - /* which mb is an intra block, init macroblock skip table */ - if (!(s->mbintra_table = av_mallocz(mb_array_size)) || - // Note the + 1 is for a quicker MPEG-4 slice_end detection - !(s->mbskip_table = av_mallocz(mb_array_size + 2))) + // Note the + 1 is for a quicker MPEG-4 slice_end detection + if (!(s->mbskip_table = av_mallocz(mb_array_size + 2)) || + /* which mb is an intra block, init macroblock skip table */ + !(s->mbintra_table = av_malloc(mb_array_size))) return AVERROR(ENOMEM); memset(s->mbintra_table, 1, mb_array_size);