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