From patchwork Mon Apr 29 15:24:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 48369 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp2066714pzb; Mon, 29 Apr 2024 08:25:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX9nBbVPCWbxk5UekYNbscIZXcHNfqiBWq+uNWc85NijFC27rZPjuFKDthN0GDdF8NakQkA6eaK0762poNFoMAc9w0GA0qv3Cox0Q== X-Google-Smtp-Source: AGHT+IH6aBzaewsVlSan6gqdFMJP+7iJgDeD0Y5pAaIFXl8Rb1IAHQvRpSRv0Uh1Aabvev1LIgcP X-Received: by 2002:a19:5f56:0:b0:516:d6b5:7caf with SMTP id a22-20020a195f56000000b00516d6b57cafmr7443980lfj.6.1714404343133; Mon, 29 Apr 2024 08:25:43 -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 qk41-20020a1709077fa900b00a55760b004csi14821679ejc.716.2024.04.29.08.25.42; Mon, 29 Apr 2024 08:25:43 -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=WllBvbxa; 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 03C4968D4DE; Mon, 29 Apr 2024 18:25:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01olkn2097.outbound.protection.outlook.com [40.92.99.97]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DEDB668D4CF for ; Mon, 29 Apr 2024 18:25:16 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YwkoYR5dlaOHxAJRbKtqs0UxVXBDdsXtR8VqRzYq5l2pli+6yVPmzd64HoELDmy81cmhyQEWmItMfDUV409Md91NZFib/WvgU4KtoYdv1TgGko9K95V5XrIpHyBlP1MRu7z+HTFzxIPuABDvaD70bjiQqxseIku9H+2ZrbG0ouR151gDQsntxmvaDvL3TQtXhtsIrqgL5ZujJeDXS2L5QyfyLJ3lQ+f+cj3bKqf+gLetjbzIvv5DMPuqvJjumYMm0c9pQoqTXJdUiuuIxczyMpweaaNrobKPWTwt18XO377U67bRnKzQye4a9UgMaZHDfpRaZQwfL16asGKZl7ZM/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=b8r9oKo/ra4P278GU8dk7Eyxy67UXA47PeQewuAMDBI=; b=gw+Jp7zos47hYwIPWp+co6OQKowlyGo483zGdUnNrLneq/EDBIsJpqbwFmfjXJZqXpzibduwpTOap7eqQVarkkavqR+sdaIT9/Q+g3El3aXMcpDJioKM/UufR3Rk5qT7YEiQK6mJs3r8YcoytyQnlOpr8XdjOmswphqC84IwufBGu/dvKXMxtxNV01dtnosHTnR9vlehxJQHMTaM+IOBut9RsDJhCdmo+aVJqPSXzr0ImWHiJnxvqCU6dfKtb7aJWqz7o4ZkCJRBQYivmCIf1zdZX42jSlyrIpY5Zf+Iyyia8W0lFRBIohyb1iqG4q345HCNEUkxd3Mbdu2l2kigsg== 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=b8r9oKo/ra4P278GU8dk7Eyxy67UXA47PeQewuAMDBI=; b=WllBvbxagJxfQETZeSj17omsP/YhHyt+7SpHpabPpfA4CVZWz4NR/qe4l0bZrDwtngd3gKY0NWzt24rbpyFmlTyn23GBuXPpiKlpxqP+iEwsX0o2wKjvf5VScmZ5wc7/JmKgwOhEGLXRWz/nRFkTGZKye+bwXvWZOBuCqIWujq3RQ27Qj+pI0/+cJN+cHbD0o1C1/61JbvpIS+Aviktd1h32gDE1L75lL0zJqEKjyaWwjj+mCtjXv/E/ExpMXhIRygh6C1VykeWEhlqj7XRKXnKgX/nsmRbzVD4Wu/yqefsv7rnqVx7JvUIN3HYYM8Cr72d2ggkpxo1neAbq+gemlQ== Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) by TYYP286MB4080.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:14f::5) 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 15:25:10 +0000 Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::451b:2fa4:87f7:14a9]) by OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::451b:2fa4:87f7:14a9%5]) with mapi id 15.20.7519.035; Mon, 29 Apr 2024 15:25:10 +0000 From: toqsxw@outlook.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 29 Apr 2024 23:24:44 +0800 Message-ID: X-Mailer: git-send-email 2.44.0.windows.1 In-Reply-To: <20240429152445.1461-1-toqsxw@outlook.com> References: <20240429152445.1461-1-toqsxw@outlook.com> X-TMN: [f3gSNWtYx22w2W/CROCgYeaeKW95b69Z] X-ClientProxiedBy: SI2PR04CA0016.apcprd04.prod.outlook.com (2603:1096:4:197::7) To OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) X-Microsoft-Original-Message-ID: <20240429152445.1461-4-toqsxw@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OSZP286MB2173:EE_|TYYP286MB4080:EE_ X-MS-Office365-Filtering-Correlation-Id: 9b8898de-1454-4600-92e1-08dc68608f06 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|440099019|3412199016|1710799017; X-Microsoft-Antispam-Message-Info: uhRGFGfWbTrFBi+dO4eF14AIB8kY6mYxXgH3SRwNMO/D4xbsM+JxRbLhMYgV/6Ir4bpOv1gYUWVU0+JSf8Abxyl/9jpk/mUm4t6ct0idgl4Z6xcIOBN+Tw4VheSfBVzKNeVUJD9y/hBU+RH7QiHvJVGnOoalIZq1O7m56rkm3w918M730FnfNESE5+X/IvUicyxMtXzePLLuuk8dvvIm35IWuF29FVr9IsihAJLcOUvUdUbn1x0lbcKpcxiu3s9M3eo/vZRdKZr817RBZlBJ5WUzbWeO3bc+0o7C1w0YWnxdGgG349YQ8XsQWGhjN2C0tL1iy9GpPKNjRv76MnXsilRo/9pHfIDPrxycfnHDJTZ0n5QnsnqoyA27ny6kruyC5HqBxI8HaZWkQTuzdVwaUaskoFnrkXgCx6ACjD/2winUmnr4ALwvVkjG570kYl9lflk0whdTKiZvR1zpiQBzQsSxjgM/2Q9dhrtVedvLioUtz3l6lXRTsrupGYj8YBzy6/xmYNnRUtBSWFl75tTTg6mktsR5TOjXhNHr5pF7OJf2QTATRYa05w/psJnIiR4jmiNOkTBt/IpXQf9HgLCvEAM4UGRCHRz3U7tcMds7kPlDb63GpaywA4y6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pywrLNYAKHYY9lAHeCmF4UO6eGXO5FJ5qq/qMDvdRxVplzArnIFgySaHPpB85tEBx285mDbw8+B9i2GcdXlPMK3ZlZBunLv1oMqoRJzzdFrMuIlfD5gbvLPynttAS8cW+YUkVOaPbQ+9bSXewxl7n3PxOMrQJ77nCyjLR5bV/0jCJchVga1w7r6/ZrV1WVsgw6q3Gnj7yL1SQLslMV6A/FZ39sKh4+kKfhWvO14= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b8898de-1454-4600-92e1-08dc68608f06 X-MS-Exchange-CrossTenant-AuthSource: OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 15:25:10.7633 (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: TYYP286MB4080 Subject: [FFmpeg-devel] [PATCH 4/4] tests/checkasm/vvc_alf: add check_alf_classify 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: Wu Jianhua Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: H6FmWQLmi852 From: Wu Jianhua Perforamnce Test: clip before (fps) after (fps) delta Tango2_3840x2160_60_10_420_27_LD.266 56 115 105.36% RitualDance_1920x1080_60_10_420_32_LD.266 272 481 76.83% RitualDance_1920x1080_60_10_420_37_RA.266 303 426 40.59% Signed-off-by: Wu Jianhua --- tests/checkasm/vvc_alf.c | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tests/checkasm/vvc_alf.c b/tests/checkasm/vvc_alf.c index 10469e1528..9526260598 100644 --- a/tests/checkasm/vvc_alf.c +++ b/tests/checkasm/vvc_alf.c @@ -121,6 +121,47 @@ static void check_alf_filter(VVCDSPContext *c, const int bit_depth) } } +static void check_alf_classify(VVCDSPContext *c, const int bit_depth) +{ + LOCAL_ALIGNED_32(int, class_idx0, [SRC_BUF_SIZE]); + LOCAL_ALIGNED_32(int, transpose_idx0, [SRC_BUF_SIZE]); + LOCAL_ALIGNED_32(int, class_idx1, [SRC_BUF_SIZE]); + LOCAL_ALIGNED_32(int, transpose_idx1, [SRC_BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]); + LOCAL_ALIGNED_32(int32_t, alf_gradient_tmp, [ALF_GRADIENT_SIZE * ALF_GRADIENT_SIZE * ALF_NUM_DIR]); + + ptrdiff_t stride = SRC_PIXEL_STRIDE * SIZEOF_PIXEL; + int offset = (3 * SRC_PIXEL_STRIDE + 3) * SIZEOF_PIXEL; + + declare_func_emms(AV_CPU_FLAG_AVX2, void, int *class_idx, int *transpose_idx, + const uint8_t *src, ptrdiff_t src_stride, int width, int height, int vb_pos, int *gradient_tmp); + + randomize_buffers(src0, src1, SRC_BUF_SIZE); + + for (int h = 4; h <= MAX_CTU_SIZE; h += 4) { + for (int w = 4; w <= MAX_CTU_SIZE; w += 4) { + const int id_size = w * h / ALF_BLOCK_SIZE / ALF_BLOCK_SIZE * sizeof(int); + const int vb_pos = MAX_CTU_SIZE - ALF_BLOCK_SIZE; + if (check_func(c->alf.classify, "vvc_alf_classify_%dx%d_%d", w, h, bit_depth)) { + memset(class_idx0, 0, id_size); + memset(class_idx1, 0, id_size); + memset(transpose_idx0, 0, id_size); + memset(transpose_idx1, 0, id_size); + call_ref(class_idx0, transpose_idx0, src0 + offset, stride, w, h, vb_pos, alf_gradient_tmp); + + call_new(class_idx1, transpose_idx1, src1 + offset, stride, w, h, vb_pos, alf_gradient_tmp); + + if (memcmp(class_idx0, class_idx1, id_size)) + fail(); + if (memcmp(transpose_idx0, transpose_idx1, id_size)) + fail(); + bench_new(class_idx1, transpose_idx1, src1 + offset, stride, w, h, vb_pos, alf_gradient_tmp); + } + } + } +} + void checkasm_check_vvc_alf(void) { int bit_depth; @@ -130,4 +171,10 @@ void checkasm_check_vvc_alf(void) check_alf_filter(&h, bit_depth); } report("alf_filter"); + + for (bit_depth = 8; bit_depth <= 12; bit_depth += 2) { + ff_vvc_dsp_init(&h, bit_depth); + check_alf_classify(&h, bit_depth); + } + report("alf_classify"); }