Message ID | AS8P250MB07441DFEF4D00D3FC15057CF8F1B2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM |
---|---|
State | Superseded |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp2272724pzb; Mon, 29 Apr 2024 14:20:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCULsNAmd0D6rgVnnAlFHwyyDNeAy22K0FZ2k8BW5Icsi0KWSY+ag0QwG89SuxRAe9eN4j5GO+wqTUmkvktwXA5l+1uxh07Z7VGmFw== X-Google-Smtp-Source: AGHT+IEpubFaWx/AWYePJr8xh3Wnk1iBteYjil9sUl8DbGH4mxQDk1H3IV0HigREa2xCTfLBehxO X-Received: by 2002:a17:907:6d14:b0:a58:fc85:397a with SMTP id sa20-20020a1709076d1400b00a58fc85397amr3656456ejc.5.1714425606618; Mon, 29 Apr 2024 14:20:06 -0700 (PDT) Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hr35-20020a1709073fa300b00a55aeff36dfsi11778512ejc.640.2024.04.29.14.20.06; Mon, 29 Apr 2024 14:20: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=YFUbmMYt; 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 13B7F68D5FE; Tue, 30 Apr 2024 00:17:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2088.outbound.protection.outlook.com [40.92.91.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7A57668D5FD for <ffmpeg-devel@ffmpeg.org>; Tue, 30 Apr 2024 00:17:02 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gYDZ0dcptk0j0dkGY1KmnvlvYTiWeIHO4mTicdokZoSInQYRkENRgGUKgd8rr117jv5ld1GUGcA1XM6lkCtmtKPT1sT8Qbgp+5kNzU+wFXPgs5B/CP4wT1IAt8ee3kPOERqZSF5RUV+SzD+vulw14/DGfEvGMBIvRrL1dYqUBuufwMGNuiz6XBboWZBxrOOVE1FXDT2O0+NaG/AzCPMff0If6eR9BX6DJ6AERNxfcUKIJElyk6TzCqgtujeCxZLFpAeVsRB6JyWs43JEb/r53otVOg5yboMfQ0+yOrFoCN/YEH5ZDwf4kpjHFe8hSmmhLXCKjD1ApEc9gvqc6r3qNQ== 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=FvUTpr1rkB+OGKCr6lfgrNwwYCG4GwZVnmcxbfPhdog=; b=ciuXNBMBF2BzJU6UoOkPKOUuoUxLiA25loqZvhRPq/94NxNs3jF75YTAPX378Eaqj9OzotY8a6nsD0PYzTfv8i2r2L4x9EWcaVOfO+T8FXlJwRo3x5rfhZwCdHdKnR8mgtN4wspUbuxjyCq/bG9i1nOnsX7yrvaPPMBDAm/jmZG1nTi/WPAgszyQE5qYDrRDqZNJiGCiEFtkQdJR8FDT1NQTankK5JGCFoNtVNyoloWlF9L8m+n9G44ruwjVJGhXOzDFeQsIeY25BYTvqSswvfB0Vy67kuAWnewCf94MS5FvIjjPLErYkdCiUOE/zFhwn55WDV6yvduKWtQ+iAK2BA== 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=FvUTpr1rkB+OGKCr6lfgrNwwYCG4GwZVnmcxbfPhdog=; b=YFUbmMYtS8jT4fAG6q2CfxvrRd0ExG5UlUJz1RQ0+s4htnFrGTNwijK+vn3uuL2Imvrnyh+P/rKGCB8zlluj38r4BUumzUEV+62bYqRkYYUcpN1Oa7F/Q++cec7uebe1iuJptQi3IcKUUn28Hks33KeC9fA4V+qT0gekdQqlgHyJnwpQlOjeoJFuRLu8QkQbxmiBGZGX7HM02H1zA+Zn9m28NSJHyGN1pnLG2TtSQb4ADrG9P95abqB2evPoPkk7kDByOntM6UyvB7y9clfHN2zttCbZjV2zICcWMW7r7cTvgU+UKZdNWS70dvEsbh7ni9ckAnw+fwcD6oaGATmF+g== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PRAP250MB0616.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:297::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Mon, 29 Apr 2024 21:16:59 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::1f29:8206:b8c3:45bb]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::1f29:8206:b8c3:45bb%3]) with mapi id 15.20.7519.031; Mon, 29 Apr 2024 21:16:59 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Mon, 29 Apr 2024 23:14:28 +0200 Message-ID: <AS8P250MB07441DFEF4D00D3FC15057CF8F1B2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> X-Mailer: git-send-email 2.40.1 In-Reply-To: <GV1SPRMB0021759DDCCEFEB3B9609B808F1B2@GV1SPRMB0021.EURP250.PROD.OUTLOOK.COM> References: <GV1SPRMB0021759DDCCEFEB3B9609B808F1B2@GV1SPRMB0021.EURP250.PROD.OUTLOOK.COM> X-TMN: [NCG/NtzK/ckC/vzRgf/sB7zlbdYx/jAO+nnkTbjuj6A=] X-ClientProxiedBy: ZR0P278CA0199.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:6a::21) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240429211438.3274834-33-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PRAP250MB0616:EE_ X-MS-Office365-Filtering-Correlation-Id: 60cbb362-998e-403d-300a-08dc6891b4f1 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|3412199016|440099019|1710799017; X-Microsoft-Antispam-Message-Info: 1P4yVzrn7YFQavqabLC56x9YeZyNGlW5E02oWZ5g4t2KIVL7tDz8FrHvfAtpxZfzpqmvzJB3svKomOZE6MsI1LB/aLl+FWKe9jk/8h3hG/ynw8qWhvtUuylLSqDRIfefrazzvtd5VmP1losit4c5/VwxXLy2WtaJcOpii9jxeSrlqPziAyqgeB9tUwu7npOyO5AUuQaOqVFEXnCZxX+3EZnYt5vyabJXZk6ASCSatZLwIus7a4PE/vfgCYwfnZXGHo1nlb9ZU6QA3QbdeK/EMXT/spmQwhfjl0uA4d3OTixzKGTGWk4l3XC6cUQqo63ykNdOTscwPa1NkrJ+r2FAMYDxauAH8i/Cwt7Cj21+XoBv+UoHQJv31WN3nNIJ3JWPAd46In6MGv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ZSTD64KpJM7hoPIKJ274ueh33nq7RU6y7TXhD+EdnIkdcWU45LwKZaIExISy5NhOAWIS8DO4m4qW7h0n/GY131AdnGz2EvIFi1Z/azeskTqZfIUd6o7mAE2JAwEf7IjMPdQ9IiTn6i4gVSllDDaObAJozl81MZL3TdNQCaMR+Cse4+vVi5TwuVXk9YorMv91ucdxcZYJaf0fmV8Yb34sK00q0FhbThjaYuiP2uDZMeC+oe16TIkxDlWsvu0ArKTeZ6h6QDLLlfSjRqHw/Mvis396HrRFSNDETrfumPk56IIgSliCvlJA/u6SKNsZjO7QK4S1Ls64EhUTSJzzpBQYKzZf5dYdbLuPQlzRDl/oS0x6Jwemt3bWxvdzTrgp3yvTfFA8D72saqqEYBSlXtfg4jlPYAwsTKIRzj2gTkJd3XYoVKM4PqfVDPbsmCZyfQP9rjnd6liqBUFgod0oXDmGJxDyzUujx+zK/bPUeCTxJ2nfR/Pr9uzXlyP11k1nkbE2fpFiET93SU7/0BS+8jalOYQ9uDaA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60cbb362-998e-403d-300a-08dc6891b4f1 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 21:16:59.6791 (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: PRAP250MB0616 Subject: [FFmpeg-devel] [PATCH 47/57] avcodec/mpegpicture: Use union for b_scratchpad and rd_scratchpad X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> X-TUID: ke8mk/k8Qg5C |
Series |
[FFmpeg-devel,01/14] avcodec/get_buffer: Remove redundant check
|
expand
|
diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c index 234bf45735..cfb97a664d 100644 --- a/libavcodec/mpegpicture.c +++ b/libavcodec/mpegpicture.c @@ -176,7 +176,6 @@ int ff_mpeg_framesize_alloc(AVCodecContext *avctx, MotionEstContext *me, sc->linesize = linesizeabs; me->temp = me->scratchpad; - sc->rd_scratchpad = me->scratchpad; sc->b_scratchpad = me->scratchpad; sc->obmc_scratchpad = me->scratchpad + 16; diff --git a/libavcodec/mpegpicture.h b/libavcodec/mpegpicture.h index b66fedc132..5f619a29bf 100644 --- a/libavcodec/mpegpicture.h +++ b/libavcodec/mpegpicture.h @@ -33,9 +33,11 @@ typedef struct ScratchpadContext { uint8_t *edge_emu_buffer; ///< temporary buffer for if MVs point to out-of-frame data - uint8_t *rd_scratchpad; ///< scratchpad for rate distortion mb decision uint8_t *obmc_scratchpad; - uint8_t *b_scratchpad; ///< scratchpad used for writing into write only buffers + union { + uint8_t *b_scratchpad; ///< scratchpad used for writing into write only buffers + uint8_t *rd_scratchpad; ///< scratchpad for rate distortion mb decision + }; int linesize; ///< linesize that the buffers in this context have been allocated for } ScratchpadContext; diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index dc7fee2ac7..711bf6c17a 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -440,7 +440,6 @@ static void free_duplicate_context(MpegEncContext *s) av_freep(&s->sc.edge_emu_buffer); av_freep(&s->me.scratchpad); s->me.temp = - s->sc.rd_scratchpad = s->sc.b_scratchpad = s->sc.obmc_scratchpad = NULL; s->sc.linesize = 0;
These pointers point to the same buffers, so one can just use a union for them and avoid synchronising one of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/mpegpicture.c | 1 - libavcodec/mpegpicture.h | 6 ++++-- libavcodec/mpegvideo.c | 1 - 3 files changed, 4 insertions(+), 4 deletions(-)