From patchwork Sun Feb 26 06:09:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 40526 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp2502447pzk; Sat, 25 Feb 2023 22:09:26 -0800 (PST) X-Google-Smtp-Source: AK7set8hhj4xkuIUUdW5WFi+icvg38UQ/vZnYb6DwjRP8NeEI9Q6HDwKjUfnEdQ1ruRnAtCfatKP X-Received: by 2002:a17:906:2b14:b0:878:72f7:bd87 with SMTP id a20-20020a1709062b1400b0087872f7bd87mr26314885ejg.6.1677391766295; Sat, 25 Feb 2023 22:09:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677391766; cv=none; d=google.com; s=arc-20160816; b=DtksquL+Yz92cGd4enodRDJQYqJc/oLV0xUdOivzQIwBhN1Jkt8jQsTD2+4Hs3xuQH GdNRgDMNs//NMoLSXHqI+g7oUOHhALAURrNtzTEqgYNvm6QcRJDHWWFWpoa1hLV+Bv7R 1JCwqWcbtD2WVceH9/HTTGpf2+JMQ/txRezl4GAzF/sdnhb1+PjDR2YSjqIu66tWGFi/ fiH/k3Sf5OcjWDubl+fMNQFjOTAbToNstKeYEzywejlWhyvIkjP866+sgSB+OXLdd8pC 0iVNpQVpT5KZMmeSWQhIscYVmotQMPFqXB0bY5w7CGn41WaaljuecRCfRyvcdYxK0Kil JXlw== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=Gz1a7Upk9UTavbbvtyHctkODAt3Sg0023honj2WYHZo=; b=kDNh1n+hiB5IqFyleVG3UgjYbTOqdLKiHPu0Zf+bia5o+wOe5XCDq7aXlllPpeURWq qX4G3Ie+kQT8C7/7B94kkyPBcqFLgHW0MVV3BZOJ8OKR7iBnsZXTAXsydoh2wZpmxRq5 luF4x9gnKsynPvg4kJFrhl8QuhYGbZ1QckQcdQA9kOrx6L4sJT8F2PAv3UsXM9QR4ChX neUIV/cqxsbEZDmPhiWlY/T6/Vf3AOc+SMQYD0q9Xw/1yJu+VM4Bzah5UQKogi+72rTe CsJrHUqMLPT4UhOJUZ+v6jaXnhdpWHqGm0Ccb9LPbK5jI73pBDW/g1OGpViTg2S+WCEE hbJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=B+qZNc2z; 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 k27-20020a1709062a5b00b008ba6b182877si3881919eje.698.2023.02.25.22.09.25; Sat, 25 Feb 2023 22:09:26 -0800 (PST) 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=20210112 header.b=B+qZNc2z; 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 E7D5768BA90; Sun, 26 Feb 2023 08:09:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7BC5068B6D4 for ; Sun, 26 Feb 2023 08:09:16 +0200 (EET) Received: by mail-pj1-f53.google.com with SMTP id c23so3016094pjo.4 for ; Sat, 25 Feb 2023 22:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OYAg39GxLHo0A4+JD5vG2IJ1ZWl/eo5AocRO5XKpaTE=; b=B+qZNc2zLQ556fkZfHB5W015sF8HGfnPmhOKsii322co37wjsq1bDIB5WmjMRHLCsq NuFgCyi08IdHD5nlzW1WIbklMzjXTKMhJ/C2CbUSpS7q+Z7QeNRASsAQkjan7OjPGIt9 a+pMBH7fhLKAfJ4Hd4iT24i9IoMuqL6NC/HvfPYlM/RNPQjU4G1C43Odq4dZgJHpVEs4 78Lk/kM12ikuhrz5yL9Yz+/2uPPHa6cpqJ9V/LmV5AuiS5/jfWV+Ez/8VOlOl1CQIz/b zVwHgBYfDhircj1P9bQIqgjnxmdqnOAo7+KltQPZY252Djb5uYggRMCF2CZlORAx9z2P DPYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OYAg39GxLHo0A4+JD5vG2IJ1ZWl/eo5AocRO5XKpaTE=; b=4F1qBWwQbUhNCL6oga2hg3nhR5+EvG0vQjoybZDciFfcFrgYQkLAvvi3aop8Ak3GwR cGmgCxK38YgfCoggyQ8dgg9a1aAaCRM7zE9bxIZuCHecd6CQ0OAOplOY3sx+0ZOVGH+0 TFJGORRwepa8/Cggu/SlzRS9xC99cV0nWwN27WSJVpfTku22nHrRg+qOJH3Tbl5pF4WW 9Uc74ijweGzyunt6UF6AD9SSW0ueNQx5UVdd2MQi/gDue7vduq2JS/eWAXaYbKgKf4jK AizU8GADmUglnrrI4rhNTo4B3W21Q8xIixbfdEh1hD0cG9ujx954Qf+TKG8FU6f897A/ JL+g== X-Gm-Message-State: AO0yUKVL9jvaL5a7HxWcmFF3qlKC5KiYEhIyvHw1L/N35+uKrPnpGbtH 4HLsA7Mp/3KncjOteE92KybuZcRYEbgf6A== X-Received: by 2002:a17:90b:4b83:b0:236:7270:ddbf with SMTP id lr3-20020a17090b4b8300b002367270ddbfmr22348961pjb.21.1677391754008; Sat, 25 Feb 2023 22:09:14 -0800 (PST) Received: from NuoMi.localdomain ([112.64.8.103]) by smtp.gmail.com with ESMTPSA id a15-20020a17090a70cf00b00233df90227fsm3842457pjm.18.2023.02.25.22.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 22:09:13 -0800 (PST) From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Sun, 26 Feb 2023 14:09:09 +0800 Message-Id: <20230226060909.16477-1-nuomi2021@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] checkasm: add support for vvc alf 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: 495LuWUUHZcZ vvc_alf_filter_chroma_4x4_10_c: 661.9 vvc_alf_filter_chroma_4x4_10_avx2: 138.4 vvc_alf_filter_chroma_4x8_10_c: 1287.4 vvc_alf_filter_chroma_4x8_10_avx2: 258.9 vvc_alf_filter_chroma_4x12_10_c: 2017.1 vvc_alf_filter_chroma_4x12_10_avx2: 375.9 vvc_alf_filter_chroma_4x16_10_c: 2604.6 vvc_alf_filter_chroma_4x16_10_avx2: 489.9 vvc_alf_filter_chroma_4x20_10_c: 3074.6 vvc_alf_filter_chroma_4x20_10_avx2: 626.1 vvc_alf_filter_chroma_4x24_10_c: 3674.1 vvc_alf_filter_chroma_4x24_10_avx2: 728.1 vvc_alf_filter_chroma_4x28_10_c: 4427.6 vvc_alf_filter_chroma_4x28_10_avx2: 876.6 vvc_alf_filter_chroma_8x4_10_c: 1269.1 vvc_alf_filter_chroma_8x4_10_avx2: 293.6 vvc_alf_filter_chroma_8x8_10_c: 2511.6 vvc_alf_filter_chroma_8x8_10_avx2: 497.4 vvc_alf_filter_chroma_8x12_10_c: 3645.9 vvc_alf_filter_chroma_8x12_10_avx2: 735.6 vvc_alf_filter_chroma_8x16_10_c: 8241.1 vvc_alf_filter_chroma_8x16_10_avx2: 972.4 vvc_alf_filter_chroma_8x20_10_c: 6074.1 vvc_alf_filter_chroma_8x20_10_avx2: 1269.6 vvc_alf_filter_chroma_8x24_10_c: 7268.6 vvc_alf_filter_chroma_8x24_10_avx2: 1447.4 vvc_alf_filter_chroma_8x28_10_c: 8707.4 vvc_alf_filter_chroma_8x28_10_avx2: 1727.9 vvc_alf_filter_chroma_12x4_10_c: 1831.9 vvc_alf_filter_chroma_12x4_10_avx2: 386.4 vvc_alf_filter_chroma_12x8_10_c: 3847.6 vvc_alf_filter_chroma_12x8_10_avx2: 738.6 vvc_alf_filter_chroma_12x12_10_c: 5460.6 vvc_alf_filter_chroma_12x12_10_avx2: 1098.9 vvc_alf_filter_chroma_12x16_10_c: 7642.6 vvc_alf_filter_chroma_12x16_10_avx2: 1445.4 vvc_alf_filter_chroma_12x20_10_c: 9056.6 vvc_alf_filter_chroma_12x20_10_avx2: 1898.9 vvc_alf_filter_chroma_12x24_10_c: 10862.4 vvc_alf_filter_chroma_12x24_10_avx2: 3073.1 vvc_alf_filter_chroma_12x28_10_c: 13005.6 vvc_alf_filter_chroma_12x28_10_avx2: 2587.9 vvc_alf_filter_chroma_16x4_10_c: 4406.1 vvc_alf_filter_chroma_16x4_10_avx2: 249.9 vvc_alf_filter_chroma_16x8_10_c: 4846.9 vvc_alf_filter_chroma_16x8_10_avx2: 478.6 vvc_alf_filter_chroma_16x12_10_c: 7247.1 vvc_alf_filter_chroma_16x12_10_avx2: 704.4 vvc_alf_filter_chroma_16x16_10_c: 10163.1 vvc_alf_filter_chroma_16x16_10_avx2: 934.4 vvc_alf_filter_chroma_16x20_10_c: 12041.1 vvc_alf_filter_chroma_16x20_10_avx2: 1196.1 vvc_alf_filter_chroma_16x24_10_c: 14448.9 vvc_alf_filter_chroma_16x24_10_avx2: 1390.9 vvc_alf_filter_chroma_16x28_10_c: 16846.9 vvc_alf_filter_chroma_16x28_10_avx2: 1664.9 vvc_alf_filter_chroma_20x4_10_c: 3036.6 vvc_alf_filter_chroma_20x4_10_avx2: 373.6 vvc_alf_filter_chroma_20x8_10_c: 6190.4 vvc_alf_filter_chroma_20x8_10_avx2: 715.6 vvc_alf_filter_chroma_20x12_10_c: 9278.9 vvc_alf_filter_chroma_20x12_10_avx2: 1096.4 vvc_alf_filter_chroma_20x16_10_c: 21400.9 vvc_alf_filter_chroma_20x16_10_avx2: 1451.9 vvc_alf_filter_chroma_20x20_10_c: 16755.6 vvc_alf_filter_chroma_20x20_10_avx2: 1862.9 vvc_alf_filter_chroma_20x24_10_c: 18029.9 vvc_alf_filter_chroma_20x24_10_avx2: 2110.9 vvc_alf_filter_chroma_20x28_10_c: 21003.6 vvc_alf_filter_chroma_20x28_10_avx2: 2585.4 vvc_alf_filter_chroma_24x4_10_c: 6182.9 vvc_alf_filter_chroma_24x4_10_avx2: 501.6 vvc_alf_filter_chroma_24x8_10_c: 7429.9 vvc_alf_filter_chroma_24x8_10_avx2: 964.1 vvc_alf_filter_chroma_24x12_10_c: 11429.9 vvc_alf_filter_chroma_24x12_10_avx2: 1436.9 vvc_alf_filter_chroma_24x16_10_c: 14822.4 vvc_alf_filter_chroma_24x16_10_avx2: 1983.6 vvc_alf_filter_chroma_24x20_10_c: 18020.4 vvc_alf_filter_chroma_24x20_10_avx2: 2418.9 vvc_alf_filter_chroma_24x24_10_c: 22183.1 vvc_alf_filter_chroma_24x24_10_avx2: 2896.6 vvc_alf_filter_chroma_24x28_10_c: 25198.4 vvc_alf_filter_chroma_24x28_10_avx2: 3298.6 vvc_alf_filter_chroma_28x4_10_c: 4363.6 vvc_alf_filter_chroma_28x4_10_avx2: 623.1 vvc_alf_filter_chroma_28x8_10_c: 8466.9 vvc_alf_filter_chroma_28x8_10_avx2: 1242.4 vvc_alf_filter_chroma_28x12_10_c: 13418.9 vvc_alf_filter_chroma_28x12_10_avx2: 1786.4 vvc_alf_filter_chroma_28x16_10_c: 16942.9 vvc_alf_filter_chroma_28x16_10_avx2: 2396.9 vvc_alf_filter_chroma_28x20_10_c: 21186.6 vvc_alf_filter_chroma_28x20_10_avx2: 2968.1 vvc_alf_filter_chroma_28x24_10_c: 25374.9 vvc_alf_filter_chroma_28x24_10_avx2: 11726.6 vvc_alf_filter_chroma_28x28_10_c: 29567.4 vvc_alf_filter_chroma_28x28_10_avx2: 4132.9 vvc_alf_filter_luma_4x4_10_c: 1032.6 vvc_alf_filter_luma_4x4_10_avx2: 239.6 vvc_alf_filter_luma_4x8_10_c: 2833.4 vvc_alf_filter_luma_4x8_10_avx2: 459.1 vvc_alf_filter_luma_4x12_10_c: 3114.9 vvc_alf_filter_luma_4x12_10_avx2: 670.1 vvc_alf_filter_luma_4x16_10_c: 4366.6 vvc_alf_filter_luma_4x16_10_avx2: 891.1 vvc_alf_filter_luma_4x20_10_c: 5139.6 vvc_alf_filter_luma_4x20_10_avx2: 1132.1 vvc_alf_filter_luma_4x24_10_c: 6161.9 vvc_alf_filter_luma_4x24_10_avx2: 1358.1 vvc_alf_filter_luma_4x28_10_c: 7178.6 vvc_alf_filter_luma_4x28_10_avx2: 1582.6 vvc_alf_filter_luma_8x4_10_c: 2122.9 vvc_alf_filter_luma_8x4_10_avx2: 489.4 vvc_alf_filter_luma_8x8_10_c: 4190.1 vvc_alf_filter_luma_8x8_10_avx2: 897.1 vvc_alf_filter_luma_8x12_10_c: 6112.9 vvc_alf_filter_luma_8x12_10_avx2: 1327.6 vvc_alf_filter_luma_8x16_10_c: 8631.4 vvc_alf_filter_luma_8x16_10_avx2: 1765.4 vvc_alf_filter_luma_8x20_10_c: 10246.6 vvc_alf_filter_luma_8x20_10_avx2: 2828.9 vvc_alf_filter_luma_8x24_10_c: 12249.9 vvc_alf_filter_luma_8x24_10_avx2: 2627.1 vvc_alf_filter_luma_8x28_10_c: 14283.4 vvc_alf_filter_luma_8x28_10_avx2: 3144.6 vvc_alf_filter_luma_12x4_10_c: 3157.6 vvc_alf_filter_luma_12x4_10_avx2: 696.9 vvc_alf_filter_luma_12x8_10_c: 6256.6 vvc_alf_filter_luma_12x8_10_avx2: 1335.9 vvc_alf_filter_luma_12x12_10_c: 9123.6 vvc_alf_filter_luma_12x12_10_avx2: 1987.4 vvc_alf_filter_luma_12x16_10_c: 13151.6 vvc_alf_filter_luma_12x16_10_avx2: 2633.9 vvc_alf_filter_luma_12x20_10_c: 15664.9 vvc_alf_filter_luma_12x20_10_avx2: 3376.9 vvc_alf_filter_luma_12x24_10_c: 18281.9 vvc_alf_filter_luma_12x24_10_avx2: 4040.9 vvc_alf_filter_luma_12x28_10_c: 21860.4 vvc_alf_filter_luma_12x28_10_avx2: 4838.6 vvc_alf_filter_luma_16x4_10_c: 5985.4 vvc_alf_filter_luma_16x4_10_avx2: 439.9 vvc_alf_filter_luma_16x8_10_c: 8094.6 vvc_alf_filter_luma_16x8_10_avx2: 912.9 vvc_alf_filter_luma_16x12_10_c: 33849.1 vvc_alf_filter_luma_16x12_10_avx2: 1343.9 vvc_alf_filter_luma_16x16_10_c: 17161.6 vvc_alf_filter_luma_16x16_10_avx2: 1769.9 vvc_alf_filter_luma_16x20_10_c: 21382.6 vvc_alf_filter_luma_16x20_10_avx2: 2193.6 vvc_alf_filter_luma_16x24_10_c: 24300.1 vvc_alf_filter_luma_16x24_10_avx2: 2624.9 vvc_alf_filter_luma_16x28_10_c: 29067.4 vvc_alf_filter_luma_16x28_10_avx2: 3112.9 vvc_alf_filter_luma_20x4_10_c: 5068.1 vvc_alf_filter_luma_20x4_10_avx2: 675.9 vvc_alf_filter_luma_20x8_10_c: 10146.9 vvc_alf_filter_luma_20x8_10_avx2: 1317.9 vvc_alf_filter_luma_20x12_10_c: 15566.6 vvc_alf_filter_luma_20x12_10_avx2: 1956.9 vvc_alf_filter_luma_20x16_10_c: 21372.1 vvc_alf_filter_luma_20x16_10_avx2: 2669.1 vvc_alf_filter_luma_20x20_10_c: 25397.1 vvc_alf_filter_luma_20x20_10_avx2: 3415.6 vvc_alf_filter_luma_20x24_10_c: 30449.9 vvc_alf_filter_luma_20x24_10_avx2: 3907.1 vvc_alf_filter_luma_20x28_10_c: 35477.9 vvc_alf_filter_luma_20x28_10_avx2: 4660.4 vvc_alf_filter_luma_24x4_10_c: 6083.1 vvc_alf_filter_luma_24x4_10_avx2: 912.9 vvc_alf_filter_luma_24x8_10_c: 12479.1 vvc_alf_filter_luma_24x8_10_avx2: 1753.6 vvc_alf_filter_luma_24x12_10_c: 19196.9 vvc_alf_filter_luma_24x12_10_avx2: 2617.4 vvc_alf_filter_luma_24x16_10_c: 24995.4 vvc_alf_filter_luma_24x16_10_avx2: 3466.4 vvc_alf_filter_luma_24x20_10_c: 30394.1 vvc_alf_filter_luma_24x20_10_avx2: 4442.6 vvc_alf_filter_luma_24x24_10_c: 36472.9 vvc_alf_filter_luma_24x24_10_avx2: 5181.4 vvc_alf_filter_luma_24x28_10_c: 45232.4 vvc_alf_filter_luma_24x28_10_avx2: 64256.6 vvc_alf_filter_luma_28x4_10_c: 7491.4 vvc_alf_filter_luma_28x4_10_avx2: 1141.4 vvc_alf_filter_luma_28x8_10_c: 14235.1 vvc_alf_filter_luma_28x8_10_avx2: 2197.4 vvc_alf_filter_luma_28x12_10_c: 22850.4 vvc_alf_filter_luma_28x12_10_avx2: 3274.1 vvc_alf_filter_luma_28x16_10_c: 28347.6 vvc_alf_filter_luma_28x16_10_avx2: 4694.1 vvc_alf_filter_luma_28x20_10_c: 35431.1 vvc_alf_filter_luma_28x20_10_avx2: 5663.9 vvc_alf_filter_luma_28x24_10_c: 45913.9 vvc_alf_filter_luma_28x24_10_avx2: 6778.6 vvc_alf_filter_luma_28x28_10_c: 49625.4 vvc_alf_filter_luma_28x28_10_avx2: 20205.6 --- tests/checkasm/Makefile | 1 + tests/checkasm/checkasm.c | 3 + tests/checkasm/checkasm.h | 1 + tests/checkasm/vvc_alf.c | 120 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 tests/checkasm/vvc_alf.c diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile index a6f06c7007..2ffe8bf112 100644 --- a/tests/checkasm/Makefile +++ b/tests/checkasm/Makefile @@ -34,6 +34,7 @@ AVCODECOBJS-$(CONFIG_V210_DECODER) += v210dec.o AVCODECOBJS-$(CONFIG_V210_ENCODER) += v210enc.o AVCODECOBJS-$(CONFIG_VORBIS_DECODER) += vorbisdsp.o AVCODECOBJS-$(CONFIG_VP9_DECODER) += vp9dsp.o +AVCODECOBJS-$(CONFIG_VVC_DECODER) += vvc_alf.o CHECKASMOBJS-$(CONFIG_AVCODEC) += $(AVCODECOBJS-yes) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index e96d84a7da..3c913eede4 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -171,6 +171,9 @@ static const struct { #if CONFIG_VORBIS_DECODER { "vorbisdsp", checkasm_check_vorbisdsp }, #endif + #if CONFIG_VVC_DECODER + { "vvc_alf", checkasm_check_vvc_alf }, + #endif #endif #if CONFIG_AVFILTER #if CONFIG_AFIR_FILTER diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index 8744a81218..b33f9f2505 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -91,6 +91,7 @@ void checkasm_check_vp8dsp(void); void checkasm_check_vp9dsp(void); void checkasm_check_videodsp(void); void checkasm_check_vorbisdsp(void); +void checkasm_check_vvc_alf(void); struct CheckasmPerf; diff --git a/tests/checkasm/vvc_alf.c b/tests/checkasm/vvc_alf.c new file mode 100644 index 0000000000..fe3d2ce351 --- /dev/null +++ b/tests/checkasm/vvc_alf.c @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2023 Nuo Mi + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with FFmpeg; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include + +#include "libavutil/intreadwrite.h" +#include "libavutil/mem_internal.h" + +#include "libavcodec/avcodec.h" + +#include "libavcodec/vvcdsp.h" +#include "libavcodec/vvcdec.h" + +#include "checkasm.h" + +static const uint32_t pixel_mask[3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff }; + +#define SIZEOF_PIXEL ((bit_depth + 7) / 8) +#define PIXEL_STRIDE (ALF_SUBBLOCK_SIZE + 2 * ALF_PADDING_SIZE) +#define BUF_SIZE (PIXEL_STRIDE * (MAX_CTU_SIZE + 3 * 2) * 2) //+3 * 2 for top and bottom row, *2 for high bit depth +#define LUMA_PARAMS_SIZE (ALF_SUBBLOCK_SIZE / 4 * ALF_SUBBLOCK_SIZE / 4 * ALF_NUM_COEFF_LUMA) + +#define randomize_buffers(buf0, buf1, size) \ + do { \ + uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \ + int k; \ + for (k = 0; k < size; k += 4) { \ + uint32_t r = rnd() & mask; \ + AV_WN32A(buf0 + k, r); \ + AV_WN32A(buf1 + k, r); \ + } \ + } while (0) + +#define randomize_buffers2(buf, size, filter) \ + do { \ + int k; \ + if (filter) { \ + for (k = 0; k < size; k++) { \ + uint8_t r = rnd(); \ + buf[k] = r; \ + } \ + } else { \ + for (k = 0; k < size; k++) { \ + int16_t r = rnd(); \ + buf[k] = r; \ + } \ + } \ + } while (0) + +static void check_alf_luma_filter(VVCDSPContext *c, const int bit_depth) +{ + LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src1, [BUF_SIZE]); + int8_t filter[LUMA_PARAMS_SIZE]; + int16_t clip[LUMA_PARAMS_SIZE]; + ptrdiff_t stride = PIXEL_STRIDE * SIZEOF_PIXEL; + int offset = (3 * PIXEL_STRIDE + 3) * SIZEOF_PIXEL; + + declare_func_emms(AV_CPU_FLAG_AVX2, void, uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, + int width, int height, const int8_t *filter, const int16_t *clip); + + randomize_buffers(src0, src1, BUF_SIZE); + randomize_buffers2(filter, LUMA_PARAMS_SIZE, 1); + randomize_buffers2(clip, LUMA_PARAMS_SIZE, 2); + + for (int h = 4; h < ALF_SUBBLOCK_SIZE; h += 4) { + for (int w = 4; w < ALF_SUBBLOCK_SIZE; w += 4) { + if (check_func(c->alf.filter[LUMA], "vvc_alf_filter_luma_%dx%d_%d", w, h, bit_depth)) { + memset(dst0, 0, BUF_SIZE); + memset(dst1, 0, BUF_SIZE); + call_ref(dst0, stride, src0 + offset, stride, w, h, filter, clip); + call_new(dst1, stride, src1 + offset, stride, w, h, filter, clip); + for (int i = 0; i < h; i++) { + if (memcmp(dst0 + i * stride, dst1 + i * stride, w * SIZEOF_PIXEL)) + fail(); + } + bench_new(dst1, stride, src1 + offset, stride, w, h, filter, clip); + } + if (check_func(c->alf.filter[CHROMA], "vvc_alf_filter_chroma_%dx%d_%d", w, h, bit_depth)) { + memset(dst0, 0, BUF_SIZE); + memset(dst1, 0, BUF_SIZE); + call_ref(dst0, stride, src0 + offset, stride, w, h, filter, clip); + call_new(dst1, stride, src1 + offset, stride, w, h, filter, clip); + for (int i = 0; i < h; i++) { + if (memcmp(dst0 + i * stride, dst1 + i * stride, w * SIZEOF_PIXEL)) + fail(); + } + bench_new(dst1, stride, src1 + offset, stride, w, h, filter, clip); + } + } + } +} + +void checkasm_check_vvc_alf(void) +{ + int bit_depth = 10; + VVCDSPContext h; + ff_vvc_dsp_init(&h, bit_depth); + check_alf_luma_filter(&h, bit_depth); + report("alf_filter"); +}