Message ID | GV1P250MB073733D81BE3ED2BCC80CF248FE02@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 nv6csp298303pzb; Sat, 11 May 2024 13:53:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWbdGfaXK+pDSMRqxWoX589w1XpmMFzslTh9GlOgLurFbZnoIb8MoARSAWxX1sT4LHhPYzBHFZyZNs9UYIgHjqIoDoH73a+H6yLTg== X-Google-Smtp-Source: AGHT+IFNfxfVrk4H7dFBKPmI6da42PAA9EIx2MS7WlE2/hsm3VQBs/OVgchFBNKilIo/NfNEkwA9 X-Received: by 2002:a17:907:747:b0:a59:a3ef:21f5 with SMTP id a640c23a62f3a-a5a2d65ed16mr778886266b.57.1715460830739; Sat, 11 May 2024 13:53:50 -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-a5a17945ef6si358250566b.162.2024.05.11.13.53.50; Sat, 11 May 2024 13:53:50 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=rM7+aymq; 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 5FB5E68D618; Sat, 11 May 2024 23:52:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04olkn2088.outbound.protection.outlook.com [40.92.74.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EB07768D56E for <ffmpeg-devel@ffmpeg.org>; Sat, 11 May 2024 23:52:41 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WBM5Jo6rYzPJKnUFxaxabLNWF8K1vjyAsbPxy84197rAgRQ8RMD3rAwCN+aBJ/MDgzN8k4CHWt4sioU2JUWdkXiMj8j/7dvIpNaHzmLM5DmyiH+VGOMHj2Iu0w3qFbfk1fYGFVXAk3+OrGqhMtYOGAUqKZ2jSluXIEOpeKgGzrhPsNhXPT7Ope39aaWTRJdya7rxgHeRoazCew4zQf3UeIJuKaZrpbch7Yg8Ge9q4C6cKKivSLaYqAGWDo9B236TKuUgPBMgVqYcRkACFhRTTyT0/BaABjJcobgb2iC94Eyeg+BsRoX3lb1mD4ePWWvWldUMTlUDOgzFQEk3IZP1cw== 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=nFvqYDiSQmB8x8bsWl8Nhp+kZ1WE7xqNfkm55vbEPeY=; b=N25/mNup2RmNQsZMvcyvrlMG50JuJFXCoAxJP019QCxH/7PN4bKdhTR9WCpIAAFjKkvkv54q6ux35Il7E/wZzMytTqYMODDq0z9EEaV7kTIJTBRh26/JeE7qiIHvRyAHQr1hlrzSrMhyWxzxs0ocPSRiOXyP/xDk6hwcA28LPqakGCPBB4ZwLtnhn/BITJ4+fQ5IVV+UnTgFJOc5w9qLZ1hCoKcdsmdT6Zz7I+3gvlPygAQL8XlBwVC5C2zC1CMtiX7In16RfSunWqpuDljISyBiymGyuR3SzxG6gwmucQwHcxMY0vsSPA9W+z2/Q8dk31WIBS6N3zpEwTOEP3IyYg== 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=nFvqYDiSQmB8x8bsWl8Nhp+kZ1WE7xqNfkm55vbEPeY=; b=rM7+aymqJilHXhtCj2fYnFltv/FmLOesaOjXwSpEX8UFzejK86Y362Uu43miLk9VB+XJ+TaKP4GKxfmtLPkyO8V6cWQtEYucizwCoTc/fsw+n/JGwRIMCGKJufULkSH5+TRavl5bRMedmmNlR2N3OROjz9WhRSWD35MJv579fwiBGfrWn0o2aqowBexxQ2MiiWaau9mfwJbqO/Rsfe6VvuJAbJPTC+9z0UIvFy9dl3fU4Zsqk83zWIcNSsoBuT6/wcqTIC9HvSOI14bTgOOnCIKQjfNxEbEDlaOtF/nJfnpvMUo4OeKOOnE1Fi7nycFbiPhu6fQ3pzvTxmuxYqTi/Q== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by DB9P250MB0449.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:325::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.51; Sat, 11 May 2024 20:52:39 +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:52:39 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Sat, 11 May 2024 22:50:38 +0200 Message-ID: <GV1P250MB073733D81BE3ED2BCC80CF248FE02@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: [zTjKDMeU5wBTod9/MlVLVpmB5WY1kI1Id2wmhzZclO0=] 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-13-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|DB9P250MB0449:EE_ X-MS-Office365-Filtering-Correlation-Id: d9b739ca-6743-459a-5004-08dc71fc4ba8 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|3412199016|440099019|1710799017; X-Microsoft-Antispam-Message-Info: ej2xoiRDkh807ntx60vsyMpGGBu8WDU8Wmx4SfpfA150IwAZmZRYTcVSTRYiTlavlQR6yMyB+sdn3DkMrGC4LbYFr6uNHhG0l1lf/1gDHW4kqLoP9wLeYULOGWIDlBZW8sdskZFtVr1BbFaUficehsC8PNPuJuSOGl+Kyr6yy0973rpdxG4BK4pWGJcepxaNPmLiY2qv0ti+cL1WUmVy3sEXkuFduACvgOIkgvFS2r4eMu2E/HEI1lMNyP8DaFvdTl3T420qfHTMkKnm1szR35nsyZtkEfSFWMi290moA9czHewXityBptaAqS1vMsvJVgh4U+v506ZnFzN57ZRqk/X4FOw2B9TG2L8cigVJhg2/4evxVhlQ5m9YK4Gz88SYxVwS3IvTRYFYbBX1C5k5gaaPwvhVPs0doo48g1AzHZkgMuVopupB2lP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yenjb+Hn4zTvPxCdDt8iLD0eWlL6IbivegTtWpFIrZIVjx+MFBLtdX0NpJ5yhpKuZsSEglN9P4VqDB4paiVSwxPusAQF1Wq+o7YtlrsH7nvfu0MSkBxOArSC0HU11j5aHeEJGQKvDSPbV7wCOeuaZiy69Wvef4IlliKHLR24omlbIdcQcpLnf15qeOnvIAWnk+43lXKyoHu+B6RjeV9LdBRGSolfX6SCD9HjhwrMI2LQPCI/2vsnvAnUCPGF4+thBx1+sSshqjoz1HezuzhbAMn56ZD+XUMvT9LgVJqB5nnYQ18YyyKIsmCWxL/dO2wlteIoGn4wW8PPAimz644kyREm/e+aJ5rjN8W0JymAHP0nQpXeNz4bT/aN6GDsCUM0vhs2fskeuqogE28Bzvxvinp6UCtPF2pIB8DF+2PcHapdY2EDFpA/At33oTZjhWDJs/D0mqc661Wb7Rqlca0jCaOVuUtFpJ6ByynbA7VcrcoHRlg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9b739ca-6743-459a-5004-08dc71fc4ba8 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:52:39.7285 (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: DB9P250MB0449 Subject: [FFmpeg-devel] [PATCH v2 14/71] avcodec/mpegvideo_motion: Optimize check away 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: 4Nbcml0zNATS |
Series |
[FFmpeg-devel,v2,01/71] avcodec/ratecontrol: Fix double free on error
|
expand
|
diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c index 5b72196395..ccda20c0f1 100644 --- a/libavcodec/mpegvideo_motion.c +++ b/libavcodec/mpegvideo_motion.c @@ -114,13 +114,16 @@ void mpeg_motion_internal(MpegEncContext *s, uvsrc_y = src_y >> 1; } // Even chroma mv's are full pel in H261 - } else if (!is_mpeg12 && s->out_format == FMT_H261) { + } else if (!CONFIG_SMALL && !is_mpeg12 || + CONFIG_SMALL && s->out_format == FMT_H261) { + av_assert2(s->out_format == FMT_H261); mx = motion_x / 4; my = motion_y / 4; uvdxy = 0; uvsrc_x = s->mb_x * 8 + mx; uvsrc_y = mb_y * 8 + my; } else { + av_assert2(s->out_format == FMT_MPEG1); if (s->chroma_y_shift) { mx = motion_x / 2; my = motion_y / 2; @@ -820,6 +823,9 @@ void ff_mpv_motion(MpegEncContext *s, op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16]) { + av_assert2(s->out_format == FMT_MPEG1 || + s->out_format == FMT_H263 || + s->out_format == FMT_H261); prefetch_motion(s, ref_picture, dir); #if !CONFIG_SMALL
When !CONFIG_SMALL, we create separate functions for FMT_MPEG1 (i.e. for MPEG-1/2); given that there are only three possibilities for out_format (FMT_MPEG1, FMT_H263 and FMT_H261 -- MJPEG and SpeedHQ are both intra-only and do not have motion vectors at all, ergo they don't call this function), one can optimize MPEG-1/2-only code away in mpeg_motion_internal(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/mpegvideo_motion.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)