From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 948444211F for ; Thu, 28 Apr 2022 13:42:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 20D0368B3EE; Thu, 28 Apr 2022 16:42:23 +0300 (EEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 622C368B2BE for ; Thu, 28 Apr 2022 16:42:16 +0300 (EEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id F42255C00BC for ; Thu, 28 Apr 2022 09:42:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 28 Apr 2022 09:42:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1651153334; x=1651239734; bh=0J99Gyc3f/hkt1SB9/pOLMJn/ cUscEgU1eN7jnzuAnM=; b=jWmngqMl/zQIyBhoNwHZAr+eLb9colrodVzpHKrj3 GYnEvoqJm3v8LO5K9e1fmtY1VX63QxkqwqXfNHQRGOHuwBWHy1/ku53TWOtAoiqp VnGqy5vXxlnD2eQT/qsM2eEBJKfMZWBBhQWYOcKWz1HiiBdudwqamFrosR3Y0rBx w0r3+BPTMkMbWzSsnGLsze8YC9x/cgs8l4Ftwjb5NpZa+6RbJmL/RvwtW53ktJJ9 DbXUmWsIBgLyagCs0TvRlJLNgV3uAs61rKqor7FUquL18STEh6T9XuXKR7CkzWIz kyoVscEFgpejUypbmmckzCL+nCD+G1MwUn7JVdnuQnE2w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1651153334; x=1651239734; bh=0 J99Gyc3f/hkt1SB9/pOLMJn/cUscEgU1eN7jnzuAnM=; b=CF27oPQQvyFBCr+v0 LBNEMaXwbTf098WJ0+3UH09ejr3Z2b/ywlGyxS1NWqlBx7gBV7iZt+xTwFR/iWdF zOo89d50zF/4mI3/l3amGECfAbF1IjM2g1v2rFu63M6mfiAlxx7d0BJWTAg3dIYx 58jHnkLrOmYUM2VzcQVKDKXtQz9BVLIYu3niPVMYn9MPQ7dtIdna4n7TMZqTS3Fg A++Omb7tqv9iIpfHkSd/IGgdcvztz3B3hlhhkGrdBXgatWwa04z98ZdHh7egtTOR 4B0ZWPJRC8suhO/2oGcbRIvZucU/+l8+8qXUwi8KLqYUgCMEbRR/DsG8V9Psu+Yv g71yg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudejgdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertdertd dtnecuhfhrohhmpedflfdrucffvghkkhgvrhdfuceojhguvghksehithgrnhhimhhulhdr lhhiqeenucggtffrrghtthgvrhhnpefhfedtieetieejieegveefveehudelveevteejke evieeukeejvefhhfetjeethfenucffohhmrghinhepnhgvohhnrdhssgenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjuggvkhesihhtrghnih hmuhhlrdhlih X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 28 Apr 2022 09:42:14 -0400 (EDT) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Thu, 28 Apr 2022 15:42:09 +0200 Message-Id: <20220428134211.4786-1-jdek@itanimul.li> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] lavc/aarch64: fix hevc sao band filter 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: The SAO band filter can be called with non-multiples of 8, we round up to the nearest multiple of 8 to account for this. Signed-off-by: J. Dekker --- libavcodec/aarch64/hevcdsp_init_aarch64.c | 10 +++++----- libavcodec/aarch64/hevcdsp_sao_neon.S | 8 ++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/libavcodec/aarch64/hevcdsp_init_aarch64.c b/libavcodec/aarch64/hevcdsp_init_aarch64.c index 1e40be740c..c8963e6104 100644 --- a/libavcodec/aarch64/hevcdsp_init_aarch64.c +++ b/libavcodec/aarch64/hevcdsp_init_aarch64.c @@ -75,11 +75,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; - // This function is disabled, as it doesn't handle widths that aren't - // an even multiple of 8 correctly. fate-hevc doesn't exercise that - // for the current size, but if enabled for bigger sizes, the cases - // of non-multiple of 8 seem to arise. -// 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; } 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 d523bf584d..e07e0cea2d 100644 --- a/libavcodec/aarch64/hevcdsp_sao_neon.S +++ b/libavcodec/aarch64/hevcdsp_sao_neon.S @@ -41,7 +41,11 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1 and w10, w10, #0x1F strh w9, [sp, x10, lsl #1] bne 0b + add w6, w6, #7 + bic w6, w6, #7 ld1 {v16.16b-v19.16b}, [sp], #64 + sub x2, x2, x6 + sub x3, x3, x6 movi v20.8h, #1 1: mov w8, w6 // beginning of line 2: // Simple layout for accessing 16bit values @@ -52,7 +56,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 +65,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 -- 2.32.0 (Apple Git-132) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".