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 6F10B4AE19 for ; Fri, 28 Feb 2025 21:30:04 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A2C8868DF3A; Fri, 28 Feb 2025 23:30:00 +0200 (EET) Received: from szaka.eu (szaka.eu [144.217.86.229]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 07CFC68DB0D for ; Fri, 28 Feb 2025 23:29:54 +0200 (EET) To: ffmpeg-devel@ffmpeg.org Date: Fri, 28 Feb 2025 22:21:48 +0100 Message-ID: <20250228212148.11560-2-ffmpeg@szaka.eu> X-Mailer: git-send-email 2.47.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/aarch64/ac3dsp_neon.S: Optimize ac3_extract_exponents 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_extract_exponents_n512_neon: 503.2 ( 3.36x) ac3_extract_exponents_n3072_neon: 2986.2 ( 3.35x) ac3_extract_exponents_n512_neon: 211.2 ( 8.02x) ac3_extract_exponents_n3072_neon: 1251.5 ( 8.00x) A72 ac3_extract_exponents_n512_neon: 964.7 ( 2.39x) ac3_extract_exponents_n3072_neon: 5434.5 ( 2.47x) ac3_extract_exponents_n512_neon: 465.6 ( 4.87x) ac3_extract_exponents_n3072_neon: 2696.3 ( 4.97x) --- This version handles 16 ints in one go and consolidates separate extractions and writes into one. I assume the length of the input is a multiple of 16 (there are no constraints defined in the template file), but the tests are passing. Krzysztof libavcodec/aarch64/ac3dsp_neon.S | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/libavcodec/aarch64/ac3dsp_neon.S b/libavcodec/aarch64/ac3dsp_neon.S index 7e97cc39f7..b2ac9edc55 100644 --- a/libavcodec/aarch64/ac3dsp_neon.S +++ b/libavcodec/aarch64/ac3dsp_neon.S @@ -38,15 +38,26 @@ function ff_ac3_exponent_min_neon, export=1 endfunc function ff_ac3_extract_exponents_neon, export=1 - movi v1.4s, #8 -1: ld1 {v0.4s}, [x1], #16 + movi v4.16b, #8 +1: ld1 {v0.4s - v3.4s}, [x1], #64 + subs w2, w2, #16 abs v0.4s, v0.4s + abs v1.4s, v1.4s + abs v2.4s, v2.4s + abs v3.4s, v3.4s + clz v0.4s, v0.4s - sub v0.4s, v0.4s, v1.4s - xtn v0.4h, v0.4s - xtn v0.8b, v0.8h - st1 {v0.s}[0], [x0], #4 - subs w2, w2, #4 + clz v1.4s, v1.4s + clz v2.4s, v2.4s + clz v3.4s, v3.4s + + uzp1 v0.8h, v0.8h, v1.8h + uzp1 v2.8h, v2.8h, v3.8h + uzp1 v0.16b, v0.16b, v2.16b + sub v0.16b, v0.16b, v4.16b + + st1 {v0.16b}, [x0], #16 + b.gt 1b 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".