From patchwork Thu Oct 7 14:30:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 30971 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp1549428iob; Thu, 7 Oct 2021 07:31:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYQI5S8AHTQ15BmRMYtRw9ovXI+F7dNF38nDAO7MwlWTsqFza+doNoggR/P+zaGdUO+dcf X-Received: by 2002:a17:906:2bdb:: with SMTP id n27mr6148744ejg.86.1633617073758; Thu, 07 Oct 2021 07:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633617073; cv=none; d=google.com; s=arc-20160816; b=dGTi/OeJHUK/Lwh091U4kB2aXV0q/XdGfhx+7IiQhoyAD9qwIUVAbWQHC3vgCb/ah/ NZcOkXx+VnidNOQx41IVoEyZE/soUQul16dcCdhMueYiPneCSOr8euD7/sLepSjd/DoI ggp/ZNTCsCWmbG4yByz7ypGfqB24U5NCH+ecwvFciJCYyc+z78bg9Am+N2q/ua6wCeL8 mKWgXnp3qbpVLSQ383nCoKBvlr79F1XSZZ+0WdpgzkqxlhnJl4XFnYukgsIyxs5Z3lNY N5HH9icBDAzR2odL4Opv8X3le4ZGIonafrjAlMl3AecLf18DRwfwEngZCfSv5xCB08XA W3lw== 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=zVemQbCesBQOnAF7NuGp9wbGRwXtGhnai63dg8nou0c=; b=q4e8sWrwQ/byGNvDG/gyLCKIwM19iR4NiGkKCdkJY2dYzsPz77IYUulY26XJ16n0ow wiVprli6URDjLO4v5F8mKjz/mjiMHD/pVhSArNmYUt+GOi5JUeAG1pq128Z0tpG/IFSz Eu3jPOZtMnUoLn96QmyEHSKfdoPBSmt7rDwcS65FnEEzcFQF8SF9fBaBNYPvas55DVOt eGj8aWPEVOGut3BqtmJEUnIid2W/khRBD/tLUrunxrfMbRhlipgYlIMsUJ97iWwZ2i/j ewUbMRe1DlTmOKiVyDReQBf3g/ZQR8VnIMCGUhFGKn9PVoRNEBVMKUtamGhv98ScxcWK ODrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=e92IG59i; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=dzecG9vh; 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 nd19si11055358ejc.48.2021.10.07.07.31.13; Thu, 07 Oct 2021 07:31:13 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=e92IG59i; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=dzecG9vh; 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 984E168A6B6; Thu, 7 Oct 2021 17:31:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 394B768A4A4 for ; Thu, 7 Oct 2021 17:31:02 +0300 (EEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3B3E75C00BE for ; Thu, 7 Oct 2021 10:31:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 07 Oct 2021 10:31:01 -0400 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=BrHjCgTyCym+n RYEtE53DukZ02RZdMeSp34YUYug2Go=; b=e92IG59iSKclGcYOoNAj2jvg6xaph C9HN8hSGUI3LJGyi+juM1X3XPZn8PO2fL6FpRTt0o+m1kMJ9UEg9HdaP9K7lYRs+ +55BmlyOfxrce2WxK7au9s81FmrRqh2UAOJJ5Mq3Twf0GLvzchzUsl0F+vXsD2c6 btFr4eGjgVSMlW4HwwpYqgWVkgVqWtrU8DI3uvemD/FTpq9UnJxavnandu8ymxhn XBX/QUR2jDnSOOQwk2/uiz/XKLOqIu+QIq/yGp/fbQ+DAsElPZdd8wCKUZvPiecK fITBoJomflvimUwjPGuEeJbZxLHYbhrSCkeTQEOFLM9I9Ww9W5VwB0kLw== 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=BrHjCgTyCym+nRYEtE53DukZ02RZdMeSp34YUYug2Go=; b=dzecG9vh KAVedCaZK+LpTuY2lcz7ZrBvkxHyVvGF/Qwp+MU67UeflktShZFeqs7gaA4ishuY cL8ZIoQh+thNQ3Bc+6P9+98IAKQlqwM1V0LwQYCwWZSly1s0CjXGbM9cv7OYCJ/7 rWLEcnhuck7Po5Zc413JHr0GTxHm0a/IVuNn1oOOfJVBSu25L0syKkO1yaV7hyrZ Ijy/oKwOcHZLd4JwSGyil5A07JHfFwU1v4yAx1if5ShXnYxKtLQiwLW8gaxyHeAY CZhDws1NeTlUU9MYsZyav0tgDA5IFMYiUbAl88u8DJtGpOmmaaBen1Df5nmm01ej jkPbEKeDwDrY2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelkedgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepfdflrdcuffgvkhhkvghrfdcuoehjuggvkhesihhtrghnihhm uhhlrdhliheqnecuggftrfgrthhtvghrnhephfdvfeejffegffefieefvefgheeuudelhe fhffevtddthfehudeitdetfeehieetnecuffhomhgrihhnpehnvghonhdrshgsnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhguvghksehith grnhhimhhulhdrlhhi X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 7 Oct 2021 10:31:00 -0400 (EDT) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Oct 2021 16:30:55 +0200 Message-Id: <20211007143057.17870-2-jdek@itanimul.li> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211007143057.17870-1-jdek@itanimul.li> References: <20211007143057.17870-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/4] 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: tZxvrA3gxYFP --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 | 52 +++++++++++++++++++++++ 2 files changed, 55 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 a7f054c075..c4b931aab7 100644 --- a/libavcodec/aarch64/hevcdsp_sao_neon.S +++ b/libavcodec/aarch64/hevcdsp_sao_neon.S @@ -151,3 +151,55 @@ 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 + lsl w4, w4, #2 + adr x7, .Lsao_edge_pos + ldr w4, [x7, x4] + 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 + zip1 v18.16b, v16.16b, v17.16b + zip2 v19.16b, v16.16b, v17.16b + uxtl v20.8h, v3.8b + uxtl2 v21.8h, v3.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