From patchwork Tue Aug 20 13:22:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 51090 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:40de:b0:48e:c0f8:d0de with SMTP id lb30csp308373vqb; Tue, 20 Aug 2024 06:23:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUz9MSiHaNx5D/aCoDY423g2efBMlppTPDH3i3ZUh5y239Vk3cOYyfRqRYsmb2ACmgy2iMgxOr2rxeyW10NWbts@gmail.com X-Google-Smtp-Source: AGHT+IHGAQNBCI6gLQoJy1lBk7SlAIfU3PjYfJByN+kkzMK7ASDT+U66987dlYFlF/j15SYWku5D X-Received: by 2002:a2e:a60b:0:b0:2ef:1c0f:d490 with SMTP id 38308e7fff4ca-2f3be5e4c3amr79669061fa.39.1724160225810; Tue, 20 Aug 2024 06:23:45 -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 38308e7fff4ca-2f3f1809f55si2571021fa.594.2024.08.20.06.23.45; Tue, 20 Aug 2024 06:23:45 -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=eGOcicJx; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CDBCB68DDBD; Tue, 20 Aug 2024 16:23:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01olkn2095.outbound.protection.outlook.com [40.92.53.95]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A4E6D68DD74 for ; Tue, 20 Aug 2024 16:23:07 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lLTfuJfLnN9D05DMvln+44Mbnw+YIotPM8AS61EPoTJZ/GbMGTFiLQXePX7ubHZ4A1c2wbaK4ogo6C7opO2RPL7fBj92Us3JTKSGHRmmtAQiJyH3EwYaB5KS1AY5Jo7HQg6jJB2e+ju6mIp5m0usvicvKjn646j9xwCuDzP9cUH849bVN9MQKM4AXTLJsdXWGzCBoLITMQdiMnsjrTR4Aii8b0rEWOSDO72CdrZYBO4LkgSmH0su3sBiA7FrVuLMFFRI8hRJ8SJmXCt16t2qrNQziiisthkMmwU1z8GfnWgY9G3Lo/47g9F4b+LRl187ljGznTdscX6JHXlrKqEdww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=D7nf9/n4C8gqaJyEzvDxVmOWwyiyDCxUqs8jECiw92w=; b=M0nItSoQVyQS7CoOt9yi3lPv3OoqudouqDczFhanjOFS7FoTf85xm8RrpTe8apr/BpI7D6B33npWN1ViDBCATch5dtJuA6GgKfGQLP6MNZvwamnDY3hJQ2BV5G0XiwHIy4+GUWj62fyi5CYI52+j+u9Rijy3vZz5bOD1epqSlP991A455k3jtg52QYZm2NTMbnN6yQPskuJQZMPtSLV2eF0/ovhMVV0mgHvW1wIOMj8+tlYEye3SjgULwWslLEpIRu8DMWpwG4cv28wgUkVzfiUpqtfIJMtOce4XpyBUOl0aARQhvDxVdmm+BXIFKuuOHA/o+yDNSBxoFeUjITGfYg== 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=D7nf9/n4C8gqaJyEzvDxVmOWwyiyDCxUqs8jECiw92w=; b=eGOcicJxenBlO5RcXOBcwC6a/g4ve41yrD8/1bEXErz8Etgns5Nhck+2VgqtS1Wuv9CISg4mWPMqL45CQShtO9IWXlESFMe0TORlQlL92XPlFL9g++pDz36lZFcdvluqqa/zAz1D2AAhSdXTOFxZi4ZCTrZfXMcM/6FXtWc2JNvXNGz7i7YNr/4JgSiSRw/RrDqB+VpXXdLF/g1m2JkEKtm9cpfCekWg+WJI8QY0sD3s1OUQ5cCGr3WGwL28ee04Egfp808hiNZw/tdbGyX/oKDl42Kjjxw3N7V75V9sbrNtrTNxmCy9IKAmF3u0fwrO3W05K8MvvotECJjRbj00wA== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by KL1PR06MB6623.apcprd06.prod.outlook.com (2603:1096:820:f9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 13:22:55 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::81f7:9125:583a:1cca]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::81f7:9125:583a:1cca%5]) with mapi id 15.20.7875.019; Tue, 20 Aug 2024 13:22:54 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Tue, 20 Aug 2024 21:22:36 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820132236.286553-1-nuomi2021@gmail.com> References: <20240820132236.286553-1-nuomi2021@gmail.com> X-TMN: [Leyu01zQynijjRwmF2ccveEycDtvDAIt] X-ClientProxiedBy: TYCP301CA0028.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:381::11) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20240820132236.286553-5-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|KL1PR06MB6623:EE_ X-MS-Office365-Filtering-Correlation-Id: 4bad019e-4b9c-42b2-d3f8-08dcc11b308f X-Microsoft-Antispam: BCL:0; ARA:14566002|19110799003|461199028|15080799003|5072599009|8060799006|3412199025|440099028|1710799026; X-Microsoft-Antispam-Message-Info: lgrpIoJCu0bB3pB65lP0WbDEcY+fNSFBt+jGmG9I80SiEIGOsMwWFsejrkHNuJWJfIRr5vNxYwiJHuqjjGFWqrgP0tRZtjLi/divQe9k8ESJJTU73w8zLSvcg357bzaSh6SUQHrmEN0tbndKS6GU3+zqvVkhhmkW9PIItMG0j9h7ZOa1q8t4iR6Itp+P4BGlkHtH0ki20ri6Wmv0PJ/0XH4STecwxBfW8Ic6NhBYPwGowpD19IGPxJNEQ0BjrLN54EHefuGIqvtnsI6xH6vXdD0XXGlWJpuMolkmJapHwp/Stze8ZpR3UiDGIiBshcoRVSwH6W8GJ/V5rQuFMs8WViA6Uaynz+kWcPHnSEtMAxmg4OQnos6iPRCyTweRDionAW+ylk75XGFpfIZTZxPbCCBolDjVRsOSxIHxgCjrAPhp56TJbVPDRhzOj4W3RDl036Y2H9JYAyH4zD24UBijgyVsTl9QHSOUnVdNC4krKmPbmtcraDywewcZyJigReGveSKgT2RRtIFr3ZBYgUshMy/QELQ2EGKlNIWlr9GPF/kYhZJV/olEe4sU9h7TsgI/E1ATdO7c1Ep8AlGGEt/MWqGdOFCDYo6BzZXy0y1TuXfL4MKcfaSA3UPrzBWq1Lua3clsnQZUPdiJtjvQr4pLuLlUrhFdtFMHRJ5tMBt9/bknJkgJho7oax6FneEormYiF29Tc3XgXRyhOi0urM7b9xxnN1S+K3x9sGqRCebQAZk= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NQF47tjehWnyEeXovepobarILq4YdjRMPoGviE4qCgtze3eXuosbbkajffBDbr67D/yvMXrtOpJBDczYqEP97OaWb1sewWJ7FDMc/V0NNobdqUvZeBjezcGkCJz9ousJntfAXpbC7JldvVWLha5q8O2gjK9etAXeM66wPUOShvRhly2kBvSFBVBX9zHfpmzGOl/8bjbd60hJaNrZetp8FBA9+GRQcER30ifrNrMJqr0iDtMs4l+CvFKNlPysjElK/v1vlIlYXiPJyhdmwNTVQrJiudpO4t3S9RNRqHcsAY+9UvnDJWBkmYPD04Il+KmXjgBVgnIDTssGBbBxBX12GzXrVO8h7ht6jve4J5dCQFjNz37wmThWQPTRiGGj8yoy6mrMoGYPlyPZoNXWccaxt72FhKSw/AH/PZxut6d6584tpoeLkz3fn7f9Za7fiUiMLDArxrSZ97GiIghZEWPL7D7B4rRv4JLH7u62wFufaTF1cxpN2mo3Yqd/I+uva9FG1DEB7uZK4KmQQSz2LRxfXpaIGWbJDKr8El2kiVuT29y67MLNJ+j8ythbi4xUe7noqfr9VuoTb/CDinPaFYAWijwgb1LAmiCWToDypchAaBs2XC4YNM3IWKj/vhh0OyAWBZUgZ3c1T6Pd32pROYKl/IceiBD1g5oM/ol+cFJ9W+w5UlHRMTuTSGLQiPrjKQu2LmIVua5T8cVtlVX4ygYbD+uqY9OgasA8HRViyAv3gm3LxFLO96x9qibB4PEYsFmYTfJxTiiFwZQwIX8wBnk91sGFNQvSBx6VfnIYyh47/nnasj5S3sL/+WPzXqfcgPhW8jtHEEmHXcpbBYG2AHxb1SIBaemHwB7kvq/39NO161Fjf9Us/YTI2quoHSHujMrMAd6xZrux+/qJI9tDOtoVarVS6QLZZAogS3gWz0pHwQM/UYW/gKftu2DL1LmsaoKTrNIJvF9PUiZHrEOkluavEhO2VaBQFw7OfKEESjHo4boKdbZyZqKwvd1lfsF8FatmcbeR/vLEiDtOTar0Ii6ifyBfwrem7r7NNrM7gRHDokJ5isP1NyOSjTnzCmpowtgxJQ1yUgy+Ptf2zaUSNQfzm9ea3O/JonSq42rlSA6AXILRL81YyQ+3ei11ryIJpdFGnipnEUhQSx72gn2vzg95Xcuniuc7hZ/rZgksKPnirbA2AaEPBeqQ0Oz5Wp8LNR3cxp9f54mz4RsgUUqIxWs2QxxKXDWmVfJV4X/QZIUzRScECBSp0+UTbbSskM1yAASEpKuM4TpbXAKsMqpyFUoAAA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4bad019e-4b9c-42b2-d3f8-08dcc11b308f X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 13:22:50.5296 (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: KL1PR06MB6623 Subject: [FFmpeg-devel] [PATCH v2 4/4] checkasm: add vvc_bdof test 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: Nuo Mi Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: LKNczv3n06lv apply_bdof_8_8x16_c: 5776.5 apply_bdof_8_8x16_avx2: 396.2 apply_bdof_8_16x8_c: 5722.0 apply_bdof_8_16x8_avx2: 216.0 apply_bdof_8_16x16_c: 11213.2 apply_bdof_8_16x16_avx2: 434.5 apply_bdof_10_8x16_c: 5657.7 apply_bdof_10_8x16_avx2: 1096.0 apply_bdof_10_16x8_c: 5531.7 apply_bdof_10_16x8_avx2: 212.5 apply_bdof_10_16x16_c: 11043.7 apply_bdof_10_16x16_avx2: 1252.7 apply_bdof_12_8x16_c: 5680.0 apply_bdof_12_8x16_avx2: 1096.5 apply_bdof_12_16x8_c: 5646.2 apply_bdof_12_16x8_avx2: 624.5 apply_bdof_12_16x16_c: 11076.0 apply_bdof_12_16x16_avx2: 1241.5 --- tests/checkasm/vvc_mc.c | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/checkasm/vvc_mc.c b/tests/checkasm/vvc_mc.c index 62fa6aa7d0..754cf19065 100644 --- a/tests/checkasm/vvc_mc.c +++ b/tests/checkasm/vvc_mc.c @@ -64,6 +64,14 @@ static const int sizes[] = { 2, 4, 8, 16, 32, 64, 128 }; randomize_buffers(buf0, buf1, size, mask); \ } while (0) +#define randomize_prof_src(buf0, buf1, size) \ + do { \ + const int shift = 14 - bit_depth; \ + const int mask16 = 0x3fff >> shift << shift; \ + uint32_t mask = (mask16 << 16) | mask16; \ + randomize_buffers(buf0, buf1, size, mask); \ + } while (0) + static void check_put_vvc_luma(void) { LOCAL_ALIGNED_32(int16_t, dst0, [DST_BUF_SIZE / 2]); @@ -382,6 +390,47 @@ static void check_dmvr(void) report("dmvr"); } +#define BDOF_BLOCK_SIZE 16 +#define BDOF_SRC_SIZE (MAX_PB_SIZE* (BDOF_BLOCK_SIZE + 2)) +#define BDOF_SRC_OFFSET (MAX_PB_SIZE + 1) +#define BDOF_DST_SIZE (BDOF_BLOCK_SIZE * BDOF_BLOCK_SIZE * 2) +static void check_bdof(void) +{ + LOCAL_ALIGNED_32(uint8_t, dst0, [BDOF_DST_SIZE]); + LOCAL_ALIGNED_32(uint8_t, dst1, [BDOF_DST_SIZE]); + LOCAL_ALIGNED_32(uint16_t, src00, [BDOF_SRC_SIZE]); + LOCAL_ALIGNED_32(uint16_t, src01, [BDOF_SRC_SIZE]); + LOCAL_ALIGNED_32(uint16_t, src10, [BDOF_SRC_SIZE]); + LOCAL_ALIGNED_32(uint16_t, src11, [BDOF_SRC_SIZE]); + + VVCDSPContext c; + declare_func(void, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *src0, const int16_t *src1, int block_w, int block_h); + + for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) { + const int dst_stride = BDOF_BLOCK_SIZE * SIZEOF_PIXEL; + + ff_vvc_dsp_init(&c, bit_depth); + randomize_prof_src(src00, src10, BDOF_SRC_SIZE); + randomize_prof_src(src01, src11, BDOF_SRC_SIZE); + for (int h = 8; h <= 16; h *= 2) { + for (int w = 8; w <= 16; w *= 2) { + if (w * h < 128) + continue; + if (check_func(c.inter.apply_bdof, "apply_bdof_%d_%dx%d", bit_depth, w, h)) { + memset(dst0, 0, BDOF_DST_SIZE); + memset(dst1, 0, BDOF_DST_SIZE); + call_ref(dst0, dst_stride, src00 + BDOF_SRC_OFFSET, src01 + BDOF_SRC_OFFSET, w, h); + call_new(dst1, dst_stride, src10 + BDOF_SRC_OFFSET, src11 + BDOF_SRC_OFFSET, w, h); + if (memcmp(dst0, dst1, BDOF_DST_SIZE)) + fail(); + bench_new(dst0, dst_stride, src00 + BDOF_SRC_OFFSET, src01 + BDOF_SRC_OFFSET, w, h); + } + } + } + } + report("apply_bdof"); +} + static void check_vvc_sad(void) { const int bit_depth = 10; @@ -422,6 +471,7 @@ static void check_vvc_sad(void) void checkasm_check_vvc_mc(void) { check_dmvr(); + check_bdof(); check_vvc_sad(); check_put_vvc_luma(); check_put_vvc_luma_uni();