From patchwork Tue Jan 4 05:20:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 33040 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp16691875iog; Mon, 3 Jan 2022 21:20:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJztm7yKTjtxBps9wHgv5xiMDmmY3FYoaI+qpL97lSt7uZ7HNKNChFSnFgwgiOG0xcqBJtbJ X-Received: by 2002:a17:906:5ada:: with SMTP id x26mr38275623ejs.720.1641273637512; Mon, 03 Jan 2022 21:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641273637; cv=none; d=google.com; s=arc-20160816; b=qNMhsGCumjZGBMbV7joNarpQZLBdl383vkt8jsjYduWqgW9QdI+bhIZAmz0pEDIGHC fDsra/8jTkLgGUqJQNZhMtdc3HVIwVMYWXBXvOdyQoZcqEM30HaU+voo1mSzLrbpqEJd FY95zgzVOSDx/pmMcQjS7i/1qrPuot4Izh5dePIdP05WLF5YBf0xEsGyueyb28o68ifI iX3pljgr23sTOh8gemfZzmB97jAS8zgzte46Sv1s6DOorsOHJAZnyeT5aIAVz5rbKLMF LtMJ9J1D37GMP7pto6Mygie9NQPo1IlycA27au+cvLc4uiqaHGDgNTQ17yDMwQZU59nq x+Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=RTskmvksSJYo5LKaZ2AK0Wh/6m1mdvokhWj/0Cjt3Yk=; b=R2L1/dps+qXJijWEbvDsCxe9hBqTMHrqt/rxMZ1elicbcpOHrHfYblfa7RLn0gxSzi eCv8djH1Loye2JomtVUmc02pUuOZ4CjC1D+unxClbXtLtIDHVX02lvPNSZEcMdH4f+tJ ET7BiBCEgUJFqvb+qFSirigAKRP8NiWByb+l51hsRqjbFiHv1C1HrLoVbEzxVsnCQ3Rm tfcuHaMWWwUE8QKRgiTFzxYRtCdIm96GQl6oVQ8scnfQGdFY1wdCTTgxfYGw7mdW9VRN SrETsyhuAk5o2pD5eA/PJUzuLm5wXqGopeDqLH4IoOScw6xM/S/oQqjFlAo3B2F7hVNo J5Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=g0ycuX0r; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=kDQONwpm; 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 c12si8023190eja.536.2022.01.03.21.20.36; Mon, 03 Jan 2022 21:20:37 -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=@itanimul.li header.s=fm3 header.b=g0ycuX0r; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=kDQONwpm; 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 8FC9768B221; Tue, 4 Jan 2022 07:20:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EFD4068B191 for ; Tue, 4 Jan 2022 07:20:25 +0200 (EET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id E588B32006F2 for ; Tue, 4 Jan 2022 00:20:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 04 Jan 2022 00:20:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= from:to:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=IadAjFXFdknsr3grChyE2TRo6y nT1g55L5Sj9KINDmQ=; b=g0ycuX0rt4Yihfvvg5Ysi3VhzLLIDU5RZClmmvwa8m pgSpvybCOw3hB4wK2TYrDj4r5yzh0+Nq5srLZRGGLc/BsOeWUzHV/Bz2S16Z8U65 AqkdsB5SPViRE/l9ca4+D83N00fr6xe4No2lfgYWRO9LSMQUhLcctgW/yJkjRFL8 OXVA+TwAWbJaurPwnhfktLXSeJ1Z+nkNXZ2EBQIYe4GPgLbThPt4IEprtOyV1Wf4 ormVoCWMX4AbD6w9loS2DR16cT+0vE3Wtp1oCr8sW2LtDxok9f5On3xK9VwsNgCq 679AtbdOUTUqc9qJ3YMeRbjvJ8z/f3Z4HS2K9bSG/opw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=IadAjFXFdknsr3grC hyE2TRo6ynT1g55L5Sj9KINDmQ=; b=kDQONwpmh41xFrfrkh7SfKx0Jq14Vp123 UKssqK9liOZfkQk0kEgMYbxET1Hbksr5d4gM/TOwqstWgVqWVt19DYaDVzPDnw5L sbd6mtb//dUQiBhTRnn96S9dW9yCzzCk+xypAJMKR/u/LBAR/78597ZjcWKKr4JY i/RyxdXzt2o6P/td9qEnAhLEOWj0WUMM5pCnqSL6r96j1nWumbcJh3d/rQv6Xmju qo928uVh8EtBy52T9VcsuXaeH8zXMfdlmjxgATUQ/HUYwqLmWgGxCklG+4zQGJ3C kp8wTMt1rhl11vov4NFZMQKU8b4AigB5yV4KtlWgzS59TA8iNwMmg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefvddgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepfdflrdcuffgvkhhkvghrfdcuoehjuggvkhesihhtrghnihhmuhhl rdhliheqnecuggftrfgrthhtvghrnhepueetgfdtuedvjeejjedvteelffeuhedtfeetud fglefhjeeukeetvddvtdevieeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepjhguvghksehithgrnhhimhhulhdrlhhi X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 4 Jan 2022 00:20:21 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Jan 2022 06:20:13 +0100 Message-Id: <20220104052018.9541-1-jdek@itanimul.li> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 1/6] lavc/arm: dont assign hevc_qpel functions for non-multiple of 8 widths 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: a1YCnW11vE44 The assembly is written assuming that the width is a multiple of 8. However the real issue is the functions were errorneously assigned to the 2, 4, 6 & 12 widths. This behaviour never broke the decoder as samples which trigger the functions for these widths have not been found in the wild. This relies on the mappings in ff_hevc_pel_weight[]. Signed-off-by: J. Dekker --- libavcodec/arm/hevcdsp_init_neon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) This set has already been reviewed by Martin, sending to list for transparency. diff --git a/libavcodec/arm/hevcdsp_init_neon.c b/libavcodec/arm/hevcdsp_init_neon.c index 201a088dac..112edb5edd 100644 --- a/libavcodec/arm/hevcdsp_init_neon.c +++ b/libavcodec/arm/hevcdsp_init_neon.c @@ -270,7 +270,8 @@ av_cold void ff_hevc_dsp_init_neon(HEVCDSPContext *c, const int bit_depth) put_hevc_qpel_uw_neon[3][1] = ff_hevc_put_qpel_uw_h1v3_neon_8; put_hevc_qpel_uw_neon[3][2] = ff_hevc_put_qpel_uw_h2v3_neon_8; put_hevc_qpel_uw_neon[3][3] = ff_hevc_put_qpel_uw_h3v3_neon_8; - for (x = 0; x < 10; x++) { + for (x = 3; x < 10; x++) { + if (x == 4) continue; c->put_hevc_qpel[x][1][0] = ff_hevc_put_qpel_neon_wrapper; c->put_hevc_qpel[x][0][1] = ff_hevc_put_qpel_neon_wrapper; c->put_hevc_qpel[x][1][1] = ff_hevc_put_qpel_neon_wrapper; From patchwork Tue Jan 4 05:20:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 33041 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp16692012iog; Mon, 3 Jan 2022 21:20:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzESdpSAvg8q+00+PR2yMghc3LaSrvjNfKdZSx5qsksb7AcpuDDl5nidFHxPhpiVtfiFXmU X-Received: by 2002:aa7:cf82:: with SMTP id z2mr37375898edx.105.1641273649767; Mon, 03 Jan 2022 21:20:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641273649; cv=none; d=google.com; s=arc-20160816; b=okH0AQNim6pEPxQFu+hj92U0moEAEMz+2b8DIsCPn9qlM3cpQxKu+knNzjGZ4kfn19 rF9zDHZYkV8XFtLSd3TBvxp1N7zabuZKvxp/VFf/VI4KTU6t5EZbW372juT5Akj6jkTX yrL8uCasz6LNVdKR0tuvYV7jYoI2xrC/Z0hOq6CDxPejTbKLvv7VBZZLFDy1/dNNmflS vYtKr6bK5MSIK+hg4iL83tRj+nOMAffEI5BRAb4ig5PCq46gfZMP/WelXIJ256UaUrZ1 NBT8RKOk46piRkJco49bwNG8Yp4JEwYZDpJ7KO+W4aibjBDczr8M7c7zk+pgJ28JKOSQ 2gvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=ObDQndNsU3h7XQflvBmfHhIwIbTdrDWAuRboHhtf3bM=; b=HXaYzwx1EvGgRzny4e/du8lkP7VhzouQ9vH5vU8wiNNRCxnm/TEGKFTnUCnuDuqVej Tg2cpRBoC5Og29Qyt0VXPlvfuD6CD9AGwb+Dej6EjfZ99NspXwz1y4FzVK6q0bUR3Jlv N4Zg4Jd7O9GlWLnDGKKU8C4w+HCpXhlCpcBHpHJwDqHa4+jCH5c2SXYmAhJCoZNVTE2A haDYc8RG//egdC7swjPldKvH8m9xCLPvd8Kvk8pd6XNaQazU8EkJStoi+ouaiyx3jGCQ P7/vW60zS8cpHzrvfLT5/dq3dCHcHE3z/NkXHQE5iiUGC320kGteQJ6wOpsP2vxApZIV 6/8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=We0geqD1; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=FIy7W5g2; 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 p29si18570203edi.491.2022.01.03.21.20.49; Mon, 03 Jan 2022 21:20:49 -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=@itanimul.li header.s=fm3 header.b=We0geqD1; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=FIy7W5g2; 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 ABE7A68B225; Tue, 4 Jan 2022 07:20:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3F2CC68B216 for ; Tue, 4 Jan 2022 07:20:26 +0200 (EET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id A4A0C3201E3E for ; Tue, 4 Jan 2022 00:20:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 04 Jan 2022 00:20:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=du/WZ7cRh3AWE ZRQjWYvFtVlRYhThVwAo+coM+xX4+0=; b=We0geqD1Al5pmJARB6i9g/BTx3urb D8Cc8ZgrM+4zES9m4z2sbi1YMNgHJVc1YOZjd40MoF3zDBTAFGk3/eddI21+BRpA RGKfh6p44gRKxHr1ZNKiQqNBSCUzHHUxvtnDh33A+rWh6NXTKaMZQO7kAhW8gdd6 cu7izb9/VDy3GvHZdti5i9eluALiWHQd4Jqi96ECkZjVhtdcRiCiuboXOeK4Jv9P ahiK/eHTLX1BmmuyIxGKSf3kwyc0PB43PQjDAnf7r8YdufYJJZAanqcUBdbSxBiJ mCMW5jAPfVadRYwJzSAdezlNGcDaBp0btCR28RVz6ekqey8WQJLKVAr2w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=du/WZ7cRh3AWEZRQjWYvFtVlRYhThVwAo+coM+xX4+0=; b=FIy7W5g2 8of/qUK8pY0SIg4sUfFNR/61bAm1mQfgk+fuVZ2P8P3FNVmBy18Mdw/GFcHhL01r i7swDbBVe9sa/bMTjEVGtFvpVviGzWDa/RHBJKqs2qzuOzxwnhCCubV/pnJTLJDv VPRes6g5Ju2tXoJcRIrIoWg15wBAIhOpI7GMaRKaH+RrCkHtX/e02J5INC3BORn6 ba/72+vK8xl+LtRFEAj60xQSuLGaC4OA+SxTy6Rd5qRAp99vRzFp2UbFBqhX4C6S XIDdmdCSTcZ9bEUt/81REQdio7OmqrORXqKWqKd3fwMd+4RvdB7YjkAN5xtRTnqb O4mzXVxOsTPgXQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefvddgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepfdflrdcuffgvkhhkvghrfdcuoehjuggvkhesihhtrghnihhm uhhlrdhliheqnecuggftrfgrthhtvghrnhephfdvfeejffegffefieefvefgheeuudelhe fhffevtddthfehudeitdetfeehieetnecuffhomhgrihhnpehnvghonhdrshgsnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhguvghksehith grnhhimhhulhdrlhhi X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 4 Jan 2022 00:20:23 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Jan 2022 06:20:14 +0100 Message-Id: <20220104052018.9541-2-jdek@itanimul.li> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220104052018.9541-1-jdek@itanimul.li> References: <20220104052018.9541-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 2/6] Revert "arm: hevc_qpel: Fix the assembly to work with non-multiple of 8 widths" 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: BWvmYaxMH0m7 This reverts commit 2589060b92eeeb944c6e2b50e38412c0c5fabcf4 which was originally to fix the FATE test. The real cause of the test breakage was fixed in 8dc8f04036eb27c8ad419839d4ed3bc67c44fe7a. Signed-off-by: J. Dekker --- libavcodec/arm/hevcdsp_qpel_neon.S | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libavcodec/arm/hevcdsp_qpel_neon.S b/libavcodec/arm/hevcdsp_qpel_neon.S index f71bec05ed..caa6efa766 100644 --- a/libavcodec/arm/hevcdsp_qpel_neon.S +++ b/libavcodec/arm/hevcdsp_qpel_neon.S @@ -237,7 +237,7 @@ vld1.8 {d23}, [r2], r3 bne 8b subs r5, #8 - ble 99f + beq 99f mov r4, r12 add r6, #16 mov r0, r6 @@ -280,7 +280,7 @@ vld1.8 {d23}, [r2], r3 bne 8b subs r5, #8 - ble 99f + beq 99f mov r4, r12 add r6, #8 mov r0, r6 @@ -310,7 +310,7 @@ vld1.8 {d23}, [r2], r3 bne 8b subs r5, #8 - ble 99f + beq 99f mov r4, r12 add r6, #8 mov r0, r6 @@ -377,7 +377,7 @@ endfunc vst1.16 {q7}, [r0], r1 bne 8b subs r5, #8 - ble 99f + beq 99f mov r4, r12 add r6, #16 mov r0, r6 @@ -417,7 +417,7 @@ endfunc vst1.8 d0, [r0], r1 bne 8b subs r5, #8 - ble 99f + beq 99f mov r4, r12 add r6, #8 mov r0, r6 @@ -446,7 +446,7 @@ endfunc vst1.8 d0, [r0], r1 bne 8b subs r5, #8 - ble 99f + beq 99f mov r4, r12 add r6, #8 add r10, #16 @@ -533,7 +533,7 @@ endfunc \filterh q7 bne 8b subs r5, #8 - ble 99f + beq 99f mov r4, r12 add r6, #16 mov r0, r6 @@ -594,7 +594,7 @@ endfunc \filterh q7 bne 8b subs r5, #8 - ble 99f + beq 99f mov r4, r12 add r6, #8 mov r0, r6 @@ -641,7 +641,7 @@ endfunc \filterh q7 bne 8b subs r5, #8 - ble 99f + beq 99f mov r4, r12 add r6, #8 mov r0, r6 From patchwork Tue Jan 4 05:20:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 33042 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp16692131iog; Mon, 3 Jan 2022 21:21:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFxosYwH5CadigK75xMuy6Yo7AHbOnw1mjSWGOMk2cYPirIqHk/6j4GgNBuvuLeIGPKoN4 X-Received: by 2002:a17:906:5e10:: with SMTP id n16mr40526799eju.129.1641273660152; Mon, 03 Jan 2022 21:21:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641273660; cv=none; d=google.com; s=arc-20160816; b=ptmSVS5heMR3uirU01ty96Z4TmQ0s9PrNZWDIxFNIseQ45adnj+mZKhMfRSzSsFAa8 VcMhKukpjrZtRSAKkwHKRd16ejjAX6seVlefAvAvPBsTzIE5CW6A28Lhr+osu27Pyltt Lm1XPMgMTyhuJI0je2QsrtHMfmo/qruU44sNIp+Zo6PspoGrwFJMEuN+2gE0zZ4k4nZd GDHvhBh0ia1ptoDS7uFqQ1H/tpl+RUjT/jfToja3jk5NHmkZGzkRpArxsDnpkxe/VPq9 HjwDNP3RfrkZj3d7e1ZnQg+wunJDV0N7HaOBPeAA2E0YKFpW2DYaag5jBjY+qwSNvV9X I8sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=7GGLyj4gz+pGx5mQgyryrwU6aM1eVHIb2WeUzhbA3os=; b=XU4E30q0kMDas2VGtbMsYdjUsk/a3HOUs0NFYfYq4KCfgkKhGwBDwdclDcpQqHKKSZ RjnCbDE35Qm0xRu4etgfPpv/Wf7v5qN3CgTqo38/765MNplSG9qMd39qA3fM9tu3VsHg NMUbuV3Y6tDKAHxF8xwgkxcxAxmVAi3wub3YP9Q/wnP802va5j/NbWeyS9cqRQM+QOms DKocwdvAauZTTZKBHC0nCXIh90QtN6sYj6dMjqBGPGYs5ytVruwEX58YC3L2SgZhXsJW t+7op26eWS4nJTJJxr2GInf+ebeQ5dzCm7w3ljkGrrbQg1ztxih97y2WZurd/AeMoabi 1aOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=Qc3dDaAe; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=ObIHbtuN; 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 z12si18981450edd.544.2022.01.03.21.20.59; Mon, 03 Jan 2022 21:21:00 -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=@itanimul.li header.s=fm3 header.b=Qc3dDaAe; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=ObIHbtuN; 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 B4EE368B22B; Tue, 4 Jan 2022 07:20:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 241C068B21C for ; Tue, 4 Jan 2022 07:20:28 +0200 (EET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 7BFA33200927 for ; Tue, 4 Jan 2022 00:20:26 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 04 Jan 2022 00:20:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=+KeowKyFRcm7Z 4eut1nHb3SI4hpyQgpQZLyWynwkSYo=; b=Qc3dDaAem1sDr5LYROya1jcd86vjV OzrorlQEJpCLOMwK3RbnRS3cvcYHsBxy/1EEjGk6DFBf3eU35ZNcaGnankbkQqpI 7JsTLm384IJCf27+GQu8xISlRAkO5fjjShlYsX3HIZL+n4hltRjlDBgIRUi2HRcr dQymTv2wk2fd35oo7NQfjxcsnB9y5cEkqxpBiAQujSJnJLTT4D2CZ7DsxmzoenCA 9CXhthggSeXsNehLakzOtJJAvLq/eY9BG26snD6ooFReDLzn+uXrH1PsEgGHtGmk a8a27BVlNWjc4ONmwzHm2TS67GdN1EH5N3D5Wb0/jrm4jwebPRS0Si8YA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=+KeowKyFRcm7Z4eut1nHb3SI4hpyQgpQZLyWynwkSYo=; b=ObIHbtuN Zceg2WcyUU0wjfpo5uZjzybqqfZkBiUSpJ0zrOhYQQpBEhs/i1Q9cPBauGO8TEmt OoyBDDWCNFjSwyX6EFzxh2H8UQeCWRsU57oHlhzbf7OIFqsZtuqjVSbrC5Lj2eOk G9Wzw4uxI4N2PjSBb6lGiFOCIIjtOQMCSkck+ov7bvSZJI9hjbb8DC5IKvXDYnEm Z0QYsPX2Fiesiv24AIGkkg0R5pPKu2OTyRmj7LZIcNMSw7oclR53C+SRvyq4TfSd tWuisWjYXco5sGLY7zMIqsMZK8OCeq2ZOesO3KQrm6jDHE9T67EbFXBquFFBHTl9 Bny1zIjhNuo1Zg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefvddgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepfdflrdcuffgvkhhkvghrfdcuoehjuggvkhesihhtrghnihhm uhhlrdhliheqnecuggftrfgrthhtvghrnhephfdvfeejffegffefieefvefgheeuudelhe fhffevtddthfehudeitdetfeehieetnecuffhomhgrihhnpehnvghonhdrshgsnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhguvghksehith grnhhimhhulhdrlhhi X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 4 Jan 2022 00:20:25 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Jan 2022 06:20:15 +0100 Message-Id: <20220104052018.9541-3-jdek@itanimul.li> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220104052018.9541-1-jdek@itanimul.li> References: <20220104052018.9541-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 3/6] lavc/aarch64: add hevc sao edge 16x16 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: zgzr+HCW0Qy0 bench on AWS Graviton: hevc_sao_edge_16x16_8_c: 1857.0 hevc_sao_edge_16x16_8_neon: 211.0 hevc_sao_edge_32x32_8_c: 7802.2 hevc_sao_edge_32x32_8_neon: 808.2 hevc_sao_edge_48x48_8_c: 16764.2 hevc_sao_edge_48x48_8_neon: 1796.5 hevc_sao_edge_64x64_8_c: 32647.5 hevc_sao_edge_64x64_8_neon: 3118.5 Signed-off-by: J. Dekker --- libavcodec/aarch64/hevcdsp_init_aarch64.c | 8 ++- libavcodec/aarch64/hevcdsp_sao_neon.S | 65 +++++++++++++++++++++++ 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/libavcodec/aarch64/hevcdsp_init_aarch64.c b/libavcodec/aarch64/hevcdsp_init_aarch64.c index c785e46f79..747ff0412d 100644 --- a/libavcodec/aarch64/hevcdsp_init_aarch64.c +++ b/libavcodec/aarch64/hevcdsp_init_aarch64.c @@ -57,8 +57,8 @@ void ff_hevc_sao_band_filter_8x8_8_neon(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, ptrdiff_t stride_src, int16_t *sao_offset_val, int sao_left_class, int width, int height); - - +void ff_hevc_sao_edge_filter_16x16_8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst, + int16_t *sao_offset_val, int eo, int width, int height); av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) { @@ -76,6 +76,10 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_neon; c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_neon; c->sao_band_filter[0] = ff_hevc_sao_band_filter_8x8_8_neon; + c->sao_edge_filter[1] = + c->sao_edge_filter[2] = + c->sao_edge_filter[3] = + c->sao_edge_filter[4] = ff_hevc_sao_edge_filter_16x16_8_neon; } if (bit_depth == 10) { c->add_residual[0] = ff_hevc_add_residual_4x4_10_neon; diff --git a/libavcodec/aarch64/hevcdsp_sao_neon.S b/libavcodec/aarch64/hevcdsp_sao_neon.S index f9fed8345b..4b895959d8 100644 --- a/libavcodec/aarch64/hevcdsp_sao_neon.S +++ b/libavcodec/aarch64/hevcdsp_sao_neon.S @@ -85,3 +85,68 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1 bne 1b ret endfunc + +// ASSUMES STRIDE_SRC = 192 +.Lsao_edge_pos: +.word 1 // horizontal +.word 192 // vertical +.word 192 + 1 // 45 degree +.word 192 - 1 // 135 degree + +// ff_hevc_sao_edge_filter_16x16_8_neon(char *dst, char *src, ptrdiff stride_dst, +// int16 *sao_offset_val, int eo, int width, int height) +function ff_hevc_sao_edge_filter_16x16_8_neon, export=1 + adr x7, .Lsao_edge_pos + ld1 {v3.8h}, [x3] // load sao_offset_val + sxtw x5, w5 + ldr w4, [x7, w4, uxtw #2] // stride_src + mov v3.h[7], v3.h[0] // reorder to [1,2,0,3,4] + mov v3.h[0], v3.h[1] + mov v3.h[1], v3.h[2] + mov v3.h[2], v3.h[7] + // split 16bit values into two tables + uzp2 v1.16b, v3.16b, v3.16b // sao_offset_val -> upper + uzp1 v0.16b, v3.16b, v3.16b // sao_offset_val -> lower + movi v2.16b, #2 + mov x15, #192 + // strides between end of line and next src/dst + sub x15, x15, x5 // stride_src - width + sub x16, x2, x5 // stride_dst - width + mov x11, x1 // copy base src +1: // new line + mov x14, x5 // copy width + sub x12, x11, x4 // src_a (prev) = src - sao_edge_pos + add x13, x11, x4 // src_b (next) = src + sao_edge_pos +2: // process 16 bytes + ld1 {v3.16b}, [x11], #16 // load src + ld1 {v4.16b}, [x12], #16 // load src_a (prev) + ld1 {v5.16b}, [x13], #16 // load src_b (next) + cmhi v16.16b, v4.16b, v3.16b // (prev > cur) + cmhi v17.16b, v3.16b, v4.16b // (cur > prev) + cmhi v18.16b, v5.16b, v3.16b // (next > cur) + cmhi v19.16b, v3.16b, v5.16b // (cur > next) + sub v20.16b, v16.16b, v17.16b // diff0 = CMP(cur, prev) = (cur > prev) - (cur < prev) + sub v21.16b, v18.16b, v19.16b // diff1 = CMP(cur, next) = (cur > next) - (cur < next) + add v20.16b, v20.16b, v21.16b // diff = diff0 + diff1 + add v20.16b, v20.16b, v2.16b // offset_val = diff + 2 + tbl v16.16b, {v0.16b}, v20.16b + tbl v17.16b, {v1.16b}, v20.16b + uxtl v20.8h, v3.8b // src[0:7] + uxtl2 v21.8h, v3.16b // src[7:15] + zip1 v18.16b, v16.16b, v17.16b // sao_offset_val lower -> + zip2 v19.16b, v16.16b, v17.16b // sao_offset_val upper -> + sqadd v20.8h, v18.8h, v20.8h // + sao_offset_val + sqadd v21.8h, v19.8h, v21.8h + sqxtun v3.8b, v20.8h + sqxtun2 v3.16b, v21.8h + st1 {v3.16b}, [x0], #16 + subs x14, x14, #16 // filtered 16 bytes + b.ne 2b // do we have width to filter? + // no width to filter, setup next line + add x11, x11, x15 // stride src to next line + add x0, x0, x16 // stride dst to next line + subs w6, w6, #1 // filtered line + b.ne 1b // do we have lines to process? + // no lines to filter + ret +endfunc From patchwork Tue Jan 4 05:20:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 33043 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp16692249iog; Mon, 3 Jan 2022 21:21:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPgSs+OGQI99cSPsOwbNxtiYSiQknoik0U20Fn/840qkLrpjf8eVkbLKqXQVb2DpTeNXW0 X-Received: by 2002:aa7:d64e:: with SMTP id v14mr47807590edr.194.1641273671613; Mon, 03 Jan 2022 21:21:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641273671; cv=none; d=google.com; s=arc-20160816; b=DG2y10JXnPlvlS0+kXh3gdpSNkdjyCbvQ2s8MUMDD2r3IG2CQDAVw1TCb6U4j1VaF8 bMChCdGCX1dpXSr1KUrSxE3wrTTseuvDkmJlDh8NpsCB39NZWM4UYHoFYZzVCUnYnKZj eQaaqUDAerOPIx5cRjG3Z1HxYX9Kfnf6f15an94+HF0w+dNOEHRlfh0rSA5VFGLCRrOB bvWWsUNlwWYWh7Gmr7ATt+DL8/QQ1wQ31hnol9J0rdgbTkIcBUhFhcVaKlYy2fmvNjQP 4zcqqNuK55xLvsZB6PtYiJ0IJmXza6iCleOAj4w7C6p2ZBttnpSt/BD4WkrErm+qx8XH WpBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=kwgmlCAVVfUONCzrkXc0lVu42UpetWAx40DG4DXCAsw=; b=z9yrthpq3tTEHXGvRvl4+8CI8tdwiSvGRkeKb/dpJNC736WOyM4SfpLWXeY1Hm8yQT 5rKrhS19UsvTj/eOvfYJmm/YR3aLIYYCJGHMA080Prx309kNl/k01/psaaNSm0wcfKkf aoZ5wb6kLlw4Hm46D/yLWr4FIbfhkH1kUDrZDWroYH+MLUcUfoiogwC+PWw+WoCVxvUH BCZ6sqB40GMlJ0hwG4ddUvRO3i8aWoIM1MQk6vqOPUYuTF8d31kWYLMaTFhxRLOwi1wj jVi/33GyPezTZdwDYuQQ7JgXQWXwuV10XTnIeALfItEQOtJ5SVvVMOAu5wGWDA0C8e4X qyyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=eVAcw+gf; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=JVone+Zw; 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 o17si7551292edf.383.2022.01.03.21.21.11; Mon, 03 Jan 2022 21:21:11 -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=@itanimul.li header.s=fm3 header.b=eVAcw+gf; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=JVone+Zw; 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 06C4A68B219; Tue, 4 Jan 2022 07:20:37 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 02EF168B22C for ; Tue, 4 Jan 2022 07:20:30 +0200 (EET) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 54FD93201F18 for ; Tue, 4 Jan 2022 00:20:28 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 04 Jan 2022 00:20:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=WTcuqIK9tjG0L SumyHJSTKk3CNoRWiepBzdl95IvA94=; b=eVAcw+gfqwR58UhQPtafAjwTq8DZ6 fxLwvFYs6NoIykkCAndLST84oJ0OmpS2B1sngz7JBJuGp+8dNYilma1U2CT1aI60 qdj1xz3U9Rvk15iAYxPqX1lDqGMqSXmcqN3Xt9BPuMmYvdjV156x/iQr8ljjZNF9 iCy4Bll48RjwN5kR61OdnGAhhsL6aCysvmus99J0LTU3ySdQzrJSsqGi3d0Fqf/M 4QtbbYzVMg5nBYC6fDLPR+pWtKUaObp+iVLCbmjQwLPHpw+OCz5WEwV7wlHU6Oxi x3Ljdlt2OV29ySJ8S4naJgz+hKhL/UqxteFSbTqhhXSZj4qi5DJJN0SFw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=WTcuqIK9tjG0LSumyHJSTKk3CNoRWiepBzdl95IvA94=; b=JVone+Zw +hU/ak3YvD+kGjANfe6XPsnHmw98OnAuNCfDpSQNq56n1U0FNxVQBaMtoEoIH1i4 wKy8OVxbZtLgcHu3NK5PJkSjB3fO8Hyvt2tkMuGTtNPfyn+sBhAHZ/gXXwse9MoI Z9FoBhDP/TL+TVlrJ6NZpYC4FdBxt/31HBPriNAE9OhYK1Ef1LSP9cZBNnKnxZwC ucQXsYwROj4nJPu0wRd0sp8s2HGm0ViPI/GMiPJJwlWf718hwnsLoYiNC5gaW/eL Mcl0UkGRRyFi5nBR1jKzdFzCnrzeLSV3w6yQi7zrJleOemM0kU+PsH4xFXifT5wz ofc7jTDji14tPw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefvddgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepfdflrdcuffgvkhhkvghrfdcuoehjuggvkhesihhtrghnihhm uhhlrdhliheqnecuggftrfgrthhtvghrnhephfdvfeejffegffefieefvefgheeuudelhe fhffevtddthfehudeitdetfeehieetnecuffhomhgrihhnpehnvghonhdrshgsnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhguvghksehith grnhhimhhulhdrlhhi X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 4 Jan 2022 00:20:26 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Jan 2022 06:20:16 +0100 Message-Id: <20220104052018.9541-4-jdek@itanimul.li> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220104052018.9541-1-jdek@itanimul.li> References: <20220104052018.9541-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 4/6] lavc/aarch64: add hevc sao edge 8x8 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: UYHNa9oBlzkA bench on AWS Graviton: hevc_sao_edge_8x8_8_c: 516.0 hevc_sao_edge_8x8_8_neon: 81.0 Signed-off-by: J. Dekker --- libavcodec/aarch64/hevcdsp_init_aarch64.c | 3 ++ libavcodec/aarch64/hevcdsp_sao_neon.S | 51 +++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/libavcodec/aarch64/hevcdsp_init_aarch64.c b/libavcodec/aarch64/hevcdsp_init_aarch64.c index 747ff0412d..b93cec9e44 100644 --- a/libavcodec/aarch64/hevcdsp_init_aarch64.c +++ b/libavcodec/aarch64/hevcdsp_init_aarch64.c @@ -59,6 +59,8 @@ void ff_hevc_sao_band_filter_8x8_8_neon(uint8_t *_dst, uint8_t *_src, int width, int height); void ff_hevc_sao_edge_filter_16x16_8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst, int16_t *sao_offset_val, int eo, int width, int height); +void ff_hevc_sao_edge_filter_8x8_8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst, + int16_t *sao_offset_val, int eo, int width, int height); av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) { @@ -76,6 +78,7 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_neon; c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_neon; c->sao_band_filter[0] = ff_hevc_sao_band_filter_8x8_8_neon; + c->sao_edge_filter[0] = ff_hevc_sao_edge_filter_8x8_8_neon; c->sao_edge_filter[1] = c->sao_edge_filter[2] = c->sao_edge_filter[3] = diff --git a/libavcodec/aarch64/hevcdsp_sao_neon.S b/libavcodec/aarch64/hevcdsp_sao_neon.S index 4b895959d8..167b9676d8 100644 --- a/libavcodec/aarch64/hevcdsp_sao_neon.S +++ b/libavcodec/aarch64/hevcdsp_sao_neon.S @@ -150,3 +150,54 @@ function ff_hevc_sao_edge_filter_16x16_8_neon, export=1 // no lines to filter ret endfunc + +// ff_hevc_sao_edge_filter_8x8_8_neon(char *dst, char *src, ptrdiff stride_dst, +// int16 *sao_offset_val, int eo, int width, int height) +function ff_hevc_sao_edge_filter_8x8_8_neon, export=1 + adr x7, .Lsao_edge_pos + ldr w4, [x7, w4, uxtw #2] + ld1 {v3.8h}, [x3] + mov v3.h[7], v3.h[0] + mov v3.h[0], v3.h[1] + mov v3.h[1], v3.h[2] + mov v3.h[2], v3.h[7] + uzp2 v1.16b, v3.16b, v3.16b + uzp1 v0.16b, v3.16b, v3.16b + movi v2.16b, #2 + add x16, x0, x2 + lsl x2, x2, #1 + mov x15, #192 + mov x8, x1 + sub x9, x1, x4 + add x10, x1, x4 + mov x17, #4 +1: ld1 {v3.d}[0], [ x8], x15 + ld1 {v4.d}[0], [ x9], x15 + ld1 {v5.d}[0], [x10], x15 + ld1 {v3.d}[1], [ x8], x15 + ld1 {v4.d}[1], [ x9], x15 + ld1 {v5.d}[1], [x10], x15 + cmhi v16.16b, v4.16b, v3.16b + cmhi v17.16b, v3.16b, v4.16b + cmhi v18.16b, v5.16b, v3.16b + cmhi v19.16b, v3.16b, v5.16b + sub v20.16b, v16.16b, v17.16b + sub v21.16b, v18.16b, v19.16b + add v20.16b, v20.16b, v21.16b + add v20.16b, v20.16b, v2.16b + tbl v16.16b, {v0.16b}, v20.16b + tbl v17.16b, {v1.16b}, v20.16b + uxtl v20.8h, v3.8b + uxtl2 v21.8h, v3.16b + zip1 v18.16b, v16.16b, v17.16b + zip2 v19.16b, v16.16b, v17.16b + sqadd v20.8h, v18.8h, v20.8h + sqadd v21.8h, v19.8h, v21.8h + sqxtun v6.8b, v20.8h + sqxtun v7.8b, v21.8h + st1 {v6.8b}, [ x0], x2 + st1 {v7.8b}, [x16], x2 + subs x17, x17, #1 + b.ne 1b + ret +endfunc From patchwork Tue Jan 4 05:20:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 33044 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp16692353iog; Mon, 3 Jan 2022 21:21:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOZZfSb6Li1hRsnW4atncy6GhyekG5olY+pzxMQYedASmTPAPiO4MGgHZudzQqfwW32GGP X-Received: by 2002:a17:907:2d24:: with SMTP id gs36mr37263760ejc.248.1641273682628; Mon, 03 Jan 2022 21:21:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641273682; cv=none; d=google.com; s=arc-20160816; b=o1wTem8VDJT9qrdRFEzUR1RTIhmJNr6Rx2zCrExJG/3n2ndpKbj7kSdErX3U7Sh9o3 NQ895RSwD3IzVdIagNbX+Eh0yAAJ6f617HZI03ESN2CS90NDWN7CXynNtnt6xXPgM/VD k63vvnGRni65mklLTaKC56PndmTdNbAqhC2deCu3KknEJSrHopk7FlCNeWlYOrAJjN6X mlj0VryXivKeYPwWEnbplvpaETnlCGFw1zOSRnDH9sIeMxzQpHE7Z/PZXHc9mgmk3bEZ fsP3nisCl6bhn5QQOiarAZRnvzSfsCjsLlevAAQVFzecGGn3lAnAzyys2D3eExCsb2I5 k4LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=ffA2dR+QTDXE3maFmh2uvBJcKftid/gAJWq8oKq4qbU=; b=yUNsdohemSbD10xoh7SfdLY7928HR8cTGoVM7tSi0TnHhs6CANeD7ctKPt/HVQcbvp D3W4MMJihQbpCMx+vb3+a9ot/mGqWuZcpZA2vnDM7d3hAZPRhxTaxHltE2IeP4k1r45+ D5sYs0D2OhVNvAbYJz/FLgayyELYaDNOVB5iMospkhae81Q4TuH42KE2NA0iC4qJa6w+ 1JOx5wBPnJXs//CJGLCkQPFDpD7FA3HBdiWit6mriIir4+oJ1DZdzNYPq4O7m9mgohZ4 WreVSAfEPADahHCoFXuw7uynXHlkAuKfAb5nIM19FeWhbX4bhNMsOvqelkB01XBGfcij 5Wxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=l34GYrCk; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=awpLJb0O; 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 r6si18815059edv.7.2022.01.03.21.21.22; Mon, 03 Jan 2022 21:21:22 -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=@itanimul.li header.s=fm3 header.b=l34GYrCk; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=awpLJb0O; 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 2CF5A68B237; Tue, 4 Jan 2022 07:20:39 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wnew1-smtp.messagingengine.com (wnew1-smtp.messagingengine.com [64.147.123.26]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2662768B231 for ; Tue, 4 Jan 2022 07:20:32 +0200 (EET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.west.internal (Postfix) with ESMTP id 24E732B001E9 for ; Tue, 4 Jan 2022 00:20:30 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 04 Jan 2022 00:20:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=rasbJDbUwmLnu Ucw7VlaM7OWrPXWw0MkyX4u3tCrllg=; b=l34GYrCkxfDr15igAgiD27pF4J8f9 FE23K8lU1vU3hOTT1wlQa9CTDEOhl0deo7+KbE54gbWQCa95Mrj4fzNb3inGcRPM 31CKIbWlWjCDk0EzTk9vgP3f0VUJLKl3z7/MEna6hFx/n1XgFSPrgqYTx9rLewT0 UX/2EHwg/4j8uXOI2EbwkroP/COWE+FSOEGtZPUaPM76ix4qRa8cRVdN2lCBJRfx LQneZ6+fxyhjC7P+/nEV9umh0Lpvb98QFu//uupCGb0J4HSyZI/KwS0+tFcYW/1T TUZC8yL3aQEdeOkekBOcY9jp0UjjjLpycRsPH1W2xEZZWwjt67m9/n/MA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=rasbJDbUwmLnuUcw7VlaM7OWrPXWw0MkyX4u3tCrllg=; b=awpLJb0O Zz8ZPCUwrBkh3J5lrnTNflnJRn7XXB7MUIi935D3pITbFuQClyoekw5V17XMFgVP OFmhppViQgwRqnmO2Wz3Btu7qtv32xpVIkzhPHavtQJNsMso4N/x97Dw85EJOAR+ BXkzDwvnaYxV3KbpSdhS/LhRWncaMEP4VMa7PhdmJYETrIy0Q2MODHITp5cEpPRh 3OhRBQmDfIiwVTj1Ooogt4K/m3YcNwyI8ZWbN6wbqsYUEm1K5Y8RMclVz+pk4Puc b8e7EVSc+DGAvHKSpLHjqhfmlI5bjDoyoOMdowoEmdBfW0bZ96Vrs0FiQWsGtNVz RJaLZCxfW6la5Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefvddgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgovfgvgihtqfhnlhihqddqufhprghmsghothdqkg egvdduqdehudculdeftddtmdenucfjughrpefhvffufffkofgjfhgggfestdekredtredt tdenucfhrhhomhepfdflrdcuffgvkhhkvghrfdcuoehjuggvkhesihhtrghnihhmuhhlrd hliheqnecuggftrfgrthhtvghrnhephfdvfeejffegffefieefvefgheeuudelhefhffev tddthfehudeitdetfeehieetnecuffhomhgrihhnpehnvghonhdrshgsnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhguvghksehithgrnhhi mhhulhdrlhhi X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 4 Jan 2022 00:20:28 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Jan 2022 06:20:17 +0100 Message-Id: <20220104052018.9541-5-jdek@itanimul.li> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220104052018.9541-1-jdek@itanimul.li> References: <20220104052018.9541-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 5/6] lavc/aarch64: clean-up sao band 8x8 function formatting 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: bPJ1z20RcJ8D Signed-off-by: J. Dekker --- libavcodec/aarch64/hevcdsp_sao_neon.S | 65 +++++++++++---------------- 1 file changed, 25 insertions(+), 40 deletions(-) diff --git a/libavcodec/aarch64/hevcdsp_sao_neon.S b/libavcodec/aarch64/hevcdsp_sao_neon.S index 167b9676d8..73b0b3b056 100644 --- a/libavcodec/aarch64/hevcdsp_sao_neon.S +++ b/libavcodec/aarch64/hevcdsp_sao_neon.S @@ -30,24 +30,21 @@ // int width, int height) function ff_hevc_sao_band_filter_8x8_8_neon, export=1 sub sp, sp, #64 - stp xzr, xzr, [sp] - stp xzr, xzr, [sp, #16] - stp xzr, xzr, [sp, #32] - stp xzr, xzr, [sp, #48] + stp xzr, xzr, [sp] + stp xzr, xzr, [sp, #16] + stp xzr, xzr, [sp, #32] + stp xzr, xzr, [sp, #48] mov w8, #4 -0: - ldrsh x9, [x4, x8, lsl #1] // x9 = sao_offset_val[k+1] +0: ldrsh x9, [x4, x8, lsl #1] // sao_offset_val[k+1] subs w8, w8, #1 - add w10, w8, w5 // x10 = k + sao_left_class - and w10, w10, #0x1F + add w10, w8, w5 // k + sao_left_class + and w10, w10, #0x1F strh w9, [sp, x10, lsl #1] bne 0b - ld1 {v16.16b-v19.16b}, [sp], #64 - movi v20.8h, #1 -1: // beginning of line - mov w8, w6 -2: - // Simple layout for accessing 16bit values + ld1 {v16.16b-v19.16b}, [sp], #64 + movi v20.8h, #1 +1: mov w8, w6 // beginning of line +2: // Simple layout for accessing 16bit values // with 8bit LUT. // // 00 01 02 03 04 05 06 07 @@ -55,33 +52,21 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1 // |xDE#xAD|xCA#xFE|xBE#xEF|xFE#xED|.... // +-----------------------------------> // i-0 i-1 i-2 i-3 - // dst[x] = av_clip_pixel(src[x] + offset_table[src[x] >> shift]); - ld1 {v2.8b}, [x1] - // load src[x] - uxtl v0.8h, v2.8b - // >> shift - ushr v2.8h, v0.8h, #3 // BIT_DEPTH - 3 - // x2 (access lower short) - shl v1.8h, v2.8h, #1 // low (x2, accessing short) - // +1 access upper short - add v3.8h, v1.8h, v20.8h - // shift insert index to upper byte - sli v1.8h, v3.8h, #8 - // table - tbx v2.16b, {v16.16b-v19.16b}, v1.16b - // src[x] + table - add v1.8h, v0.8h, v2.8h - // clip + narrow - sqxtun v4.8b, v1.8h - // store - st1 {v4.8b}, [x0] - // done 8 pixels - subs w8, w8, #8 + ld1 {v2.8b}, [x1] // dst[x] = av_clip_pixel(src[x] + offset_table[src[x] >> shift]); + uxtl v0.8h, v2.8b // load src[x] + ushr v2.8h, v0.8h, #3 // >> BIT_DEPTH - 3 + shl v1.8h, v2.8h, #1 // low (x2, accessing short) + add v3.8h, v1.8h, v20.8h // +1 access upper short + sli v1.8h, v3.8h, #8 // shift insert index to upper byte + tbx v2.16b, {v16.16b-v19.16b}, v1.16b // table + add v1.8h, v0.8h, v2.8h // src[x] + table + sqxtun v4.8b, v1.8h // clip + narrow + st1 {v4.8b}, [x0] // store + subs w8, w8, #8 // done 8 pixels bne 2b - // finished line - subs w7, w7, #1 - add x0, x0, x2 // dst += stride_dst - add x1, x1, x3 // src += stride_src + subs w7, w7, #1 // finished line, prep. new + add x0, x0, x2 // dst += stride_dst + add x1, x1, x3 // src += stride_src bne 1b ret endfunc From patchwork Tue Jan 4 05:20:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 33045 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp16692452iog; Mon, 3 Jan 2022 21:21:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDumS8fuaB81aG9w11rSBFYfoungq6oABzcnAkwsfttKKwVcsfxa2TfOVKUaIbza5Nk4yS X-Received: by 2002:a17:907:7fa4:: with SMTP id qk36mr37565401ejc.308.1641273692308; Mon, 03 Jan 2022 21:21:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641273692; cv=none; d=google.com; s=arc-20160816; b=X999sg3xJPQhow0ybfw811mWRW53Sv9kLbFqEgU5pBB47zPRScaU6ySLfT2ODTtC28 YCxkz98eIBA2/djQsfHePKbeTd1hFrL7PvATqVmwCUQUy/JiOZkWJ/cWVHuD62uhaYc1 fcLzIqXsobNUtdlqEbejurBnmdQcIogtHtFbvpp1H5MjB6umibD0MXuyVcnHr0mK1eBa 06RbT0yI0eNUa3ebtKKvxRfcVoR7yfeRENT7N813P64NYkBGM0Tcxi1WB/bfWnRAWaM6 nEe18RtBKEuJ1hFIhhH2ZW8sRpRjJPu1WExgH7/Nxmm1efanFlqNYgr7syoOagStZTvu 1P8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=LQihEsTiioQndNw1T/FaHeXyEeT5IZEdJZMbp8FC8ps=; b=ngj5eSv+95LfWcu870ZwNqBkXsnhxdi6EtJcfHzSTvLDwhNgDxr6OKXtfe3gDEO/BK QD5PXDdsXfaJclfdw3JwaWoW8xoNjw+RyzhfGYTvIO2CiIDcdrwUB8eOgsNlhzrQ09Pq f6mu9Jhmuyu3JnE2WNmrkpSvo6g4qa8ePY4oJ/qANUKzCSVmsMiCbTyZBO1YCHfYzrjL XyHQrGQsJlp9s+f8o0iVIpm0e8Vlg1JDrJpckvnb7jod+9MLBAein/x9j0p+xjMKnPtk OSbE2nat/lSiJ//Ph6sDxtUE26+o9bG2zbppjiB+cdggPugpVf7d9V3ENj9VbhPsyJW0 Mfnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b="X/y3xcZ0"; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=Wg7yWIqZ; 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 ds10si19664163ejc.607.2022.01.03.21.21.31; Mon, 03 Jan 2022 21:21:32 -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=@itanimul.li header.s=fm3 header.b="X/y3xcZ0"; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=Wg7yWIqZ; 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 4130C68B238; Tue, 4 Jan 2022 07:20:40 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 72C4268B233 for ; Tue, 4 Jan 2022 07:20:33 +0200 (EET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id D00F332006F2 for ; Tue, 4 Jan 2022 00:20:31 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 04 Jan 2022 00:20:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=Dwulq/0TsAwQL 8vZPAakZXwq7PhXaHtCuSCeK1lvJM0=; b=X/y3xcZ0QSZ4ZA0QOO2tAwLfhi9bX dg5jlzhDZYJxO0eZKc6/E1jCpSgcK9VqAymJK5ny9SoEdL6UoDXTTWemh4xwpacU EXPMf9xoL4p5qlZ8qxady64Pve/zYizVE7ymKhCgJiroKF9eGT2Eq6irXTp7mCjt 8CBpl6FlF61/CPkg7Zf9orNyU4Yp7fe//gGvK3lLhtQNGDeiRf5Q+2H8gV5r2TXs rRBUo+mAXAZm+AKl8lIqXK2OMZO2SC0YsCv8RIWmD6h4gUxyohLNLd4dYSOWHPiA Xbi/fkbXI88j7VO3kfEyb6Cmd870S5+NIy2Ai+UjJpwAHrCos9lSLm5Bg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=Dwulq/0TsAwQL8vZPAakZXwq7PhXaHtCuSCeK1lvJM0=; b=Wg7yWIqZ fsgJlTGylkRmb9RH/UOI1QC57A6b5bSdPpKW24atg0x2JYBw/Wj+A8U7xTFLpzff i3tYVzoOBRFcxE0w2Uil8I579NatnxyL2kGnh5ZO7xPHMGB3IUbAViQhXuq1TkOl 4x3z5VKsVfuE6zbs+jrpxRm2l86t0UdXn/h6ys5PqWfHPE5La2fYABpxio5ByUt7 ciibXMPQjRqG/cODD9J447kwAMh4cfV2ukCOZ72UXkMG3yk2ImIyDk+tg8G4o0GA jnNfpoKW+zDwbdY5BSMRyMQ4BGsLag6cisMSnX2Ed5qC6jeyoBFAT1kZng4LVKsE QxxBTODodtn4Ug== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefvddgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepfdflrdcuffgvkhhkvghrfdcuoehjuggvkhesihhtrghnihhm uhhlrdhliheqnecuggftrfgrthhtvghrnhephfdvfeejffegffefieefvefgheeuudelhe fhffevtddthfehudeitdetfeehieetnecuffhomhgrihhnpehnvghonhdrshgsnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhguvghksehith grnhhimhhulhdrlhhi X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 4 Jan 2022 00:20:30 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Jan 2022 06:20:18 +0100 Message-Id: <20220104052018.9541-6-jdek@itanimul.li> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220104052018.9541-1-jdek@itanimul.li> References: <20220104052018.9541-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 6/6] lavc/aarch64: add hevc sao band 8x8 tiling 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0jULpb+VKvud --bench on AWS Graviton: hevc_sao_band_8x8_8_c: 317.5 hevc_sao_band_8x8_8_neon: 97.5 hevc_sao_band_16x16_8_c: 1115.0 hevc_sao_band_16x16_8_neon: 322.7 hevc_sao_band_32x32_8_c: 4599.2 hevc_sao_band_32x32_8_neon: 1246.2 hevc_sao_band_48x48_8_c: 10021.7 hevc_sao_band_48x48_8_neon: 2740.5 hevc_sao_band_64x64_8_c: 17635.0 hevc_sao_band_64x64_8_neon: 4875.7 Signed-off-by: J. Dekker --- libavcodec/aarch64/hevcdsp_init_aarch64.c | 6 +++++- libavcodec/aarch64/hevcdsp_sao_neon.S | 11 +++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/libavcodec/aarch64/hevcdsp_init_aarch64.c b/libavcodec/aarch64/hevcdsp_init_aarch64.c index b93cec9e44..2002530266 100644 --- a/libavcodec/aarch64/hevcdsp_init_aarch64.c +++ b/libavcodec/aarch64/hevcdsp_init_aarch64.c @@ -77,7 +77,11 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_neon; c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_neon; c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_neon; - c->sao_band_filter[0] = ff_hevc_sao_band_filter_8x8_8_neon; + c->sao_band_filter[0] = + c->sao_band_filter[1] = + c->sao_band_filter[2] = + c->sao_band_filter[3] = + c->sao_band_filter[4] = ff_hevc_sao_band_filter_8x8_8_neon; c->sao_edge_filter[0] = ff_hevc_sao_edge_filter_8x8_8_neon; c->sao_edge_filter[1] = c->sao_edge_filter[2] = diff --git a/libavcodec/aarch64/hevcdsp_sao_neon.S b/libavcodec/aarch64/hevcdsp_sao_neon.S index 73b0b3b056..d524323fe8 100644 --- a/libavcodec/aarch64/hevcdsp_sao_neon.S +++ b/libavcodec/aarch64/hevcdsp_sao_neon.S @@ -3,7 +3,7 @@ * * AArch64 NEON optimised SAO functions for HEVC decoding * - * Copyright (c) 2020 Josh Dekker + * Copyright (c) 2020-2021 J. Dekker * * This file is part of FFmpeg. * @@ -35,6 +35,7 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1 stp xzr, xzr, [sp, #32] stp xzr, xzr, [sp, #48] mov w8, #4 + sxtw x6, w6 0: ldrsh x9, [x4, x8, lsl #1] // sao_offset_val[k+1] subs w8, w8, #1 add w10, w8, w5 // k + sao_left_class @@ -43,7 +44,9 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1 bne 0b ld1 {v16.16b-v19.16b}, [sp], #64 movi v20.8h, #1 -1: mov w8, w6 // beginning of line + sub x2, x2, x6 // stride_dst - width + sub x3, x3, x6 // stride_src - width +1: mov x8, x6 // beginning of line 2: // Simple layout for accessing 16bit values // with 8bit LUT. // @@ -52,7 +55,7 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1 // |xDE#xAD|xCA#xFE|xBE#xEF|xFE#xED|.... // +-----------------------------------> // i-0 i-1 i-2 i-3 - ld1 {v2.8b}, [x1] // dst[x] = av_clip_pixel(src[x] + offset_table[src[x] >> shift]); + ld1 {v2.8b}, [x1], #8 // dst[x] = av_clip_pixel(src[x] + offset_table[src[x] >> shift]); uxtl v0.8h, v2.8b // load src[x] ushr v2.8h, v0.8h, #3 // >> BIT_DEPTH - 3 shl v1.8h, v2.8h, #1 // low (x2, accessing short) @@ -61,7 +64,7 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1 tbx v2.16b, {v16.16b-v19.16b}, v1.16b // table add v1.8h, v0.8h, v2.8h // src[x] + table sqxtun v4.8b, v1.8h // clip + narrow - st1 {v4.8b}, [x0] // store + st1 {v4.8b}, [x0], #8 // store subs w8, w8, #8 // done 8 pixels bne 2b subs w7, w7, #1 // finished line, prep. new