From patchwork Mon Sep 26 19:57:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38371 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp48623pzh; Mon, 26 Sep 2022 12:57:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5baMykfpIc6bDLCpNdDH2Q8XrFb8gQaZrfyMau7vkeQG1lBmHNtlOFLx0AWB2tlwYniLsi X-Received: by 2002:a05:6402:1910:b0:450:fb10:fddf with SMTP id e16-20020a056402191000b00450fb10fddfmr24065466edz.321.1664222261317; Mon, 26 Sep 2022 12:57:41 -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 qb7-20020a1709077e8700b0077b49a2aca5si1076563ejc.393.2022.09.26.12.57.40; Mon, 26 Sep 2022 12:57:41 -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=qIq1CxqS; 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 C927368B808; Mon, 26 Sep 2022 22:57: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-am6eur05olkn2072.outbound.protection.outlook.com [40.92.91.72]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E71AC68B0A6 for ; Mon, 26 Sep 2022 22:57:29 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cmu43eUcLBLVA5VXW3nMoTBn6gFCRzzLjH1xxttQv5Pq4K/eBleXlMC0pOqVwI0ivtaYtfRQ4skDoWUVNvAUvwwT57aR90mwHKzi7X79oo9qV/6NP/g+Lx0HPEGTdIPewWRd33FAL/Trlvj5r1VyBkCZXJykculCv8dcY8dr4dUtzH0ybYBoL7b4mg/yZKo2poT7FoKHIQ+xFHMboQSwyYwuagHt62C3zMl3Wt5N5ciALUYec9EKfCABRlsmXoEyM/SYIOh5tnfPZtj5AZFF1zVmMJoJuhUujia8m9eWJ2udJrhqfA05lVOvK3ZFbZ4QMgkZ5FSXmIApRXaGqH8o5g== 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=mUh105yxW2QMHE0QzVXMvoEjtBLUhs1ywMi+fcUPdYw=; b=GhrRsdb/ee4xFW/I+EuPawa7OykQA7l6OR88H/Dn8LIGSlmSJGy7slPQ9Z77Aa/DBeBd0eMwOSNY/6z2hryGoSmgA7StdD96TPJfqWbgyUNi3TScP/bWOgFtDeWOeHsp55Ov/yi4COA2+Fwv/h8/ZYu9cXdso8NpEbO8muVbn4PTZHPFIqu/qoboKA2BDU64HkZsksRqQQgq8Sz4G8maZcYX5TphtnJVDv+Wqz2wKu+yPaJtOtu/QDV76E2pLsXfcZlt17kGL87TQZ8+ItDS4OS3tPz2YIJ+toszSHI1lB6G9fRhcvjKaZkyBGms3hiZeTNedgJsiKHpUpqWiKfEEw== 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=mUh105yxW2QMHE0QzVXMvoEjtBLUhs1ywMi+fcUPdYw=; b=qIq1CxqSc3ahoKyeJOLhxbc5AkDBevkHXrqmmj/0l5vJ0CMPobxjUqSavTkyiTeCyVV9Dzif8fQlZ1F9iGwJdW5o+ZyleUylBJCzU/mYAUhQNaIZalCBeF2m8SmS22oPMbvUrZgccLgP1JiBYNBuHpil8pSjsDkVa33l3bqOyDgfdi7AJmB9mVft+DgkJihIh9WfciXAd+7sCkIu6LC1prSJ795x21gYqU7+ZsgwAkmIgWJlzd/35ML0nDCv6222VTWj/ZkG6B8H+dWtsQVZGOfkKRuOPTy/oyZdDomxiFEf7XrnQVn4IrFc/fahH7MfITXyn2qY/0IDgZyJH5Te9Q== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AM8P250MB0296.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:32b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Mon, 26 Sep 2022 19:57:27 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Mon, 26 Sep 2022 19:57:27 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Sep 2022 21:57:21 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [asOnn6Lc40qm1ee+GPDOiz7E0KF1D0Dh5ZeGpk2K+Xg=] X-ClientProxiedBy: ZR0P278CA0036.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1c::23) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220926195725.3838378-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AM8P250MB0296:EE_ X-MS-Office365-Filtering-Correlation-Id: 04bd2c1f-91c8-4d6e-8e8a-08da9ff95661 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmoDoqouQ984HdnI9yqZYxaIix0nDX/QTZtHCd25fX0E/e63+UrR6hrK2InTOuHobfIloXlhzgZWYF8btrFSi8dqjMNPyKcItUVqMrz4Hv3S6jlr8nxIXT6/xo9d9orKs8ODIqE+Dz0bGOi1pfKizCT4mj6X+p8y+l1FQiV7sXmoqXjm4SKiP+5l78V5/UCVtvKrWYlGHaGoq1TOYJoiQj58nWl2gF5iXWvSQeGwjsme9hxdgjLkil45jnLqwoRvR/4+M6iS4JMTlWNW6ZXnlcQDVRmOhIJvXtmQJm2eq0KvYSTJF2my6qWzQIKdLn3J/UG76F38DGtd2M3Shuo7lzMPmYDxoJrtKzBykXCr38Zpqwwt8L2GQHKnQWImq4KCOjkbZUasOmr9ljRvGKStsyh3/wXJpG9Wf29Uh13YxmHVqNKw4HAXoNusinaE/xs0tZQCAD2ccD8O+TxoBc7SjM2vi92q3n0lCiU4Cn55EFypDQeKStjLjf0BsbdhTbQMQnHKnCDWQQssaCNdYtknd5/Son5cvaGqTJ6qucKxHI+HXkSstLZhxFzQ4M4MlRZjpfIcN6Kb5qOtBmY1CTeWudyF5nermu7paVjHkA9wyJ6Ien+wuiqY9PS/ZLmt0GtHvM9JQkeARNKCZ/U/VT1tu56Xhjji0VZlbfwNkTV8J466ln14WWispDRYH2tGJu9DQVTpy7pZkvLzcJ/D9LO/4XDuXwHjOrKKvvzEoShSZYatXdvsNyYAiQxyOo4f60xhFZs= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MSHG/vW9lM2oTsjKqxEwDJlmFyhxp1mDhB6uJamWw/Ks6qUKDwxiXJ9ZNQlfNMYWbnZa+x99aAMnN7IDpBPNRyBj8ENnYD2YN4z82EJHnnNtsy74a+4OcKcwe9YD73a+YDcrVzdhmJTDVnvHhymrDHvp4ZGht64Mg5wnmzAF0z1gmaunepAY5SLJ1kuH+68m6mb0AuS625fjoYnqpxWnvYrL4yZmZXy6+AGBEG3I1Z+JPDTqvRvrbfgw3I95D435ZdwJKs5QRPeC3ROkR3YqMPRkLf6KDxePffxjl5CptgTqi2rQgNHoLgvMVF2q+cErvq1MbV1gOu+/xUTKiXKrLcGx9xzefW/xqeTHDkARtSn3zveRF/5zr35bsjliIuVRb5sYxzPzQu59pxO6BJesGAGAzU/PK8ucLHaaLUUfEgy0Vn6428JkotJxn75V/fJEzuzTiyVLKA4HS30Jtk1t56xe2RWy/C2tReEtREFmohXhReICc8cP/TzGN2lmk99g36+bF6P7XqSTuBrB+g9x7YlGt3xyCCbg/zcrhTF5cW0DHUD7dl6W8GBPfjrqiHKNZazn294k+sOV/ROk4CQqSVpLcQndVfw7UUQhgHmG2UcfV7xxkcSbYSdfpISbra6USoI2pyofPz5S66vjeUvH6Q== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ud8NqyB6nqgMc2LBxM6xhoaXRMq0w9zItUhJCYA2AH3q8lbC7IWUJatPTjFaroe9L7QNX8rdta3eLoQIkJRwGMWHv9THeWULfXQKzuaA4s32DDjQEiqMVw/TXrz1/+qslRoTuXr1VJfJjCciDTHKt0H66+1zg0ynlPAIPEEo4475wB+Xi8BlMwGBP1EAwyxDt8xZikhlk+wjwj+fQyIlOQoMCT2lC2QfXqm7lMwbG47dZ5vsGbJ+6NACWuI1/n3Gq39t5dU4QsW3cRFdSYR8cg8u2iEuimue38wB638eI/DGGey3GlABkH2kZGuMDKO2F81p0DKiM4QRZ9tj05dz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-08da9ff95661 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 19:57:27.4065 (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: AM8P250MB0296 Subject: [FFmpeg-devel] [PATCH 1/5] avutil/pixdesc: 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: EMbHIQww9lsd ff_check_pixfmt_descriptors() was added in commit 20e99a9c10cdbe9ad659dce5bdec569d744f8219. At this time, the values of enum AVPixelFormat were not contiguous; instead there was a jump from 111 to 291 (or from 115 to 295 depending upon AV_PIX_FMT_ABI_GIT_MASTER). ff_check_pixfmt_descriptors() accounts for this by skipping empty descriptors. Yet this issue no longer exists: There are no holes. The check for said holes makes GCC believe that the name can be NULL; because it is used as argument corresponding to %s in a log statement, it therefore emits a warning (since d75c4693fef51e8f0a1b88798530f4c5147ea906). Therefore this commit simply removes these checks. Also move the checks for name before the log statement. Signed-off-by: Andreas Rheinhardt --- libavutil/pixdesc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 3ac44614a7..c42a0242c5 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2922,13 +2922,11 @@ void ff_check_pixfmt_descriptors(void){ int linesize[4] = {0,0,0,0}; uint16_t tmp[2]; - if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags) - continue; + av_assert0(d->name && d->name[0]); av_log(NULL, AV_LOG_INFO, "Checking: %s\n", d->name); av_assert0(d->log2_chroma_w <= 3); av_assert0(d->log2_chroma_h <= 3); av_assert0(d->nb_components <= 4); - av_assert0(d->name && d->name[0]); av_assert2(av_get_pix_fmt(d->name) == i); for (j=0; jcomp); j++) { From patchwork Mon Sep 26 19:58:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38372 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp49282pzh; Mon, 26 Sep 2022 12:59:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5qAGxmkDS506KeZY+ZDDYBAYi7m39AuiMI7qFrmf5KXCI1orinscsrQmJ2hXXQvKdSlAWL X-Received: by 2002:a05:6402:2b8d:b0:43a:5410:a9fc with SMTP id fj13-20020a0564022b8d00b0043a5410a9fcmr24394380edb.99.1664222353345; Mon, 26 Sep 2022 12:59:13 -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 du16-20020a17090772d000b0072b1964e54esi780668ejc.1007.2022.09.26.12.59.12; Mon, 26 Sep 2022 12:59:13 -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=HLHm6vrK; 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 0EFA668B934; Mon, 26 Sep 2022 22:59:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2057.outbound.protection.outlook.com [40.92.89.57]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E3BA068B20B for ; Mon, 26 Sep 2022 22:59:03 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QBDrO9M7tgjwPE7RPilFiV5XxHjwve/xcB1x7Wc8olsjdysJpf0sFKv+ZZQAW8GwYQ6FR38jhzcDQY2mSpJIyGM9mGDRbT24tYpy17v/lbeWd99utv5UuYPMCA9ZDFYLLJJYe3DhSvVLF2YhG0QKfY/OC2G5cloXvbEKUJHiJmnhDcmKKxMO4XMaiCWnCTf8UuCDvy/nZqPIaPjFWqeLG/aeb3BR6Vqy9H+kutJD0loZkh63vQ9lnp+hGt64yTNVPOk8WHXnwgBC+Y4Bas4vIFMPhk2rC37SGTIeLIzGbzI5tXBTXPsLiruW2JKEAO6FBrrVMDtNF9WsXNZi2yJqPQ== 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=QHu/m9D7khFey8+n/XVUUiIoSN6pUFq+NBqYxgH5dv8=; b=ZFXrObIJaVvG/nTUSaAaqHiyyRLRgIwFPNmIXIV4iG0Fw4uLJwh4l4cSnaCnWzZF0o2+907ulGUWnSy6cYOvsLyS9QXq0+MCrh2rOosdVKWBQh4nfGREecgY+W1ZS+JioMUfJTCttEF5cjCN1gvWB41l/9hpQokOkDrQSQL1Z00DvYL67z+I8mpUfWDUI8exsXvKYyuje9VdgpXt+etxyTx2ATJ7T0oj7coJgeDJDUqa75VA2XLe/EB83i2Y4EWe1N1jkVwqaIhNfElYL5rAgHHhJM6qsGsvTBb1Cu1DScwTORx4gfxvwzZKHGSzd0RrDxyRMdxu9vlmcy1B2j1Dyg== 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=QHu/m9D7khFey8+n/XVUUiIoSN6pUFq+NBqYxgH5dv8=; b=HLHm6vrKZoJ2RxDhCAESjuxm52QFcPoS/8lri7kqY87yujzPVFLdUxa0/O2eU2Ol5G3N7xT2Hog2D4+o8IHyqNiRDtTha/Z1p0wypYZq4GKPMRfY1legVQdZS1F7BWKzsXKm+oymYOM08dS8mbEZmOGXxC7lGmbWQ3ghnR6JeAsTCEiET+859qLj4U3tU3o4bZI8kGwMX/6PMEeqGPngW2NgNVoFYtbh/RJ6d+1vhdmfyES5ZK0NJd0Yi3oS2hrtalVIbqbFZRjHFNbXV0NLs/JFAWGfRGhWxKkvOArHu7+LZZeKes47l0jgFqHutLkV85tnSRNB4iOzWdMZPFZakQ== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Mon, 26 Sep 2022 19:59:02 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Mon, 26 Sep 2022 19:59:02 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Sep 2022 21:58:55 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [thN8OgRMbTMg2Oah1Uge+keeSGgOKfHK+l0aHA70vW0=] X-ClientProxiedBy: ZR0P278CA0038.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220926195858.3857174-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: fba1f5c7-9727-4fc0-26e7-08da9ff98ee3 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmoDoqouQ984HdnI9yqZYxaIoNkELuETYHXKbUNDLpoW5Sh8Q9hPjU/t239pOkXmlvUsVApCidU9JskdsdxefkHwFZ41h6kWnLT4wmUPCn5r65SFxet3I5BMnOSHK4fIAyCrnVmVHjTh9RxTUfNwxp/7FLycvW3EVkqJ7+Kg3d687evj03J84fRLEWfwdMji7oQg1nYtotJRoJmCnEncSv4/VcwYftdwVYtd8yTG2cHTl0BqXBGn60H+ncVTMOYDp6/Ycr0OL4SbkVstDGFQS/mCQ4qzY65ms1Pcww0+IXGtNAnaoBwrXgxeWKT6kO7Kybsv+dpKgvR6wZUs8YiRGwZDXbk2HcNwlEU+bzF24ZwCwQzscTOYgtRrHYtjngTDy28ksHblqjqw40cbSKWqiaOhee1rWvUMoEGhoB31cQIz6CX7Hn8Kc7EYz12ItSIPutQeZYs4PGgduzaelbk6lQSS9TfZxqv4LY2nL4WyipmuYTfMAXqsvD2oiUVY5bB421Jia5Tkch7w46gTrKqxjJ13VIL5FbkyyByywKkOkDZywiIMS97iAVtzmZUbCxuzjwKJYGQHV+AvdwaeZ2/S+KYOJMJWplhW5KbBRarOrYqE6GKyUZQq1WmTJj8zGhGRjHy0Pe839PcORaxApr195yJrOEKwWtPJ/iS4TcSOYQx3V2VqPb45Zro2BJAg5/OBKDuAdY5u0nyHWHlotNaEZ1+kNgS8msquz4Q7zu2bs6YvkNzqMo377xOBDMWA5hV8wYs= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R/yspP0WTf933rX7jp7bN61lO36lAy+YjpVtNw+yD5grdimRlM4aG4I3W+lRSktD34C62l6MVplzpNIMHcWCCQLSsYjFCOBbj9ibjNQ2maJZ+3OizYvVDjELe+ums/IDSPKHluXC1Y2BnWTv2bMrrlb9GK8WPNRZyPwkh47ABa4czTVtcs7IHwy9aZoZaZET62YPGhuWeAsTxKdZ5E8bzWt6V59S/5ONbCE1Mb7C8G7cY79dThwy04UGWKc3mkFemRAn6LyEuI1TzojM7z9ZbvDRmrO9ZHJ9m4+1rUk2JsM5vQ+Ieu2KAxD1xLoFciHvFJ8beTFLy6ooxOpJUsG0f6nMwHgabtLFBdn4wDhGbpH+NQ0CldlGhuD3rKw/HIzpgbuZwNg8XhKKQCxNGzY+ifKKRD4qhum911+J1sTeUl0GRlZAJBze4w02eSQLLZh7715c5bUtDHoJUqKoAN++FcSBDwtRbYZYKCu4d0S2VBX5B9ahRjE62lHAUNwibZTFcTWc9SQfhxGCc9ygDhkFZtYSawh0S1f88Lw1YJZqWJn58p8dktBCIA3ed1Ab7CrzIYjhL0Cf59yiQvQ9h4e9bSkMcXzmwE4aHC/8nhNbbWgp++6ICysCpfA5lB2vw/eWc/GrXVIK6kA6OC4LonlanQ== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KeqzSY97oy5tsSeLBYTvsvASnsTkRgVsy4gFoOESEmEHxky8B065jatxVLz94mHkf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SnAbm2a9KKx/2exdzmTh+zW+zHXYay8N3ihE8MT95rDM370utDu6DdhEL6d3CuxQQXNqGTS6BrtPAkbYtcjymRlgN1N0gD+vONW9LoVGJpcR30avn+ZbQYJb+MBPBY63DwrmPcgBm9ZyPr51HY2yzl75VToWcBogc32394xlU2miVpVEi6f9oA7vc5iVCnrZ4MRgc1uL4EE+C5U61ll X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fba1f5c7-9727-4fc0-26e7-08da9ff98ee3 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 19:59:02.0976 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 2/5] avutil/pixdesc: Avoid direct access to pix fmt desc array 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: X3OV4BJ+G724 Instead use av_pix_fmt_desc_next(). It is still possible to check its return values by comparing it with the (currently) expected values and the code does so. Signed-off-by: Andreas Rheinhardt --- libavutil/pixdesc.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index c42a0242c5..f6755f41df 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2913,10 +2913,10 @@ int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt) } void ff_check_pixfmt_descriptors(void){ - int i, j; + const AVPixFmtDescriptor *d, *last = NULL; + int i; - for (i=0; ilog2_chroma_w <= 3); av_assert0(d->log2_chroma_h <= 3); av_assert0(d->nb_components <= 4); - av_assert2(av_get_pix_fmt(d->name) == i); + av_assert2(av_get_pix_fmt(d->name) == av_pix_fmt_desc_get_id(d)); + + /* The following two checks as well as the one after the loop + * would need to be changed if we changed the way the descriptors + * are stored. */ + av_assert0(i == av_pix_fmt_desc_get_id(d)); + av_assert0(!last || last + 1 == d); - for (j=0; jcomp); j++) { + for (int j = 0; j < FF_ARRAY_ELEMS(d->comp); j++) { const AVComponentDescriptor *c = &d->comp[j]; if(j>=d->nb_components) { av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth); @@ -2948,6 +2954,7 @@ void ff_check_pixfmt_descriptors(void){ av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2); } } + av_assert0(i == AV_PIX_FMT_NB); } From patchwork Mon Sep 26 19:58:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38373 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp49367pzh; Mon, 26 Sep 2022 12:59:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5xqUqFp3vchEic3JdsCwz7Fh9c3TdVN6d7QxjAmxqy3MY5tAo4TzGG2WTzzxpoRPfr1xV4 X-Received: by 2002:a05:6402:1941:b0:457:138:1e88 with SMTP id f1-20020a056402194100b0045701381e88mr13358063edz.394.1664222365231; Mon, 26 Sep 2022 12:59:25 -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 f6-20020a056402150600b00457463e2dfbsi3420497edw.512.2022.09.26.12.59.24; Mon, 26 Sep 2022 12:59:25 -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=r1xRECim; 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 1D08768BA4D; Mon, 26 Sep 2022 22:59:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2017.outbound.protection.outlook.com [40.92.89.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2707768B61C for ; Mon, 26 Sep 2022 22:59:15 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SHBc1R2Ca1mnJqWxNq3dM7zwM67ih2edlION/HztKRMxYxLHa1aOq1RYJZ9lgpyjuYTEbhO+2PuD5N0Czns7Ogj6lP+D7O3rBiLxFRcW3UB30xaKvVHpHW3CoBBonRlranlrh19TBFR88hCm9wdkzlnZUmx7ZB2LH22WtYN2WrZdpkDPwD6iujsISJ1cdmZcnJHXs1cvOnIcfZxmc0cZjpIZuNSvWJlSVy/smMBDXEdtTQI5EqOMQ8k3CCY+Q++A7haYm4C+6PjV7bAckBv/83gyFbijEq766rm41iirCpSwdzJkeXPfrOMd3CdfHqH88g11lPZBPE6LGBCSm41cxQ== 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=+gl8Uligr6FuVlZL6RRGzWOqCPT/v5/XSUuzKYztsBk=; b=hm8OdVaEEokmOE/fZikRnK9BLDtmxNJ/Q71XGtON3I1q9ChJNuMMAi304DIw4UAAquKhWO3Nte45bVSFdvVEccm1E0arnottmYz3qYzEP9MfX29s5+qYBClmV4Wb2ZuhNzXGC8gLrwJiJGIgf6l6Jg2uaNiMIoRqBz/dEDySFkXZg5jvDCjUeT55Ngd7w/dw8zwRjfzZmTg6muVd6eL/DG/pPdwKP5/+xit/0R2Z1K5s+dV1vqawqtRT3xir1b5pS2NiG/HrY/lLvNark+3vN5AlohVS/8apjXcxhHX6/jiMiu21Kz2yMcFmlTI94I+WzjrTx/FfrpeOhWUDZ7e0Nw== 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=+gl8Uligr6FuVlZL6RRGzWOqCPT/v5/XSUuzKYztsBk=; b=r1xRECimTYF2ZLBy4xaX73A7qTz8ahq0qIHr03Og1rXzqbBWkkDEx+fwurZO4pCgEpChPU6lC+ODHDGBOOonFc4EeOnt1T6p7pCx968omybcn9+4wZCTEijDh5HBScwcA9D/ENFNvb+fZBpRcsXl7aOwr+HZT1fON61Xf0+P42KAbtcV4/x5i1HJVGub7XPiaORerXyIkIlbopbq89Yg/E9YDUKEREmGhH87FQ9OOa5GasKnhQfPBEsBgprFcsbSap9YT3J1ZQPYKU8nHGMGM2vaLOkGNtlT1BGE4YxWimEV6iGfBXM9v5M6y1ikNBTTWZ65hBAiTTCaEvMcmySccQ== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Mon, 26 Sep 2022 19:59:13 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Mon, 26 Sep 2022 19:59:13 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Sep 2022 21:58:56 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [8K6Qo03amji7W0mjGfkgdw1dQquRwV6SMN8hFE3qL20=] X-ClientProxiedBy: ZR0P278CA0038.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220926195858.3857174-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: 086de836-08be-4a9c-a618-08da9ff995be X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmoDoqouQ984HdnI9yqZYxaIQz1MGz4ZioTDnm5Dv/0a5JwMdFeWTCfmhcfTGlHBBNP2XSU9T9YTG+MJ2MnsKnMMfT9XCpcqK4rn7clAdN+LJyS82SesZxfqI/1VfAgKAntZf+dNNbzYt6HFhOBx3lQ43AusNhq78+iTu8TOTwRtZlj/jnM5Td82V0YtONTukTPCg+wkYy83P2o8ul0S5ih0hL+FNE/FSk3uZQQ3+VoQ114hrWfPXHAq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37Raecx5nPtVpa7X6ouorHivvR+74sd05hgMC61J7gA940R9IYb9j37kzvPRf8gNbRyU+cZm4wnPvhP+y90OsKQVO4Np0NDSjObp9Nl3YQo0mBRf+PMWPCBw5GjHeqNtNaSuYVFKQZ4DSH42zk7prx9XcbKNccVyhx15UKuue9t3yEtTJMohhlvboxCgeQ4093GwwE/mNf2GrOLqm/Idens0Jj3SmFvyZFfGi8WJ0H7Juj5jFS0Qpa9EI4mbfzgNOMciWtwQbIsvB4D1zPsH6mddT0gPGS/i2HA4pPCgb5uAYqpxOSAworPFNxEwc/OcM42WaremBmBUX32L43KlOPEphkJfPIpddNu0Cvm8XlYUsMZYUOxuzJ0tUOxIJW4Wj4wvET4TDqkJFByYSi2ZDwawWJIB6Up0tvDtB9hN2Xs/wJ2o1nLt17uV9Wx9uCeK/TDzo/X+nH24wd6qW1VDgif/PUYvt X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 086de836-08be-4a9c-a618-08da9ff995be X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 19:59:13.6193 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 3/5] avutil/pixdesc: Move ff_check_pixfmt_descriptors() to its only user 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: Hf+g1cyidA5h Namely to lavu/tests/pixelutils.c. This way, this function will not be included into actual binaries any more. Signed-off-by: Andreas Rheinhardt --- libavutil/internal.h | 2 -- libavutil/pixdesc.c | 48 --------------------------------- libavutil/tests/pixelutils.c | 52 +++++++++++++++++++++++++++++++++++- 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/libavutil/internal.h b/libavutil/internal.h index c9e30bc5e9..454c59aa50 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -187,6 +187,4 @@ static av_always_inline av_const int avpriv_mirror(int x, int w) return x; } -void ff_check_pixfmt_descriptors(void); - #endif /* AVUTIL_INTERNAL_H */ diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index f6755f41df..ca3e204a0b 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -22,12 +22,10 @@ #include #include -#include "avassert.h" #include "avstring.h" #include "common.h" #include "pixfmt.h" #include "pixdesc.h" -#include "internal.h" #include "intreadwrite.h" void av_read_image_line2(void *dst, @@ -2912,52 +2910,6 @@ int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt) return ret; } -void ff_check_pixfmt_descriptors(void){ - const AVPixFmtDescriptor *d, *last = NULL; - int i; - - for (i = AV_PIX_FMT_NONE, d = NULL; i++, d = av_pix_fmt_desc_next(d);) { - uint8_t fill[4][8+6+3] = {{0}}; - uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]}; - int linesize[4] = {0,0,0,0}; - uint16_t tmp[2]; - - av_assert0(d->name && d->name[0]); - av_log(NULL, AV_LOG_INFO, "Checking: %s\n", d->name); - av_assert0(d->log2_chroma_w <= 3); - av_assert0(d->log2_chroma_h <= 3); - av_assert0(d->nb_components <= 4); - av_assert2(av_get_pix_fmt(d->name) == av_pix_fmt_desc_get_id(d)); - - /* The following two checks as well as the one after the loop - * would need to be changed if we changed the way the descriptors - * are stored. */ - av_assert0(i == av_pix_fmt_desc_get_id(d)); - av_assert0(!last || last + 1 == d); - - for (int j = 0; j < FF_ARRAY_ELEMS(d->comp); j++) { - const AVComponentDescriptor *c = &d->comp[j]; - if(j>=d->nb_components) { - av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth); - continue; - } - if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) { - av_assert0(c->step >= c->depth); - } else { - av_assert0(8*c->step >= c->depth); - } - if (d->flags & AV_PIX_FMT_FLAG_BAYER) - continue; - av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0); - av_assert0(tmp[0] == 0 && tmp[1] == 0); - tmp[0] = tmp[1] = (1ULL << c->depth) - 1; - av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2); - } - } - av_assert0(i == AV_PIX_FMT_NB); -} - - enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); diff --git a/libavutil/tests/pixelutils.c b/libavutil/tests/pixelutils.c index 927c8d9217..6e5e8cf738 100644 --- a/libavutil/tests/pixelutils.c +++ b/libavutil/tests/pixelutils.c @@ -18,15 +18,65 @@ #include +#include "libavutil/avassert.h" #include "libavutil/internal.h" +#include "libavutil/log.h" #include "libavutil/mem.h" +#include "libavutil/pixdesc.h" #include "libavutil/pixelutils.c" +#include "libavutil/pixfmt.h" #define W1 320 #define H1 240 #define W2 640 #define H2 480 +static void check_pixfmt_descriptors(void) +{ + const AVPixFmtDescriptor *d, *last = NULL; + int i; + + for (i = AV_PIX_FMT_NONE, d = NULL; i++, d = av_pix_fmt_desc_next(d);) { + uint8_t fill[4][8 + 6 + 3] = {{ 0 }}; + uint8_t *data[4] = { fill[0], fill[1], fill[2], fill[3] }; + int linesize[4] = { 0, 0, 0, 0 }; + uint16_t tmp[2]; + + av_assert0(d->name && d->name[0]); + av_log(NULL, AV_LOG_INFO, "Checking: %s\n", d->name); + av_assert0(d->log2_chroma_w <= 3); + av_assert0(d->log2_chroma_h <= 3); + av_assert0(d->nb_components <= 4); + av_assert2(av_get_pix_fmt(d->name) == av_pix_fmt_desc_get_id(d)); + + /* The following two checks as well as the one after the loop + * would need to be changed if we changed the way the descriptors + * are stored. */ + av_assert0(i == av_pix_fmt_desc_get_id(d)); + av_assert0(!last || last + 1 == d); + + for (int j = 0; j < FF_ARRAY_ELEMS(d->comp); j++) { + const AVComponentDescriptor *c = &d->comp[j]; + if (j >= d->nb_components) { + av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth); + continue; + } + if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) { + av_assert0(c->step >= c->depth); + } else { + av_assert0(8*c->step >= c->depth); + } + if (d->flags & AV_PIX_FMT_FLAG_BAYER) + continue; + av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0); + av_assert0(tmp[0] == 0 && tmp[1] == 0); + tmp[0] = tmp[1] = (1ULL << c->depth) - 1; + av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2); + } + } + av_assert0(i == AV_PIX_FMT_NB); +} + static int run_single_test(const char *test, const uint8_t *block1, ptrdiff_t stride1, const uint8_t *block2, ptrdiff_t stride2, @@ -87,7 +137,7 @@ int main(void) goto end; } - ff_check_pixfmt_descriptors(); + check_pixfmt_descriptors(); #define RANDOM_INIT(buf, size) do { \ int k; \ From patchwork Mon Sep 26 19:58:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38374 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp49438pzh; Mon, 26 Sep 2022 12:59:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7DkUYmEGkFmW10LB3aPHO6IkiHfTvgZaohOAufdU2f1W2bkUfgMkoo23uTif7gNRGYi5Un X-Received: by 2002:a05:6402:4505:b0:451:1551:7b14 with SMTP id ez5-20020a056402450500b0045115517b14mr24610551edb.300.1664222374278; Mon, 26 Sep 2022 12:59:34 -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 q27-20020a056402249b00b004551a7e54acsi13026897eda.74.2022.09.26.12.59.33; Mon, 26 Sep 2022 12:59:34 -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=nor0LIrk; 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 3C6AA68BA39; Mon, 26 Sep 2022 22:59:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2017.outbound.protection.outlook.com [40.92.89.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4B40268B427 for ; Mon, 26 Sep 2022 22:59:20 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GZQvHUdSU1F3sC4dewZTeFKQP5OkjYVSzB5oePaS/h/JWJ84Q7XqRGeTWWgpSsFIlnDF5AkxPouDXAPhNlu4IkDuPbKBxYfAx86K7KAchqlwL0GkO00NPUBUHMGxF9WBvKBxhAMpLD+EoSB9eJ10czVSYRoIpqjEbvoKoEM8BMZoEU3uajC43CUhSOLek0HclEIr8Camt02sJz58z55cCz9sC/NFV5ZFaiHzZ4To2hgdTIfCPWkHV0Tms459hxyt2iRR/oFAONs2/benJ69sbe/12yvg2fWz25lNkFr/Iimkj4YNHmhdGBAl/GlGPx5l6ED1D5LjU3/6O7Fv90KtdA== 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=6C0bkzkgNRit3d3038DKI+z730xgqA6932oqPQg1ZOk=; b=NdbtpyG/vrbY1CYKFj+CE/uuK+k5g8FczBQBuRF7YerIQN68WqrXE+vEuKRq4/QUjr4/ZpY2iK2Y+BYK1FN0tEMbVuz+AIrM2osHIG83bKpt7xnQ8xdNJtZVgF+liaIuBupRtkzl8e6Jf2RA+0jz8REF+lSFDBVWqr7Gx5i/GZJWl+S92fYWKO8lPtIn3hPmpxSFVkvj2j2FXR6lEf7ZbFA36W5mjlqZptOzHtf0LtHgDPtNDziYnBepX2S4zOhZsw+pZ2kebZgqeUNKEk/HoHXKChJJcLtM65i3AO+1wPrLtZYpZdqpXqxfyPYaqMkRpBsvmqXnBtg3KIvsoH8HUQ== 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=6C0bkzkgNRit3d3038DKI+z730xgqA6932oqPQg1ZOk=; b=nor0LIrk/vKKAWyZVQTRO4qUUAUDb88RwlMFxBYxPAxijQQCD5loL6xKZXU6nO5tgW8wDGpxytUTHhnpxRhGtXxBcip+s6PCdMohoZU1e3itFzddWvxBjze4wUH/QHBS+egkDLJW3zket1FXyR+HF1wUX5SGeSwEpK+3aym9siEukQxkNw6fEVTSNttURO+nbpCN7h6PtCQuCHdJeAvDAllZu+tcCGE+orkYrPgNROC8KJfeUPBIqBCO3LDf3N6bBQSojyXIZ6NuZfhFLW/WiWLdYqhzQGeNeqsXF/Sz2TSau3xVRdlH3W08F/+/Mfdzsq59r2cLBjq8UNBmRMZvhg== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Mon, 26 Sep 2022 19:59:19 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Mon, 26 Sep 2022 19:59:19 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Sep 2022 21:58:57 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [kSTAUZ2yEX09OXbIleBHPRfemrVHEwmZ3QmdTeLnFdw=] X-ClientProxiedBy: ZR0P278CA0038.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220926195858.3857174-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: de412b02-6057-40c1-0f7a-08da9ff99931 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKyTZJd+JeXElu/6yZudWDRQwjVAiN7n1A+ForIUTJdaNL7+unZWS+x3rU8tPyCRBMjSFJhw2+MnHX0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PpddQ6fyptd5l56Ibvwqsm3NDSNHYavTTV1mkO93BuTIf2xv8scTbBGt/O44hvfndjyZ25cQDATcKMirp8OaE7oCBbjLixYLJuM8XOt4uA0cqboqgbJDHiXBK9PuMUs0fRKvo95Aek069Ob1VGM1jeStoyBw5/9RHzBKnZ4xgXQiao5pNO6WihBe6jI6OjHnaF+N6T3wTHimsOcnWoJHKQdDxsl4Qyr5NEJ/m2mBRBfG6++QDORbGlykFIO5qcKC2vWSkcj+nSwiG46Wz9oSaTiQeSGGDcsuR7LDqyKjdAPMGXsxESh3v5XAFFbGD6T5heSUH3BpsQD/MAxMBkFC2HoRLj7tAWkCgT6sQ9S9CeWrH9MPOa8S7LPFNAI9GgN9oLI1cwKMaNLhHWqVl09688RcDO0Am9sEqQlyVcKMl7M5q5SNrbaWY7uODgyziJWKk6BW47ugEvNkOVjl+cCu6REmxcS9uN8XCRkCVbzrIZqTBI2t2YhWourQhFZooEQg5I+IEfieckk+A4mQF6zaLBPc++VsqMUsyiqoRKui4z9k2fz11ay7neEI= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: de412b02-6057-40c1-0f7a-08da9ff99931 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 19:59:19.4491 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 4/5] avutil/tests/pixelutils: Use av_assert0 instead for test tools 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: F3OtSPs8sz9B These are test tools, so they should be picky. Signed-off-by: Andreas Rheinhardt --- libavutil/tests/pixelutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/tests/pixelutils.c b/libavutil/tests/pixelutils.c index 6e5e8cf738..2d9c4edc47 100644 --- a/libavutil/tests/pixelutils.c +++ b/libavutil/tests/pixelutils.c @@ -47,7 +47,7 @@ static void check_pixfmt_descriptors(void) av_assert0(d->log2_chroma_w <= 3); av_assert0(d->log2_chroma_h <= 3); av_assert0(d->nb_components <= 4); - av_assert2(av_get_pix_fmt(d->name) == av_pix_fmt_desc_get_id(d)); + av_assert0(av_get_pix_fmt(d->name) == av_pix_fmt_desc_get_id(d)); /* The following two checks as well as the one after the loop * would need to be changed if we changed the way the descriptors From patchwork Mon Sep 26 19:58:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38375 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp49495pzh; Mon, 26 Sep 2022 12:59:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5LM4sZlA/V+QCQul3cBid+H5ob+QWhLhxVAskDvtKzJjYmX6xZNug9LYIWS6RVALYlOgWG X-Received: by 2002:a17:907:1c9a:b0:782:3046:e966 with SMTP id nb26-20020a1709071c9a00b007823046e966mr19135071ejc.732.1664222381730; Mon, 26 Sep 2022 12:59:41 -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 q27-20020a056402249b00b004551a7e54acsi13027180eda.74.2022.09.26.12.59.41; Mon, 26 Sep 2022 12:59:41 -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=YG1WKGkN; 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 51DB668BB0C; Mon, 26 Sep 2022 22:59:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2017.outbound.protection.outlook.com [40.92.89.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 726BD68B9A4 for ; Mon, 26 Sep 2022 22:59:25 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BVneO16XHO453vzuZEMbqmGIC1jYX9AssPz5+/d6lmmuFwC5hCsoGfjhF6Dn4RmBTA5/j6Oeprp6sd7cBsWYsqWiCl0B+s3Dred/UZrcW9eoLddKUG1qWY0Q3lnz50hFEYu6LnDVHww2y9y0wV8X7p7mIngkd3MqGQ5ubneSwosWfnpAKRXZUE1zxZSACuMxfrNL1g/w/o5NcY/rZgxwhzlOmrfaWL1MgWryEEd1OuF4wmyPPNdTlHiTFKYYj+WXiBEf5/HL1O6wvWs4e9+REqg0oZ9X41uhaCNxGP/UuNFWP0lQXF3LyWXcl//H8rxcldEpamyv1HwHFExcjZ/G/A== 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=MzZXOK+C0gps5qUGUekgz4nUZgHoX924rSx0/lr1KVU=; b=NrIr7tctof9H37gbIY4X3ee1+48uJt6agxhjzQevE4z9fPuLB5yufPRlPSU6ZXzRQvPWYttwNFEcjR0uAL+9qzTi2Iu39Zf2El6ZtjxthTv22YIXwOz4k40ma5xMZ/r1FyPxRAaMhtOToo/RIbZDbUkCB8z+A7AEW7TxJwHFt0vKgtYgauVPwzCsRrdT52pEQcljXH7adhG7oASjPycxcJ2pKGnmpEiEMMe2+5mmMc+FdHsLaVtjHbY/diwszpu86Hn2PDdb9jpCFfDHr0nz0w9TPoKwI+gMclmoVHOYyuMysEeg2Go7Ndjc6P0TIJ97JQ3Zykka48VjFarRzo6omg== 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=MzZXOK+C0gps5qUGUekgz4nUZgHoX924rSx0/lr1KVU=; b=YG1WKGkNWG1Vsuvm7y4YBoz0TJt/JOCTzdvuAZ80rpxCiB6aZdh+X6bnw7JoffC7Hzh1ByAMOo88Ps4anfUtBbF7cpKTKtgTNZ8N04CETUtOob4QnRupeZXHhLGzVQEl6nylVwmIYFLIEMEZggDO5I6ylkILPggMNwtFZUtZNe/6kIqKhOb22M33CeIdpQ6Z9wqCX71v785H4inZWKtodAwth/ZlJ8nNvY+GGIIrF76hA9+nZ78uxCtDf50yLseCmKDef9JsMYN+qzVdwDLVLVoPSh4IQ1uGzP9HoSe6qcGhsq6SpuBfCt3zFG0XbAUPHBbd+zsilgGPoLyCmBiQLw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Mon, 26 Sep 2022 19:59:21 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Mon, 26 Sep 2022 19:59:21 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Sep 2022 21:58:58 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [f8wmI3HKFboDGOZEMtwHEbVGB1FBO+eciPLYIdk3bzA=] X-ClientProxiedBy: ZR0P278CA0038.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220926195858.3857174-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: fd700b0c-399c-4a4e-bc30-08da9ff99a2d X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKyTZJd+JeXElu/6yZudWDRQCp314UDA7t7TVD0yXuMsI0ZADeEeIFMOSUbCyOi6ty2+y1rOgTqBy9kdoPmlMw9DGrc97I4IyxE4m0fZJ+a1Gnb+f0F43ZhasOVghC4V40a5EBBOxI5DMZ1KITWdIO8DBTjSAd30Vk/JWjOusnmCLxFNbG18HQh1LcnHQXylkrjb32eB4jKQKPKvRUGZNOjGSq19/nIPEXK/LEGnjzf/VNMjTgPNwlib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w3dR/uvfJj/p4oQ0TA6xXzWZ+uEYLJe0I1OugEHUG2rfdrN3MoHyOabtcUe988+kww3aTnKpayJ5NF0F6cogtA6RnjGVjC46wEk6rvK+mdWDeOP1p5ivgrcXexZLPIweLkNr+D5ihVt3EziygxL+gEcFHQ0zjJuoyASOP6XiR03P+0OeTbEJtHyNx7g65bhju9R4slNZQjqV3shz81YVbODd/BHNYCvsITkUqvfInLYubqX8fKYdwWcA5DagNZITDmVhrOPxLIPQarEt+EFwEmlfxqipXrJvUjBBXr7ssdWrQpa3NxT+aJlTSUIrgAz1on1vKx04hWGkx8AVYzggXE3Ac+twitOcOfFRv/CtMGN0uRp2RRwtLy6oVKumUtuObTixBeukXXYd+QjKi2d2TJOAb+P/68= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd700b0c-399c-4a4e-bc30-08da9ff99a2d X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 19:59:21.1219 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 5/5] avutil/tests/pixelutils: Test that all non-hw pix fmts have components 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: DIJi6n1nTRsW Signed-off-by: Andreas Rheinhardt --- libavutil/tests/pixelutils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/tests/pixelutils.c b/libavutil/tests/pixelutils.c index 2d9c4edc47..548ecb8801 100644 --- a/libavutil/tests/pixelutils.c +++ b/libavutil/tests/pixelutils.c @@ -47,6 +47,7 @@ static void check_pixfmt_descriptors(void) av_assert0(d->log2_chroma_w <= 3); av_assert0(d->log2_chroma_h <= 3); av_assert0(d->nb_components <= 4); + av_assert0(d->nb_components || (d->flags & AV_PIX_FMT_FLAG_HWACCEL)); av_assert0(av_get_pix_fmt(d->name) == av_pix_fmt_desc_get_id(d)); /* The following two checks as well as the one after the loop