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