From patchwork Thu Jun 29 17:57:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cox X-Patchwork-Id: 42311 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1e:b0:12b:9ae3:586d with SMTP id c30csp1945177pzh; Thu, 29 Jun 2023 10:58:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6pyeA/YBTIrPhZFwUbgMgxfNZmS65uhS+Bjztr0thPlRTIVYgNdsT45dK6c+a7/G+NaPh/ X-Received: by 2002:a17:907:7d8a:b0:978:8979:c66c with SMTP id oz10-20020a1709077d8a00b009788979c66cmr5339425ejc.18.1688061522083; Thu, 29 Jun 2023 10:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688061522; cv=none; d=google.com; s=arc-20160816; b=AyMBr0seKR89roU8vhlp4vgjxe03NxGLP4eBRtedmSopyrJ6EsDzAxTm86o6B0BhL/ qvsI7ceMll6H7i/glZuyV/6zyTvNl95W+6HXGuQptQWVJAuz94Vgpp2PCRhae7CSd77T 1ADCMKyvzuJyaRJqrtd8qcJ7WTWjbRi6hP6yehfZ/ybj3mYVOfiS80fNCcd+B7GCSi52 UgJNDXnukqfTb4eosaqxrfAxDymYt/4pXCySGwV2BmzAMKT6KpW3L1l1SjraadJM+gGe YsWA8wTl6364tn8qaWf9qn1i9Wu6CU4qF8VtVuC2attgba2mKFD+ovLrmnOg9PHO/rFR 77Pg== 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=YnhXhT+rSMvogXUHFddRs5O7kZIuugHcxGhHi272xdI=; fh=4TI4rjEBNZIiFzmH/zgNEtnT9CzHjNyw0MAPqTxWP34=; b=Yec2Ui7PeZvMYPDcECYMWkSWtyJ1kkRJLvSCc4icRjspDqJ5cdWlZ67zewJusQKthF h1a8vdYpnz65IZwlEyMYrydSwGxKyj9IllL/xQMRdJsjajMVZfj6zXwNxPuiPKm8UW6c N+LGAY6VfDqeMegSCUGFvGoy1qa3jveqBxxJiyyKYsaHQKxo6IIEZfJTnJoqPOlbMSE0 kikSa3p7RofAnJaZlqkB39rrWBgHWNKJJFVGmvxIpqrRT140dRlifdcamWVfg/hBhlUi QPlzoCZ2rda1a2Tu/UIuk48gUvZvRMbT2WVkbj/zcimpQ/ZfEH6XDehHC9lg7TzRL2ph YtGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kynesim-co-uk.20221208.gappssmtp.com header.s=20221208 header.b=K0gNEkCm; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ox27-20020a170907101b00b00987accb14aesi7181638ejb.893.2023.06.29.10.58.41; Thu, 29 Jun 2023 10:58:42 -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=@kynesim-co-uk.20221208.gappssmtp.com header.s=20221208 header.b=K0gNEkCm; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2468C68C2BC; Thu, 29 Jun 2023 20:58:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BFF7E68AFA8 for ; Thu, 29 Jun 2023 20:58:20 +0300 (EEST) Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-313e09a5b19so869208f8f.0 for ; Thu, 29 Jun 2023 10:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kynesim-co-uk.20221208.gappssmtp.com; s=20221208; t=1688061500; x=1690653500; 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=4dmBECaTEgRQraNgvU3aBne4fS2SspERLFG9YgfQtp8=; b=K0gNEkCmpSA+0yYfiSRONb0n4uD0fxHsgC0G7aKjke+2FEYpaEskPj17MKhJ1Kn7Ja S80s+Y3mZ52HS0UJeEeNDKJw1dU19M5WzdlJr7dDjfixLwFGWVkvNpYWUViVB8uEwX0B y78Y79whP9tZ1R2M6QnhHBJ8PcEhia5lb//BJU/HRSHg3qgY4p54a1inRxyDfF0nKyB4 mdXxiCRDBKh/kvFXUxBOMICGlZ8Y8u7SUWx+JHhH9hQg+bTgL1RwBmuTQFygPSUKgt/x jqeVqzl/oam9DbnTPPYQfIAHHjmDNQfTmPeP8PGZ12z8Atl3NRNH0eytRPzFlok1Vgl1 glXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688061500; x=1690653500; 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=4dmBECaTEgRQraNgvU3aBne4fS2SspERLFG9YgfQtp8=; b=NfkNGHnaH1ziXCF/4OSSHS7T7QLpsh+1No7uPV4dybU+P3hhTMbM1FZ3YeCnsFUJgv P9781eNWW/VgHLbbga76lMYm1O3ZMW/KqsO40E+6UJbFM9GbY5k8eM9KZIzyFC0uahc3 S2Gz96KQeYzLNz3j8s4iljpvWpB2JPGXMSstkM3RYE/OHBiNVcX7s8760flAaLWM/A43 VPbJQzun7eVlofKfXsX70iAQ2/8MWI2dO8jw5RLheCihHx1xzAVX+xWOzcgPpHLmkXTI 9uwQrXYlcePLjWDA854+p902AOlgLbaCJuDZfnpz2Y6a7edqMmJZAokuk7h2AZOt40/A xhSQ== X-Gm-Message-State: AC+VfDzNH+o/aqKJWsQEmdZvqvycfu8Xq2Pw0X+Bi5Y/R+vivVNxPZaI uWkILvktSNlf00moKJa+BO/K+vszivYcgZ1H0+U= X-Received: by 2002:adf:cf0d:0:b0:313:ed10:7f52 with SMTP id o13-20020adfcf0d000000b00313ed107f52mr5639096wrj.18.1688061499966; Thu, 29 Jun 2023 10:58:19 -0700 (PDT) Received: from sucnaath.outer.uphall.net (cpc1-cmbg20-2-0-cust759.5-4.cable.virginm.net. [86.21.218.248]) by smtp.gmail.com with ESMTPSA id f26-20020a7bcd1a000000b003fbba5f21b6sm2041541wmj.28.2023.06.29.10.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 10:58:19 -0700 (PDT) From: John Cox To: ffmpeg-devel@ffmpeg.org Date: Thu, 29 Jun 2023 17:57:15 +0000 Message-Id: <20230629175729.224383-2-jc@kynesim.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230629175729.224383-1-jc@kynesim.co.uk> References: <20230629175729.224383-1-jc@kynesim.co.uk> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/15] avfilter/vf_bwdif: Add outline for aarch neon functions 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: thomas.mundt@hr.de, John Cox Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: QG+KhuBajOM1 Outline but no actual functions. Signed-off-by: John Cox --- libavfilter/aarch64/Makefile | 2 ++ libavfilter/aarch64/vf_bwdif_init_aarch64.c | 39 +++++++++++++++++++++ libavfilter/aarch64/vf_bwdif_neon.S | 25 +++++++++++++ libavfilter/bwdif.h | 1 + libavfilter/vf_bwdif.c | 2 ++ 5 files changed, 69 insertions(+) create mode 100644 libavfilter/aarch64/vf_bwdif_init_aarch64.c create mode 100644 libavfilter/aarch64/vf_bwdif_neon.S diff --git a/libavfilter/aarch64/Makefile b/libavfilter/aarch64/Makefile index b58daa3a3f..b68209bc94 100644 --- a/libavfilter/aarch64/Makefile +++ b/libavfilter/aarch64/Makefile @@ -1,3 +1,5 @@ +OBJS-$(CONFIG_BWDIF_FILTER) += aarch64/vf_bwdif_init_aarch64.o OBJS-$(CONFIG_NLMEANS_FILTER) += aarch64/vf_nlmeans_init.o +NEON-OBJS-$(CONFIG_BWDIF_FILTER) += aarch64/vf_bwdif_neon.o NEON-OBJS-$(CONFIG_NLMEANS_FILTER) += aarch64/vf_nlmeans_neon.o diff --git a/libavfilter/aarch64/vf_bwdif_init_aarch64.c b/libavfilter/aarch64/vf_bwdif_init_aarch64.c new file mode 100644 index 0000000000..86d53b2ca1 --- /dev/null +++ b/libavfilter/aarch64/vf_bwdif_init_aarch64.c @@ -0,0 +1,39 @@ +/* + * bwdif aarch64 NEON optimisations + * + * Copyright (c) 2023 John Cox + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 "libavutil/common.h" +#include "libavfilter/bwdif.h" +#include "libavutil/aarch64/cpu.h" + +void +ff_bwdif_init_aarch64(BWDIFContext *s, int bit_depth) +{ + const int cpu_flags = av_get_cpu_flags(); + + if (bit_depth != 8) + return; + + if (!have_neon(cpu_flags)) + return; + +} + diff --git a/libavfilter/aarch64/vf_bwdif_neon.S b/libavfilter/aarch64/vf_bwdif_neon.S new file mode 100644 index 0000000000..639ab22998 --- /dev/null +++ b/libavfilter/aarch64/vf_bwdif_neon.S @@ -0,0 +1,25 @@ +/* + * bwdif aarch64 NEON optimisations + * + * Copyright (c) 2023 John Cox + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 "libavutil/aarch64/asm.S" + diff --git a/libavfilter/bwdif.h b/libavfilter/bwdif.h index 5749345f78..6a0f70487a 100644 --- a/libavfilter/bwdif.h +++ b/libavfilter/bwdif.h @@ -39,5 +39,6 @@ typedef struct BWDIFContext { void ff_bwdif_init_filter_line(BWDIFContext *bwdif, int bit_depth); void ff_bwdif_init_x86(BWDIFContext *bwdif, int bit_depth); +void ff_bwdif_init_aarch64(BWDIFContext *bwdif, int bit_depth); #endif /* AVFILTER_BWDIF_H */ diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c index e278cf1217..39a51429ac 100644 --- a/libavfilter/vf_bwdif.c +++ b/libavfilter/vf_bwdif.c @@ -369,6 +369,8 @@ av_cold void ff_bwdif_init_filter_line(BWDIFContext *s, int bit_depth) #if ARCH_X86 ff_bwdif_init_x86(s, bit_depth); +#elif ARCH_AARCH64 + ff_bwdif_init_aarch64(s, bit_depth); #endif }