From patchwork Thu Jul 25 13:35:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 50729 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cc0a:0:b0:482:c625:d099 with SMTP id h10csp578360vqv; Thu, 25 Jul 2024 07:16:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXJcszpd/528tsl0UzhBmTM2DDjqpbbiUYntnoLY4MUuORcGNpsoDIb+mth23fPLWksiIC57k5A5mSgiy99LCK+5IrHOwjSv9ZeLQ== X-Google-Smtp-Source: AGHT+IHm7dfV56q1I0HjmDvBKa0tUYxr5Wk71tAqlOnVcNt5V/yBjY8x3xgMYB2vKCtyWgTWB6qD X-Received: by 2002:a05:6402:354a:b0:5a7:464a:ac0 with SMTP id 4fb4d7f45d1cf-5ac2a8ace89mr2261251a12.11.1721917013811; Thu, 25 Jul 2024 07:16:53 -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 4fb4d7f45d1cf-5ac650a438csi1052037a12.336.2024.07.25.07.16.53; Thu, 25 Jul 2024 07:16:53 -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=CchPm8Jz; 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 4C95468BB61; Thu, 25 Jul 2024 16:51:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01olkn2039.outbound.protection.outlook.com [40.92.52.39]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2BC7368BB61 for ; Thu, 25 Jul 2024 16:51:17 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=r27nkie5KIkfNyy+diO0r7xxo4MzH9Q39TUaVJtZ6cZTL8rRjPbzoif421CTeIlWRlSbu6RdDnc5/sD2W+S8aBhrhBZKCNRpuvHjhmIezZWV7gzfZhsnTfyt9SUNDemUjFW2UQkUgeg4OTM5cldSBUUu7SVeGcrn4ZaTvGtrYlsvwS1fEIm6fWlOKtugt0EHGRoWveaLE9VxDD4m1bq9PpcOBdkvA9/C1ziqoWDlBTCB8u0M39BO3aSPVrSxpJE5MSqCcvBL2KGALORFhln5r1MoFsPZ2lG2ciLF2zZGCFUGx/Kzaz+wcxxad+P9Wyz/ZMBIYoGXIiARMhSjoPWhpg== 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=LxdKjGzwfnmCKl+pNnpH4cA/H5X32UOfLdM43EEnEr8=; b=n2epcpqZAWxdzONDj5k1twiVFkne/K4GBy5mnyFjoL5jYQ89DvYYm8vunyjWO0+U0dX+FP28Gs/FNEtskWFszuZWxj5LG+wtbbtHTIKvY0kdKjeswDI1OfeKWSUSSOJ+zoOFEbfXw3TBKh4HEqOjPhKRBzbSdIZVPY0kRGqh8O00j0WZHWYswg03TdkEZICQsxpd/JBlBRGzTFgdoNLTBaDuehtrk0rQf8cIVtFiox3EDV5ICFZHeJB/NnwYSIIysifY1m4oAH5hFuYcWrKJIdU2Z7wEJFkHJWvOGvT353c0uu1qs3wivt6FGMxmBDxdAC9AprCGblSah16RDdFeGg== 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=LxdKjGzwfnmCKl+pNnpH4cA/H5X32UOfLdM43EEnEr8=; b=CchPm8JzpN7Rd8siyozP4bN6dnn9G3mnoi+9bp8X0/fulN3jtB9BWBEZ/66gGrtlwmZ9YmBJLtZZFMkGgCctdCmBcKbKyfPNSVPnUNxFRyg2k4nVpfqt5ohbCJ2nhDM6Jqmt53xeYW0EGSI9KiioVxlgGd8rYy7gNz7CId6e3P+9YDa5NE2RlUrUQsiZSE9zsruMiUqIR4g3NE8F78Ih9KiYLpeGDUYbfYZfb0KcSWwZ2jYNDMc7DC3jMhhstLZWnnoez7BmlaBlV0DyXL2p4bwAD8FQaAfuumN3yEFPKGWlLzSa8uXCxz8E8BNqYccfYEf979NVbYRpxyHdoUngqA== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by TYZPR06MB5027.apcprd06.prod.outlook.com (2603:1096:400:1c9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Thu, 25 Jul 2024 13:36:08 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::81f7:9125:583a:1cca]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::81f7:9125:583a:1cca%3]) with mapi id 15.20.7784.020; Thu, 25 Jul 2024 13:36:08 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Jul 2024 21:35:46 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240725133546.19125-1-nuomi2021@gmail.com> References: <20240725133546.19125-1-nuomi2021@gmail.com> X-TMN: [yRO5Jls20zJ0qTwl20wSnfhabMVpQYIn] X-ClientProxiedBy: TYCP286CA0224.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c5::8) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20240725133546.19125-3-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|TYZPR06MB5027:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c1e2256-19b5-467e-bb4a-08dcacaebd75 X-Microsoft-Antispam: BCL:0; ARA:14566002|5072599006|19110799003|8060799006|461199028|440099028|3412199025|1710799026; X-Microsoft-Antispam-Message-Info: fGwh3n5kYyftFZ+jYzsOBTpNRt3Lw/VzFm3Jl8jVKDpSCKNI/934ajg0APUgybb+alfSexc26jwpISPJ2J3n1/6+FRPQLzv4PhIvmjli4zlKh29I29cZwXyRgc1TjSgqYitFJAX988HZi5pgVRLhfkWrMy+C/pnquk702xFCgLwpCAsnG9y2FCNuF0MpoedZSdXV6pbGlDlVL+zaU4KO1d8KKU1laWZjVhc97uXoOr24fxSwJTAJC3d0Ghdi447HLy9cTfHf/JXZqAhgOuGVr/ie70RDs3xyz78SDfixFjHWig3ufHV1UvhOuXCpw0Sn7ytlG3dsv7DugBCZhwf4mr3zmmS8x5E9+8jSTltZpEMCidT7ula2BPqV5L3v6FtgbAZAhqrxE1tz2E2c70ZAtv+lIpAx7dc+4ZAMY+xjfT7tcsSdJ0YeWSSeg2y8hQru5AYUiPHna78HaTCg+CvZwQqpi4yAx2IrrERVxW1j6SCIbvNGZpXaKPA/n3SlqPVlLs/UcSdnNpHfu07gmh4QirvCch00QwaSouwuQ0WpgHtpXGQVUdAy/uy2xikoOVHf3Ol1vSMmS2xKl9sNYdSWvaYXjGKC174lrmm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jcQ1FNGSvnsFbmDGTv89CvskERHrFb3nmkBUA8/PhbVva/bL5Yxz2tqtRRIMVtifeF/0mXANGFDVDfHUG9HUS2C3+UAl0L/MHQSuuV7Uy1qU8uOMP36p4wIGD1vYw5BvaB5EplWyql1HgdpvncvW4SspfRYzVu6eQsBpEFIvZAaT6qJsiHY80tll6pn4ZwK4IKFkFH+lDNg6rdsgNHx0kcAmTjIoG+aAXOgqWgO6E2wBhMavWqCFUUvw0AiWz995j35k7Zon5V3NS0s0PU2iUx3XaxOsK2MtMFKmrsgd5wY5QoKv1Ai+HiLubWbMm5CAR7klg7dgBslygyizSr3NHcGltQEw9G5RTbCGQWcMbFJKc9wSfMNz3jBkUMxRHiutbmU5gtGLh/4w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c1e2256-19b5-467e-bb4a-08dcacaebd75 X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2024 13:36:08.4813 (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: TYZPR06MB5027 Subject: [FFmpeg-devel] [PATCH 3/3] checkasm: add tests for vvc dmvr 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: ir//LbhPhau7 dmvr_8_12x20_c: 186.2 dmvr_8_12x20_avx2: 25.7 dmvr_8_20x12_c: 181.7 dmvr_8_20x12_avx2: 25.2 dmvr_8_20x20_c: 283.2 dmvr_8_20x20_avx2: 32.0 dmvr_10_12x20_c: 90.0 dmvr_10_12x20_avx2: 15.7 dmvr_10_20x12_c: 41.0 dmvr_10_20x12_avx2: 14.7 dmvr_10_20x20_c: 81.5 dmvr_10_20x20_avx2: 26.7 dmvr_12_12x20_c: 190.7 dmvr_12_12x20_avx2: 20.2 dmvr_12_20x12_c: 187.2 dmvr_12_20x12_avx2: 20.2 dmvr_12_20x20_c: 292.7 dmvr_12_20x20_avx2: 27.2 dmvr_h_8_12x20_c: 317.0 dmvr_h_8_12x20_avx2: 37.0 dmvr_h_8_20x12_c: 340.0 dmvr_h_8_20x12_avx2: 41.0 dmvr_h_8_20x20_c: 540.7 dmvr_h_8_20x20_avx2: 64.0 dmvr_h_10_12x20_c: 322.7 dmvr_h_10_12x20_avx2: 30.7 dmvr_h_10_20x12_c: 344.2 dmvr_h_10_20x12_avx2: 34.0 dmvr_h_10_20x20_c: 529.0 dmvr_h_10_20x20_avx2: 51.5 dmvr_h_12_12x20_c: 326.7 dmvr_h_12_12x20_avx2: 33.5 dmvr_h_12_20x12_c: 331.7 dmvr_h_12_20x12_avx2: 51.2 dmvr_h_12_20x20_c: 534.0 dmvr_h_12_20x20_avx2: 62.7 dmvr_hv_8_12x20_c: 650.0 dmvr_hv_8_12x20_avx2: 57.2 dmvr_hv_8_20x12_c: 676.2 dmvr_hv_8_20x12_avx2: 70.0 dmvr_hv_8_20x20_c: 1068.5 dmvr_hv_8_20x20_avx2: 103.2 dmvr_hv_10_12x20_c: 649.0 dmvr_hv_10_12x20_avx2: 48.2 dmvr_hv_10_20x12_c: 677.7 dmvr_hv_10_20x12_avx2: 59.7 dmvr_hv_10_20x20_c: 1093.5 dmvr_hv_10_20x20_avx2: 91.7 dmvr_hv_12_12x20_c: 660.0 dmvr_hv_12_12x20_avx2: 58.7 dmvr_hv_12_20x12_c: 682.7 dmvr_hv_12_20x12_avx2: 72.0 dmvr_hv_12_20x20_c: 1094.0 dmvr_hv_12_20x20_avx2: 113.2 dmvr_v_8_12x20_c: 325.7 dmvr_v_8_12x20_avx2: 31.2 dmvr_v_8_20x12_c: 326.2 dmvr_v_8_20x12_avx2: 38.5 dmvr_v_8_20x20_c: 538.5 dmvr_v_8_20x20_avx2: 54.2 dmvr_v_10_12x20_c: 318.5 dmvr_v_10_12x20_avx2: 23.7 dmvr_v_10_20x12_c: 330.7 dmvr_v_10_20x12_avx2: 40.5 dmvr_v_10_20x20_c: 567.5 dmvr_v_10_20x20_avx2: 48.0 dmvr_v_12_12x20_c: 335.2 dmvr_v_12_12x20_avx2: 30.0 dmvr_v_12_20x12_c: 330.2 dmvr_v_12_20x12_avx2: 39.5 dmvr_v_12_20x20_c: 535.2 dmvr_v_12_20x20_avx2: 60.0 --- tests/checkasm/vvc_mc.c | 59 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/tests/checkasm/vvc_mc.c b/tests/checkasm/vvc_mc.c index bc6b580f42..62fa6aa7d0 100644 --- a/tests/checkasm/vvc_mc.c +++ b/tests/checkasm/vvc_mc.c @@ -324,6 +324,64 @@ static void check_avg(void) report("avg"); } +#define SR_RANGE 2 +static void check_dmvr(void) +{ + LOCAL_ALIGNED_32(uint16_t, dst0, [DST_BUF_SIZE]); + LOCAL_ALIGNED_32(uint16_t, dst1, [DST_BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]); + const int dst_stride = MAX_PB_SIZE * sizeof(int16_t); + + VVCDSPContext c; + declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t src_stride, int height, + intptr_t mx, intptr_t my, int width); + + for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) { + ff_vvc_dsp_init(&c, bit_depth); + randomize_pixels(src0, src1, SRC_BUF_SIZE); + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 2; j++) { + for (int h = 8; h <= 16; h *= 2) { + for (int w = 8; w <= 16; w *= 2) { + const int pred_w = w + 2 * SR_RANGE; + const int pred_h = h + 2 * SR_RANGE; + const int mx = rnd() % VVC_INTER_LUMA_DMVR_FACTS; + const int my = rnd() % VVC_INTER_LUMA_DMVR_FACTS; + const char *type; + + if (w * h < 128) + continue; + + switch ((j << 1) | i) { + case 0: type = "dmvr"; break; // 0 0 + case 1: type = "dmvr_h"; break; // 0 1 + case 2: type = "dmvr_v"; break; // 1 0 + case 3: type = "dmvr_hv"; break; // 1 1 + } + + if (check_func(c.inter.dmvr[j][i], "%s_%d_%dx%d", type, bit_depth, pred_w, pred_h)) { + memset(dst0, 0, DST_BUF_SIZE); + memset(dst1, 0, DST_BUF_SIZE); + call_ref(dst0, src0 + SRC_OFFSET, PIXEL_STRIDE, pred_h, mx, my, pred_w); + call_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, pred_h, mx, my, pred_w); + for (int k = 0; k < pred_h; k++) { + if (memcmp(dst0 + k * dst_stride, dst1 + k * dst_stride, pred_w * sizeof(int16_t))) { + fail(); + break; + } + } + + bench_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, pred_h, mx, my, pred_w); + } + } + } + } + } + } + report("dmvr"); +} + static void check_vvc_sad(void) { const int bit_depth = 10; @@ -363,6 +421,7 @@ static void check_vvc_sad(void) void checkasm_check_vvc_mc(void) { + check_dmvr(); check_vvc_sad(); check_put_vvc_luma(); check_put_vvc_luma_uni();