From patchwork Mon Apr 29 00:35:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 48350 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp1698557pzb; Sun, 28 Apr 2024 17:36:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXEUiDAOACaYy6Sc5tLTE/dww6jktYvFdQr7lIL3t2ank29W6VOEMbUZNs0WrFV375smau8FqQKwp6n/sBh5DDi39nW9MghRaai3Q== X-Google-Smtp-Source: AGHT+IFghA3CCMvgvIvDTWOZggEznu/K3CFxH+fEIQOdTavK+UbLBuLj5imOasCoAEMTgq5y/7Pz X-Received: by 2002:a2e:9e02:0:b0:2dd:c3e5:eefc with SMTP id e2-20020a2e9e02000000b002ddc3e5eefcmr6729358ljk.27.1714350993274; Sun, 28 Apr 2024 17:36: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 g14-20020a2e938e000000b002d9e4912ac3si6856047ljh.174.2024.04.28.17.36.32; Sun, 28 Apr 2024 17:36: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=Ot26bMJS; 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 F389768D47B; Mon, 29 Apr 2024 03:36:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03olkn2048.outbound.protection.outlook.com [40.92.59.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A0FEC68D435 for ; Mon, 29 Apr 2024 03:36:02 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kpPBKm77bqs+Hr0vhyhkmgA6+8hAWA1n/zGDzqw5kPPYP0fW7qsaLOH1PM34vuyHdtLbYrgEUXvroY0tKMlWjjfyojouDbB9LTZKJqUy7I1IxMaXXttky9FK7e0dw4Nlz5qQfqTycHHCxDHzMSABlZRBG/0V1xNObgtsnMCMb7b5DW8+/0TyWajRiJZzipZzw2eIMMuCUbRlBuunTCT/31vCLf73K2eLD89xSrVxmRMyNPGvNfHdRXU+HGek2Z/8BuFt9j0GvLdxBJitGWHA/kzVnY4wiKA6X5Ksm2oPRTPuJF5siH9WuBpVyzG5c+pxn0M819XGGD4gsAlq+oS42Q== 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=pirm70lNkCUtI86A7JIVR5czxY3p6uDIRopK8y6wPCM=; b=Q5SViDg84pl23KOJdvUQ3Ck9FnNdyamSc/y8Dz+IvUTd8MJRzhbJgdrMCCco+ZWA3crhAEpZr/nCtEA7IiYX1qGC3wwx5a/7u9yw95288yodPZEt4/TQ9TAzXGfZSgdFZasvhnQo5SYe6wQFGE2MD8u2bPwiNcKYNfMO57pSP9H5zKvroX+d61E5SL7NO17uacjkia8T9U+VWNbIdDvLNLPxbCZ9/xFa6fxo67/J/FZk8osWRm4AozkYmeZrU2VsGGBFNNDRFPMERZ8IP9ekuQHvukTEPRxPVNHPLlRXtWIk1guunmUbEZIIiKxIWEBYDfd4XDX+aVPe5SjVNu0h0A== 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=pirm70lNkCUtI86A7JIVR5czxY3p6uDIRopK8y6wPCM=; b=Ot26bMJSnjIsr0ECiLkXuteJCQhi+IE2vdEM94FMr7QQlWx5OsY2xqYu5gsvPjbs5nKenp8UDT1DNVcu4cZKSGBI4sZFW7XU/AFi8DUp59Cue8LO9HtFbosIM0ig9aH9YDPr7XJGtN/05ZgK50rvENWBvhfk6r9MoemecgXQlrH5T5L4zqbu5BMY839HjcXURD15Hiy94LmiwicaAr92m3+WaUmHaZeHd8mQWysdrdgW+vgnEbDvKqzimUsaKA1pNDY7D2foBVYOfp0g66pQ4/NiFi+MR6lspkV/mtN7NnZAic0wlyFSx64Bg/yQ3tG00wH+Jm1DTF7ZgzpOEuiFSA== Received: from GV1SPRMB0021.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:60::6) by PR3P250MB0068.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:173::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 00:35:52 +0000 Received: from GV1SPRMB0021.EURP250.PROD.OUTLOOK.COM ([fe80::4eb:f54f:b451:34fd]) by GV1SPRMB0021.EURP250.PROD.OUTLOOK.COM ([fe80::4eb:f54f:b451:34fd%4]) with mapi id 15.20.7519.021; Mon, 29 Apr 2024 00:35:52 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 29 Apr 2024 02:35:28 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [tsjNDGHNhvv9te5XIsVEUl92IqwjxfOfbxLj44YjpkM=] X-ClientProxiedBy: FR2P281CA0080.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9a::13) To GV1SPRMB0021.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:60::6) X-Microsoft-Original-Message-ID: <20240429003535.1516058-6-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1SPRMB0021:EE_|PR3P250MB0068:EE_ X-MS-Office365-Filtering-Correlation-Id: 337f7178-8754-4428-fdf3-08dc67e452e5 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|440099019|3412199016|1710799017; X-Microsoft-Antispam-Message-Info: mj+pHP5weUNp7cK14P3fAkxWaik8RpXv43REHSHMmExN2hScW2AmQST3LgUoTXIHYHXKQHfnlHs9hJ7t9Zdcp2rE1uHNwx9gSQfH5pK+srhL6cJZ4hWWb+VG9b0ZUXdbZjugDIP3QIFjkKxZcLXAqtDNFEnpzgH2CHeE2HuCdWRoOVxUmODdtXoOvrKYAOBz8pnOBiMCNP23Vcnmytm40GL9jEPG9zUwKu1dfZMlMQkuRZCx0VDgGi7HAmZ2849XPj8fqPE5ZYlzGZFaU1Fj8lKmikVQ/IRCEAjS9y4jLDOJr3l3Yv3rqFsgq8K2PI6yVMG5wjJiSjReQFvUM61gVVbQ3OW7k7FKYRI2HcWLmYDMJQ7Kw2PH24E2/PWOTMl0aa6SWAgCcxeTFb95kpzxFuHk12uV6zYKaeKQLLKEm7dh1s4UUKt+yKrAO5MJRj/ANvWqBVIJ1GC7zr7xWiRbLqGYEPuCm335ZolxqfBe0uXir5Kk3liTmjYFOzecTFCRm1Gg0zg7rA+P0TRcdzilC9fqoBGOmXw/97O7KEVJBN70qab7qYv56kcXyzjr8wM66KNZpNmxiu7TmF6EeVO/nJIM70+zbuG7GRIIm+GGQoi+VB+zQ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bLzLj8vwY/4rNitw1el9qGCHclKDFOZrFdRZSiMvB7W2+c1pLORCkWwZRcuKrFiR9NJvaw6tP7fdk/0JDSvH3q7VsiKFWATz3uEEdBJGyIRS9TLYc7BouKAvaS02JI41s2va5VxG/qRi5uhTUONvDMYnfInL8mVEmeAuOyM9DYdg+en9XQnbEv4BB/lINxBex00sc0d8ya8vzmES974t25MbJtVuDyLNmmzSkg8PerUQXPNlbkAeFq1tphmr5E8IbvDylbRaGhsjOC9dTMaS5iR4URZg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 337f7178-8754-4428-fdf3-08dc67e452e5 X-MS-Exchange-CrossTenant-AuthSource: GV1SPRMB0021.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 00:35:52.2425 (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: PR3P250MB0068 Subject: [FFmpeg-devel] [PATCH 07/14] avcodec/mpegvideo_motion: Remove dead checks for existence of reference 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: x1dzDoPAiefs These references now always exist due to dummy frames. Also remove the corresponding checks in the lowres code in mpegvideo_dec.c. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_dec.c | 12 ++++-------- libavcodec/mpegvideo_motion.c | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index bf274e0c48..c1f49bce14 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -862,8 +862,8 @@ static inline void MPV_motion_lowres(MpegEncContext *s, s->mv[dir][1][0], s->mv[dir][1][1], block_s, mb_y); } else { - if ( s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field - || !ref_picture[0]) { + if (s->picture_structure != s->field_select[dir][0] + 1 && + s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { ref_picture = s->current_picture_ptr->f->data; } mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, @@ -877,9 +877,8 @@ static inline void MPV_motion_lowres(MpegEncContext *s, for (int i = 0; i < 2; i++) { uint8_t *const *ref2picture; - if ((s->picture_structure == s->field_select[dir][i] + 1 || - s->pict_type == AV_PICTURE_TYPE_B || s->first_field) && - ref_picture[0]) { + if (s->picture_structure == s->field_select[dir][i] + 1 || + s->pict_type == AV_PICTURE_TYPE_B || s->first_field) { ref2picture = ref_picture; } else { ref2picture = s->current_picture_ptr->f->data; @@ -910,9 +909,6 @@ static inline void MPV_motion_lowres(MpegEncContext *s, pix_op = s->h264chroma.avg_h264_chroma_pixels_tab; } } else { - if (!ref_picture[0]) { - ref_picture = s->current_picture_ptr->f->data; - } for (int i = 0; i < 2; i++) { mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, 0, s->picture_structure != i + 1, diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c index 8922f5b1a5..01c8d82e98 100644 --- a/libavcodec/mpegvideo_motion.c +++ b/libavcodec/mpegvideo_motion.c @@ -739,8 +739,8 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y); } } else { - if ( s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field - || !ref_picture[0]) { + if (s->picture_structure != s->field_select[dir][0] + 1 && + s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { ref_picture = s->current_picture_ptr->f->data; } @@ -755,9 +755,8 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, for (i = 0; i < 2; i++) { uint8_t *const *ref2picture; - if ((s->picture_structure == s->field_select[dir][i] + 1 || - s->pict_type == AV_PICTURE_TYPE_B || s->first_field) && - ref_picture[0]) { + if (s->picture_structure == s->field_select[dir][i] + 1 || + s->pict_type == AV_PICTURE_TYPE_B || s->first_field) { ref2picture = ref_picture; } else { ref2picture = s->current_picture_ptr->f->data; @@ -787,9 +786,6 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, pix_op = s->hdsp.avg_pixels_tab; } } else { - if (!ref_picture[0]) { - ref_picture = s->current_picture_ptr->f->data; - } for (i = 0; i < 2; i++) { mpeg_motion(s, dest_y, dest_cb, dest_cr, s->picture_structure != i + 1,