Message ID | GV1P250MB0737198555E06E234C95F1178FE02@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM |
---|---|
State | New |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1706:b0:1af:cdee:28c5 with SMTP id nv6csp298904pzb; Sat, 11 May 2024 13:56:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUAB6L2mU/SpO8iiUhshRIcH7efGyhT5OaYpOLiYg7rIsjdypMpJ1hbnXOG4cdBQsl1luGca/emkfWBvA34NaG0Bw30w9gtl+PsuA== X-Google-Smtp-Source: AGHT+IELnfqdhGHDPZJ4WBa/Tnds279XCfUPdXC+Pt4ohdcpDmHSrDT4GPBqYd17rqgvV54CGzsD X-Received: by 2002:a05:6512:3d8d:b0:51d:9ae:87e with SMTP id 2adb3069b0e04-5221016b565mr6201285e87.46.1715460975991; Sat, 11 May 2024 13:56:15 -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 a640c23a62f3a-a5a17945fe5si373656966b.196.2024.05.11.13.56.15; Sat, 11 May 2024 13:56: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=B4zZ1Koy; 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 05E1168D6CB; Sat, 11 May 2024 23:53:36 +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-am6eur05olkn2029.outbound.protection.outlook.com [40.92.91.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 688D868D6BF for <ffmpeg-devel@ffmpeg.org>; Sat, 11 May 2024 23:53:34 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=loaT/c/gSHq1DavArDQIOb5+SYSm9UaPcbHcVM3fcO/w+F8wIFVRf/4rIJ8zwvWmd/pDqZiuuEQD33D5kwma7VW5ApjnAQ3xoEDchZCeAKdjj31frnyRX1acxD5qDcYMGu5yW1oVlMISvKASivkSPTX5iU3ZIVRQ1pnZCBf2JNZyEzHupoorOgErSRu8tPpMKrS1ksjO+m2QOexs7h0NLpke61QfUz+Miw+vu2sKK9gGebYC14fjzXfYGh3k4i8YJGjpcteg3XtUgG9mir8QOmlJFMbk7YHOTS3vX133NBFWg2/Q77PebkssRnoZDx3CJ5GnA3v/7DERLo0xY6rKKw== 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=2mAHbcSW1QsjQfEe2aR+Lkf2Rc72uDRc15LZnIe58SU=; b=JWxJl9f0A9N5A5Ai6AOUTpvU833vFQ5uAoskO+Vlzml97WhxJT3DapRXGc6guqQgQ26+hea5/z1yiy5de+OAzN3/VRu0+J8kUtiNKoMi+2U7TZz0/DSeKEWfeRVATx4PCV7ML/VxNzPQeiIgiv/IxOsYapFeLkIGcXsVpKJF8DaazU9+ghahZGKRms/AC2fEhgDpUbFT6qY+L6pSLj93YZuDy8z0rWCdA9Kt2BwsZGosZWMANx2cCqgsTZAxVJ5L94LYdbNkS8upqK7SZqeSUBkv//QombUac4S6ZeBxPW+r5/w1d6MpaC6CwE4ogVyzUuq0u2yAPsZfZWXexvABpw== 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=2mAHbcSW1QsjQfEe2aR+Lkf2Rc72uDRc15LZnIe58SU=; b=B4zZ1Koy6rNVdD/akCwJvi5wi5fxG6jo9EjrLR2Z/D9uW21UFmS/Yeku0y2drGNAUmmBgu12Kx10ftUGQEb8UPeQ0j6tjCmDq+/mo3MOBvv7V8WwwAmtmM/1OJPV15D0VJGEquOVp41hN5RYyUR4iLz55GzJMKJzWNRhIXZrPGamlfjxQTgOZRK7546d74YxCYFvEp1c5jpAWcUwpf6XMAPqBAO/R0XFYjM12+W7RjLb69kaDnfmgYy19dBjy9PWAbIklvGFDQ6QWZjedodpDq1DgL6wY1lVIPdHFVIpFZPeDHN9IRyWXxBrqGrHlouS1avna3xicqsnF0T9grBCcA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PR3P250MB0370.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55; Sat, 11 May 2024 20:53:33 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614%7]) with mapi id 15.20.7544.052; Sat, 11 May 2024 20:53:33 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Sat, 11 May 2024 22:50:56 +0200 Message-ID: <GV1P250MB0737198555E06E234C95F1178FE02@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> X-Mailer: git-send-email 2.40.1 In-Reply-To: <AS8P250MB074471DDEA29072B2586F0EF8FE02@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> References: <AS8P250MB074471DDEA29072B2586F0EF8FE02@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> X-TMN: [C0SXeOEh+ridn+kESVj7QMjebc/yVPmUrqa5LSkdUko=] X-ClientProxiedBy: ZR0P278CA0172.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:45::6) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20240511205135.2411886-31-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PR3P250MB0370:EE_ X-MS-Office365-Filtering-Correlation-Id: cec5271a-a8a7-4a00-df7b-08dc71fc6b71 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|3412199016|440099019|1710799017; X-Microsoft-Antispam-Message-Info: pbjEZnoDUQEo4OMTBofxnR+SuW0sPJdQP6r1mY4F3UYtc026xuSSb439/EneyZ8aOKeqqO+CQaneeeIB1Noqp0v5PkfFIC9gnnoblWiYWPbd0TfQdgJyCzRzjFdGClODA0sm4YOr26YeIQoNp2jckmpiTkO6pgDyZaEpj8zgtjODJ0twW3ZaeMkTy/jQV7ZDMfC0iXHcf2HsciRg8gCTj13vB2Fd3ZrZbOl6gQjvAZZzsrhSHPrtwuAchpPmM6aNqrBt26/svZvNKJuFPzs2b49qMqonAVixp5r7a3TvnafvWcXdg273a74L+XtrkY1zYW++6F7MoFF4WenXIIXsnYgZ/l6Ak5SLgLYhYdLSMQxv3fXhAqUjS0/aXR+xAR8m2Vm0DbYDBVq+s8Ht2fZh6LT7/lMfCNEYtFIyzYy1hxFaL7io5HV327AI5Pw46V4yxmSD3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hXN1uK8tBIWxBJzBw1X9HV4HH6csKeO0ytKs+SfZMa4Rhz/3DxNxiLfc0v+EItxsZvub3SM1SsgGjwE+N5j1GPnny1MB6Smn9AyKj8LAp0ZLKoGGSFEvy3MuHAWcUaJxMgMpNj85yFUf4YgAkeis0HBvPB9yVOEvPbxodNfBqqWSwfwbvWOg+C9amqjJsOgybcbFx5fCcKJWVB9l+gDtoQLkpyGWYI10+0YiYF/xVOEshmB0fIx+uEyK88NKQs4q+hB3VARIpiwEECfCNvexRohDFCfsKoEMb/kq26DYlKyISNMjbihGZdU2Fz8jmbjsjEZSVjluPyqDadAWd4MipfD3C8dQTZBpc7vgWrt6rCTPa+dswpu/+x3s1kPoURb7fM2nF5NN4dme9/ZKmR/7op4KUL24VFXFway0GNSSNNDGwe7gFgcvz1syhAcMytEIRmqblJtv7+XHoS1Lj76iB7MA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cec5271a-a8a7-4a00-df7b-08dc71fc6b71 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2024 20:53:33.0339 (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: PR3P250MB0370 Subject: [FFmpeg-devel] [PATCH v2 32/71] avcodec/mpegpicture: Reduce value of MAX_PLANES define 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: mZquOvsF+jcf |
Series |
[FFmpeg-devel,v2,01/71] avcodec/ratecontrol: Fix double free on error
|
expand
|
diff --git a/libavcodec/mpegpicture.h b/libavcodec/mpegpicture.h index 363732910a..8e3c119acc 100644 --- a/libavcodec/mpegpicture.h +++ b/libavcodec/mpegpicture.h @@ -27,7 +27,7 @@ #include "motion_est.h" #include "threadframe.h" -#define MPEGVIDEO_MAX_PLANES 4 +#define MPV_MAX_PLANES 3 #define MAX_PICTURE_COUNT 36 #define EDGE_WIDTH 16 diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index e2953a3198..62550027a7 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -256,7 +256,7 @@ typedef struct MpegEncContext { uint8_t *mb_mean; ///< Table for MB luminance int64_t mb_var_sum; ///< sum of MB variance for current frame int64_t mc_mb_var_sum; ///< motion compensated MB variance for current frame - uint64_t encoding_error[MPEGVIDEO_MAX_PLANES]; + uint64_t encoding_error[MPV_MAX_PLANES]; int motion_est; ///< ME algorithm int me_penalty_compensation; diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index d7e1085cf8..e7459cc5bf 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1634,7 +1634,7 @@ no_output_pic: } else { // input is not a shared pix -> reuse buffer for current_pix s->cur_pic_ptr = s->reordered_input_picture[0]; - for (i = 0; i < 4; i++) { + for (int i = 0; i < MPV_MAX_PLANES; i++) { if (s->new_pic->data[i]) s->new_pic->data[i] += INPLACE_OFFSET; } @@ -1861,12 +1861,11 @@ vbv_retry: if (avctx->flags & AV_CODEC_FLAG_PASS1) ff_write_pass1_stats(s); - for (i = 0; i < 4; i++) { + for (int i = 0; i < MPV_MAX_PLANES; i++) avctx->error[i] += s->encoding_error[i]; - } ff_side_data_set_encoder_stats(pkt, s->cur_pic.f->quality, s->encoding_error, - (avctx->flags&AV_CODEC_FLAG_PSNR) ? MPEGVIDEO_MAX_PLANES : 0, + (avctx->flags&AV_CODEC_FLAG_PSNR) ? MPV_MAX_PLANES : 0, s->pict_type); if (avctx->flags & AV_CODEC_FLAG_PASS1)
No mpegvideo based codec supports alpha. While just at it, also make the define shorter. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/mpegpicture.h | 2 +- libavcodec/mpegvideo.h | 2 +- libavcodec/mpegvideo_enc.c | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-)