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 ESMTPS id 1490D4AE9D for ; Fri, 28 Feb 2025 21:32:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 31F5C68DDFA; Fri, 28 Feb 2025 23:32:31 +0200 (EET) Received: from szaka.eu (szaka.eu [144.217.86.229]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AFE3D68DD7F for ; Fri, 28 Feb 2025 23:32:24 +0200 (EET) To: ffmpeg-devel@ffmpeg.org Date: Fri, 28 Feb 2025 22:21:50 +0100 Message-ID: <20250228212148.11560-4-ffmpeg@szaka.eu> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250228212148.11560-2-ffmpeg@szaka.eu> References: <20250228212148.11560-2-ffmpeg@szaka.eu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/aarch64/ac3dsp_neon.S: Optimize ac3_sum_square_butterfly_int32_neon 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: , From: Krzysztof Pyrkosz via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: Krzysztof Pyrkosz 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: Before and after: A78 ac3_sum_square_bufferfly_int32_neon: 484.8 ( 2.00x) ac3_sum_square_bufferfly_int32_neon: 468.2 ( 2.08x) A72 ac3_sum_square_bufferfly_int32_neon: 793.6 ( 1.26x) ac3_sum_square_bufferfly_int32_neon: 527.3 ( 1.92x) --- Instead of calculating a^2, b^2, (a+b)^2 and (a-b)^2, calculate only a^2, b^2 and 2*a*b in each iteration and derive the latter parts from these three at the end. Krzysztof libavcodec/aarch64/ac3dsp_neon.S | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libavcodec/aarch64/ac3dsp_neon.S b/libavcodec/aarch64/ac3dsp_neon.S index b2ac9edc55..2128eab528 100644 --- a/libavcodec/aarch64/ac3dsp_neon.S +++ b/libavcodec/aarch64/ac3dsp_neon.S @@ -80,21 +80,20 @@ function ff_ac3_sum_square_butterfly_int32_neon, export=1 movi v0.2d, #0 movi v1.2d, #0 movi v2.2d, #0 - movi v3.2d, #0 1: ld1 {v4.2s}, [x1], #8 ld1 {v5.2s}, [x2], #8 - add v6.2s, v4.2s, v5.2s - sub v7.2s, v4.2s, v5.2s - smlal v0.2d, v4.2s, v4.2s - smlal v1.2d, v5.2s, v5.2s - smlal v2.2d, v6.2s, v6.2s - smlal v3.2d, v7.2s, v7.2s subs w3, w3, #2 + smlal v0.2d, v4.2s, v4.2s // sum of a^2 + smlal v1.2d, v5.2s, v5.2s // sum of b^2 + sqdmlal v2.2d, v4.2s, v5.2s // sum of 2ab b.gt 1b addp d0, v0.2d addp d1, v1.2d addp d2, v2.2d - addp d3, v3.2d + sub d3, d0, d2 // a^2 + b^2 - 2ab + add d2, d0, d2 + add d3, d3, d1 // a^2 + b^2 + 2ab + add d2, d2, d1 st1 {v0.1d-v3.1d}, [x0] ret endfunc -- 2.47.2 _______________________________________________ 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".