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