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 CDCB64A77D for ; Sat, 6 Apr 2024 14:26:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4404C68D0E9; Sat, 6 Apr 2024 17:26:19 +0300 (EEST) Received: from riki.gfrh.net (riki.gfrh.net [52.40.11.205]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C514568CD00 for ; Sat, 6 Apr 2024 17:26:12 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geoffhill.org; s=20220510; t=1712413566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/x+N5pb1zFg8+/IKLSTO3lgDCMvasM9pYpvC0dbx+fc=; b=ff1E5sy1totBuyJ6Of28OKWsOH7iz0tqjUf8ZWSP90RBZMMedL6sdOTlRbkbSjkbvZf4nG CA3PoiwB0DSAuHt+pwv+ZJ6eL2TXUN3Jk+kw3g8xld22ZQ/IF1rTC9R2So2HBUCqdiU0G7 3uHEex4kslYxhZtG0QuUMEn8RR/eGoY= Received: by riki.gfrh.net (OpenSMTPD) with ESMTPSA id 8d0c57d7 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Sat, 6 Apr 2024 14:26:06 +0000 (UTC) Message-ID: <9ec9519a-5914-4f04-8873-bdabfb590d36@geoffhill.org> Date: Sat, 6 Apr 2024 07:26:06 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Geoff Hill To: ffmpeg-devel@ffmpeg.org References: <51f7be0a-4267-47bf-ab0b-bd6585806da7@geoffhill.org> Content-Language: en-US In-Reply-To: <51f7be0a-4267-47bf-ab0b-bd6585806da7@geoffhill.org> Subject: [FFmpeg-devel] [PATCH v4 4/5] avcodec/ac3: Implement sum_square_butterfly_int32 for aarch64 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: , 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: Signed-off-by: Geoff Hill --- libavcodec/aarch64/ac3dsp_init_aarch64.c | 5 +++++ libavcodec/aarch64/ac3dsp_neon.S | 23 ++++++++++++++++++++ tests/checkasm/ac3dsp.c | 27 ++++++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/libavcodec/aarch64/ac3dsp_init_aarch64.c b/libavcodec/aarch64/ac3dsp_init_aarch64.c index 1bdc215b51..e95436c651 100644 --- a/libavcodec/aarch64/ac3dsp_init_aarch64.c +++ b/libavcodec/aarch64/ac3dsp_init_aarch64.c @@ -28,6 +28,10 @@ void ff_ac3_exponent_min_neon(uint8_t *exp, int num_reuse_blocks, int nb_coefs); void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs); void ff_float_to_fixed24_neon(int32_t *dst, const float *src, size_t len); +void ff_ac3_sum_square_butterfly_int32_neon(int64_t sum[4], + const int32_t *coef0, + const int32_t *coef1, + int len); av_cold void ff_ac3dsp_init_aarch64(AC3DSPContext *c) { @@ -37,4 +41,5 @@ av_cold void ff_ac3dsp_init_aarch64(AC3DSPContext *c) c->ac3_exponent_min = ff_ac3_exponent_min_neon; c->extract_exponents = ff_ac3_extract_exponents_neon; c->float_to_fixed24 = ff_float_to_fixed24_neon; + c->sum_square_butterfly_int32 = ff_ac3_sum_square_butterfly_int32_neon; } diff --git a/libavcodec/aarch64/ac3dsp_neon.S b/libavcodec/aarch64/ac3dsp_neon.S index c350c1f173..77f9d20275 100644 --- a/libavcodec/aarch64/ac3dsp_neon.S +++ b/libavcodec/aarch64/ac3dsp_neon.S @@ -64,3 +64,26 @@ function ff_float_to_fixed24_neon, export=1 b.ne 1b ret endfunc + +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 + b.gt 1b + addp d0, v0.2d + addp d1, v1.2d + addp d2, v2.2d + addp d3, v3.2d + st1 {v0.1d-v3.1d}, [x0] + ret +endfunc diff --git a/tests/checkasm/ac3dsp.c b/tests/checkasm/ac3dsp.c index dc1b169e68..573a76c764 100644 --- a/tests/checkasm/ac3dsp.c +++ b/tests/checkasm/ac3dsp.c @@ -139,6 +139,32 @@ static void check_float_to_fixed24(AC3DSPContext *c) { report("float_to_fixed24"); } +static void check_ac3_sum_square_butterfly_int32(AC3DSPContext *c) { +#define ELEMS 240 + LOCAL_ALIGNED_16(int32_t, lt, [ELEMS]); + LOCAL_ALIGNED_16(int32_t, rt, [ELEMS]); + LOCAL_ALIGNED_16(uint64_t, v1, [4]); + LOCAL_ALIGNED_16(uint64_t, v2, [4]); + + declare_func(void, int64_t[4], const int32_t *, const int32_t *, int); + + randomize_i24(lt, ELEMS); + randomize_i24(rt, ELEMS); + + if (check_func(c->sum_square_butterfly_int32, + "ac3_sum_square_bufferfly_int32")) { + call_ref(v1, lt, rt, ELEMS); + call_new(v2, lt, rt, ELEMS); + + if (memcmp(v1, v2, sizeof(int64_t[4])) != 0) + fail(); + + bench_new(v2, lt, rt, ELEMS); + } + + report("ac3_sum_square_butterfly_int32"); +} + void checkasm_check_ac3dsp(void) { AC3DSPContext c; @@ -147,4 +173,5 @@ void checkasm_check_ac3dsp(void) check_ac3_exponent_min(&c); check_ac3_extract_exponents(&c); check_float_to_fixed24(&c); + check_ac3_sum_square_butterfly_int32(&c); } -- 2.42.0 _______________________________________________ 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".