From patchwork Mon May 20 00:37:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stone Chen X-Patchwork-Id: 49043 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp4139047pzb; Sun, 19 May 2024 17:39:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUr+Sjrsbix8Lah1Mlh4viWAeK+1Qx9H7lrpDadnrkYgED8maqBmxsUJMM2qvFZoP/TablRoNojBm/ngVJdqJO0ivoUezWo/LdRPQ== X-Google-Smtp-Source: AGHT+IHV+hQw7Bfj86os6vK1xyazuC/YCHpaFJoezKAI5yjxRe+5iT4nQkt6wl5I0BNnUwvHQk5i X-Received: by 2002:a17:907:7d8e:b0:a60:c514:31d9 with SMTP id a640c23a62f3a-a60c514327bmr240036766b.6.1716165545949; Sun, 19 May 2024 17:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716165545; cv=none; d=google.com; s=arc-20160816; b=AGIP+ATHPZrdKih31Z+msoI0K2YeD/8s8piv2qm65Bqqa3HM5pcIpeFFb4LUhGFEYc lJpwxm4esVHkUPLssqNxDTT5/wAxWDFRyks4pzRseEJ1OOmxbCCsyCV2eAkKNrPXh+SK 0gihziSI18l2yY/tIGR5npQAmxeiC8OjTxx8vkDxN4+RutWK3jKNr+M7Wt8Hcx2L62PR 14MRrKu5q5Tp9mBpUcbhpF3mYyLZTWVCja2VvMzgp35QQ0rBRSop8Tjsceg9pHpIifTo Qe2UQYinU9VhoTdA/DcMtz7dh0EBppj3IlA2eikCkvy/RJ8905nU0IH4pzDyv80EsbN4 BOMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=1MV7ItrXkn6zJwAZWr0NVfaiDi+NgR8CW6DmZVIOlIc=; fh=eXL0VfxTysmJvjluz5gzyadDwRdHpiPfPZqJ5KBw8Sc=; b=OcNOaa8jL08xBxtP7DLloKsUPaKF5LVv45HF/46AGUnlx2vAQQSW3MSfbXMak9TctQ akdPTTcNrZngd1Fb5YqMnyadLoeu/60v4f7k/hUtpFStIUCKSFIZd3SbaBaEm95pH3t/ A1mGh4cM4/SEG2149w8vWwYW5sq2KNvDcx/d0WxKH8hmJVd+txqT3nMsAIHB1begVWWH +pIYA7IntUfQEjXC+gfSxHYcqgUliyj9owgvjisqMwtmRP7I5vMsi564ns3aqrZJE1ht raS+ZS4KoLFZOu00xTghlqQ7zyTEoWCUikCDh8PLWlNXyOYMIuv5nsNB8PSd/6AF4ZBb nW7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=ZpYUnNCX; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a5a17ba29d5si1187403566b.492.2024.05.19.17.39.05; Sun, 19 May 2024 17:39:05 -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=@gmail.com header.s=20230601 header.b=ZpYUnNCX; 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 58CF868D084; Mon, 20 May 2024 03:39:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 698AA68CDAC for ; Mon, 20 May 2024 03:38:56 +0300 (EEST) Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-de604ca3cfcso1723526276.3 for ; Sun, 19 May 2024 17:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716165534; x=1716770334; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aGvTMhGOaxrf04bYXpxOloXE02vhH6EyRHW93MX9OVc=; b=ZpYUnNCXZKLAqPmvWBj7407Phodvndw8jubzcTOIDLAr+6O+sTOcXDC0FgLzVQkczT G+jJQAk1/+bgZHORxh8RnwXspwzk6Sa3H872E6c9yn+esl18VwdXlcpSrj7eYdzyjJP/ cOdFV/unsCC10VEXswchKi3Wr8XiR0p0GeQD2nReUw7bXC1tzdOUvyI7hRRcDmk/Svoi gYTOzVoRTy75prdzB2wHwsebTxtqCLMFSJVqkadSvt0WlcOnSqqkx1eXeTd+NheYTMrn nZgN5FbOYud5925X2AEQkEfoVKCNUMje4p/0xD5ODcHa3E9uQZRoPuaWlH/5RY/9DOlt l03A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716165534; x=1716770334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aGvTMhGOaxrf04bYXpxOloXE02vhH6EyRHW93MX9OVc=; b=ln4BT3eA6hTu0BrCyhS9NNNLul/bDsvGuFV8dvYDWEJ4mcTraRPXaQ88DMyYmPKP0u 42JcKIQ9qaSaULDrmxmAPXSII6pqaI4Y1JLk76RQOr5N7gdxMoIdPSo0WPA3UxMMimCm S+KAhv3QPhWfbcmu9sK1E50CU/two6KNatMXcZYFLQlcUAgLUAm6ASH2RPloscKErHR0 UyTqNkNgEp2hFL581kPmvZUrDpH3ztjXp1muBj0RyOsHCNvTdZB7v9kUd48/QUuhLFfz 8XouydjmCpbQOLDJWD253UrGXIV3bOM7A45UrAKRtnEzfkaesGBJ/OfHwfMntcPkzxt6 jQMA== X-Gm-Message-State: AOJu0YxtaqjnILqMMPMMROx8Jgw1GT6UDJ8pj91yXRlINj3q0Lf/2MSJ GP+VaK57Io33JCR4rAP5TeRkLsZVziwDefrb9PeccBmVNR6wazETLKV48LD9 X-Received: by 2002:a25:7484:0:b0:dcd:63f8:ba32 with SMTP id 3f1490d57ef6-dee4f3973c7mr23052375276.65.1716165534573; Sun, 19 May 2024 17:38:54 -0700 (PDT) Received: from fedora.tailc94c2.ts.net (209-6-133-125.s1659.c3-0.bkl-cbr1.sbo-bkl.ma.cable.rcncustomer.com. [209.6.133.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6a35d0bfeabsm44625946d6.2.2024.05.19.17.38.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 17:38:54 -0700 (PDT) From: Stone Chen To: ffmpeg-devel@ffmpeg.org Date: Sun, 19 May 2024 20:37:36 -0400 Message-ID: <20240520003737.10603-5-chen.stonechen@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240520003737.10603-3-chen.stonechen@gmail.com> References: <20240520003737.10603-3-chen.stonechen@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 2/2][GSoC 2024] tests/checkasm: Add check_vvc_sad to vvc_mc.c 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: Stone Chen Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: CoRBanYUQyUe Adds checkasm for DMVR SAD AVX2 implementation. Benchmarks ( AMD 7940HS ) vvc_sad_8x8_c: 70.0 vvc_sad_8x8_avx2: 10.0 vvc_sad_16x16_c: 280.0 vvc_sad_16x16_avx2: 20.0 vvc_sad_32x32_c: 1020.0 vvc_sad_32x32_avx2: 70.0 vvc_sad_64x64_c: 3560.0 vvc_sad_64x64_avx2: 270.0 vvc_sad_128x128_c: 13760.0 vvc_sad_128x128_avx2: 1070.0 --- tests/checkasm/vvc_mc.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/checkasm/vvc_mc.c b/tests/checkasm/vvc_mc.c index 97f57cb401..e251400bfc 100644 --- a/tests/checkasm/vvc_mc.c +++ b/tests/checkasm/vvc_mc.c @@ -322,8 +322,46 @@ static void check_avg(void) report("avg"); } +static void check_vvc_sad(void) +{ + const int bit_depth = 10; + VVCDSPContext c; + LOCAL_ALIGNED_32(uint16_t, src0, [MAX_CTU_SIZE * MAX_CTU_SIZE * 4]); + LOCAL_ALIGNED_32(uint16_t, src1, [MAX_CTU_SIZE * MAX_CTU_SIZE * 4]); + declare_func(int, const int16_t *src0, const int16_t *src1, int dx, int dy, int block_w, int block_h); + + ff_vvc_dsp_init(&c, bit_depth); + memset(src0, 0, MAX_CTU_SIZE * MAX_CTU_SIZE * 4); + memset(src1, 0, MAX_CTU_SIZE * MAX_CTU_SIZE * 4); + + randomize_pixels(src0, src1, MAX_CTU_SIZE * MAX_CTU_SIZE * 2); + for (int h = 8; h <= MAX_CTU_SIZE; h *= 2) { + for (int w = 8; w <= MAX_CTU_SIZE; w *= 2) { + for(int offy = 0; offy <= 4; offy++) { + for(int offx = 0; offx <= 4; offx++) { + if(check_func(c.inter.sad, "vvc_sad_%dx%d", w, h)) { + int result0; + int result1; + + result0 = call_ref(src0 + PIXEL_STRIDE * 2 + 2, src1 + PIXEL_STRIDE * 2 + 2, offx, offy, w, h); + result1 = call_new(src0 + PIXEL_STRIDE * 2 + 2, src1 + PIXEL_STRIDE * 2 + 2, offx, offy, w, h); + + if (result1 != result0) + fail(); + if(w == h && offx == 0 && offy == 0) + bench_new(src0 + PIXEL_STRIDE * 2 + 2, src1 + PIXEL_STRIDE * 2 + 2, offx, offy, w, h); + } + } + } + } + } + + report("check_vvc_sad"); +} + void checkasm_check_vvc_mc(void) { + check_vvc_sad(); check_put_vvc_luma(); check_put_vvc_luma_uni(); check_put_vvc_chroma();