From patchwork Wed Apr 3 06:43:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Hill X-Patchwork-Id: 35101 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f96:b0:1a3:b6bb:3029 with SMTP id mm22csp213634pzb; Tue, 2 Apr 2024 23:43:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUWtf/Qou8bLZqcf63zUv6tTWR68jn7ndUICT9oNKxzQMTIX2374eulWcuY+sw4sBFlnLHwODLFckDpx9udnyerxQmZedyTFu04wg== X-Google-Smtp-Source: AGHT+IHQ1LgYaUOf8CtRxZtjReZ7CpbofBebFWe2fbBwS/cgKX09dfiYefDIWXpENVBWdPf3mKw1 X-Received: by 2002:a17:906:ae48:b0:a4e:5abe:3832 with SMTP id lf8-20020a170906ae4800b00a4e5abe3832mr1132444ejb.72.1712126613225; Tue, 02 Apr 2024 23:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712126613; cv=none; d=google.com; s=arc-20160816; b=BamsjUGFmYX0Zlx08XBpkskAmTbwd+gip1tlwORJYXrvWVX7X3NFYi5LqNa/2mqOXr noXJ32hQFEiZAXdkwZyn5uDBWFaTUTygu7pIMoS+nB+8eFx8hbVv51gKpYYqks9Rw+dJ sPr6CcFu/791Mb8o9iHUNcIeu5jx3oyh+uIN6FHPgh55rjvmMYAZQ49VOX3VD2wsFgYp G8aeE0/kZ76xfuYHiSuP/piirMTfZNJxGYEB5L0v8270dFdVK0ZV39CDJl39QYkLZUnO eHgcNzZM8ZKR1MTrmAbtLuuyJT8VIVGsRbZR2IIQQE533fOiwRKQFn98azZZ/DzQe+PY 42Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:to:from:user-agent:mime-version :date:message-id:dkim-signature:delivered-to; bh=mWg3i+Bgv+jdFQUs0qoKtsAdbx1ONcW2/5tmrCXbTi0=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=0moJ2RBgVZ11pyfVUbYcbBCslrGYRV7e794F2pEXnAKfhj99h1FdlmqZuYHPXznFL7 czlF2EFUdqXsPNFvLdLmVPFZGP3unVIecltVGnzoL2By00wTw5a6cz+eKLFeUyFtuD2S 4YJfMCIKnwBBUV60JbTWn6yTIUJdmuY0pyK9xI9uLHMlryl1s41ldHyQZS9xSPh3iw4R h3qlBbgUZskrb8/56DRfL6Fpcgb6UTv29IyzwOgiAAVLYzvNdvlRVocdgAV0iT+Q2KBq +6cXL2TUBmHje9r1dAwsjm9WUAIWMnS83eyFfLN8EkYQhawJg0th7lzrOMlctf/TAeOp xZTA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@geoffhill.org header.s=20220510 header.b=K9VNIjGs; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=geoffhill.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v7-20020a1709062f0700b00a4dfb16ac54si6336328eji.595.2024.04.02.23.43.32; Tue, 02 Apr 2024 23:43:33 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@geoffhill.org header.s=20220510 header.b=K9VNIjGs; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=geoffhill.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 32F1268C2A8; Wed, 3 Apr 2024 09:43:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from riki.gfrh.net (riki.gfrh.net [52.40.11.205]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3089368C2A8 for ; Wed, 3 Apr 2024 09:43:21 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geoffhill.org; s=20220510; t=1712126599; 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; bh=kUlnHzASMdCbb3ba35JE7+253b99/fHNcWBAQKGecAI=; b=K9VNIjGs8jzu8WrhjSYa+kLiKIFMYk0RC5abSSAwmCXP+esRRuvSxEIyU9x/sSY2c1dKdY AcND01SM0g6MCD+etBRoPXq5+87ewIklhdt9A7w5CBLlB2blybt7b3ByRdjBCKoDo1KG8p I9EY3lMhRIGULCMml5oQKaXFDO492E8= Received: by riki.gfrh.net (OpenSMTPD) with ESMTPSA id 7bc6be03 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 3 Apr 2024 06:43:18 +0000 (UTC) Message-ID: <79644c46-4f7b-4713-901e-f9c0e5d46f09@geoffhill.org> Date: Tue, 2 Apr 2024 23:43:18 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Geoff Hill To: ffmpeg-devel@ffmpeg.org Content-Language: en-US Subject: [FFmpeg-devel] [PATCH v3 0/5] avcodec/ac3: Add aarch64 NEON DSP 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3XU75x3P7l+r Here's v3 to push the AC-3 ARMv8 NEON experiment a step further. This version implements 5 of the AC-3 encoder DSP functions, and adds checkasm tests where missing. I've tested that the checkasm tests pass on aarch64 and x86. On AWS Graviton2 (t4g.medium), GCC 12.3: $ tests/checkasm/checkasm --bench --verbose --test=ac3dsp ... NEON: - ac3dsp.ac3_exponent_min [OK] - ac3dsp.ac3_extract_exponents [OK] - ac3dsp.float_to_fixed24 [OK] - ac3dsp.ac3_sum_square_butterfly_int32 [OK] - ac3dsp.ac3_sum_square_butterfly_float [OK] checkasm: all 20 tests passed ac3_exponent_min_reuse0_c: 9.0 ac3_exponent_min_reuse0_neon: 9.7 ac3_exponent_min_reuse1_c: 1037.5 ac3_exponent_min_reuse1_neon: 54.0 ac3_exponent_min_reuse2_c: 1820.7 ac3_exponent_min_reuse2_neon: 135.2 ac3_exponent_min_reuse3_c: 2080.5 ac3_exponent_min_reuse3_neon: 167.7 ac3_exponent_min_reuse4_c: 2493.2 ac3_exponent_min_reuse4_neon: 200.0 ac3_exponent_min_reuse5_c: 2970.0 ac3_exponent_min_reuse5_neon: 231.7 ac3_extract_exponents_n512_c: 1717.5 ac3_extract_exponents_n512_neon: 506.7 ac3_extract_exponents_n768_c: 2562.7 ac3_extract_exponents_n768_neon: 769.7 ac3_extract_exponents_n1024_c: 3389.2 ac3_extract_exponents_n1024_neon: 1019.0 ac3_extract_exponents_n1280_c: 4210.7 ac3_extract_exponents_n1280_neon: 1267.5 ac3_extract_exponents_n1536_c: 5071.5 ac3_extract_exponents_n1536_neon: 1522.0 ac3_extract_exponents_n1792_c: 5896.5 ac3_extract_exponents_n1792_neon: 1784.0 ac3_extract_exponents_n2048_c: 6779.2 ac3_extract_exponents_n2048_neon: 2051.0 ac3_extract_exponents_n2304_c: 7559.5 ac3_extract_exponents_n2304_neon: 2290.0 ac3_extract_exponents_n2560_c: 8397.2 ac3_extract_exponents_n2560_neon: 2552.5 ac3_extract_exponents_n2816_c: 9224.2 ac3_extract_exponents_n2816_neon: 2797.7 ac3_extract_exponents_n3072_c: 10026.2 ac3_extract_exponents_n3072_neon: 3047.7 ac3_sum_square_bufferfly_float_c: 1605.7 ac3_sum_square_bufferfly_float_neon: 365.7 ac3_sum_square_bufferfly_int32_c: 965.5 ac3_sum_square_bufferfly_int32_neon: 486.2 float_to_fixed24_c: 2453.7 float_to_fixed24_neon: 516.2 Geoff Hill (5): avcodec/ac3: Implement float_to_fixed24 for aarch64 NEON avcodec/ac3: Implement ac3_exponent_min for aarch64 NEON avcodec/ac3: Implement ac3_extract_exponents for aarch64 NEON avcodec/ac3: Implement sum_square_butterfly_int32 for aarch64 NEON avcodec/ac3: Implement sum_square_butterfly_float for aarch64 NEON libavcodec/aarch64/Makefile | 2 + libavcodec/aarch64/ac3dsp_init_aarch64.c | 50 +++++++++ libavcodec/aarch64/ac3dsp_neon.S | 125 ++++++++++++++++++++++ libavcodec/ac3dsp.c | 4 +- libavcodec/ac3dsp.h | 3 +- tests/checkasm/ac3dsp.c | 130 +++++++++++++++++++++++ 6 files changed, 312 insertions(+), 2 deletions(-) create mode 100644 libavcodec/aarch64/ac3dsp_init_aarch64.c create mode 100644 libavcodec/aarch64/ac3dsp_neon.S