From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id A076246A05 for ; Sat, 1 Jul 2023 21:35:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5B52468C08C; Sun, 2 Jul 2023 00:35:22 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3673168B838 for ; Sun, 2 Jul 2023 00:35:16 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 361LZFp5012061-361LZFp6012061; Sun, 2 Jul 2023 00:35:15 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id 59AEBA146B; Sun, 2 Jul 2023 00:35:15 +0300 (EEST) Date: Sun, 2 Jul 2023 00:35:14 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: <20230629175729.224383-3-jc@kynesim.co.uk> Message-ID: <41d6b9bd-803-a12c-8e90-84dc9dc9beb0@martin.st> References: <20230629175729.224383-1-jc@kynesim.co.uk> <20230629175729.224383-3-jc@kynesim.co.uk> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM Subject: Re: [FFmpeg-devel] [PATCH 02/15] avfilter/vf_bwdif: Add common macros and consts for aarch64 neon 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Thu, 29 Jun 2023, John Cox wrote: > Add macros for dual scalar half->single multiply and accumulate > Add macro for shift, saturate and shorten single to byte > Add filter constants > > Signed-off-by: John Cox > --- > libavfilter/aarch64/vf_bwdif_neon.S | 46 +++++++++++++++++++++++++++++ > 1 file changed, 46 insertions(+) > > diff --git a/libavfilter/aarch64/vf_bwdif_neon.S b/libavfilter/aarch64/vf_bwdif_neon.S > index 639ab22998..a8f0ed525a 100644 > --- a/libavfilter/aarch64/vf_bwdif_neon.S > +++ b/libavfilter/aarch64/vf_bwdif_neon.S > @@ -23,3 +23,49 @@ > > #include "libavutil/aarch64/asm.S" > > +.macro SQSHRUNN b, s0, s1, s2, s3, n > + sqshrun \s0\().4h, \s0\().4s, #\n - 8 > + sqshrun2 \s0\().8h, \s1\().4s, #\n - 8 > + sqshrun \s1\().4h, \s2\().4s, #\n - 8 > + sqshrun2 \s1\().8h, \s3\().4s, #\n - 8 > + uzp2 \b\().16b, \s0\().16b, \s1\().16b > +.endm > + > +.macro SMULL4K a0, a1, a2, a3, s0, s1, k > + smull \a0\().4s, \s0\().4h, \k > + smull2 \a1\().4s, \s0\().8h, \k > + smull \a2\().4s, \s1\().4h, \k > + smull2 \a3\().4s, \s1\().8h, \k > +.endm > + > +.macro UMULL4K a0, a1, a2, a3, s0, s1, k > + umull \a0\().4s, \s0\().4h, \k > + umull2 \a1\().4s, \s0\().8h, \k > + umull \a2\().4s, \s1\().4h, \k > + umull2 \a3\().4s, \s1\().8h, \k > +.endm > + > +.macro UMLAL4K a0, a1, a2, a3, s0, s1, k > + umlal \a0\().4s, \s0\().4h, \k > + umlal2 \a1\().4s, \s0\().8h, \k > + umlal \a2\().4s, \s1\().4h, \k > + umlal2 \a3\().4s, \s1\().8h, \k > +.endm > + > +.macro UMLSL4K a0, a1, a2, a3, s0, s1, k > + umlsl \a0\().4s, \s0\().4h, \k > + umlsl2 \a1\().4s, \s0\().8h, \k > + umlsl \a2\().4s, \s1\().4h, \k > + umlsl2 \a3\().4s, \s1\().8h, \k > +.endm > + > +// static const uint16_t coef_lf[2] = { 4309, 213 }; > +// static const uint16_t coef_hf[3] = { 5570, 3801, 1016 }; > +// static const uint16_t coef_sp[2] = { 5077, 981 }; > + > + .align 16 Note that .align for arm is power of two; this triggers a 2^16 byte alignment here, which certainly isn't intended. But in general, the usual way of defining constants is with a const/endconst block, which places them in the right rdata section instead of in the text section. But that then requires you to use a movrel macro for accessing the data, instead of a plain ldr instruction. > +coeffs: > + .hword 4309 * 4, 213 * 4 // lf[0]*4 = v0.h[0] > + .hword 5570, 3801, 1016, -3801 // hf[0] = v0.h[2], -hf[1] = v0.h[5] > + .hword 5077, 981 // sp[0] = v0.h[6] > + > -- // Martin _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".