From patchwork Fri Oct 6 02:38:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44168 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp114396pzh; Thu, 5 Oct 2023 19:37:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHnuCgoHnjeG22p0+QqjLLFl/6YltB3HJWj7BBd2hoWKcd6IplMD4OsRyXTR48zxxKTe+Jg X-Received: by 2002:a17:907:1de6:b0:9b9:f0e2:3ef0 with SMTP id og38-20020a1709071de600b009b9f0e23ef0mr2645870ejc.17.1696559869009; Thu, 05 Oct 2023 19:37:49 -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 lf18-20020a170906ae5200b0099cc4b278c9si1207175ejb.208.2023.10.05.19.37.48; Thu, 05 Oct 2023 19:37: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=UvViBfMd; 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 29BB268CAE5; Fri, 6 Oct 2023 05:37:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02olkn2045.outbound.protection.outlook.com [40.92.49.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 346BB68CA1D for ; Fri, 6 Oct 2023 05:37:39 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=etK2G6oGIt77DISKvmPldnxVjYlH5b1/VarErSKNtGNyLs+Gz1O8BcXsL4E1uXVWpd0OtRGa/lc/24AFCKXUXfihSVzSOl3CeCMyOru6LbK4krsPn6wvo9L14SqYr0A1BjVgV+lPBhIhSvbv2K79a1H/1iJ8xLDh/mO5avvRbENhbHbUW8CfBYYZIo5XklQuubTF8KUCb9elhVoqOxl+tOaREl24gShFI6QNADXVkMNdW+pn5ba/bbKs2S4iC+eoTkwc1TvLdmPCgY1SeZUe8cTTJYzmDB4s8Ed9wiRSnUB6PlRFIjzmCpniB2A5z6XVGt/JtwjFV6XmqPCVD6Cqrg== 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=K7gGhYf2UcV1mUZKRraRsxKA2sSnZrdGeTZxL+RZS1c=; b=Bx9cjTzsrotHsJSHNr4UtKV+BTULhwGy+seztVaihXcf0MUrkAz1sR+TFWuXO5oOyngfWuOqGIRXusJs3FwxHmbGAmO3Kg5qzr7bXILm0/cBPniYPyGtI8qKyIC3RPdocNlthGmbDS0Vy/gTK99LUoFeN8E4Q/Tm9XfTgNOKTuf5dbE5kkU2OJb8nF28ZpJ3mBBmu1RVNGbbP4wRNSeC4eA3Roar3e5gA6u0XMTKkUtx04rtPZw0jIpXkKMd7yN13spdrOfgzWzoU43qY3JYKEYAZVvidBKzfm1v9kcQcF54oO1muBc9LcGYX9RhFdVZk7mLxms+8Te1KnI99iFGLw== 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=K7gGhYf2UcV1mUZKRraRsxKA2sSnZrdGeTZxL+RZS1c=; b=UvViBfMdn6m2g3nc9cnAdj0nAAF9DYomiz07hHw40ngb+9bq4VSprkIrr4YNEETJVO7GidQk9/qti/IdoXXj4Th15qN2E35M9ksduQa5a1o/he1iMbHwHumsHlg3Ja9PAT3YrXTbE69XP5WaTsY1aSc502hHgOYPM7GfPGEqAM4LZyu/Qz7yF7df1HRImtNAl461ft2kzaX435W5Zdt2RuUxMl/XE9ni2MvVnbbb2d3N5JB06Jx8Ss92XvGufHTuRc7QceFI5hURRkCDvrxRRM+ffg/7o83ZdgdPRHBSgl7FX7AgL+EgdYnsBJNXzzewmHO99FJ5HbqFpp7/Q0q3yQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:37:37 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:37:37 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:38:33 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [BrY2No2/fa1MgyR8cBUMb5CC3rKQZ8Hh] X-ClientProxiedBy: FR4P281CA0119.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:bb::14) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006023845.1005290-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: 452906bf-12c0-4652-0bc8-08dbc61533c7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A+IgIv/Py6kXW7IyZorzeDtWqmjqiiOaTkegWHgMy3RhZWIZUev3WSyTuGjfLjZhpKOOOlHRv95HJl6k5rR/+2UsGfepVeMGAXXDowgYsOTDLw2/sLf4BugRBlq3HialDFg4veXkotPdWh3viCi7LGoVsBbzMIGE2J17AurCA06u1YaoU6/tozQB6tx+Xiz6cD/MuodQoJGLpOipVy+lcSDasf8OLm/PNyJY9y2ngGIr9WUQCf52kL+2It1yy5l/QvMV9B7yBBaAWwtO8YscNsdH9dXQU1f2JnxEQXs6+y6VmtxrjL0ThHzvIlvZKRbBKYitrct0N8DxydFPuhMBaSZvZwx8RkW76wRu6+qyI+5es1EyL9EodfkCwmYau3Yhyll2k38nqwnyHu8NPVxETPoDyA69+LNCMUBwdhZ1tjdCDREpNaF92fS29BySet1m+sWhE9fp8Nb4DpV3EgsvnEvItMnMCFbEiyj0nMGGM7LQOhdScEXyT7lz3/oStDBiD06fronoJcfWohUqXNYs0LbQ81UYMKcBIMpZkrh/QnlmaBE6r+ndvjKgjIw1+RhwtBAZ7BETq2eP6Scho733sQ+vLmqIYPSmC/oiqnWyf+Mtd2Lnb9qFTvU+FIvm0wQG X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cMCGkKs/+MnAV8Ho5vKw4ED8177jFQ9G+yXzsQcmlIFM+lmINUvPnkbeu3WbAT7NG7RyIyWfKcjH6KpSr5GY9lDrpgSAcSx0gpXBscy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Yv9ZN7Icr8gf06+h6UGHlyHra1NdPokX5mkeMPRNIaOG5dQQIYdmwgGQZYBdYoHiMnNCrKS+/421atT4SnjbHCs2sNk+A8mspgtQndQDUHzj X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 452906bf-12c0-4652-0bc8-08dbc61533c7 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:37:37.0734 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 01/13] avcodec/mpegvideo_enc: Fix abort on allocation errors 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: 2QTFr1bqLEvD mpegvideo_enc uses a fixed-size array of Pictures; a slot is considered taken if the Picture's AVFrame is set. When an error happens after a slot has been taken, this Picture has typically not been reset and is therefore not usable for future requests. The code aborts when one runs out of slots and this can happen in case of allocation failures. Fix this by always unreferencing a Picture in case of errors. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 5bf4b06a11..6cd9d89e1b 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1223,8 +1223,10 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) } } ret = av_frame_copy_props(pic->f, pic_arg); - if (ret < 0) + if (ret < 0) { + ff_mpeg_unref_picture(s->avctx, pic); return ret; + } pic->display_picture_number = display_picture_number; pic->f->pts = pts; // we set this here to avoid modifying pic_arg @@ -1535,8 +1537,10 @@ static int select_input_picture(MpegEncContext *s) } } else if (s->b_frame_strategy == 2) { b_frames = estimate_best_b_count(s); - if (b_frames < 0) + if (b_frames < 0) { + ff_mpeg_unref_picture(s->avctx, s->input_picture[0]); return b_frames; + } } emms_c(); @@ -1591,7 +1595,7 @@ no_output_pic: if ((ret = av_frame_ref(s->new_picture, s->reordered_input_picture[0]->f))) - return ret; + goto fail; if (s->reordered_input_picture[0]->shared || s->avctx->rc_buffer_size) { // input is a shared pix, so we can't modify it -> allocate a new @@ -1604,13 +1608,15 @@ no_output_pic: pic = &s->picture[i]; pic->reference = s->reordered_input_picture[0]->reference; - if (alloc_picture(s, pic, 0) < 0) { - return -1; - } + ret = alloc_picture(s, pic, 0); + if (ret < 0) + goto fail; ret = av_frame_copy_props(pic->f, s->reordered_input_picture[0]->f); - if (ret < 0) - return ret; + if (ret < 0) { + ff_mpeg_unref_picture(s->avctx, pic); + goto fail; + } pic->coded_picture_number = s->reordered_input_picture[0]->coded_picture_number; pic->display_picture_number = s->reordered_input_picture[0]->display_picture_number; @@ -1631,6 +1637,9 @@ no_output_pic: } return 0; +fail: + ff_mpeg_unref_picture(s->avctx, s->reordered_input_picture[0]); + return ret; } static void frame_end(MpegEncContext *s) From patchwork Fri Oct 6 02:46:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44169 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp116836pzh; Thu, 5 Oct 2023 19:46:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZJea1+scgMCV2hY5Z/mrT+VecTEzeLQDX53FLyFUx+xOfTWk0/UqhrO7T+5yC5kI0fIJz X-Received: by 2002:a50:ee1a:0:b0:530:a0a9:ee36 with SMTP id g26-20020a50ee1a000000b00530a0a9ee36mr6194038eds.38.1696560361219; Thu, 05 Oct 2023 19:46:01 -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 q17-20020aa7d451000000b00536751c859asi1220278edr.443.2023.10.05.19.45.36; Thu, 05 Oct 2023 19:46:01 -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=Bu8YzfXs; 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 D971568CAEC; Fri, 6 Oct 2023 05:45:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2029.outbound.protection.outlook.com [40.92.65.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 06E8D68CA22 for ; Fri, 6 Oct 2023 05:45:27 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bd083SuEhaTENUkcFG+eTIirYZHGlIwh+BxxVUjTTEtjjMnot0lcXFBO5OHr5PW9SjCLnYUKVOA1QtdKAYeHIt6x02mYOQ49C96lCAE5C9g6jDkagN2x/kczEpyqWHqNrvODBPkK7V4QiSYNOqScQM0wubqN3Teb/2WzpaWWOzIPwio3iFU/Zu3pkEXwPUVlrOUtSQQyCXUBeTeHbg6AjmXSaKzeOswV1GxVM8Mv96RFbKcNQYRzvfTiQZCIEk7mT6cEhHmLpXP9XQHOikEQpiN9l/A4oOQuUJU54+fqvwtao81UwOFtlVyr1Zv4cM8rPazlLHynfQ1Bko9qOZ6y1A== 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=aC5BYZgwsaas4pcUeEh8G0LCD5QAx7DdAFUTW7WD8p0=; b=CtFu3bXzZiDXs5hXu1h1mzYpDpqiGnVX4Fny3t2lqgYqIMTxw829MOkVGRvM4P0q53BGTYh+YDfdWYZyPKp/1pw03FTpdSy2eLm0KDID+eIXVmGfpq5UIn60VdxNtX/Q2Y5quRxKsoqqf2D1bd5aRhmyr77k1utfToFPwZmC0qO6SlrvjPJP1jh8dV7K71QqrWPW6bXCT47BcodbU6+SzbLZnTXIgkRS7EAV6wxNGwkvRQQvycmGPNbRwzW8An0U91HdWGo0g2kWNjeYett4G1YoxAv+rC1ekXA5N/OUR8oiwrRs4+DEZm9/Q8ZzyDJDYEn2sW25i8rxZUhfmGwKjA== 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=aC5BYZgwsaas4pcUeEh8G0LCD5QAx7DdAFUTW7WD8p0=; b=Bu8YzfXsDF89dxwyc4lR28BfjWoMbI/7sJCshqFlsgyqUKbDi03caGQriGzEX4HGLEmfUbgwFDfJTehii3O+SgPl7lvwIg1cVaAon5IdhMJq0vYsdS7OD6Yn9ntMM1ULCVpyU/WJiAIJ9Da0y/Bt0kzfQJ9l+vE+QXCOVfXmylJAW68j8yKdFOqeVAU0AEVWm0M50sMfKaiOw9aufuzchGm6HD48fPGn0QBLGy6+kc9F40RqZUvdsHuusUH4xLlrfx7RsLw3nQk5/j4Thz37pceR0PHiumUvc+PnTB2UeXrDbkWfrKbMo7c2aa/kSUHIPoZmkiJVJZLutMDR7Blb8Q== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:45:26 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:45:26 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:25 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [AIYArofS1qqsZoPTrywRFcoby9tZmoaQ] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: 5dfe4a7c-401a-4bc6-6674-08dbc6164b64 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b1zpVJngeJzQp+IHtJeEiglY25Mw/UKAfnkj5GS0GuZUFNKn2qJvj2D81yvO0oq4nuudZtOuLR2rHV98Tk/qKPUIIkJZig21zQLzjvGvtNULpS/VKXiMFPbkZyiDOOyv37Th/UE7yjJuAA4FM23/mL3oXQJgCPYH1IL78JyMm+KK7/Kdi95ew/wrdCdup1SDbGAPpjT1b6oILAD0tGl1hyNFuhTDmLh5h7h2hmRTD5R1vb37JilASSLEa3Wosjs9/0ZbqQv+FFFkTMUpdObTjix+Lsy2g9LXMfmJb5iPC1vMAVys9riMt+3sJBEeBHe0h+A0TSPo0tDecnJGKbo2qdbFtfXbQELwauSacad2mwmwnu/CVMnIML18WxEPcEOj9wiSO06rP66PsbJHuR9/1VTpG96nFGcBF2q/9JA1mAm86mLYJL/gh1L7urCRlft6NEepVNqsUTSTcVnRfKUcLiO5InACRjPIEls+ZMJZVLPkbrkTiNR2ymHmY0JiZfb7oN2cUdM77MDwUbw12tZciaiU0yh57cPdkXk4p2wDWrO2yRDvTQrXlk3iJosUBVmud271EknP7wxQGr+AwVVc8eQS4FzzPcpQyQm+MtWl6Mmjp+jFhHsm456rxoSHR/t7 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vqvcnxY4Ld3+b0lQCFFRW3IS9hsFh7eIj2HOITyuaxKzf5vRj16yX+1CSUI1t7cQ+RCBDW47FqBeFubYBcPUe1cTwsY36mJU1WpRMAdfufZWh1zIBCNkQ+KGbioZPYjDFC1OCh2Um7GwBGRCZe06K1ic0Khiyru2bJwhUuewB6BllbjPUsRnurTF+zIqMs8ePCe3qlHtL7VxomDRMLDcSdHxpD+bFVNNN4YvXCgf5OeuVKo+aPkif88aVFN4oKOZB+JNfF8axHHdKBIIfddHdBI8emIvtFyXNmTht+VzsPzm8kDDeZv0WDGGaOoDMsm+qDG2T3QfHST6nLgGtiSRnGrxN/IUpTVSPva9LzemdrnbzgukD8PgGy8hzcr/zAlYZxKl7hseI9sX43yYqhWsj1KtAMKyCGcBvu8B40Kr2H+6UHdRxadxygew9m1sVzhyiocQ93EVVe0yixhlGGU+5sAKsOQVMdP8wNZ1meGnn2ipWd/mKXIrutpOaGheUVBqr4XOx54i3mq53UilYEPotY9YppbLJaRUeMION3fQBMhV6OCvfyIiCd2KQg0qNIHHtkAgYUiDw9WpdavC+NlBS8PBpu7ThpJGlTAH3wVLhDSFy79WFaLDOZ2SGRkfqNAgBuOEwfOcFQ9Xz3kkS1z4LOny9TMCuRbNGVufOq2IFiIwwbBt1rlDtYjmpNbSEqr9+GI1di7mxwDAPEYYztLVYcA2ALCSh6RVBzCH9U/gj+lsfcxVoVExL0uV0E9/b/IMw/i1Dy5XKsCXxg1mgvQJQ/B1pJG7s5to8+CBAmL/ocmAiqj7QLpHpvv402bXo+20pp2u3o/zyFTUv6kml1m+RB6oz5b6AWcN4TcKt/1on/b0WAxT7jNCyyYGnEKTa7eiRZY/Yc87gn5sqVYnHds0waG8KIapNqSqHz4cKZV0vYHe+6NQLe79IMfcOAXZ8m2KT624AM3ByCedtGpF0LUA51H2UKQzLXDGxZEfWC4dnWQmql03GAkjPT39Cy4AuytsvR2hssbsfd+Awzor/gc81TDsKufQdXWPA82wTZeNgvcWPND+KkGtMEQOOsALPaas0T6y4eoyAG0Aa17lczpT9/8jfKqmPsvWBtKTciSGrWlc80bl7NkFcL3hmwXEqc04eh7orSPe0bpwy8ppCQUYCNuZltqPXA1ZGWyfgxWfy+npk1EL1f0th3JRqNYAbNsiIgKjuTCwa2fFK2+Dk4cWWSgZlNANX0jnMGnl1JcEjQaFokv/Zio4G86UYvZDXD/N X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5dfe4a7c-401a-4bc6-6674-08dbc6164b64 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:45:26.1961 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 02/13] avcodec/mpegvideo_enc: Remove always-false checks 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: cabBNGAzr64n In case "!direct" we are not reusing the input buffers (due to e.g. insufficient alignment), but allocating new ones. These of course do not alias with the ones provided by the user, so these checks are always-false. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 6cd9d89e1b..3be6c1f928 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1171,11 +1171,6 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) return ret; if (!direct) { - if (pic->f->data[0] + INPLACE_OFFSET == pic_arg->data[0] && - pic->f->data[1] + INPLACE_OFFSET == pic_arg->data[1] && - pic->f->data[2] + INPLACE_OFFSET == pic_arg->data[2]) { - // empty - } else { int h_chroma_shift, v_chroma_shift; av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, @@ -1220,7 +1215,6 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) } } emms_c(); - } } ret = av_frame_copy_props(pic->f, pic_arg); if (ret < 0) { From patchwork Fri Oct 6 02:46:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44171 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp116861pzh; Thu, 5 Oct 2023 19:46:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhGCfmkSYy29NCr5ldGVrC0tH+re8Wafh+HlRobjv9TcpYmm852E+sUcerX3vOByp8Lr++ X-Received: by 2002:a17:906:7695:b0:9a9:f042:dec0 with SMTP id o21-20020a170906769500b009a9f042dec0mr6776698ejm.38.1696560366949; Thu, 05 Oct 2023 19:46:06 -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 qu26-20020a170907111a00b009a1af6d05c3si1198432ejb.1009.2023.10.05.19.45.45; Thu, 05 Oct 2023 19:46:06 -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=eTggYT36; 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 0458868CB12; Fri, 6 Oct 2023 05:45:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2029.outbound.protection.outlook.com [40.92.65.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3680168CB18 for ; Fri, 6 Oct 2023 05:45:33 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mg+BrWbe60HrPnVQ/0awhoFJoobcWC1o+wcjTNQB4+/oSPI6wqR4npOTPL7fnWaEOIgfongEmDpf0xrcBOzLSnkLoPSq3X7fC9Fwb4Qb6+T9TQajLtzzDN304RYXI/Om9vHtey+m5wgI6r+Nlgmg55CEP/2f0XoWWmxbi/V/expl9P2MQOGNxRpHnFovejB8GNN0XcLrFALz0ukcKejVfkjeM8e6g9nzgVb/bgABoEGwVdqHHYuDNkp0fac0Mo/H9mzjpby9x5gTwBZqoF54kC0lbRg4cW4gygUZIf6LNcceVK9TP3hzgjeCwKb0QQG1WkVodX6j1dH6Nz9Nt4tpkA== 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=k7KM22uqtjZ68BdiT9v/4phX33GD2pAL/6mf57diGLw=; b=CCdbjy7pgF5E4aCH8NTwPPhSFbShLKvdZRvaxl62XFahGQ9u7o5q2AjReFY7h8+CzbGeYd/3ZjUKSPJ3U9kmj1ZagpYUSzHE4C2a4y1XHxfMyiFqp/nthK2QzCqSl5XOvC0QWvvy1gxx43iWSoeRtMtmRiL70zymxyL2wNcRo+Oru0yKUHBNZWPHJ9kWJPtksHvbSt9gr++iPGob2CMY3GMFsmGS8xh8JbVAXDA4m2WTTIoofMdVSEttX2H9YJru07i+jf+kfOGbTCCJJbk6BxCv+nrDY0C0Zj92dTrzDpe1nQgZbWMNCg+hb/dCCX/3jl6/OIDl6Ld2ixmlEoSmqA== 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=k7KM22uqtjZ68BdiT9v/4phX33GD2pAL/6mf57diGLw=; b=eTggYT36jo/tK/5mM0N2uxa8rQlFVPK4uqBYHaHHaCsH6yafI2Cb6UbEQOrvtETnCEXjhKD3AryrM3VlUrFi++6bq63Mq8LpM6EsEPkHWXEJRW6DW6oEgCX787AasjA123UzXKe0GwCjVagSKliJM5DTn2aGlse5AnI9jC8uwnNEDV2edwrfscZH+emPTmXlq+y6tsLnofXoII6TSyQAcq4MJwxbywcuK3PPkT1CbUoxrkew5oI15SnmlQryd8JXtT1CA4vEMoOO7V888Oyzvd61E7+e6kskCUZMXNVWfOaf/4qAzYH7cm4m2IXOJRhTnZQYFOujyBPDE5UZx8Q8VA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:45:32 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:45:32 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:26 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [ejHwPeClI2NOJUK8jR3CtgGT2RXYaF+w] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: 869c6ef0-2b0d-4a59-ae19-08dbc6164ee4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q4v9OjxuagRoSPDpSgGJc2poSpQgfICX5Oo3XntkA3sVtMnaocjftYNK6arbhkDYTe+r1sFuFl0OARJ0RQHFkD/LZrW8psCR2m+/kWKOVwex3MWmiYkGk82EWRbfa3XW8PMOPXEJCUz9T+ik+4mc/R+KYQdpf5LNyFd5D2UloEhEmTlNyTqnEuYncRATOxTpYgZvYoABSB7gNWyLUyWej9pE5jfhe52dBlfmNOKnz92C9wqDZll6dbXo1zJTODdShB/OFwa004UadYuzCnjEthVPRatv1QWiRYeZ/m8OWckR4XqB+OzRF6UoM0GEWRa+vLZsvWEKG3q656pWw7/+liUpZ6K1otGgI/mfpm4ZkS7QV3QBy5YnzGAhN+eifqm9HRH2D/BI50jtoqMCsjYyAA7AWDOYIZLyXVv3MIgdTBMDKM5ItEpPSmdK4Fiw5S1E1kUPlAK0v7JDzraTTJn5z6Q1VyPrTT76lhbpItLNgbWTYX7PEuPRG1fbAEH+M1EYgdcBrqtnHEFqFZ9zBKStsm2/wPsDdpDpdvULPq94F4Q1gIcVdYb59ZEq1k2U27S1zyknanCPA6zL1dmHKNQHLYI98UQyh4GeRU/+neNizL+xyHCcP6KV/SX9krR+Nb0i X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nZrpPItpXAN7xjk0jMwbjYcMU0nFlEJsLoR6C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/s1f8GVXM8DSx31wfPaUOZVvLScLUS3OyaA23uJveZz2GdZSCwgqKuBaBwcWzSXr9tSMzWYzChXhhYYtFZQCTYOLlkUncMI8nX1jULMBqK2OYufHs78ySjBNcF4RiUJraQJN5oPN9eLjAGdEZKfZ2RITvg4e X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 869c6ef0-2b0d-4a59-ae19-08dbc6164ee4 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:45:32.1041 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 03/13] avcodec/mpegvideo_enc: Reindentation 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: KHCLIEJY/w63 Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 84 +++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 3be6c1f928..09b8348ae7 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1171,50 +1171,50 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) return ret; if (!direct) { - int h_chroma_shift, v_chroma_shift; - av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, - &h_chroma_shift, - &v_chroma_shift); - - for (i = 0; i < 3; i++) { - int src_stride = pic_arg->linesize[i]; - int dst_stride = i ? s->uvlinesize : s->linesize; - int h_shift = i ? h_chroma_shift : 0; - int v_shift = i ? v_chroma_shift : 0; - int w = s->width >> h_shift; - int h = s->height >> v_shift; - const uint8_t *src = pic_arg->data[i]; - uint8_t *dst = pic->f->data[i]; - int vpad = 16; - - if ( s->codec_id == AV_CODEC_ID_MPEG2VIDEO - && !s->progressive_sequence - && FFALIGN(s->height, 32) - s->height > 16) - vpad = 32; - - if (!s->avctx->rc_buffer_size) - dst += INPLACE_OFFSET; - - if (src_stride == dst_stride) - memcpy(dst, src, src_stride * h); - else { - int h2 = h; - uint8_t *dst2 = dst; - while (h2--) { - memcpy(dst2, src, w); - dst2 += dst_stride; - src += src_stride; - } - } - if ((s->width & 15) || (s->height & (vpad-1))) { - s->mpvencdsp.draw_edges(dst, dst_stride, - w, h, - 16 >> h_shift, - vpad >> v_shift, - EDGE_BOTTOM); + int h_chroma_shift, v_chroma_shift; + av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, + &h_chroma_shift, + &v_chroma_shift); + + for (int i = 0; i < 3; i++) { + int src_stride = pic_arg->linesize[i]; + int dst_stride = i ? s->uvlinesize : s->linesize; + int h_shift = i ? h_chroma_shift : 0; + int v_shift = i ? v_chroma_shift : 0; + int w = s->width >> h_shift; + int h = s->height >> v_shift; + const uint8_t *src = pic_arg->data[i]; + uint8_t *dst = pic->f->data[i]; + int vpad = 16; + + if ( s->codec_id == AV_CODEC_ID_MPEG2VIDEO + && !s->progressive_sequence + && FFALIGN(s->height, 32) - s->height > 16) + vpad = 32; + + if (!s->avctx->rc_buffer_size) + dst += INPLACE_OFFSET; + + if (src_stride == dst_stride) + memcpy(dst, src, src_stride * h); + else { + int h2 = h; + uint8_t *dst2 = dst; + while (h2--) { + memcpy(dst2, src, w); + dst2 += dst_stride; + src += src_stride; } } - emms_c(); + if ((s->width & 15) || (s->height & (vpad-1))) { + s->mpvencdsp.draw_edges(dst, dst_stride, + w, h, + 16 >> h_shift, + vpad >> v_shift, + EDGE_BOTTOM); + } + } + emms_c(); } ret = av_frame_copy_props(pic->f, pic_arg); if (ret < 0) { From patchwork Fri Oct 6 02:46:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44173 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp116922pzh; Thu, 5 Oct 2023 19:46:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETluZseW76S/etBjiOeeQ6jXWVnVk9/vY71cq4o9ZPgVA/ngDOMEehH9Ku3/slh1J5rcHU X-Received: by 2002:a17:906:318f:b0:9b2:cf77:a105 with SMTP id 15-20020a170906318f00b009b2cf77a105mr5844283ejy.15.1696560376006; Thu, 05 Oct 2023 19:46:16 -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 h24-20020a17090634d800b0099349f9c248si1246850ejb.592.2023.10.05.19.45.55; Thu, 05 Oct 2023 19:46:15 -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=BREMd7Pl; 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 1D3BD68CB96; Fri, 6 Oct 2023 05:45:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2029.outbound.protection.outlook.com [40.92.65.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6502668CB64 for ; Fri, 6 Oct 2023 05:45:38 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZyxUYXcdxPlQFfaRfvzxKKfFV83vgaUmIsJ1474aN452GgAktWBCn0XtRCa0K8w4C9rFPg+JRu2H4gmLc2GEvrfZ3W8pYGIqlnKs/5QNv3KBpi/3zb1XKjHV5kjRooZDnBiBNGxwsGue3TkyERgFnixD5DBgYvaRt5L54f/rcaoDzudRP2wRFFKZBMG0w566sfqDH3eiPWLGev5bzxKNLLb9F6BK27S8BKYtTa6vf8y+qTCIsKZXnTnSWISQZsB6GFmkaXY5hTeB+acaLZvvp9847xqZ6HqQusUBAbEzRyPZdA9thMPFoaR5QgGkzt5iYaQidfnY3jFU78OhLxtPWA== 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=uS/b7vJ9BdWxau/kCie8pbj0tb/n7GkGl/kEJJnVbrY=; b=ilhM0blA8Rn4s6cVg8KUq1kIyfs4Hm7+7Fgjsmzw12nl0k8u4e8ABodwoDizaQJJoEYBgW6GuPa8N6hnOhMnzC22P9+78cPete4avFf20+KtQRpFKoC/QNtGRTpa/erZWMf7QL7WxUcdKg8DlyqrVeEQTXzEgOdhdt3Rg2j/tBvETFVuhiuWstY4XIG5cWmjSdon/NsS58yC4VfKvxlkW9aRT0GhSoc9KCw2oRh6WFMf43NhzNj65qH5AbuBXThlE+ZXBwkeLKi+PUb8+KbXzhaVv/DhyrsgMPUQp4sSCBEqhmvZz6gL70C3MiIPlTWNp0VPjlNIp7pLE3LghCU0Vg== 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=uS/b7vJ9BdWxau/kCie8pbj0tb/n7GkGl/kEJJnVbrY=; b=BREMd7PlleNPCGtExnMa/b4m4rua02C8Qdo1Ie3EtLjMm6rYV4bIEbEf1JT3uzEYfj+9GzVXWP/x/kfZwusO53WFnNQH/Aj7IByja9WyE+ZF8aJVCT6oemUYXy33C1QPRo/vqxX7siBVB6P/jBDO/msCAUDkSzNy7zr6jTLZlUrGb35ryEMChdQ49YXQnxdCyeV2b5HoIjaAizvevQDXza3fH/GHy7EJrNTHXJt2+V9mZhAiHM8sjXgdDlG0Boj3ntHA/+oqehylIuAtBtemH1PjGKZJMKF4GdmZ2h+zWLfOi8i9NqPKozo3WgcdN2FLHd+b+2Tpje9umyK9FLzr8Q== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:45:36 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:45:36 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:27 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [7Eu9iIysWD7ZDxWWIZSPyhuijsxEaxhN] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: c90ac2dd-443a-4202-b37d-08dbc616512c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fwn+I1kFVDIWSUttFZMM99RJm+/L+AKQM3rIeAbOOv3K9qHt02mbHfuoSHBcffgypdkaDvQyJjZ9Vfmh0gad/aBto5NOqu2vue381DwuQOkw/FLwWkb1wXOVJTZqZXvP4pWmgj6Y2/4gmFyW/RnQaLUyKRQYVDctiYcuW1TRlwP6WjyYXxEuxN4u54CV2+mlT1yMqQNxSms44l2ussN+cxz5wyTl4h7ku/q9ryqD5iELTFOvtkLkRsMyi+blx0CF/gAJIUauamLdUM8WQercaxIWs+y8tiOILA3mXvO8GrCu4jeNwjFTOpeUg72x1N0GQWMZsNsmCyuaNm+5rinVgJGp1M/EyA9i4RmfV5snSIidwxDMxmdJYGfJVcLoj88wi0O3wkYbcfF01RfdQrbmBCV5/vlkjrj1bQihJHczmy67/A3Oe6ppRkjrnFI97aThTAgLmHLLZ0F+YdMwSOk2vb7VfkDoGfttjI+HHvEP/iT/7dd98PfqrZfnmyTCOYbgQia9OenumHEAF99vsb0CXLKtE/gWAWoUYLn1MaVCJOY6tVXV8OT6mYAqxCw9ooWqYKj/HkOrwEt88BsklT1LqxWqRM1t25ifEni23hzHV/aGfpgHPFgG/AG8G8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pqpV0F9MMBYBD2+uk6tlHe0k0CwgAMmtv/fyeMUU+v8zUk8HU9dsTbuT/5NbZOLf8n09vzUzB/akvcPo6k03eRcWmsKs9fTjR6gYfbjT4DcwRTWLNX0HQx+DoeC9o0zTM3QA2NWszO/F0WlkDdiPu7bBmcFay1C9TDO0NkJtYqsCN50eUrpfVUqQtGGB71/PKLuf2oG3+ON5ymuQBk9tNDY+45wXxbhp2M64BQuH+QdjSjWouWyxSLobFdAeiDo0c44Al3yZJTNb9Do0oo5 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c90ac2dd-443a-4202-b37d-08dbc616512c X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:45:35.9783 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 04/13] avcodec/mpegvideo_enc: Don't pretend input to be non-refcounted 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: qd2um24fdDN0 Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 09b8348ae7..3b6386e144 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1140,8 +1140,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) } } - if (!pic_arg->buf[0] || - pic_arg->linesize[0] != s->linesize || + if (pic_arg->linesize[0] != s->linesize || pic_arg->linesize[1] != s->uvlinesize || pic_arg->linesize[2] != s->uvlinesize) direct = 0; From patchwork Fri Oct 6 02:46:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44170 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp116853pzh; Thu, 5 Oct 2023 19:46:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5W5I0lnZjexaAGSfCxamfZd4+8oQzkWDzla1R2SUcyc6xeIc9Tl2fk/JEuvqVGy+bzkNV X-Received: by 2002:aa7:dd0c:0:b0:538:15df:d12f with SMTP id i12-20020aa7dd0c000000b0053815dfd12fmr6209898edv.18.1696560364884; Thu, 05 Oct 2023 19:46:04 -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 r23-20020aa7cfd7000000b00534e16ae1ecsi1252288edy.347.2023.10.05.19.46.04; Thu, 05 Oct 2023 19:46:04 -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=mBtERLw4; 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 114F468CA67; Fri, 6 Oct 2023 05:45:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2029.outbound.protection.outlook.com [40.92.65.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A821F68CB7E for ; Fri, 6 Oct 2023 05:45:43 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OqTmmzDQxl5krhFZ9BRKOzK18iwahGpicwGvzEQooWrm+RGuXMPXbn6VTYbN5yw6QwNstDWiy99bs/KP7KoE4KCpKDFQH+JbOmHr964LuuWWGjBkt/vfq4ImWQK8haE3OeXy3/nARl0hM9ZAbwKKMY790oXtXC6/zTOggaH/F04lDcAi9Mvqg0Zx0NVVzn8AQiuExzj78G84sTeJ0T647xaUbaRicoz7rh0o/SDKvZ5gru0h5K2eD4l1G+UXvDmMon6RzE53wzkxACIOD5TcqlVTXGvV2lrXB2OLs7kk2kwjGqZ+ndC9nyRSJF0NlmU8VpJQsfMPM+oRWyTIiT5Spg== 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=eY1HZaptsANDadSkgHtBJjcPUgAOig/aVKnCtD66bks=; b=N/jramTpUbGxtVveCdOtYc5ZiJmHuiRvMJXb7bvW3omq7GoSHXemnN0s6DOdRMeZqqgzp8bUfofyG77UbTYVsfKNDfuc12QGf85HHLOUbM1OLWDqVSNkOSQI8gcdr27FvQL2Urs21HouchLcrebS748al9z/Dr3sKt+l5T25GL+wGgXQji+5Mrfp6nInRgPYd7TXbdcEnD/j1unRIs9Q1FPsRAFJiQyhEjgmEZ/TBPwRpVBz3WSER+CLosuOYnrj/8GKr03syECfRJG3bxkTf2FLskz2ChIKjoVLlhcBhbqK3IOQ2R/Me7Q6U3+3fAbsPzTvlGXvPkBSMIa8TZG2Kw== 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=eY1HZaptsANDadSkgHtBJjcPUgAOig/aVKnCtD66bks=; b=mBtERLw4pmB+EmLclrOMgwetmiDv057CBYjSk0bWx8yyONbGkfrGZhMSAVhDWtsdZSpU4z+AT6xEa26NHQLEzxN6SuSrkzQ+vYRyrXxVIcrwHbG9jfiBDIgxX7VpRabUy4LY+4kX7Mb/201EtSdPjJ8EzGQcs/jUZ+4djanRwlmpx8WooO1YHRUvcY57MbnQe4ggaz6iYvAkoXTfvYOQ76A5NBHF7sf4g84wMzaJdndPhbaRuABE8JuA2KpwCYaHi3ymXbkd3dLduPQ7ZqBDHjAO9rBBPw4rRxGxtcm4xUoPcZ30I81dwazenDkwYHkYjw/B9+8o8WX95UBlHes0ag== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:45:39 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:45:39 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:28 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [uKrmRjrwUvh7w5oIt6xzLvGvED3CNks5] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: 0df72fc8-19b1-4118-44de-08dbc6165340 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0TwN94qy5XGz1AbxJLNbsy2mQKrCPkH8LvM7mKIwJwE+d7GSFQG3AgY1xNYQ3VJ/u1UzN+YW4FZmRx/pYNWJZoGGlmME08lyoh+doWbXzkYRbol0ITGZX5c53FuA0H/ai7JEqOL/Y7xqFOyjngC+bw+Tg3T9FbkiBvdO78meaxXB/rovUeHMt1iWGrXFFbZXX2zzH/v3rxONdewsip72qDgX8rVI64onZXlgd9SgjLqF9WLj5HE2KvtMmjCHAp4hOUnvkC8zw+cpktp8enoAq2b0IyHY0cpftJAQP5609lzlvuBABrP7CkpfWhEmtFfqd+9E0ABYKni42p7qdZpMTC07IYs8a1h79A6Vbvj2mTfnd16vQmISevUnAN8v6kZu6QA07ABORjsG3yUdidPZspQFVZVB65vpRVF24I6VxbV+44cr2FvRD9J5Ity5iRjM1Tcn0LUa8XZbKCMmAIoOPhdhp2fZ7oZuO2rK4evRNrjMOGQYuRoIqSDa5yCwS5Ft/UGgxzhVMVSds1gUWBzlMMyWElZREU6DVKncZ0jOxjBmFTv2r/ezXZ9YfluUNurZbbF0/Y55tZthwG6tjqjkpinHKoe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5qO5Q2zRTkR/g1jkuHjD272CatoZGkOXGKE++U8jUAN52GI2Xh0J7duEh80WgEBPrkot42lB6ai/zor8khxLOuhgybD6R4kZhuj2gB6DcCWWWh+zblSY2S3zsl09mM++sd1oHoiiQvbgETKsFsGejualcOfQn+d6P7/z+DvmAQBVQYGGGx7bEgGv2KJJP94jsG4RzQzoiGDoQhqN1bWkFihVJuIV6uEZoOt9sKbMMdJ+/I/VtdQHO15Ulw9eXmd/0JgXAVf4wGS+2o1lXHwwbLp6Oa1vtFDbylVE X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0df72fc8-19b1-4118-44de-08dbc6165340 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:45:39.3745 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 05/13] avcodec/mpegvideo_enc: Don't reget known values 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: fpbeoMWo//pt Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 3b6386e144..1e0aed8db9 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -40,7 +40,6 @@ #include "libavutil/intmath.h" #include "libavutil/mathematics.h" #include "libavutil/mem_internal.h" -#include "libavutil/pixdesc.h" #include "libavutil/opt.h" #include "libavutil/thread.h" #include "avcodec.h" @@ -1170,16 +1169,11 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) return ret; if (!direct) { - int h_chroma_shift, v_chroma_shift; - av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, - &h_chroma_shift, - &v_chroma_shift); - for (int i = 0; i < 3; i++) { int src_stride = pic_arg->linesize[i]; int dst_stride = i ? s->uvlinesize : s->linesize; - int h_shift = i ? h_chroma_shift : 0; - int v_shift = i ? v_chroma_shift : 0; + int h_shift = i ? s->chroma_x_shift : 0; + int v_shift = i ? s->chroma_y_shift : 0; int w = s->width >> h_shift; int h = s->height >> v_shift; const uint8_t *src = pic_arg->data[i]; @@ -1640,9 +1634,8 @@ static void frame_end(MpegEncContext *s) if (s->unrestricted_mv && s->current_picture.reference && !s->intra_only) { - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt); - int hshift = desc->log2_chroma_w; - int vshift = desc->log2_chroma_h; + int hshift = s->chroma_x_shift; + int vshift = s->chroma_y_shift; s->mpvencdsp.draw_edges(s->current_picture.f->data[0], s->current_picture.f->linesize[0], s->h_edge_pos, s->v_edge_pos, From patchwork Fri Oct 6 02:46:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44172 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp116910pzh; Thu, 5 Oct 2023 19:46:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFTBx8GfNscwgbnPEVxcMQ3M7MXxmrvsx+qQYadpBglTnSDM8NJxW4OQ+wmzXppwFqknow X-Received: by 2002:a05:6402:4314:b0:525:4d74:be8c with SMTP id m20-20020a056402431400b005254d74be8cmr2824712edc.14.1696560374511; Thu, 05 Oct 2023 19:46:14 -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 g19-20020a056402181300b00530893136fcsi1236037edy.18.2023.10.05.19.46.14; Thu, 05 Oct 2023 19:46:14 -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=lWPCy2D1; 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 0CF9B68CBE0; Fri, 6 Oct 2023 05:45:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2014.outbound.protection.outlook.com [40.92.65.14]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D962D68CAE0 for ; Fri, 6 Oct 2023 05:45:46 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N2o2VXHfRDHjjed5V2W6gjiZd9Bhe/t7bnu9ep/evAFrPq0xzJEkIrXqnMqZPeWOtLrU1LHvc4vcAypb5pxdGK1LRbZ/+Jk45xLIm3fAY/fTuGhJlObZCj4rryXziml2EoEGwQm8wvrch4YHZllu2XjlgT0+HwvooWXOYRJjHv4dIMIah9xVdCj7BFSN51XmXq9TmeIPeYInNRlY5MRhArpdYxmZfW4FQrnTu4BPgipz1mAS+n04OXs/+WaFdQ4jrCahK5BFwUiTg5pGEONw4SrF8mK1XWkiYSCdiNWG/MOF/MG2cBfcZzRjtVVvR9nr8lpXuivjPmzx82JaT4TDRw== 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=TswwEcr481qwhQfrgJeA3dQjAiGu2ir+oL7zMBlQ8Bs=; b=IcO9baZ1po+QWuklcbaThtyfb1+bbHQQ2kZ7UQAvztVNJC8LBShyQRwHVBlxQ3XJKlzgWwXi0x31gbPeeVTp1MSSmPuea2PMiO17+jHldHtHxc3Hoaj7b+Bkvy+MqcduYBhzvobwtGEWEbCfl7tE0yMaJXRSTmFPvmi8n0sb5xIE7IJZmuz+ScaY5e/kGgKZNJNqmwQ/KRT2f0HZJb2mNOZWn5NLaCuCnNCiKEvC4kjQRnrPVgYolqbhvHZAtnVFhdN7tTIu9Ns8JUPB65NDnjztrBVV52ZiQUNsgUgW2xVKgcoVasTYSgCFI6RULaUHsjQXFzFLCEXiF5K3siFSAQ== 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=TswwEcr481qwhQfrgJeA3dQjAiGu2ir+oL7zMBlQ8Bs=; b=lWPCy2D1pV+pjHWBkLkjYgHatHGo23igtfSVXMnTjMN37BrrfisiAQyh0STU93SXufMafY+sTTXp3rW202/Ffe/3rVfB27iqkzvG5Y6B73vyd6uVJJJaP67az9Rl4+vR9x+K5XGr6IvlfBK5u6+HsxK76+C0iHZZ10dP9TqJ3IMgqEBjYdNW/VvmP5ofRNgYKOpVF3BH6fayvS5nPsTipcZePQBknsrfGg1VAB5dLcjENs4wmtBYDfGQURuJGR6X7kY3GhsTu1x6oGeNdqj5LjJ0ukuZTjutLycG0RIJyMVGZV4WmYNabdCWVx4SQn6tgogCfGF9biHYY8rJfQpurA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:45:45 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:45:45 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:29 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [vxjxDF7Dt7rIANi9KcfJNMPY6ZkBU/4J] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e07b5ab-2816-4c17-6c7e-08dbc616569a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 80JT47tsx0AgasB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+cef3eecJgKE5EPeV3ytl5anXumfcMj1EoJCl93ePmlivMcyBE6ozJ5VU+w0ksUyyzE3LHEcmwuSqQQG+gdmNSuVqR5czztAy/jiC8SxMg144MNGHTvjlZd/LcryfoOWvnEDFkrDmRlpQqQ/wPVjDQAPmxtAKkTrqRH0lCvGS+bFVO3VdD6lGUuYs06nic7abcJZ//ItzeDaRskmCB7lcYeDEmfP5zfDMneGSb/IBRrI5uuv8MWVY2skgrvjUrUPuVNbiavsKpaRnb3dOvpYNbs6huteTFAG38X7gPPaZG+kJq3Gfef6ciAqijwHsjnkcKVic6UDIupcwx4rdGhVKQKD3AMRqdcj1sSDSD95vswDPW7anJLY9nEMEyabSkq4SdZYQQP2ZS+r3CKlyQaI/diG9ULNWlmO4xMWHN0F+6YnDXvKmmHzHZLrrrK+m4jYQL7OCMfQX8vqJPGeo0x+coIA0W47Qli7iWbY4JxXHFb9u7ep510ZlhrSsEm3LYVQSSDHEFNclZXqL4THCD+sSjHd0zLj8zRaFPOUgavE+acOPo003SdRvP8axKuRTejaLgi57uSXTydSTj1MCDj+/KQo6/OtHekvJyabPz6a/hjxK9ljMnIKO2mTzaaHfF/GEferCDsPEaHOHu6iOrAwXsH2RtwIAR6TSwuHLotTAucKIzcCe5mXL5b1F8Ug2EACGiu0+yamFQ4kafEf+tU39H7gJspnzxjXXkGklQEz3207vPd5YhPH64jOaFvAIBWxZfsm5VtsY+vaWlzPSVnnHn8qBD6psdMENC0dNegwgd18auDy10yzSEy8MRBrPIC+Qxbpk8qO/yJhVdECR0kd2uuLU2inI8YX2HZ3B6exTtROQA461 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e07b5ab-2816-4c17-6c7e-08dbc616569a X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:45:45.0390 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 06/13] avcodec/mpegvideo_enc: Don't overallocate arrays 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: rwUEAzaXDU0T Only entries 0..max_b_frames are ever used. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 1e0aed8db9..c06fdd08fe 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -819,8 +819,8 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) !FF_ALLOCZ_TYPED_ARRAY(s->q_intra_matrix16, 32) || !FF_ALLOCZ_TYPED_ARRAY(s->q_chroma_intra_matrix16, 32) || !FF_ALLOCZ_TYPED_ARRAY(s->q_inter_matrix16, 32) || - !FF_ALLOCZ_TYPED_ARRAY(s->input_picture, MAX_PICTURE_COUNT) || - !FF_ALLOCZ_TYPED_ARRAY(s->reordered_input_picture, MAX_PICTURE_COUNT)) + !FF_ALLOCZ_TYPED_ARRAY(s->input_picture, MAX_B_FRAMES + 1) || + !FF_ALLOCZ_TYPED_ARRAY(s->reordered_input_picture, MAX_B_FRAMES + 1)) return AVERROR(ENOMEM); /* Allocate MV tables; the MV and MB tables will be copied @@ -1231,7 +1231,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) } /* shift buffer entries */ - for (i = flush_offset; i < MAX_PICTURE_COUNT /*s->encoding_delay + 1*/; i++) + for (int i = flush_offset; i <= MAX_B_FRAMES; i++) s->input_picture[i - flush_offset] = s->input_picture[i]; s->input_picture[encoding_delay] = pic; @@ -1450,9 +1450,9 @@ static int select_input_picture(MpegEncContext *s) { int i, ret; - for (i = 1; i < MAX_PICTURE_COUNT; i++) + for (int i = 1; i <= MAX_B_FRAMES; i++) s->reordered_input_picture[i - 1] = s->reordered_input_picture[i]; - s->reordered_input_picture[MAX_PICTURE_COUNT - 1] = NULL; + s->reordered_input_picture[MAX_B_FRAMES] = NULL; /* set next picture type & ordering */ if (!s->reordered_input_picture[0] && s->input_picture[0]) { From patchwork Fri Oct 6 02:46:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44174 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp116961pzh; Thu, 5 Oct 2023 19:46:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcBoHWxE4rKZK6v1FoTwe+iGoLmiF+jl6oiqgtkUWzZiSXU2TdZKdgOd59HRBGaCfzhpo5 X-Received: by 2002:aa7:d8d3:0:b0:52b:d169:b374 with SMTP id k19-20020aa7d8d3000000b0052bd169b374mr5879727eds.3.1696560384275; Thu, 05 Oct 2023 19:46:24 -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 c14-20020aa7df0e000000b005340666a3e3si1176640edy.589.2023.10.05.19.46.23; Thu, 05 Oct 2023 19:46:24 -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=cMUsCUgJ; 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 1966168CBA2; Fri, 6 Oct 2023 05:45:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2036.outbound.protection.outlook.com [40.92.65.36]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6B6F468CBA2 for ; Fri, 6 Oct 2023 05:45:49 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GCbVc8NbLXYyzbzC9xxb/ZGV8JYPIDkZ3y6a8RGxPKc73v4hh6sKbIKnu/djvPTN79bZtmmJDam/Ozf2BciJVh0dGBKEokLskgLMiwDtIGJI3FwQFYhJkNyTgOFwKYx0wWkRes8iuQXrpk4vCrxwc6MuGGK4T/+kjXVp5iDYHCPUFnn38wnIGtQoHPFSTiVfKWo26V/CUSnuYbx1SrUGG/6cUhcWPNuBBm9JggWQL5reenxLEP2CjeWBs63KFPmhdE5FaVcRFrcdTJKFhGxLcOC4cp7RF5jCR53XGffoni6wGvmtGjK34dq33ER3zmw+ITF2+4QZRCH5oGvN3jiapg== 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=R6zMI2tkZ7WdWpZlsQG/NProGBzJpxMgdP4OTP+mhDA=; b=KhL79JgRBasGe7s521+MM7xCQX65ETbxZ4FRhB8LdKg2YExb/Px33DxZlwsQBZoE7UYTKlTsyIFMkqceih1kXPUXdKAkhlwRtvd6dlLVOKuE6qfJ4hUb50jLl4eJiv1L2kcXJwB8zH2yJAETxm9QnxhDjgS+EQVl9MBFO5vix4H63rQFDPrupRV1ylzzmGTxRq2nT/vRXWI+ES0yV4R0T95HRy4wTZe2XO+Bivk03Y2cplQRfjSk2P3u8xfGIxZsMd8WTugS+RfTIfrK+lBXhEjvizOkdERZumOJwoSZ7ellX42Rl390/KMo5LFSG3Z0clohwC2uiYaciZTTXigv7w== 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=R6zMI2tkZ7WdWpZlsQG/NProGBzJpxMgdP4OTP+mhDA=; b=cMUsCUgJUtTyRBCMy9S7EBz9HonVhyPch2LWP03ItyONV2pxR3/higZRgM0kVZ5PIEp49Ih/XDrvlZqWq25opNPZg32ALz0zNAqP4Mhr6/TECEW3TRsRnX5WzNYcDysZBKL53RlqZxW3J3+GLTNT8xkHyel8l3oY13kijnzZp8/N9WiwN1QuOhGqC85OVq+uHktM0j1X3EyGpCOaSgoAZa6JtNre/zwpXI8Y5esOdgMrQpgEIDh8VlSffyEbMW8SUWouDRs0VvLWkieA3SKZu+CFDUvK6wxDC8d7rgRkdFQQRuAVNLmJ7e5DOqQM7nuaVlOLsspw/v5G7+ieJoDocg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:45:47 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:45:47 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:30 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [m2IwSVkpxYTVi7OhEarl4D30MM0uYfd5] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-6-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: dadf3de8-a237-4fd6-0bfe-08dbc6165832 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: POmh/LlKKoDp7RTyu30na/uFPHVIzHevCCXCBXNH1rjo5pCN/yJh75TQ3aAO/E9d6qP3h7Is53ZLtKAAXEp/OPP7uiGiQBN0ANCo9FprteS1x0j3eC9yII5fVdUNvpAbwyzTVYQh30Bn732RElRQCdIxnnGLHbTvgcd6cRe80ghBZy+ptV+GSSSGg2YQA/erj+VmzS3tiZIqSn8BQ+4q42FBpO+t/aEkrxr+s6ylJ7Zh4EcOQCCMalI6WJAl8sbYn2r8Kmco3NTiiSFKQYx0ot90dlYfmgCN7dkoASPIAwben3/0JSab2batnKHkrayOOh7+E8jYbzxNxKE+6k7Mb86t/j45oq6qRgf6t8W78DjeBYXZQY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T7Cpe5JHg6dlBNRFIDQceWGC4BHYc/7i16uOLFdG0Y0fJVg9KtCauXJOvs2+lGDwysKlrBK3QVS2kvb0ynXyS9Wroa9bxIts59yI3UHbWcZSxkqHbE7D4QLxuNEd4e34Nh4pUUzFeP8jyj3kqaXKFQ2/MMh/EOb/yD6Ldu8EXImGoODI97k4iN2n7nH5cC8yHPxbT8vzKHYJ6w/KDv3TQDTrJjWyzd52j1MADLrAM9wCFhOE4nhFSFxiba1hWJJF2sgKwXxUuJruyDNLEit0I/yxjVDPyY2PAJh8qHb8BCLCssKcUMwWVK2FMq0XA5VH7A241nSlJzBre9mWjPNlbQpxhv54336ADKilxjUtvtLI/g1a7J0lXvBSHCvlp5kSezMMH9reOp7JmrH563PpoCiYHDeJhhOg/ZRHN/+JipVxveA9cbayEmP9QHGS1g2GKJ7Q4aCpC00HS9ddvP3g5Vye8qGwGfGxowcjDsGVk/0GzOLKcnbFtjRQIzdwH1uRcdyo8huNtu2dDkKFUKhau7r X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dadf3de8-a237-4fd6-0bfe-08dbc6165832 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:45:47.6598 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 07/13] avcodec/mpegvideo_enc: Don't set write-only properties 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: Tx+EVbNlYBoF The frame is immediately reset in the ff_mpeg_unref_picture() call below. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index c06fdd08fe..9e28304554 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1698,10 +1698,6 @@ static int frame_start(MpegEncContext *s) } s->current_picture_ptr->f->pict_type = s->pict_type; - if (s->pict_type == AV_PICTURE_TYPE_I) - s->current_picture.f->flags |= AV_FRAME_FLAG_KEY; - else - s->current_picture.f->flags &= ~AV_FRAME_FLAG_KEY; ff_mpeg_unref_picture(s->avctx, &s->current_picture); if ((ret = ff_mpeg_ref_picture(s->avctx, &s->current_picture, From patchwork Fri Oct 6 02:46:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44175 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp117011pzh; Thu, 5 Oct 2023 19:46:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IElNxmkXGfxH4ZEMVAbT1W9N2qA8h55Fw7v1+q5oufLTbAv3HnmzMDhbWlwdYWP5ZmWj0Dd X-Received: by 2002:a05:6402:2547:b0:531:14c4:ae30 with SMTP id l7-20020a056402254700b0053114c4ae30mr2952193edb.0.1696560393056; Thu, 05 Oct 2023 19:46:33 -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 c24-20020aa7d618000000b00534993e2c95si1295694edr.513.2023.10.05.19.46.32; Thu, 05 Oct 2023 19:46:33 -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=MWtlsKBr; 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 3943568CBE8; Fri, 6 Oct 2023 05:45:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2011.outbound.protection.outlook.com [40.92.65.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 89F8068CBDF for ; Fri, 6 Oct 2023 05:45:53 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OoGTzGFFwUukw5OWyPsf5p7bsSXM+myOMYiLEHfmeQ38+NiloetEQra51jCUHbF2obWx7mDFwph5FsjlxfN1k9dnXBI6ml1tuIQZGOldlcUgvqv/PW9Qvd9X5tBL00Dz8DWIMcAPPllwP8IdkE8rGvrd/bFrUa10iX6N2cGdQOeMc0l3aUKg6ZRdX1plpPWYBo/oT/SKjWofgCHLMSM7GoVtx4k+D8ycpY42ru2mgncft0V/Rq7+vtJCcRQCtPgFanRqiO0NDWMX0XDW0Kk+OU7KIqv682adtYbsePCoG9hqR/JBw0/0jGjqRIRRsIlBpMXG1QhkvFPkWqa8KvClDg== 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=y5SjIjJTynKEBSwy7NuT7jTmI1jzrxO2FtzkuiUoAYc=; b=hdZo/2yAGOmLun4zD+z/cd0aE9a0N/B41jrsFLZeGHLF9B6D4Wvp4qEHss1jD4s8rQnibDHAQMjvL0LP5cn/0Mx3Yo66KQe7AH2b6EQIPjOY8KQ3Zem1mJ0eO0vw8+seeiMVUo1Dzbwb49ig8oWh2QqdVMS2gV8n5jfRia5AboyUzdrL8yMh72bkRzGozCo/fHtvre8luEL2/3AfTHVvXzurBOXOEk88UkClINpW9XlNqjFfma7j+kxkVBGW/aUlhRDVdIJtqPqDYBowcpy24qZ6LmeMJbi8I1RaXSIR16WkjKZ+Cb/XSN11s2kOQWo2svoroHLxScAioOUYDNGrvg== 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=y5SjIjJTynKEBSwy7NuT7jTmI1jzrxO2FtzkuiUoAYc=; b=MWtlsKBrocraWY5NNxabuJwLUDi2vozyvNbgX9K1RunpsP3pRU+ncPM0rebyciZWoQvCxYpNIRFXoUS7P1WcE34K9jw5dOJ+1HHCqOB3ujeZ+JWtkl+GfAXGF03Euk77ZZPIRsVYWaozYeaPz0o6YJrmPFxTHrO57cIFR3n990mjIHdxd2YfOq/VF2kB2mYUt5GIGHmvC2EhWI4L1T9bAVjswDjvAmMIN/ZsdBPwWQUGhTyR86vcHrredqynk6/SwpXbuO/evEFLT/gFO9atkpGJPzqoWzBs9aJARkkK1noM3ZD3qudpVl+MATojv8r4+duzhqYI/HgDSyv2ORZ8+g== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:45:51 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:45:51 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:31 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [sZi650+2t51Vea6cheWlJmoAqXDgDccD] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-7-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: 191649db-da04-464c-3232-08dbc6165aa0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vvcVbZ5c7KgyFCAb9AofeCChvUUzxigiRx6vycIHGWixq4D9u4U3lryHE5xbXhthiPoBo4o2eZDIwu+xzw8lJHfagR3001+6GMcZ/Sgo98+kbMzSJsLY/o9MlBEKWDVyUMRgQKakls3LdEo4ZI/jWL9W8U8YqFbpGmXPIc6fdFEd5lnOacG4PnaFiJFaMQhLjl5s2UD/bKxU2dMwL4pZJ+8JFlQ0/a/gwn+U0uMDrCPgYINeESUUDBgvGNh5fQbUGEoqo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Ldjrxee0DSNy4d52jk4MCAHPetpdfECpULrsGGajQGP81DZFgxfOv7pcKYi2rOWDqBu3n7YvOdNRPx/Is1j99OHu24pin7ItgaKVrRpIyuxgOrbz7SgCsnx1KR6NqTEB/eg6K6iWuBtY5NdnN/BuQjAR9YcEF0B3H20JgAB45nk6YZCNv4PHCinJ3TFQxZhgSexT7O49uvqXFCCm3cTAokone/t+re4IgPchu+oKrZkrbyK00/3agwe6Hii5s3aEvWjw+7TKX7NX/V19Vuw8Zu+pRvQnfpGUIuMj0LRz8w49+Dn05dnT9hVXI3O3HLCq7ipcIvBjNn7zFm9G5oDOjkmHhlUnzkKU9p5qlAF7jh/Z8Jh4qsWSiOVOx0HEcI/P7j83Td3kYASZxhV9Nz5h3zsLp02yFr4hBmFeMG2fxWsb9BhpnVnrc5xNcweA2rEnehRZaudTH4G5yHJZSVNOFV7DEP9w98jge6quPqfcrrAkGEASkM2KXqmMWL/OunQ0CtvDtzNCcgMkDoGfralz6Z5K5WAN26s8gBxpexi0JL0j9n6mOZ7kVKLcLIMQw5gQmcNJ8NF1a//FB/dPrVsCuTjyVNd0/wfnNoizgHzYsxT+P6QtjvSXwV4MqoPQB0SHJ/jMLH X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 191649db-da04-464c-3232-08dbc6165aa0 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:45:51.7461 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 08/13] avcodec/mpegvideo_enc: Remove dead block 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: /CmbRPvg8La1 None of the mpegvideo encoders support anything but coded frames; and if this were to change, it is unclear whether they would need the adjustment here. So remove it. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 9e28304554..5dc95ef309 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1724,19 +1724,6 @@ static int frame_start(MpegEncContext *s) return ret; } - if (s->picture_structure!= PICT_FRAME) { - int i; - for (i = 0; i < 4; i++) { - if (s->picture_structure == PICT_BOTTOM_FIELD) { - s->current_picture.f->data[i] += - s->current_picture.f->linesize[i]; - } - s->current_picture.f->linesize[i] *= 2; - s->last_picture.f->linesize[i] *= 2; - s->next_picture.f->linesize[i] *= 2; - } - } - if (s->dct_error_sum) { av_assert2(s->noise_reduction && s->encoding); update_noise_reduction(s); From patchwork Fri Oct 6 02:46:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44176 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp117071pzh; Thu, 5 Oct 2023 19:46:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHA8zwcTUHmbNZ2lDjyjFhXdHnVguHbEwiaXucdP2aTNtpGatfAXf9GESsCTG2ewOCM6U14 X-Received: by 2002:a05:6402:14c4:b0:52f:a80b:83c9 with SMTP id f4-20020a05640214c400b0052fa80b83c9mr5911984edx.31.1696560405325; Thu, 05 Oct 2023 19:46:45 -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 w13-20020a056402070d00b0053828f829d8si1235349edx.365.2023.10.05.19.46.41; Thu, 05 Oct 2023 19:46:45 -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=T5HBpm3U; 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 2A0F168CBD0; Fri, 6 Oct 2023 05:46:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2053.outbound.protection.outlook.com [40.92.65.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5E9BB68C95C for ; Fri, 6 Oct 2023 05:46:00 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kG0L9l3cdoBRTcze+SVYpEesP0F6jb16vtE8oDTlJavKPnGLnXmARSe8fiAbOtefh+WIi2pwCL3vsWikmhNk3qTsP9117wSscgWsXttdi7do9DO0RS9mRqdoAWxMLraqHU/YJTiDmdeP0p5BWQusjhpvLeGHPsWi6goyhvMNHKkBKSgYh6BwrOCVeyxLu2WHyidL1LWCusNqg+TG4rUbLnubrWU8SZ2szPRX30bzHdi85E3ItZcm/RKuXqQpKwfG21HmeljGwsBY3Aux3hi3Tz4q8tUb8OmeyAlL6b0a1Zzc+YAekxCKCTOXw3dzTaD3lkUlweWz9GUJUUk6JCMC3A== 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=l6IdQ8wi+6Ww28byvUa6ZOU2TTxWEAYPUbzLkV/7mUs=; b=eMzYqeMmFhMUxRGxIqNm6Xz5QETTEocAzZ3wP5ttKhy1Nw55iPOPq4koDFywr3d9y/A0cnPCLjHNkjRMs2+E7H+oyVWc4c3i3A1fe/HBhYzZmA1pksnkLOcHRRJKLS1wz4D7ODYpsvDyAkll8pZPKEpY4REKT7vJMd2wgm1p5lLLE2ssjEmLccQ4AqQAv9DGjd6VqeRA4Lv5ZSy3rhNd3xmaHzeJJlTND4cEVg6umZW843q0UGlLQAeD8UvkejlxvKgf67I4mC+uC3jnYbukrgiGYylGjFnxhFvNN2SFar+OIVuVig+8rhekpVhaHIEUhFDgC/YICTy3KSZWAfajHg== 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=l6IdQ8wi+6Ww28byvUa6ZOU2TTxWEAYPUbzLkV/7mUs=; b=T5HBpm3UiDhv1Z+ZeIM1+fNmmezVkxYFhvCd/kpku06GJWc6CneaLrGymryPOzd3lknWK/WI/A1KqjFg3IEJB2j04CSyDbGgrsMhwKBzGtNveg1MEUdLaN+I5deVlp9yEJkLCS0VfNSLTKol9sfw5aPXwL5Wi/8do5+EeAdZH6MyQ3EmKva9I1Ji89W9f+TY+VAzIxdCKtS8zwzxjjDvJs8fiKRUlZ1X0SZ5TetM7om0RBi7k9WsqkVYvhtthSQG+4qMKQpUnX4qNjbDdMbpHHv3bS2V5Ha2zApNHPQHTI2LltdPhJ5f1JLlH8R5RdDjsIIgK8ryoUdRvH5uJJTLZw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:45:58 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:45:58 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:32 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [0DmevPzOpsuLX7EBXXumGPnX4zh1JxYa] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-8-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: 08eb3b80-7d35-4565-fa17-08dbc6165ea5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rF7U3ZnboKrj5q1ZQJCe+21j21gcMQgaXbKN+qSHdyI1XGiq9gmCMAzUJV7wbJ12Km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3w2u8z4AXF8nQkRIXg8zokA08+BRzXfcyi+18Go2Qg0hkTezcMuEmZmXmdZTHL+Ujb2KnEMheuV3ibSJstXesPOhC6tvUoHBxVjH3FZjnrB7doKTKiGymL82TKyxzfEU3zmk3/xT6aBX9fe6s1mrqg/O2YmWKx1PFdXqN5KOgnwnF7+9KCZDGPatrKxgFMxw/3Zv/8NOT/byLLvkWwpvLpkeI56oniCjjK955WQiLl3doph5/8kHjyaOy4VG+4s5OkfD7c/6fzbV9a2kwyoivVOAhVhjUvR94YkEf2LXvpRX0Gj06g3RdfKJi7+whhqh+Q4IAaGTcI0fFouvWFnQA6PRbTCJ9m5l3by9AfmN/ddpTpld0lV/1NXL+gW0iF3UR3ctenXhuEeKIBlTkWZ9rY3YyBYFJP78NU3e8BJ8NzhCkTZ4ZOWJH1Kjo69qO/K146q1fn48h7X0puA0xMY6l/Pqs55IspR/rkqbEV19d/b+oIthosk6t/Q3mFzQ193swB9OzOj34z89QTBniHbQpijlUZ5SwHRc4G2AK7IFlpqumozUmmw8aDMzGOVhjhMG1ymUjrL+2OVWr6X1y5JuOMfSNhfmYuxqMhNgfgrtuChPrmIfvTHjBJVIZsSaBaKR7Xmd0IiqsoFciIfh5xJtRfp2KF+7LEGOiWeoPzhfWkTmv5N2Cwx2FbinSyY2gZCJwNO5On1k3/ljZk0vYpohCf3evkmYisLSVC7i0rte+ucanb4hg32Zvxnr7jMB//EKyDuE2JrhoAHjJCfpU8/1cG51kawGQ6DR/Z/0NdEi8vj0v026CCRf2TtmvBpqj+j843paIuePRW0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 08eb3b80-7d35-4565-fa17-08dbc6165ea5 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:45:58.5326 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 09/13] avcodec/mpegvideo_enc: Don't allocate buffers 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: +UEEdMT2I2Sq ff_alloc_picture() performs two tasks: a) In most instances, it allocates frame buffers and b) it allocates certain auxiliary buffers. The exception to a) is the case when the encoder can reuse user-supplied frames. And for these frames the auxiliary buffers are unused, because this frame will never be used as current_picture (and therefore also not as next_picture or last_picture); see select_input_picture(). This means that we can simply avoid calling ff_alloc_picture() with user-supplied frames at all. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegpicture.c | 7 +------ libavcodec/mpegpicture.h | 2 +- libavcodec/mpegvideo_dec.c | 2 +- libavcodec/mpegvideo_enc.c | 16 ++++++++-------- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c index b7c804c8ec..a0f5181325 100644 --- a/libavcodec/mpegpicture.c +++ b/libavcodec/mpegpicture.c @@ -247,7 +247,7 @@ static int alloc_picture_tables(AVCodecContext *avctx, Picture *pic, int encodin * The pixels are allocated/set by calling get_buffer() if shared = 0 */ int ff_alloc_picture(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, - ScratchpadContext *sc, int shared, int encoding, + ScratchpadContext *sc, int encoding, int chroma_x_shift, int chroma_y_shift, int out_format, int mb_stride, int mb_width, int mb_height, int b8_stride, ptrdiff_t *linesize, ptrdiff_t *uvlinesize) @@ -259,10 +259,6 @@ int ff_alloc_picture(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, || pic->alloc_mb_height != mb_height) free_picture_tables(pic); - if (shared) { - av_assert0(pic->f->data[0]); - pic->shared = 1; - } else { av_assert0(!pic->f->buf[0]); if (alloc_frame_buffer(avctx, pic, me, sc, chroma_x_shift, chroma_y_shift, @@ -271,7 +267,6 @@ int ff_alloc_picture(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, *linesize = pic->f->linesize[0]; *uvlinesize = pic->f->linesize[1]; - } if (!pic->qscale_table_buf) ret = alloc_picture_tables(avctx, pic, encoding, out_format, diff --git a/libavcodec/mpegpicture.h b/libavcodec/mpegpicture.h index 7919aa402c..a04820237a 100644 --- a/libavcodec/mpegpicture.h +++ b/libavcodec/mpegpicture.h @@ -86,7 +86,7 @@ typedef struct Picture { * The pixels are allocated/set by calling get_buffer() if shared = 0. */ int ff_alloc_picture(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, - ScratchpadContext *sc, int shared, int encoding, + ScratchpadContext *sc, int encoding, int chroma_x_shift, int chroma_y_shift, int out_format, int mb_stride, int mb_width, int mb_height, int b8_stride, ptrdiff_t *linesize, ptrdiff_t *uvlinesize); diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index b4ecb56987..07febcfe55 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -236,7 +236,7 @@ int ff_mpv_common_frame_size_change(MpegEncContext *s) static int alloc_picture(MpegEncContext *s, Picture *pic) { - return ff_alloc_picture(s->avctx, pic, &s->me, &s->sc, 0, 0, + return ff_alloc_picture(s->avctx, pic, &s->me, &s->sc, 0, s->chroma_x_shift, s->chroma_y_shift, s->out_format, s->mb_stride, s->mb_width, s->mb_height, s->b8_stride, &s->linesize, &s->uvlinesize); diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 5dc95ef309..26a596430d 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1090,9 +1090,9 @@ static int get_intra_count(MpegEncContext *s, const uint8_t *src, return acc; } -static int alloc_picture(MpegEncContext *s, Picture *pic, int shared) +static int alloc_picture(MpegEncContext *s, Picture *pic) { - return ff_alloc_picture(s->avctx, pic, &s->me, &s->sc, shared, 1, + return ff_alloc_picture(s->avctx, pic, &s->me, &s->sc, 1, s->chroma_x_shift, s->chroma_y_shift, s->out_format, s->mb_stride, s->mb_width, s->mb_height, s->b8_stride, &s->linesize, &s->uvlinesize); @@ -1163,12 +1163,12 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) if (direct) { if ((ret = av_frame_ref(pic->f, pic_arg)) < 0) return ret; - } - ret = alloc_picture(s, pic, direct); - if (ret < 0) - return ret; + pic->shared = 1; + } else { + ret = alloc_picture(s, pic); + if (ret < 0) + return ret; - if (!direct) { for (int i = 0; i < 3; i++) { int src_stride = pic_arg->linesize[i]; int dst_stride = i ? s->uvlinesize : s->linesize; @@ -1595,7 +1595,7 @@ no_output_pic: pic = &s->picture[i]; pic->reference = s->reordered_input_picture[0]->reference; - ret = alloc_picture(s, pic, 0); + ret = alloc_picture(s, pic); if (ret < 0) goto fail; From patchwork Fri Oct 6 02:46:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44177 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp117138pzh; Thu, 5 Oct 2023 19:46:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGA+UaKLmXuV6HuWwNgZfpUtT9HS17czI4NwoGXQb2asfp4CGulwpsXumvuwCsWK8U8v0GP X-Received: by 2002:a17:907:77c9:b0:9b2:6d09:847c with SMTP id kz9-20020a17090777c900b009b26d09847cmr5697848ejc.10.1696560419659; Thu, 05 Oct 2023 19:46:59 -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 i26-20020a17090671da00b00997c3561696si1247653ejk.577.2023.10.05.19.46.50; Thu, 05 Oct 2023 19:46:59 -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=YuZYMzOv; 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 AAE1968CC4B; Fri, 6 Oct 2023 05:46:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2025.outbound.protection.outlook.com [40.92.65.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B65AF68CBAD for ; Fri, 6 Oct 2023 05:46:03 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FC2byv0eNX+oIU/ciO9wmdX6GXs4/vbTRtou7jpaoGWEaytwMGLtl4ipxfoaJE2V+gtYsHoU3vbPayM/oQGtlHYsczuF1TfhrUdLQSfZRV6FYMEHFMaZ2pO2CTwB66k8M9SYog1X97ug3rKA6QIOaQr2QUif1cLsSV8biO/dveqP+hwgra0ve7swLqSJ8TntmSIMNMTdUTnpJfgvgim4T82RNKa8eWnWmv539vJrtf/DeKSFgGyFkwGTiwkZgWTZpAc1BTI2b6Gnij7W51uM7O4uGThBzeeI/5tkGsCBTS9XJJ7SDimx4xgcA8iMGyN5Vbd02Vae6ww8C6YGo5nIQg== 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=T/xZgOPfjYUNX/nrkPfzkPhkUvu1G9no6C+7ciYFnjA=; b=M0/P6/fHdHK0EAuGYRgufupAVC987CF6R/hdQb/tIbSPOw9SgIQzeGwMtjSwNYnI4N4jjM0GqlmlhdFuemkePd6X0q3k5PoCzOfiUDXQTIoTHdi5RjvjHcwa8NVBI+ZNP2KLAfrHwqJ29zDJn7+QnaDELbwKsRxErVAN8Kwhm6SoIFuIAMiVDOSd48L5j59crdtMlpnSggclcH2ASmRUGFWXwktXNpGkzCJCS6G7n2Wdyefs8RoLKwwjVr/IoY7sUL2SuRYjMOk5RhEpjCwRBWHylyg2x7lgLBwRzeDwnOJioA0d99hwR0L+HX/L4YTNXdVR3xoB8uFhTwxKsuXwjg== 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=T/xZgOPfjYUNX/nrkPfzkPhkUvu1G9no6C+7ciYFnjA=; b=YuZYMzOvR9uSvonRw2ZzQpvf79VdTPnm+7peUj837gO90NNo8RCctz8o/LkBs5d36tncZIvMY6JLbJkfjmQtn5XmUVIc4+1juSs19Wh8W0RB1QN5jk5XXYGJEqjZCb/dLWnXGHPwr3UfFFA7dhVlEmoS/Agsfb3H72CUIUvnF3kAoopMgrozSqDofoxszWylzB7YLoL2t1WWIQgFyD9oN5bSbAg6ErSv7US2OgTcLvpMmiBcv4X5OGb3Y5SAc3VT1EEEhmBVgU3Ee9Phxn/HiFPmbzMFnaWbp7ths+u8313rGT8xA4ogRK7oX7kBvAVDiypoUjTRH5GdDSaHSbkF1g== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:46:02 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:46:02 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:33 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [v2OVCND4NSEiUw7cmWBgsS0rmxKNXjkY] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-9-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: 3114ca8c-33aa-44e5-74d2-08dbc61660c5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R0FU7Dtb6Q0oPqQLfnkTcQ2GQ7YuHCvsxGJSNxhPgzj4TZvpjd39JKQLN6JYZLpyWmhQ6OeUFBQTtFKBPmEdk/V4PlJMFZfvWB1c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vKVpSS1uj1PFOYkuf+lPuB4xL/iDCFDvtGxFuYs7bK47hukRCAVWmemiDMbqmEA288IJ+EgJCKyZAlN9BthccCg6NtgEi9PnrT+ebIWPA4m1V/9ndSZ4cpepWnCld87UYjq0mPXHWV7TKPA9PmhmNQuKbKNwLc1jcm1FfGnI5hv8ucW0+4/zLqudX3ZjkmYHoO0+mkpZ82kYNPbrmcyFF0Q4IlMFaEcmqqarkUtLc12eXVM2JFnc1zGcw2zG5pZkT0R5PFgs08WbNesY7ZvIR5ROZKBhn9aZQ1LfACpv3tK5yR+rKfP4uKR5MSJqkrsQmW4pJApVB8HlaS59Qob28tPhMZ0LLJIjAvR54F9LHNYc1S5uDvmBtxCAF64khsJqNtfPQWW6Obs7fiIdWrYwO7H5g4OS2cAqC4amMnluLUHFuIQ//c5e4YqIbW2dSsITFSc8lRHPoJV1uLfWiEZXslKDfWIMI7WL09xQX/w7IJCJRClr7r+x10qAAV2TUIznE3X3SSpGrWIE8oc6Ui4ywtEfVz7eUnainXp0IQ7SyN+a7L2hZVXmHvmob7roNcHshEunmnKx8ZsIzDbyQgqwK4dFt3JKcNSDNZvNFJ1uLeMoB+/yGSgH/sQ4Td7EtuOBqByQkFhGgi4PmZi0gitvl0nLWKN9N++Qjzf2l4Pp7G0Y/nSbAPthm1EcxoCDfjqD9DAGR0PnZnX2u0KUhiaTQFZ1GeRjkGXSvdDs6oo+P9lo1957TAUE7Ryg+9WffanQfu2oSt5rkDjoj9ah0RZ91TU+dda0IUe1ZPwFJY X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3114ca8c-33aa-44e5-74d2-08dbc61660c5 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:46:02.0645 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 10/13] avcodec/mpegvideo_enc: Don't call av_frame_copy_props() 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: GD8aaHX0wYPf It is unnecessary in case of user-supplied frames, because it happens directly after a av_frame_ref() with the same src and dst. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 26a596430d..cb6b801b2a 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1168,6 +1168,11 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) ret = alloc_picture(s, pic); if (ret < 0) return ret; + ret = av_frame_copy_props(pic->f, pic_arg); + if (ret < 0) { + ff_mpeg_unref_picture(s->avctx, pic); + return ret; + } for (int i = 0; i < 3; i++) { int src_stride = pic_arg->linesize[i]; @@ -1209,11 +1214,6 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) } emms_c(); } - ret = av_frame_copy_props(pic->f, pic_arg); - if (ret < 0) { - ff_mpeg_unref_picture(s->avctx, pic); - return ret; - } pic->display_picture_number = display_picture_number; pic->f->pts = pts; // we set this here to avoid modifying pic_arg From patchwork Fri Oct 6 02:46:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44178 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp117139pzh; Thu, 5 Oct 2023 19:47:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxzzpnTZlGOPiZz964ArDwSlQs1FV8rRD1QvCsKxCdnpMT0bUbvWhgaux2+79E+52aNPV0 X-Received: by 2002:a05:6402:1651:b0:538:26b7:a525 with SMTP id s17-20020a056402165100b0053826b7a525mr5830301edx.19.1696560420271; Thu, 05 Oct 2023 19:47:00 -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 t6-20020a056402020600b0053402a7ecdfsi1285534edv.552.2023.10.05.19.46.59; Thu, 05 Oct 2023 19:47:00 -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=pW5A+B6+; 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 CF24D68CA90; Fri, 6 Oct 2023 05:46:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2011.outbound.protection.outlook.com [40.92.65.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AEA7A68CBE9 for ; Fri, 6 Oct 2023 05:46:09 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aMnrYB41JPWgLVMLvqQn2k8ZPJ0M2m6jp/nDcKGcM7w5tIpHUp9hcWv8FP/Ee9rmFl5VNxTbfVZQaRySNOdZyEYPVk8lznMCGqUH1n6U71ihYslC8cnw2bOAP+ZrFzm4PMmPI9Sc5P5DjS39QM7v6IYv1zaS7WxUxQhPrcut3TJAtyHU6zoNZxQf3clJxl6sfMRUPpnsZn1+zX3tdp+y9d6pdvXqwxhNlvjokTlRFE62uAY/0tgnkUQY0dnBltF8CU2ECgBtnXeJLH3ftXXkeH+/Ifl5lnNwc+7SmmCqhW0BJQkijobEKBLYrRUoLBP6UXywmsAY5yd8JUNDkgJaQQ== 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=Jpwmf588koEJ3w74pv8MsURZ7PW8AsVOZezbYW7txF4=; b=m3nwZkW+H7lGW3a7Nm9utHml4LEDKqLekr6W+pgSGaD08M8T7HuNNZhfu0jCSxOS3cND4zw1wdxOcTMRigApUUDWksVx9fjLMg5B9FpVjddJbqzVgM6QnPF5svwrKFK2D3gSuOZuBZN9ZtaPEbciVv7krW9wgWfUPeHxguFfMtXVsKZxqGd+FSq+Qs7vXfEJPuRYfGG4kGC4Xp1gBhDEBOhIvk4eyt7IrKxmelvtoVjihKO36zydaxI2/zo/z4KBpAvUcnIXqLK+oWCedqq7SpsYmfQQX0cv+KgbrAM5T6trAEKlfpbpNMwD1GLEx4wZL9VSO+hJlSbjxIAAUnH6SA== 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=Jpwmf588koEJ3w74pv8MsURZ7PW8AsVOZezbYW7txF4=; b=pW5A+B6+nzOoz/n7EhP26xzopBvoVhLyQf9PQMAPPMc4GPCVyGvLaBN+ot8NuzsjDerLfgz3/fPQqCtGbmFdJagAEGVEpxGA2HBpgZJ4V70edWcCNM49fY6GwOWiLWWBt0sRYQqNElh9wnvK0qopxrZejbVfUe2LFE116EAyM/1Zadj6z1lTFkLuPKNpIj70KFUzJdN0+6MY33Xoby2OphRus+/Z974dU97sDExoTQZ1cbVC2kjB92LneMa8F1Keujq34w+sB5lv++jTPFPdhU9A5jqSJxQUr1jrLgyZR8B93uwoMoSPwkOCQWWhD7+ZjXcw4SMH1RTlRo0drfFKRA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:46:08 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:46:08 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:34 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [uwBllcxIZuHH+hNl8YZySejkJpXHZKXq] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-10-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: 109e2688-03a3-419f-57ac-08dbc6166481 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U3srwfOl0PSXWkgB34OkElZHpdLjwfEbhXDh6f9u/Imzfy1Bdi+pSiQ0nkW6npE+xMpXTaJoW5bx4CJMWlGaJ8WzDDbzY/uCZCH7GBmSZBGNGW2Srn+LqkiGGuTQvSNxeCv+ImXC5QM+5ih/2zVe348bdNZvqoj6eQYDnjxXu7yzRGaas6Gu+Fgv5Sl0/AmKCdeMkHnSH+uNPpk6PTQL5kAZsloRQgj4oXHi1uj+Z1evTk6yzLL80/Dc7R9jDmcO0Sqvz+YMQtiqZDf7DVZGNpdYwJajv8RAwcg59MVqvx5OfMK8+cMj8E1x5oguPHiGHH+9IWH0b8NHhCR1ztrsNcYR6wT3H0PfLZV/C2OiYE5cLbnXPspvtDAumUdoTmo4bKUdHIWUG5trPVIayrc4snIJSA780nr6i9ngNCUzrIa3IA9b7+RoBkhRHX18LNMtLIbJTgUMaHIN7q2TrDp7gBxUk0exP6Pzt9fIg5sOpnNuRGcdlUC2kyQqrbVuPusO3/bwBbuiTHz7DzRDPDayp151LKbFD98vnV9KwOqe90+fDP4Aqo4q1k4DkKPvc6DnuY3eS01b2NiOe6w5A5aEUd80T7Xhhn2CmPJcbRjXZ19aEX3OHDnBwkYVsowNeP8x X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dR0J/aEQs7I2bVfS/LtSb1s6IlFYSbcbpCKaEqJu4ZvBMwBTjtQM7ehWxB4uHXqT2/0cGPeMmQI8DWImf0h+HOuH1Os8hQCZiO5xN0KjaPWQ9+vpwBU/5bOH2GVuIozvKuyZ0p5ZKrT4DXznkhJ21vVo/K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mVFSQm3uSH+pOrAOMlR8mwWkssubjwrFtUsYKa5C3BgUtCE9oRswOy X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 109e2688-03a3-419f-57ac-08dbc6166481 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:46:08.3156 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 11/13] avcodec/mpegpicture: Move caller-specific parts of function to callers 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: d9NxXtlJlPtq Since at least commit c954cf1e1b766a0d1992d5be0a8be0055a8e1a6a (adding ff_encode_alloc_frame()), a large part of ff_alloc_picture() is completely separate for the two callers. Move the caller-specific parts out to the callers. Signed-off-by: Andreas Rheinhardt --- I know that the name ff_alloc_picture() (like lots of names in mpegpicture) is no longer appropriate; I will fix this later in rewrite of mpegpicture (soon...). libavcodec/mpegpicture.c | 72 ++++++-------------------------------- libavcodec/mpegpicture.h | 6 ++-- libavcodec/mpegvideo_dec.c | 31 ++++++++++++++-- libavcodec/mpegvideo_enc.c | 22 ++++++++++-- 4 files changed, 62 insertions(+), 69 deletions(-) diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c index a0f5181325..44c4c8fe93 100644 --- a/libavcodec/mpegpicture.c +++ b/libavcodec/mpegpicture.c @@ -26,9 +26,6 @@ #include "libavutil/imgutils.h" #include "avcodec.h" -#include "encode.h" -#include "internal.h" -#include "decode.h" #include "motion_est.h" #include "mpegpicture.h" #include "mpegutils.h" @@ -124,57 +121,13 @@ int ff_mpeg_framesize_alloc(AVCodecContext *avctx, MotionEstContext *me, } /** - * Allocate a frame buffer + * Check the pic's linesize and allocate linesize dependent scratch buffers */ -static int alloc_frame_buffer(AVCodecContext *avctx, Picture *pic, - MotionEstContext *me, ScratchpadContext *sc, - int chroma_x_shift, int chroma_y_shift, - int linesize, int uvlinesize) +static int handle_pic_linesizes(AVCodecContext *avctx, Picture *pic, + MotionEstContext *me, ScratchpadContext *sc, + int linesize, int uvlinesize) { - int edges_needed = av_codec_is_encoder(avctx->codec); - int r, ret; - - pic->tf.f = pic->f; - - if (edges_needed) { - pic->f->width = avctx->width + 2 * EDGE_WIDTH; - pic->f->height = avctx->height + 2 * EDGE_WIDTH; - - r = ff_encode_alloc_frame(avctx, pic->f); - } else if (avctx->codec_id != AV_CODEC_ID_WMV3IMAGE && - avctx->codec_id != AV_CODEC_ID_VC1IMAGE && - avctx->codec_id != AV_CODEC_ID_MSS2) { - r = ff_thread_get_ext_buffer(avctx, &pic->tf, - pic->reference ? AV_GET_BUFFER_FLAG_REF : 0); - } else { - pic->f->width = avctx->width; - pic->f->height = avctx->height; - pic->f->format = avctx->pix_fmt; - r = avcodec_default_get_buffer2(avctx, pic->f, 0); - } - - if (r < 0 || !pic->f->buf[0]) { - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed (%d %p)\n", - r, pic->f->data[0]); - return -1; - } - - if (edges_needed) { - int i; - for (i = 0; pic->f->data[i]; i++) { - int offset = (EDGE_WIDTH >> (i ? chroma_y_shift : 0)) * - pic->f->linesize[i] + - (EDGE_WIDTH >> (i ? chroma_x_shift : 0)); - pic->f->data[i] += offset; - } - pic->f->width = avctx->width; - pic->f->height = avctx->height; - } - - ret = ff_hwaccel_frame_priv_alloc(avctx, &pic->hwaccel_picture_private, - &pic->hwaccel_priv_buf); - if (ret < 0) - return ret; + int ret; if ((linesize && linesize != pic->f->linesize[0]) || (uvlinesize && uvlinesize != pic->f->linesize[1])) { @@ -247,8 +200,7 @@ static int alloc_picture_tables(AVCodecContext *avctx, Picture *pic, int encodin * The pixels are allocated/set by calling get_buffer() if shared = 0 */ int ff_alloc_picture(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, - ScratchpadContext *sc, int encoding, - int chroma_x_shift, int chroma_y_shift, int out_format, + ScratchpadContext *sc, int encoding, int out_format, int mb_stride, int mb_width, int mb_height, int b8_stride, ptrdiff_t *linesize, ptrdiff_t *uvlinesize) { @@ -259,14 +211,12 @@ int ff_alloc_picture(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, || pic->alloc_mb_height != mb_height) free_picture_tables(pic); - av_assert0(!pic->f->buf[0]); - if (alloc_frame_buffer(avctx, pic, me, sc, - chroma_x_shift, chroma_y_shift, - *linesize, *uvlinesize) < 0) - return -1; + if (handle_pic_linesizes(avctx, pic, me, sc, + *linesize, *uvlinesize) < 0) + return -1; - *linesize = pic->f->linesize[0]; - *uvlinesize = pic->f->linesize[1]; + *linesize = pic->f->linesize[0]; + *uvlinesize = pic->f->linesize[1]; if (!pic->qscale_table_buf) ret = alloc_picture_tables(avctx, pic, encoding, out_format, diff --git a/libavcodec/mpegpicture.h b/libavcodec/mpegpicture.h index a04820237a..1c1e5ddbd1 100644 --- a/libavcodec/mpegpicture.h +++ b/libavcodec/mpegpicture.h @@ -82,12 +82,10 @@ typedef struct Picture { } Picture; /** - * Allocate a Picture. - * The pixels are allocated/set by calling get_buffer() if shared = 0. + * Allocate a Picture's accessories, but not the AVFrame's buffer itself. */ int ff_alloc_picture(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, - ScratchpadContext *sc, int encoding, - int chroma_x_shift, int chroma_y_shift, int out_format, + ScratchpadContext *sc, int encoding, int out_format, int mb_stride, int mb_width, int mb_height, int b8_stride, ptrdiff_t *linesize, ptrdiff_t *uvlinesize); diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index 07febcfe55..4e00137cbb 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -31,6 +31,7 @@ #include "libavutil/video_enc_params.h" #include "avcodec.h" +#include "decode.h" #include "h264chroma.h" #include "internal.h" #include "mpegutils.h" @@ -236,10 +237,36 @@ int ff_mpv_common_frame_size_change(MpegEncContext *s) static int alloc_picture(MpegEncContext *s, Picture *pic) { - return ff_alloc_picture(s->avctx, pic, &s->me, &s->sc, 0, - s->chroma_x_shift, s->chroma_y_shift, s->out_format, + AVCodecContext *avctx = s->avctx; + int ret; + + pic->tf.f = pic->f; + + if (avctx->codec_id != AV_CODEC_ID_WMV3IMAGE && + avctx->codec_id != AV_CODEC_ID_VC1IMAGE && + avctx->codec_id != AV_CODEC_ID_MSS2) { + ret = ff_thread_get_ext_buffer(avctx, &pic->tf, + pic->reference ? AV_GET_BUFFER_FLAG_REF : 0); + } else { + pic->f->width = avctx->width; + pic->f->height = avctx->height; + pic->f->format = avctx->pix_fmt; + ret = avcodec_default_get_buffer2(avctx, pic->f, 0); + } + if (ret < 0) + goto fail; + + ret = ff_hwaccel_frame_priv_alloc(avctx, &pic->hwaccel_picture_private, + &pic->hwaccel_priv_buf); + if (ret < 0) + goto fail; + + return ff_alloc_picture(s->avctx, pic, &s->me, &s->sc, 0, s->out_format, s->mb_stride, s->mb_width, s->mb_height, s->b8_stride, &s->linesize, &s->uvlinesize); +fail: + ff_mpeg_unref_picture(avctx, pic); + return ret; } static void color_frame(AVFrame *frame, int luma) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index cb6b801b2a..fe097c2c3b 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1092,8 +1092,26 @@ static int get_intra_count(MpegEncContext *s, const uint8_t *src, static int alloc_picture(MpegEncContext *s, Picture *pic) { - return ff_alloc_picture(s->avctx, pic, &s->me, &s->sc, 1, - s->chroma_x_shift, s->chroma_y_shift, s->out_format, + AVCodecContext *avctx = s->avctx; + int ret; + + pic->f->width = avctx->width + 2 * EDGE_WIDTH; + pic->f->height = avctx->height + 2 * EDGE_WIDTH; + + ret = ff_encode_alloc_frame(avctx, pic->f); + if (ret < 0) + return ret; + + for (int i = 0; pic->f->data[i]; i++) { + int offset = (EDGE_WIDTH >> (i ? s->chroma_y_shift : 0)) * + pic->f->linesize[i] + + (EDGE_WIDTH >> (i ? s->chroma_x_shift : 0)); + pic->f->data[i] += offset; + } + pic->f->width = avctx->width; + pic->f->height = avctx->height; + + return ff_alloc_picture(s->avctx, pic, &s->me, &s->sc, 1, s->out_format, s->mb_stride, s->mb_width, s->mb_height, s->b8_stride, &s->linesize, &s->uvlinesize); } From patchwork Fri Oct 6 02:46:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44179 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp117204pzh; Thu, 5 Oct 2023 19:47:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH71L0HH9ZfI9ijh0dj+xxfpklT3lmjSkmxuV5yCDBk7n9bF3Zs7vALWuSrKY79CqZXBK1J X-Received: by 2002:a17:907:77d0:b0:9a5:81cf:57b5 with SMTP id kz16-20020a17090777d000b009a581cf57b5mr5521033ejc.2.1696560434268; Thu, 05 Oct 2023 19:47:14 -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 kt19-20020a170906aad300b0099cd52f95dfsi1227728ejb.332.2023.10.05.19.47.08; Thu, 05 Oct 2023 19:47:14 -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=HJ45qyVR; 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 0E80F68C95C; Fri, 6 Oct 2023 05:46:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2060.outbound.protection.outlook.com [40.92.65.60]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0A48768CC5E for ; Fri, 6 Oct 2023 05:46:14 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mE2ShO1Qb72xgrNpIGAkkAH/WXGi0Wf5/YSjWV0/aUV48zkMn2GhnsUGwrnet311OkXp0OfoCg7PlrvRNqEvnyplda7BowM1xUKsul4FTmJoVRAVZxE9i67GFK9mIdvdkdXepFQdZxFHnN+DvVTW7u8S0GEKg6UMpD0E7wR3vs919zORcH6Gmcx1ltyIoGGQw6htVpKF2Z6YpYNryH2KA7O6ukCYpjA5QSQ+HgB29W2COhS/N+IE2YGrzer49E2YJ1DhMq1R/ZR8s4S3f2TvyMT7aPoeCrJmwHezzT5EH/pQt6TOf12Nxl1kvfbifp2gX/bbgIff68fRkNv7R7ojHg== 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=doNwkGRsjXYkBFVNs09fGWdgsym1mBhuVN4cIWooyTs=; b=RgVXi7XgeaOBmNEe7KYfAbWUTWIZqU+YbJw99R64d+dRA8kQYpVSaYb5HxQQ5GcyGLZgBVfoll/lnr+bv5Kat9qKkJkQ/FQliFvp7ciCO0TdPn/vbmbqcDwQBy52QgE3uQEe/TYiSXixgD+ZJCIi3SB+zRKt08+cwShgsCFW858gMVH9hNOr7D6Rw0OjkGteIj23gw5xmY0gNI+joc9YnRIhxogWc1cb0MTxqubvl5yfpBEtZqX/ATFCssOl9/740vjPTnG/5ZmexPWFuNdtF0obCZX/zdyQ42EvzwOaYgMZDMWhzuX09EM2DSwFKebfukPzsJ4zN565WwNovW3s7g== 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=doNwkGRsjXYkBFVNs09fGWdgsym1mBhuVN4cIWooyTs=; b=HJ45qyVRf26xvjvdU/UrnKgCPoRb7q/l1uHmkzE6+Ut6aBzFTUfLm3FfVKdB3wJW0aQBnxKcwaMC0hDKYyGnJkU+WqZtEGlbgSHlthDM18CHTroSj+/CVd0fW4d8S7KKteDXYnnC48qqivGUoufaTdhT39ifbJXCP4em2X6/Cx3CeLYrtVJBSAOI15hu+bwWfGogmLv2SfPyXcXufC8kefZj22gaWGTGmfzlbNnRNGDiqMKxCmOQNqw617YYHZL9bdt1KYS1Z8Ly2C4oUdovI9bYo+V0x5oHMdfQUXYmQzMNJmvOiSsHmw7IP7s4LePlQoSCRbfqhprps3F3kW9LbQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:46:13 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:46:13 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:35 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [6Dgez/1mU3VLTFbFrzQ+QZ2BGBNMZKWr] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-11-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: dd2551ea-b85e-41f6-e7a1-08dbc6166780 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: luFqtoasvy2du4RdsQEysDSPyg/htnC1LbUICcse1W3hYaWpA+ZGeLKFx5XTc0K7Td6Q/E2GGiTLWKZIJT6y3ZBs4fhgn99s4m+b8dBrSCuBQ4BqMpnBhp2+BZhwqbdDNtuNslAPiHS7JmwW+C72CQ4Ywe1HfOLmqQgcgpy96OWlE1DJECPg/fC4tUto0hDAG8DRRkalLrHE3b6yOPFeoAtWqjkv9H3KS8DkLblPJ/7dk/hFMAE0rih6moMmi8AOZb/bnLkaI33WiCoJvoH/VbYIBOVgBDCr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H7bX17jEczmRzicFGgmNKFKfliVlC8Vu9OzhiK7Fvd4TyV/xKahGSFlxGShdsGnmXlBDGdBr5MJVCgXXuUCojaXEATpkXskT9uPCaej3b4fvT0C1yZMxw3mz9C0hLRhN2/crD2a4kVw/Bg91it/6ORPjo5etUsLoQzmbjJBbyOznAfBY5d7yxFP8D2JPoQedNmNZ/835FntVndjdNGolZLatwOuu6YyQnGZd0OE0wxGAJ591v8Nz+rXujilqCQNaBDj0Ij9q9EbPho6Y0V9c98pu4p+sVbywYKZWaUEJL3KDXDZhISVtf6CrhYxPvg83oLCE0xeInEu1AX7ieA7Y3/AGpClpBwiQgGeXds8zPyv9K+uduYjQcrn3TlAiByrIw7M3+7PIK4xkhst0Zc+0dGBk7qOaTz88WMngyS4QPnkKX5c1BbR+Qp+YWsrk+3ZHjzC++5TKm8TtisruqEDR/1Ot43kllW6Z0QVjvfcODq3SgtqiJcPzj72M+1IJ299bQLabZd5udLUpFJHm6igZDIWggxeWjf99bet52xwb2RK/9ANjgvTIIgckgayniowHgMjRel/6lez6s/Wrj8h+D0vHQnB2gJuYuidC+JwxQ9+ X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd2551ea-b85e-41f6-e7a1-08dbc6166780 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:46:13.3499 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 12/13] avcodec/mpeg(picture|video_dec): Move comment to more appropriate place 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: fnt1HRirwk1r Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegpicture.c | 2 -- libavcodec/mpegvideo_dec.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c index 44c4c8fe93..f859f163a6 100644 --- a/libavcodec/mpegpicture.c +++ b/libavcodec/mpegpicture.c @@ -252,8 +252,6 @@ fail: void ff_mpeg_unref_picture(AVCodecContext *avctx, Picture *pic) { pic->tf.f = pic->f; - /* WM Image / Screen codecs allocate internal buffers with different - * dimensions / colorspaces; ignore user-defined callbacks for these. */ if (avctx->codec_id != AV_CODEC_ID_WMV3IMAGE && avctx->codec_id != AV_CODEC_ID_VC1IMAGE && avctx->codec_id != AV_CODEC_ID_MSS2) diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index 4e00137cbb..7a9101a781 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -242,6 +242,8 @@ static int alloc_picture(MpegEncContext *s, Picture *pic) pic->tf.f = pic->f; + /* WM Image / Screen codecs allocate internal buffers with different + * dimensions / colorspaces; ignore user-defined callbacks for these. */ if (avctx->codec_id != AV_CODEC_ID_WMV3IMAGE && avctx->codec_id != AV_CODEC_ID_VC1IMAGE && avctx->codec_id != AV_CODEC_ID_MSS2) { From patchwork Fri Oct 6 02:46:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44180 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7b1d:b0:15d:8365:d4b8 with SMTP id s29csp117224pzh; Thu, 5 Oct 2023 19:47:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVh9+lST/bMVD9SSHzLhq7L8ESFe3tIn6m0n5Wi573VA/qUP/rNp30RcZjco2IZXVNyjMC X-Received: by 2002:aa7:d046:0:b0:533:45b3:1963 with SMTP id n6-20020aa7d046000000b0053345b31963mr5490777edo.28.1696560436507; Thu, 05 Oct 2023 19:47:16 -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 e21-20020a50ec95000000b005362cffe8c3si1262355edr.660.2023.10.05.19.47.16; Thu, 05 Oct 2023 19:47:16 -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=RQfRWbq8; 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 3E0B868CC67; Fri, 6 Oct 2023 05:46:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2036.outbound.protection.outlook.com [40.92.65.36]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 575FC68CC54 for ; Fri, 6 Oct 2023 05:46:17 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VqA+FcDE9OWpTeWnDpYGpnXyiQG84g/n3PUXC17BZZmBDtl3dO7QLF9SeLNwzdTtzoQ0bgmCnCieGIjECjhBfotAJZmYhbukLKl1oEtL5C7i27gpNAPnaTlMHmH4V7ei9MvZae7rz7+Oe9rvanEaDvS14dtCrTyd18malSZ6X0Tplazlb3z5U0zJ1stAYYj4FNP/2yV9a0I5I2ePFtxc2oWh8A5tgjFclaxgy2EIXpLxV5APNtDl38O15Ji1COdq3SdXVLd/C6GgJgyJESVixj9G0uDR0fuh6jm0O09IAuKTrhbnLQidhZhQOB+BynWRRkfCrHP7Uph6+YCZnYA9JQ== 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=VuDce9oCD3BEoEEcBJC0fCyvFwg5FgAnFla04vnX0aM=; b=dscxp1UCrvnkeDkEJjAcoXBs/j8DIZrXBzjXq4kZZEFcx67K8CgTwOlNXW39C55y8NBvq1dfYwqs6boC42AfMhhjAZOZbvTIsNtL7QzRkcJt6yEh5MXN5BPox8jIVJjohsjnxvn6FJ6m7oFzir+192IXdGyVfngujjtcYVl0VyVlEzio46IeOvtGY3H/TCToIq5FgLBNh45Vfw0sbhaZ6UHFi5XyH0E0mYWy5LNU1VUcg227A2fioqOWccIGGGVFGY3rHGcxNl5kJoKt7uwE9VgMSbqnN6iEO77CK/dwrBVgPtcYcAbb1zU3r26FmaXE7ES6shwPDLJlvxgg1Twssw== 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=VuDce9oCD3BEoEEcBJC0fCyvFwg5FgAnFla04vnX0aM=; b=RQfRWbq8w7iTYvyoV1KnrmkopIkJsHqMB3RDgE/2z+Kj8FEDh4MFHSO2bqkHOCbODgCJd9HtPHCD+bE9/ERIKArEkpOu060TqBY+5lNj3/eFiVl4sxpS+A463HHGO3ru1MqrPzlZbWfLYbBpS/xv0tMr3oEezNqnLBcxwHK2aNhNOSjE5/JolALrnlcJrC8ekuXJMEdNn0NRnep1ILUZP4DOgUAND2YciGlg8kpBcrv37MRlcLVpBzEhUT5nFBjrqYkUQyiSbS9gxnOR5G2Uqp1yELUgCNuilFV9/lGAA3DfHoppTC3EGnye4KVt4ruLy2wkk1aInxA2Rr0Y6YxDsA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0148.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Fri, 6 Oct 2023 02:46:16 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Fri, 6 Oct 2023 02:46:15 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Oct 2023 04:46:36 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [vQ9+4cxsHGtrzOTB4bBbJkjw+KfgLeMD] X-ClientProxiedBy: FR4P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231006024636.1005349-12-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: 219d8f96-1de2-4821-997f-08dbc616690c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jiC3DlztXhd50IeJ806uDd3nzkEK9sTOEt/X4IpqTK3jMB6xoaDDlalADmwNfqEbe0I/RgPe2wa2pGdb7nnxV7XBX7Z/7/AFmTvF9wKciXt0do/SbUQtQ+TSTrKNjuaq/rYTuKyUi7vURYnDeNa3HP5S/k2wBkAmb21J7oXxer5Buda3q3jl145mcInZXfkXdnL/e/KO8MgpGbvJxKe6OW/0I7KvwlK5svHo7tIh8+3EKAgQpGh59wYNdD4aK6sxjwAUKvoi/M/iESK8nF3bzch19jqUJy2Q8O8t6/4v+iSmwUyLTp0/K+DQPxWENqe/PsDpWbQ26MEtK2eZV1n6qrxa7AkQH/tgPbY8r2wC/kUCUzOhFj1cfHv4UuGdDSNO7J+mn/AqEnk02ptMyXn92J9oW49uIE8D2SwKeyBmGyBlHsPGgPHDMX4NwxbmQ/a7s0b/Z11UaYlQq/CwTnLs+2eiSY2948A6LVmsggW/fzApEpuaCTIH5NacEa8GiIdIQypagaDpuWtmAEoJmkReo2o+kGmiinNcCLW7JK7+rKKvj9ItvfQIoLSLeVZ5B3JYg3gq6T2/Noi1amZwlGgjxWIb8C0nCzT+i93ZTorOuMgijK4HXPdVT+KomkCR2RIK X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: l/HYUgD5EEq5R/7FRgV/pipgdUPJ7zqbtQAWQ3qp8sZIi0NVJisNnUQjlFUnCMEgQEzNf3FhZuLCGJAnP4+AD1nG3yt65dKzSWsYQIivMIhq/CkjklLAQPeNz8B/k+vZixw8f0Va4QIFHAVhmxmLh2YpvRLHj0T0ShEQrj9k2QEQ+vY+or9XfpXX2L9uCsl/RW8q5sKOt/pUW546j4Rg2rsE6xRsxgBbsw4Ja1PQ4U5S8d9V2wZwKImKxYWrMCsWBkjJZu+JGJ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c616690c X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 02:46:15.9567 (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: DU2P250MB0148 Subject: [FFmpeg-devel] [PATCH 13/13] avcodec/vdpau_vc1: Fix indentation 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: kMn/BLgB4P3W Forgotten after af6e232ccf8db2341361f02852017aac48772950. Signed-off-by: Andreas Rheinhardt --- libavcodec/vdpau_vc1.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/vdpau_vc1.c b/libavcodec/vdpau_vc1.c index 4e5ee14428..0eacc4477d 100644 --- a/libavcodec/vdpau_vc1.c +++ b/libavcodec/vdpau_vc1.c @@ -48,16 +48,16 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx, switch (s->pict_type) { case AV_PICTURE_TYPE_B: if (s->next_picture_ptr) { - ref = ff_vdpau_get_surface_id(s->next_picture.f); - assert(ref != VDP_INVALID_HANDLE); - info->backward_reference = ref; + ref = ff_vdpau_get_surface_id(s->next_picture.f); + assert(ref != VDP_INVALID_HANDLE); + info->backward_reference = ref; } /* fall-through */ case AV_PICTURE_TYPE_P: if (s->last_picture_ptr) { - ref = ff_vdpau_get_surface_id(s->last_picture.f); - assert(ref != VDP_INVALID_HANDLE); - info->forward_reference = ref; + ref = ff_vdpau_get_surface_id(s->last_picture.f); + assert(ref != VDP_INVALID_HANDLE); + info->forward_reference = ref; } }