From patchwork Sun Jul 2 12:32:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cox X-Patchwork-Id: 42368 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1e:b0:12b:9ae3:586d with SMTP id c30csp3714558pzh; Sun, 2 Jul 2023 05:33:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlGHYPapXz9mD1tojva1VdbBEbeyC3kzIyHcE/FT2Lm4kevH1aF3lLxmI+CKHSpZF07BEF2j X-Received: by 2002:a17:906:4b11:b0:982:21a1:c4e0 with SMTP id y17-20020a1709064b1100b0098221a1c4e0mr4901726eju.56.1688301208422; Sun, 02 Jul 2023 05:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688301208; cv=none; d=google.com; s=arc-20160816; b=jtrg4k99/H+dnCrLyYNtfDbYIWJNzBBpx4xcrKtWQ3imeAx8iDM3gJ5NVEtM25b05a Jkc1Ha10leabgsC1AUMINPOD8PVxegJdU77BLM9bvT6sRT1qsreCy7bWn+O8B9/1Na2u zCBuwEMAaP0o5zZ6FXOvgQtaUJx5GFaKYmJUFJoQWUgUe33dqGMWPoq1q2EJbNlPQr9c oLM/j6GigJwUWD1UKRjmct6qELslMWDjl5f289Lo5UWuIU0Hv1glm1Xsa4dNsU31DaNH KSnYALrflBk4enTuFzRkb/x250rVqy1hIvV0TqXklBT7pF0rzSHl6cqolfSGOudOJwEZ z6UA== 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=2QQVLAqz5Dgp0O7PTQ7hb1i3rOEvtuxkp5BnHStC38U=; b=yZJOBH8U0+01iNp+SO2VTqlV+kIRT3/rkhpI75UQLIvnxDGo4pfhCtPx/yM6OSrQDB 1IUi3rfkcaXtUGSUYqSyeare0i7Q3GF/20cRBsZl8S8/4PwUY5w7jTnEULj9MrhiE9iD jBmsz/uQzAPefkFcQvkCuIm57I2pgeki4DR8z2dcK7CWgnlI1dWstwofWLU604obbHjt M5ibKx7lB/x5aHNxGGFyGzGhzHNdgxyA5BJYUQTj5ogxIxSB2tR4x5O/e7jP/fagXN3V Ci9AOc9Tefo8Now/48O+mDbvO2kcQV3NCJ0Z6TiYH/m42aP9rak5NtxLnItaNxC06Ck1 xGGw== 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=2fpwzQOZ; 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 gg18-20020a170906e29200b00988e62b24ecsi1475200ejb.760.2023.07.02.05.33.28; Sun, 02 Jul 2023 05:33:28 -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=2fpwzQOZ; 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 BA37E68C225; Sun, 2 Jul 2023 15:33:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 360E568BDCB for ; Sun, 2 Jul 2023 15:33:06 +0300 (EEST) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-3fa9850bfebso35887235e9.1 for ; Sun, 02 Jul 2023 05:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kynesim-co-uk.20221208.gappssmtp.com; s=20221208; t=1688301185; x=1690893185; 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=2fpwzQOZi0XuNG/oJhPvNIxCPNjVYz9TWS/5RjBGlwVbI4soQoSX/KN+1080v14/8O HzUhloQbdGPlXIZg6yJRj0X+Xc4SW2gTeGxk3H83g/+25Ksn+ekWqsB7N9PcU5uFxtDo NHF1Cycz3+Ml9Y7c8FIPR7A5bZ4ZETIq8Gd4lCteKC+iujqq0zfEdcruEwbJXSOSqK+Z zKLgzBwQ97Yxt+TnKxa8jLWbpehJ+2t2RJhHiTTo6FpMR61P0LKJ+/YDuh1X/995mkH2 FVwHvUYkITjr26umG7Qeb78sozHmlXX2+v5gg5SuP6lGGP5ovHFx2u/cgT0PBM36KX5O Tm6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688301185; x=1690893185; 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=Va/GBsLw6EdkCVfARS1QyRKrvmyiMbFW9EIFnH6dBxeVVQOXsj2MCSHc4VgvFuD9rl Wa7X0iWPeVOtaBO5c4SR/z1620i18s4OGZi2PPB/wUO9o2+tfyxiR0lJKpOharOt0c+u y++MRbnrsSRVcddtx80q7LVEPnHKYQnQT9zAQmM0IYJtY8rgBaKZoB6gUcgk85lsjVRl 7hIqkn3UcHjZi6hqJCJ5XqsUTWKUniRyuSuBf+Y8U0kOQ5IBdvmIqVmt/c/ipe1qUYZK cEQdDGLSA3fDdG/hInqb3+bi0DRvjbCRpu+b5tN6oXNmjJ8c6uwKqDKmxezXsZbi5Wth weNg== X-Gm-Message-State: AC+VfDxy36p+CduI6Kn9eLTMJZxXGYQ4iHVS/Bv4NG1ghhgx9wkvyOQy hLMaa3iSH1clF0e07hH1e1Kgqx0i7GvS3+wcE+k= X-Received: by 2002:a7b:c409:0:b0:3f8:946:115d with SMTP id k9-20020a7bc409000000b003f80946115dmr5669042wmi.30.1688301185580; Sun, 02 Jul 2023 05:33:05 -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 f12-20020a7bc8cc000000b003fbbe41fd78sm8816167wml.10.2023.07.02.05.33.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 05:33:04 -0700 (PDT) From: John Cox To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Jul 2023 12:32:28 +0000 Message-Id: <20230702123242.232484-2-jc@kynesim.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230702123242.232484-1-jc@kynesim.co.uk> References: <20230702123242.232484-1-jc@kynesim.co.uk> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 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 , martin@martin.st Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: mTk+X/OEnhpp 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 }