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 A508B4A77D for ; Sat, 6 Apr 2024 14:26:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7865668D10E; Sat, 6 Apr 2024 17:26:25 +0300 (EEST) Received: from riki.gfrh.net (riki.gfrh.net [52.40.11.205]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BD9BD68D0EE for ; Sat, 6 Apr 2024 17:26:18 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geoffhill.org; s=20220510; t=1712413573; 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=ANhTYx+xlnQtopRFs1lvaf7OLitGC8GPxh7fHyaDnV0=; b=AKmN/57JEnj8GGWbd0u/FVKzeBmlSG3ngM4G7SMV/hg+VUf1YIB/vacgT0tiBQ+cKr2RgT m17OZc0IjmfjdHHWyw32E1sUM05HwHvhC168eCaieAryCemsh6NTikUhW5bMId0sN79YjS ZdRvuErtuFUKGR5znliXjXBW3j2zkUQ= Received: by riki.gfrh.net (OpenSMTPD) with ESMTPSA id 67a5128d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Sat, 6 Apr 2024 14:26:13 +0000 (UTC) Message-ID: <70079918-e9e5-42de-a3b1-2c34496e57fa@geoffhill.org> Date: Sat, 6 Apr 2024 07:26:13 -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 5/5] avcodec/ac3: Implement sum_square_butterfly_float 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 | 30 ++++++++++++++++++++++++ tests/checkasm/ac3dsp.c | 26 ++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/libavcodec/aarch64/ac3dsp_init_aarch64.c b/libavcodec/aarch64/ac3dsp_init_aarch64.c index e95436c651..e367353e11 100644 --- a/libavcodec/aarch64/ac3dsp_init_aarch64.c +++ b/libavcodec/aarch64/ac3dsp_init_aarch64.c @@ -32,6 +32,10 @@ void ff_ac3_sum_square_butterfly_int32_neon(int64_t sum[4], const int32_t *coef0, const int32_t *coef1, int len); +void ff_ac3_sum_square_butterfly_float_neon(float sum[4], + const float *coef0, + const float *coef1, + int len); av_cold void ff_ac3dsp_init_aarch64(AC3DSPContext *c) { @@ -42,4 +46,5 @@ av_cold void ff_ac3dsp_init_aarch64(AC3DSPContext *c) 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; + c->sum_square_butterfly_float = ff_ac3_sum_square_butterfly_float_neon; } diff --git a/libavcodec/aarch64/ac3dsp_neon.S b/libavcodec/aarch64/ac3dsp_neon.S index 77f9d20275..20beb6cc50 100644 --- a/libavcodec/aarch64/ac3dsp_neon.S +++ b/libavcodec/aarch64/ac3dsp_neon.S @@ -87,3 +87,33 @@ function ff_ac3_sum_square_butterfly_int32_neon, export=1 st1 {v0.1d-v3.1d}, [x0] ret endfunc + +function ff_ac3_sum_square_butterfly_float_neon, export=1 + movi v0.4s, #0 + movi v1.4s, #0 + movi v2.4s, #0 + movi v3.4s, #0 +1: ld1 {v30.4s}, [x1], #16 + ld1 {v31.4s}, [x2], #16 + fadd v16.4s, v30.4s, v31.4s + fsub v17.4s, v30.4s, v31.4s + fmla v0.4s, v30.4s, v30.4s + fmla v1.4s, v31.4s, v31.4s + fmla v2.4s, v16.4s, v16.4s + fmla v3.4s, v17.4s, v17.4s + subs w3, w3, #4 + b.gt 1b + faddp v0.4s, v0.4s, v0.4s + faddp v0.2s, v0.2s, v0.2s + st1 {v0.s}[0], [x0], #4 + faddp v1.4s, v1.4s, v1.4s + faddp v1.2s, v1.2s, v1.2s + st1 {v1.s}[0], [x0], #4 + faddp v2.4s, v2.4s, v2.4s + faddp v2.2s, v2.2s, v2.2s + st1 {v2.s}[0], [x0], #4 + faddp v3.4s, v3.4s, v3.4s + faddp v3.2s, v3.2s, v3.2s + st1 {v3.s}[0], [x0] + ret +endfunc diff --git a/tests/checkasm/ac3dsp.c b/tests/checkasm/ac3dsp.c index 573a76c764..442e965f3b 100644 --- a/tests/checkasm/ac3dsp.c +++ b/tests/checkasm/ac3dsp.c @@ -165,6 +165,31 @@ static void check_ac3_sum_square_butterfly_int32(AC3DSPContext *c) { report("ac3_sum_square_butterfly_int32"); } +static void check_ac3_sum_square_butterfly_float(AC3DSPContext *c) { + LOCAL_ALIGNED_32(float, lt, [ELEMS]); + LOCAL_ALIGNED_32(float, rt, [ELEMS]); + LOCAL_ALIGNED_16(float, v1, [4]); + LOCAL_ALIGNED_16(float, v2, [4]); + + declare_func(void, float[4], const float *, const float *, int); + + randomize_float(lt, ELEMS); + randomize_float(rt, ELEMS); + + if (check_func(c->sum_square_butterfly_float, + "ac3_sum_square_bufferfly_float")) { + call_ref(v1, lt, rt, ELEMS); + call_new(v2, lt, rt, ELEMS); + + if (!float_near_ulp_array(v1, v2, 10, 4)) + fail(); + + bench_new(v2, lt, rt, ELEMS); + } + + report("ac3_sum_square_butterfly_float"); +} + void checkasm_check_ac3dsp(void) { AC3DSPContext c; @@ -174,4 +199,5 @@ void checkasm_check_ac3dsp(void) check_ac3_extract_exponents(&c); check_float_to_fixed24(&c); check_ac3_sum_square_butterfly_int32(&c); + check_ac3_sum_square_butterfly_float(&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".