From patchwork Wed Nov 17 04:56:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 31455 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp211195iob; Tue, 16 Nov 2021 20:56:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjBWWFrYZECHr7DHEUsd/Pier1KL3/3nEsxznP1ir5H5iApTUu/JbP+J+7MbsuGv5VIjgs X-Received: by 2002:a17:907:7f18:: with SMTP id qf24mr17410344ejc.568.1637124993667; Tue, 16 Nov 2021 20:56:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637124993; cv=none; d=google.com; s=arc-20160816; b=JabWaCLI6i8OoS/gFU5xUYy4HKra6YxJmupz6zo0Kh0jH9pmnZnJ4yz4ug/igF0Wsi v2t3S9gsquVN7wr12QxQCO3S4P90xC3zLdFJ/n8nhtnLrM8jw18gCI3nngX+FvOtLQin /l55vjg58TNmYhauH0MdSvitL3IdJf4lTR0Dd2yLseFXbQJs2I9eqDRgU77aJe3FonPd 0lPQoig2qObsACxdCrbPT8eurO+mvfdNv5/lDfrEVuLMqx2KmCivwCmikyxCffPu0AKs TnpB37bZwv+RP9oZOtVMWvl9jcbBqjAp86c0mXiOJTGd7zPJ0DjngbXN0UwZt2Ma29zx 154g== 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=ZRqdBu/eNF8ZAbwoClKNBjdW59/FnEgBGsx3oXIDzmY=; b=S/Flg2zxbbMtDihbHynRGdHCH+wp0imfzIQzw/lOdesQiW0F8Nk+LiBFJbk8BEn13s Thu3atTGb55IDHjUYdJyWzbf6Oiyk0QuoxM330ZzyuCfNxhmXchfEesKOI5VD4uD1vgB SsxAwypzicU27C4YvTPIUuC6wfyvyJYEbCGIJb7/VjO0cCfgWMh93EP2Zj+6Z+YHZ6ik z28DGpwKQ4ASTXYEMgf7PAo9QaNiu4PFTOx9MEPbc3GLlfyQ6Rjcu/fKdEVJUQWo43wM 2lIdSI7aSaIR52ZAVJAXTMJYFD3stJK2TmmNyqXnodxxQOV89AbxbycC1QIK4F25VzLd ZRFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=inwK68Oi; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=keEgDWKN; 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 s20si34607518ejb.327.2021.11.16.20.56.32; Tue, 16 Nov 2021 20:56:33 -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=inwK68Oi; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=keEgDWKN; 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 7449668AD15; Wed, 17 Nov 2021 06:56:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3EF046804B9 for ; Wed, 17 Nov 2021 06:56:20 +0200 (EET) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id AEE223201D34 for ; Tue, 16 Nov 2021 23:56:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 16 Nov 2021 23:56:17 -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=BC8H1jZnGQSaybfHwKKIiqOJ2b k0LMgDCcaa1CPmea4=; b=inwK68OimtxERAFkCe1qEzwZiOcxqIaZHfDGCanV17 ADdjq3h/1gkB81Qa6/DxssVzD5qPcvd/TLRA2NGHpj1CjlEbfNLCe4Kn8QsZxTU6 9JJvFBILiy8fAdLJ+MwbfhrWix1rQdkymaqKPR1FzEYYoRrHgqPAxL/FtZOtB/l2 9xevyGwvFp3YHvaYPMLiURTg9tmMG9nNaGIpqC+soGMNyiaXYg5o+w9vgnlTedP5 WwQCrUL+jziE6DXJscM7c1CBHiBiMQHpsQ0lu6zKt1j0+ATD0t4ELwMZFRentC7f K+muBFJSRuc5I35olwC4eJNIOEhd1w+0x2P79DkDEaQg== 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=BC8H1jZnGQSaybfHw KKIiqOJ2bk0LMgDCcaa1CPmea4=; b=keEgDWKNtlEY+QMXa2ohTHn7CLNh8jyRM 9m51YbWJf+OWPtKZ1UJAgSU80hmxZfLWXm6jL6MRAUqN2Tp496KKks1/dCkNmPzo /DlSATF/1M1ulcSBZsGh++34aO/6K4nJrcvwrVGXMJvK2t4TVij+ehKYOjPHfpFX sICK1Rjow3P4SWigNFHqh/gBWWs5dUvj+ZQ4trEps7aQSJVzdczldaVK3mbnQnFd TxPoHELDViTk0p9nOxBnEIJdcMQJda0fM4boezEqwM7DGrTKeqfIyImsnycmDYd5 AxBITPOuonBlPfWjxrcH/+cqs9gbRZd336S9RL3xYJxvsB51bDpSA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeefgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertdertd dtnecuhfhrohhmpedflfdrucffvghkkhgvrhdfuceojhguvghksehithgrnhhimhhulhdr lhhiqeenucggtffrrghtthgvrhhnpeeutefgtdeuvdejjeejvdetleffueehtdeftedugf elhfejueektedvvddtveeiieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpehjuggvkhesihhtrghnihhmuhhlrdhlih X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 16 Nov 2021 23:56:16 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 Nov 2021 05:56:09 +0100 Message-Id: <20211117045614.55251-1-jdek@itanimul.li> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 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: 1sW8tigen276 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(-) Updated commit message. 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 Wed Nov 17 04:56:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 31450 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp211413iob; Tue, 16 Nov 2021 20:56:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwChd1N+DjqfWM4kz5eNQ7rciWbp3rewSVmWfiMx8osAhrsv82+MAj8Y5EUP6KtluwXhPLh X-Received: by 2002:a05:6402:278e:: with SMTP id b14mr17866117ede.354.1637125007413; Tue, 16 Nov 2021 20:56:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637125007; cv=none; d=google.com; s=arc-20160816; b=m8nAT/RTGU6+fxW5yQpRIg6aykCO1ZU3cL8EelS6MmhJTD+/ijWa1UyC4A+TDT8Oy5 6kur05RPnm3kvm/ZPq0WfvnBo4MTzXi4y058b1DkbZi2jS4fC0n/iyjNsN/jXOH2cJe4 y2T1ue0yM6FAm6+IJtVuPJ3O60nHC7Qp/IlZYThS9VqTKiQ/fnb2kdr0RjqY0iBxjIe+ yIQ+N6R2uxdy4w8Oi6DZmoxr5jwDAhjwcpiSS40ENw6icuEKuPg+SGiVJBPsZrE0Szx7 7rsbSP+H7GmV1dhIB1+QzjMksud3jh81oqPdcBI/Gtc2YjopsZbtGsJId87Bqtm0D92K b4WA== 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=sZrlF1CT50WrWOPa3hQNt9Kp+61b1fUtZ9IOMPsb5R8=; b=1D3LBT5RNHX4RPMQ7ccEkFsPFYjOoNfAO+4vdOf6+0CHukwbBCuxA8OTS55PxwVLDz X/WE9xFfK0kZyHWctYfsqCfvf8bYDIzS1rEgBfLvR+Xiusjb0W4BSeVeEaP6Ndm9dGTQ RqN/WFE/vrwYAcsz0UdmwHngIQ2rzfFxZADc1ryYVg8Cbho9LAwqduuYV+jm/ql9GXwO 74qBeEiWEip5L9PN8bN3iHDcSU0oeowQ4Py6tk+fNdiTkvt8ajkietXfVDLgP1Tjqo29 rimMKBzMbspTaUAb2JwQB7fmxGEHS7ksgufEaX9EAvW9lGcBKWBJ4zYjdi84R9540WO9 ep3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=A91dvHve; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=VrJYACzm; 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 dr22si53950884ejc.562.2021.11.16.20.56.47; Tue, 16 Nov 2021 20:56:47 -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=A91dvHve; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=VrJYACzm; 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 AD7B168A5F8; Wed, 17 Nov 2021 06:56:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9C9EE6804B9 for ; Wed, 17 Nov 2021 06:56:20 +0200 (EET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 283E43201D47 for ; Tue, 16 Nov 2021 23:56:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 16 Nov 2021 23:56:19 -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=xwFSkINHhAtuS foGzQo+CxiwlzuACD+QMSPIVQdZcEc=; b=A91dvHverGSrnBv3ZreF/Vy+09SX4 h+DXinSCFV/ePqjbMJH9B6oWfYOYIdbWYRyHr0U1A3V7DWvxuNm1g8ZAVe0h3ua4 vtTYAQ5/SyBgWlVXYqbycasRqnmPqQFAQTd/6dkHie8uj9rENMt1YSOo6jtHZ/8U fIkFNL2wf590vl6Zhf2kSJ5WqpGZf686G9Zk5F3Mef//9PTx/W2ETnV1KI+IcLLe KZtKsqJ7ZfXO08auuD7zMK/CQiaxlClywwo9x3MFpE1DJuNZ8tm1DY+ohbLbhUmF p7FPAkGz67/jWRab02maQa6IchRkgnCwTOP0zLMgip4DdN8WIunyn43uw== 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=xwFSkINHhAtuSfoGzQo+CxiwlzuACD+QMSPIVQdZcEc=; b=VrJYACzm DPtpVtlA6MvnF4oVYwVYendQBF4RGaext7qnnkkyaAXOd7CM0u9gdbAnKG+a6z9T Mrd2nHVuJ4wlzCYDd1SLDE3ixzh703SFJLJmGgL/doaTA8tEk1ldMrFQd5H9DheN DZvgl7vVOYzfHcYVpgkZhZ5G4RY8eHOfB6a2ndFoD1DQ7VLRcPHV1BdXzBxokUM/ N/FKcW6GaSlrvXLgxwyBEojBk2PiJJkIIsHwqqfE38RbdTbNAsdxa48jXjm8wpr0 /I0IDXWk2kp6bK9UX+fwDi4hzTSCweyRwiwEFTf/j4zFGpin4qucVeJkSPrJl0bI ev80VdtrMVvOIA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeefgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpedflfdrucffvghkkhgvrhdfuceojhguvghksehithgrnhhimhhu lhdrlhhiqeenucggtffrrghtthgvrhhnpefhvdefjeffgefffeeifeevgfehueduleehhf ffvedttdfhheduiedtteefheeiteenucffohhmrghinhepnhgvohhnrdhssgenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjuggvkhesihhtrg hnihhmuhhlrdhlih X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 16 Nov 2021 23:56:18 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 Nov 2021 05:56:10 +0100 Message-Id: <20211117045614.55251-2-jdek@itanimul.li> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211117045614.55251-1-jdek@itanimul.li> References: <20211117045614.55251-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 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: Bs/TIzaoVjVw 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(-) Updated commit message. 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 Wed Nov 17 04:56:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 31454 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp211581iob; Tue, 16 Nov 2021 20:56:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzC2zA6/SHiufTz3Mo2tBSy5Awt9Uch+hBj0ULNKXo3RmIu7kXNhcfDbjkR8fPnUi3z5paQ X-Received: by 2002:a17:907:2da1:: with SMTP id gt33mr17484873ejc.378.1637125019254; Tue, 16 Nov 2021 20:56:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637125019; cv=none; d=google.com; s=arc-20160816; b=p3y5BRbhjhzv35ot/g8TmPPeCLpNYv9m4PqDxobIi/B3c6I2dByltbi+4K41c2N8OQ x/mu7/4p8POebEE2VEfxuCJLMsHZvCCKJRCO1ebyYRJrwtI4N70wtjo2JixT8YQpUhep Bjnn58Qd99TkWANd5IoW+dZPNbncd2F1RclL7U6v+pKUu3gPu21MWvfk6s9hRPKK4Dak biFLil9lm+eIjiQoui2EatSxFrengCcNSqlGWOLjYWCoOPQvl/9M1Wrb8P54nGfLb0zf 8hYiM7N4wP+iA7Jd/1lOwByNye1EwaZ5bfgb5O8klbxGudQgHZJEdLoTjgT1K90sj6XY gTUg== 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=NGlHR4DoGOVSfE+TPueFGfez23VFvzpInj+NMPkNLl8=; b=kD3qOkI+PDewmoyNucQsi//2vzhPcZIOyAUv8NeaBPHuLFRV8i8Ri2R7+fNunMxDiz SXVtgTVtmwAPoaECU6PigMhZ/TSRMrS8Q2de2mt1LbisAzw0Aih3flH21J7tK8Kmz5T/ VHa5/6CFysZVHfxBgSD8wwNRfbeKLXbcwtkT6c4QNywv/CkOTthMFJTZSo1XEIg97k0I GMB80groDmZMI3Gje41g5tLMvtO5UpF31sv61Xcu4ffIFOsfBCFMcPn7kzCJs4mvlczr hZ0EZolLZT/KlZF660k0h19VySKwYd/fvi9hDi7ELttFYnR94+CKSoYWkqoGRwHoAL7t 5enA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=H19l2qro; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=MeR7Nu2g; 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 qf26si51815506ejc.28.2021.11.16.20.56.58; Tue, 16 Nov 2021 20:56:59 -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=H19l2qro; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=MeR7Nu2g; 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 D9E0068AD5F; Wed, 17 Nov 2021 06:56:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 249B968A5F8 for ; Wed, 17 Nov 2021 06:56:22 +0200 (EET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id A26513201A3C for ; Tue, 16 Nov 2021 23:56:20 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 16 Nov 2021 23:56:20 -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=A+xKUy/xd9nsA I2IVEP+OflHc03TIqdIXjiGOD5Kmao=; b=H19l2qroZsohNJAPY+kaY0U4+4Sfx IwqALWIdbqJYeOVk+yTuNfzUGMDGvWe0ygJvy6kyuAENB4XFLuLlOQEG6yq/nhU8 +3FxPAeaTCizj3o2qjsGuXwlEPMXRZh+cboMFYxM8XMJMun/AGhyCSTwiS3GJHQj oX6Qj8ihU/3cXKD1BTSS4gzbclBPS6rTQOc8vXH3TfXmvM8AFGGhOpW1D3olNf+2 c+K036noqJHRiKO4WLAuXe4hqKB0RMCzUnnLIrVPzHawspPhnOmm0JzJd4BOflFc /hitG1PFjrU4YGVRKyzYgLdSlLR0D8gg+D+TQdMNLEI2tJL4V91WJUqlw== 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=A+xKUy/xd9nsAI2IVEP+OflHc03TIqdIXjiGOD5Kmao=; b=MeR7Nu2g qAbSJe7XZaz1AzZ/eV1WKjixPzkkVailJGlfBDIYC+VWDDEQkhAcGQgJ+x3cSB68 ft3GzWYdahCxUrekHGJ2m8hLKuKKzHT/drTEoHQHH8SV7LlStTZUDC0aNHaNqVxZ /CZuERqLtVRQlxHkaaokO76N7Z/EbT8qq52R22HYwCUWwSOLyK3kullJBXSvCjKS 9PlQv5NPc78pdQiFDeEaQzbPaCjQAwH9bbmsR4IFAhkVbZUnyP7dwOaR8NLpwEuZ goI0Ls9GQ2qbHs66mtEKHt3EDyZJXKHVou6GnoTYFZvFaNM6+u+Yf4799mAhDWRp jDmrbpIw1xvZog== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeefgdejhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpedflfdrucffvghkkhgvrhdfuceojhguvghksehithgrnhhimhhu lhdrlhhiqeenucggtffrrghtthgvrhhnpefhvdefjeffgefffeeifeevgfehueduleehhf ffvedttdfhheduiedtteefheeiteenucffohhmrghinhepnhgvohhnrdhssgenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjuggvkhesihhtrg hnihhmuhhlrdhlih X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 16 Nov 2021 23:56:19 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 Nov 2021 05:56:11 +0100 Message-Id: <20211117045614.55251-3-jdek@itanimul.li> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211117045614.55251-1-jdek@itanimul.li> References: <20211117045614.55251-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 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: 5zkp2P4HJxtS --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(-) Used inline shift for ldr & escheduled uxtl/uxtl2 before zip/zip2. 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..f1b9ced93f 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 Wed Nov 17 04:56:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 31453 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp211761iob; Tue, 16 Nov 2021 20:57:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXs89KIcTM32jbKj/QwEeqTbcQX6OXDFR2vyNNjcmvQeY35NyP7mAyFwEnPuJXqWjrAsaL X-Received: by 2002:aa7:d4c3:: with SMTP id t3mr18029180edr.268.1637125031438; Tue, 16 Nov 2021 20:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637125031; cv=none; d=google.com; s=arc-20160816; b=kb3P+R5hIMTQrRP2BpRnp3mkbtzgyLRrZfNI1o0iNg10ktWGju1f29FZakyFjMksOB QHkjhF2BMfANbIiiaGxK9PPgSjvXiAli0Dzm8GSkwlrCokEnk6iXqqkwMzivD5rfdxnw F2TxBVso7RSOan5mjWXv+909f+0aws5K6irBFQuSqW+g0Ee7lLMDjWIsAarvTfj/QBzG /ZIeSc12gGKgUtOy+eHxoTuKQ29zHIXc109eWiE1wRYumYseFTrGRsh8QUl6ghSOJAd8 KRFBF7fRSBuAshhv2DKcxDckR5BD5aQH6cI3xx08X2NMmQBm2FFIV5mBR+VdI9aXVxdt LQSA== 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=+CWZvTCwJ5+2sRnAzhH5SO8yOqXTYASI1LCT1XHmU0E=; b=eL0vaoY2xCEY7VBZOaoVXn9rVVB5o16z9WeCWLXZJl3MU288SaSlvIX0vT+ubmXctj kEVR4WIncR3Ml5RIp8EzAljLuztwtx3Bard479V74SkTSG04nEble2QLZsmPYvlcYGuo 9xNFxkbjZvmmkx0Rn7KBYMKMbXfecyRjbjy8q29uxVjwKQvk9K1qQ9GWf+NjjgrYqz3N gXqTrJMPeqNfH/RNWgQ6O3OOAWI2xJY/XORXXvm6Z7ffmWdx+lR2P33aXORPczFpPEjP zkaY+NmGpQDUYpXo/5depdPNtRAnVNMdatMPPAzpc4Pe80r8wjcpBt4ZnnTvgiO9d6sH jKQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=ZiVn13mG; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=ZZOPxvqe; 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 z23si42880391edm.184.2021.11.16.20.57.11; Tue, 16 Nov 2021 20:57: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=ZiVn13mG; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=ZZOPxvqe; 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 D556468AE3F; Wed, 17 Nov 2021 06:56:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D2C3B68AD50 for ; Wed, 17 Nov 2021 06:56:23 +0200 (EET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 5F49F3201D49 for ; Tue, 16 Nov 2021 23:56:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 16 Nov 2021 23:56:22 -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=UGqY4XD/M/vlu Cg1R5UCZLr09bdGoPUW69al23uxnu0=; b=ZiVn13mGH2rtRZAMoJQYeeJLx1Eov hdJzJmnG7WoIivFdMsfk9yHQwJZTYjjfhPlT3jD9WvWiRgI2+vb+hqWtHgbH+YwB FSUA/X7tKGtkXHWTLf4unzVDC5II4CO9J0RZMBOqMsBORYbNeWH2Qt4owH65SfEi iw86xVNFKQ3+DrLbuB1NuNUP9WMngkpRyHHHI4c3uYBs/VK97fHSAZffYImUKOiV yciUUxoBZdoN4UYI4ABCzACQjGhxnQJfMDaSC2CxQ+8hY+iOECm0BVvQTimjJ2S1 8eCDJM7S+yrPZaAi5GyhrM67D1mT0vylpjHvX2aCf0gdguBlR6xWqkTZA== 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=UGqY4XD/M/vluCg1R5UCZLr09bdGoPUW69al23uxnu0=; b=ZZOPxvqe kLwR0K7m3/AVbzi/DjnHwYQJIkDa21ysNDn77WJyRBSwXK/5OCFQKSXDvffY3tir wOx10tgiVv91rafCAQMEsqH3zUzasvK2K3CxYfQJfi5W5GR/phrpxhNZyMSCAF46 8es+SlTwi0lEcy4Z7HZn0PNFVHRQFHaNslLdlJ3EijR28wiEqz53GUjP4TNANS3H fEK0doi8F9z+SNfHpV8rk+UEFV7EcgXC9qBxU/NydY7HgtiRn91nf4rGsIu4v2nO 61kpJPUBlKPt6yAbqhq6hp3+/LWhMqt5tVxpF6h0lccMqyy1bNXkrMpi/NM1SSfW Ea0NEele4LiQcA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeefgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpedflfdrucffvghkkhgvrhdfuceojhguvghksehithgrnhhimhhu lhdrlhhiqeenucggtffrrghtthgvrhhnpefhvdefjeffgefffeeifeevgfehueduleehhf ffvedttdfhheduiedtteefheeiteenucffohhmrghinhepnhgvohhnrdhssgenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjuggvkhesihhtrg hnihhmuhhlrdhlih X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 16 Nov 2021 23:56:21 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 Nov 2021 05:56:12 +0100 Message-Id: <20211117045614.55251-4-jdek@itanimul.li> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211117045614.55251-1-jdek@itanimul.li> References: <20211117045614.55251-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 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: dTcTJiHJbM+W --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(+) Used inline shift for ldr & escheduled uxtl/uxtl2 before zip/zip2. 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 f1b9ced93f..e844cc8980 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 Wed Nov 17 04:56:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 31451 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp211940iob; Tue, 16 Nov 2021 20:57:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7yS6ptF6RMJmSio2az0NiVI7uOzLCIOX+90d54Jw2WP3RP76gpCylvAJLY0cHjRz1ipbB X-Received: by 2002:a17:907:94ca:: with SMTP id dn10mr18132005ejc.263.1637125043559; Tue, 16 Nov 2021 20:57:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637125043; cv=none; d=google.com; s=arc-20160816; b=ygwP86Yxo/LW99wruX355qOylEmhc5Unj2w5pcPTQL6ntEdJO+hMdblrPhw1uVC+M2 A7mO2iKimUn5cFvykU+dBPJi4AOngFFfV04OnGYv7jh6jlvwvYh2lnDV6uKqUohl+Jq3 SYR8BltDzunW6fBN5sNnWnZqMdlQL5FdtMQLc/ELQZui+pEhgzANrvTAoaWiyMoWFg23 vDp1MyTPMqmAzwIiIwPSDiSpx6lAkX3pX+NVOpdCgbYD1JTjvtNjz1YQtk8ZQhUTjMA6 K6psmmSzv7s3FT5x8l3nF8TON3YUqJvPHKJ6lbZ8ki3rFJhJr/VvMHwE6kWKqGuiHkfb xPYw== 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=50ZJJZO7h276vDIjot2hn3LHcZp+FavAFshSqui1n/o=; b=sHAu6uijnJ6ALVYmbLySgTmHb3LqLGK0L7IscrEw3aEpjfL7HurewfZsQK+K32co8o n/fOfSm0NxvAVFZ+k7sX38vlfDWBqUqqnwNrLuxL4wAtkBkLc8UN8jyqxpKPwx8yKhJU CHbxDZTx0V1CA9aoh0ZJ8LSBf3epnsHG6BHDOV30eh8OuKc1Pzmutx8NqOMiCkp+zpST rdR+Ci09cois9lKhmIkVCE7IHmtR3PJfCxf06v+yZ9CwxUHGE40hNFEEEjhdGay/xfvL yPNdEAI+pnXT42XDjpCgH2Gfw7/u7JpWWdfAvjlUj1ivY5vpmSzrp9IBTL2U8FGC+xvV DWdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=W3OEJf73; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=KVWNGUUh; 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 hj1si52379385ejc.555.2021.11.16.20.57.23; Tue, 16 Nov 2021 20:57:23 -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=W3OEJf73; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=KVWNGUUh; 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 E0BDF68AE5B; Wed, 17 Nov 2021 06:56:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8717368AE3F for ; Wed, 17 Nov 2021 06:56:25 +0200 (EET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 0E85F3201D7D for ; Tue, 16 Nov 2021 23:56:23 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 16 Nov 2021 23:56: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=uV9QWEa0hO21R 2YiYFt/qMtt4gztArn8fAu/fn7YIac=; b=W3OEJf73gX/OiEAM+hdCUzmXjeQCG kwY1MWJegx2p4wBEBFZbbe4jc+J55luVl/W6dxBpLHalAj4eNzWN6+Shd0C0HDIW /kwJzib07bbIWycE5vVS10eUkzq5CC+ZZArvw5NjE2dOGDgbf8WQy5HqrMGKkMs3 jwaRUBzBtkUdOwrwFjSDmlF27Kym2fwRgKUVNpqtI4nysV4bTs1/YiIesHuc0u7+ AKdbThQOgdUU4RM7bcyed5ihwdprHXlZ6X2531/J/w3FcpeTvDsWBdDp/8dWEewx hW+GDjE5b7O+0Bf4reLyXTGXYVjRIjLNWr3PojRaAaidhKL6UTB5OJGJw== 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=uV9QWEa0hO21R2YiYFt/qMtt4gztArn8fAu/fn7YIac=; b=KVWNGUUh wrdRyEamPC3hZ7NxAGPW6lCCZxHM2h+dUfg+hPK97+eXX7iQ1UnqgMKQ8FBNAeCa 2rH8rahZd6unxeaEpBCJqzgFT7xtcuKyp6kMY3/aMGP0kcuaBTqiDy0kEUUiTPS/ 1dj5DdLR02j05XzjTY+2339QTf48jZVSH7nZjof+VGtTPISBcsmXAeIcZMLMgqbc zlDlfvl7s7nfE6XJ+ls7HbE205Sfv1p11oZ6/0a7Ynsi7ibEIAmz0HU9RmySeF/J N2IMI/pAWo3kI76G94LmeuB7rKhhjIjxF9EUfu7WT4TTCJXK2d+/KITwDw8naSJd FblmFFThd6Ocaw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeefgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpedflfdrucffvghkkhgvrhdfuceojhguvghksehithgrnhhimhhu lhdrlhhiqeenucggtffrrghtthgvrhhnpefhvdefjeffgefffeeifeevgfehueduleehhf ffvedttdfhheduiedtteefheeiteenucffohhmrghinhepnhgvohhnrdhssgenucevlhhu shhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehjuggvkhesihhtrg hnihhmuhhlrdhlih X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 16 Nov 2021 23:56:22 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 Nov 2021 05:56:13 +0100 Message-Id: <20211117045614.55251-5-jdek@itanimul.li> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211117045614.55251-1-jdek@itanimul.li> References: <20211117045614.55251-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/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: VOZz0sBk1sxx --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 | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) No change since previous patch which was ACK'd, just want to push this set together. 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 e844cc8980..82b234aa47 100644 --- a/libavcodec/aarch64/hevcdsp_sao_neon.S +++ b/libavcodec/aarch64/hevcdsp_sao_neon.S @@ -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] // x9 = sao_offset_val[k+1] subs w8, w8, #1 @@ -44,8 +45,10 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1 bne 0b ld1 {v16.16b-v19.16b}, [sp], #64 movi v20.8h, #1 + sub x2, x2, x6 // stride_dst - width + sub x3, x3, x6 // stride_src - width 1: // beginning of line - mov w8, w6 + mov x8, x6 2: // Simple layout for accessing 16bit values // with 8bit LUT. @@ -56,7 +59,7 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1 // +-----------------------------------> // i-0 i-1 i-2 i-3 // dst[x] = av_clip_pixel(src[x] + offset_table[src[x] >> shift]); - ld1 {v2.8b}, [x1] + ld1 {v2.8b}, [x1], #8 // load src[x] uxtl v0.8h, v2.8b // >> shift @@ -74,7 +77,7 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1 // clip + narrow sqxtun v4.8b, v1.8h // store - st1 {v4.8b}, [x0] + st1 {v4.8b}, [x0], #8 // done 8 pixels subs w8, w8, #8 bne 2b From patchwork Wed Nov 17 04:56:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 31452 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp212079iob; Tue, 16 Nov 2021 20:57:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZJtWY87M6FKaXi6+Sr6oHW7SxLm6Rzb3nHZk7ZUfm8Fw0VS8EYXBlFe2v9o9GeMAnI5lA X-Received: by 2002:a17:906:7955:: with SMTP id l21mr18825196ejo.6.1637125053153; Tue, 16 Nov 2021 20:57:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637125053; cv=none; d=google.com; s=arc-20160816; b=oDPIYLYIYZJ7L6zSuijvG09tDHRh4zxfI2fRM/mOshxW6NIR0NlDe9hNxhJMCe/Seb 2mEoTxFcaRpqyosradH++lH/gCthSkYmjl+ZcZKgk6jruXGkuDU2Ilz/jmGhxJrd+Tej QCdj7w+9ACF6NW+us5ecRvu46XBQjgz4MrPLZwMUeqGaLfhn9WpfraV9QlcKZ1IM0K7Z JrYb0EQbIm2qJ+9oy4LbRXyJ30oC49EI0/auWofqOLfH3wTXCqzOBO62J4VRpO4KRNEU tQpdD2m93BQo1m/x93Zb+tdfg7wow0rFtGtVkTDCfeMgp5/4iURU43x3Ohp6Qb1A/6OT oZGg== 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=A8uy3FRjf3hsgni2oEmFMojeUrkLl6uakTHFbX9n8S0=; b=fh/Gt4Fnz5q9Zasr45H7eT/6BWUP/p+VAc7ZZNDDFXWub9KfijyXY6jQelfy8FsnCP 1morJkNSe1W/kA/4QUo7wZk1Jw4vcxGanf1GElzaqp0ZMWBrs2jQG6+Tj/ZyQDOGdt6y ngtXQBai2P/JyhdgQ4n+YUqpRPYlR76cxDlDf2xBAnJDwZegvNxRLLmig65fCMrBj4fV A+8Ws1tEE0UDjwVZpPUwdrIE9B0LAPvlsI9OWwGiTv6gEF2GsONklDwB4jz8vwRH0fqV AyaFpM6jiVFKLIT3GcB9lbPjQIWwATji9TPgHrZaJkIM7hJiDzKvC7Xs8JN9A+OQedX4 EcDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=SFK9SWXu; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=V8B9mY1l; 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 hw19si33895386ejc.291.2021.11.16.20.57.32; Tue, 16 Nov 2021 20:57:33 -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=SFK9SWXu; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=V8B9mY1l; 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 F13A968803D; Wed, 17 Nov 2021 06:56:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D4CC568AE5A for ; Wed, 17 Nov 2021 06:56:26 +0200 (EET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 64BF43201D80 for ; Tue, 16 Nov 2021 23:56:25 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 16 Nov 2021 23:56:25 -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=Vf2lUdYOe/tnx 1d/3UrTzX0UrvTrOpN37kEhKibd99s=; b=SFK9SWXu2sPoEJy60c2uVEEUBW/js wBP9s9x2lzAN9b+77OROrRJNI5aiWXSO06plh3qxlRw4+wTzvjglMnRmmAlEMIMv wnC8PzS//Ipy8hDPAK3kWYIaeJn3jtVf4YmdPXaPS5O62cY0PthyyFkAGu2WsD6M jwBaR5reOEwC3g3xnVjUOO/Js+J7cXliMmgScUzKpuvhvV1HAisFIzuCdYx5qbCK mdLvXy/0TD3PI0VFISFOd+LUXbwb/7dd25xZU+gbPPiyJZ/86YYggLwUi6PVrHcE qvQw2iZwevCdc4m/wDkWqG/Ho+Pvw6CKpnmciZkxv1X0kSIPOybKjF+5g== 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=Vf2lUdYOe/tnx1d/3UrTzX0UrvTrOpN37kEhKibd99s=; b=V8B9mY1l HHrvILITlRFBBqdlRN55CHnukbJ9O4zRoUx2jvmZolYAj2S3sFeYI/ShNk6bPudI 079a577Rhkj5Hy7cxfCSGRTEv3WbhEl8ZTNcnpxPpyvC9tLBtyLiaZcdsXFAoUyT gC9P4Sil2Hfp9d1ktXGxBdob4h/ci+V2/FF1CpyoA49BLTcbAJt54xYe44N9rUU6 J8wzDp8HwYaT45Pr6e76lGk7mQcLTNLLui3AR9BnUiaoDcIWCotoySSF9R1R/oAp QddPqO9QDzAq31Sgfjhzfunl49NkxlKSsaZxIfnoP/3WDE1Fcgsmt9i6bM/RI3xc F0zibEsy4MQBSw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeefgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpedflfdrucffvghkkhgvrhdfuceojhguvghksehithgrnhhimhhu lhdrlhhiqeenucggtffrrghtthgvrhhnpefhvdefjeffgefffeeifeevgfehueduleehhf ffvedttdfhheduiedtteefheeiteenucffohhmrghinhepnhgvohhnrdhssgenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjuggvkhesihhtrg hnihhmuhhlrdhlih X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 16 Nov 2021 23:56:24 -0500 (EST) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 Nov 2021 05:56:14 +0100 Message-Id: <20211117045614.55251-6-jdek@itanimul.li> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211117045614.55251-1-jdek@itanimul.li> References: <20211117045614.55251-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 6/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: Ru7zanGwPD3k Signed-off-by: J. Dekker --- libavcodec/aarch64/hevcdsp_sao_neon.S | 195 ++++++++++++-------------- 1 file changed, 90 insertions(+), 105 deletions(-) Now matches the 9,25 indentation like other ASM. diff --git a/libavcodec/aarch64/hevcdsp_sao_neon.S b/libavcodec/aarch64/hevcdsp_sao_neon.S index 82b234aa47..3ca34705db 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. * @@ -29,64 +29,49 @@ // int16_t *sao_offset_val, int sao_left_class, // 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] - mov w8, #4 - sxtw x6, w6 -0: - ldrsh x9, [x4, x8, lsl #1] // x9 = sao_offset_val[k+1] - subs w8, w8, #1 - add w10, w8, w5 // x10 = 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 - sub x2, x2, x6 // stride_dst - width - sub x3, x3, x6 // stride_src - width -1: // beginning of line - mov x8, x6 -2: - // Simple layout for accessing 16bit values - // with 8bit LUT. - // - // 00 01 02 03 04 05 06 07 - // +-----------------------------------> - // |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], #8 - // 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], #8 - // done 8 pixels - subs w8, w8, #8 - bne 2b - // finished line - subs w7, w7, #1 - add x0, x0, x2 // dst += stride_dst - add x1, x1, x3 // src += stride_src - bne 1b - ret + sub sp, sp, #64 + stp xzr, xzr, [sp] + stp xzr, xzr, [sp, #16] + 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 + and w10, w10, #0x1F + strh w9, [sp, x10, lsl #1] + bne 0b + ld1 {v16.16b-v19.16b}, [sp], #64 + movi v20.8h, #1 + 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. + // + // 00 01 02 03 04 05 06 07 + // +-----------------------------------> + // |xDE#xAD|xCA#xFE|xBE#xEF|xFE#xED|.... + // +-----------------------------------> + // i-0 i-1 i-2 i-3 + 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) + 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], #8 // store + subs w8, w8, #8 // done 8 pixels + bne 2b + 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 // ASSUMES STRIDE_SRC = 192 @@ -157,50 +142,50 @@ 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 + 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