-
Notifications
You must be signed in to change notification settings - Fork 246
Build opus with NEON intrinsics on non-Android 64-bit ARM #3833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mcfnord
wants to merge
1
commit into
jamulussoftware:main
Choose a base branch
from
mcfnord:fix-2806-arm64-opus-neon
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+26
−3
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -660,17 +660,23 @@ SOURCES_OPUS = libs/opus/celt/bands.c \ | |
| libs/opus/src/opus_encoder.c \ | ||
| libs/opus/src/repacketizer.c | ||
|
|
||
| SOURCES_OPUS_ARM = libs/opus/celt/arm/armcpu.c \ | ||
| # NEON intrinsic sources: self-contained, need no external library. | ||
| SOURCES_OPUS_ARM_NEON = libs/opus/celt/arm/armcpu.c \ | ||
| libs/opus/celt/arm/arm_celt_map.c \ | ||
| libs/opus/silk/arm/arm_silk_map.c \ | ||
| libs/opus/silk/arm/biquad_alt_neon_intr.c \ | ||
| libs/opus/silk/arm/LPC_inv_pred_gain_neon_intr.c \ | ||
| libs/opus/silk/arm/NSQ_del_dec_neon_intr.c \ | ||
| libs/opus/silk/arm/NSQ_neon.c \ | ||
| libs/opus/celt/arm/celt_neon_intr.c \ | ||
| libs/opus/celt/arm/pitch_neon_intr.c \ | ||
| libs/opus/celt/arm/celt_fft_ne10.c \ | ||
| libs/opus/celt/arm/pitch_neon_intr.c | ||
| # NE10 sources: FFT/MDCT acceleration via the external Ne10 library, which | ||
| # Jamulus does not bundle (they #include <NE10_dsp.h> unconditionally and are | ||
| # gated on HAVE_ARM_NE10, which we never define). Kept listed for completeness | ||
| # but never added to SOURCES. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then investigate if we can use it and it makes sense to use it - or drop it otherwise |
||
| SOURCES_OPUS_ARM_NE10 = libs/opus/celt/arm/celt_fft_ne10.c \ | ||
| libs/opus/celt/arm/celt_mdct_ne10.c | ||
| SOURCES_OPUS_ARM = $$SOURCES_OPUS_ARM_NEON $$SOURCES_OPUS_ARM_NE10 | ||
|
|
||
| SOURCES_OPUS_X86_SSE = libs/opus/celt/x86/x86cpu.c \ | ||
| libs/opus/celt/x86/x86_celt_map.c \ | ||
|
|
@@ -690,6 +696,18 @@ contains(QT_ARCH, armeabi-v7a) | contains(QT_ARCH, arm64-v8a) { | |
| SOURCES_OPUS_ARCH += $$SOURCES_OPUS_ARM | ||
| DEFINES_OPUS += OPUS_ARM_PRESUME_NEON=1 OPUS_ARM_PRESUME_NEON_INTR=1 | ||
| contains(QT_ARCH, arm64-v8a):DEFINES_OPUS += OPUS_ARM_PRESUME_AARCH64_NEON_INTR | ||
| } else:contains(QT_ARCH, arm64) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try to merge this with the above case to avoid duplication |
||
| # arm64-v8a above is the Android ABI name; plain arm64 is what Qt reports | ||
| # for 64-bit ARM everywhere else (Apple Silicon macOS, iOS, Linux aarch64). | ||
| # NEON is part of the base AArch64 ISA, so the NEON intrinsics can be | ||
| # presumed present and compiled without special compiler flags (see the | ||
| # SOURCES_OPUS_ARCH handling below). | ||
| # OPUS_ARM_MAY_HAVE_NEON_INTR is required in addition to the PRESUME | ||
| # defines: opus gates the inclusion of its arm/*.h headers on it | ||
| # (see libs/opus/celt/pitch.h and libs/opus/celt/cpu_support.h). | ||
| HEADERS_OPUS += $$HEADERS_OPUS_ARM | ||
| SOURCES_OPUS_ARCH += $$SOURCES_OPUS_ARM_NEON | ||
| DEFINES_OPUS += OPUS_ARM_MAY_HAVE_NEON_INTR=1 OPUS_ARM_PRESUME_NEON_INTR=1 OPUS_ARM_PRESUME_AARCH64_NEON_INTR=1 | ||
| } else:contains(QT_ARCH, x86) | contains(QT_ARCH, x86_64) { | ||
| HEADERS_OPUS += $$HEADERS_OPUS_X86 | ||
| SOURCES_OPUS_ARCH += $$SOURCES_OPUS_X86_SSE $$SOURCES_OPUS_X86_SSE2 $$SOURCES_OPUS_X86_SSE4 | ||
|
|
@@ -1172,6 +1190,11 @@ contains(CONFIG, "opus_shared_lib") { | |
| sse4_cc.variable_out = OBJECTS | ||
| QMAKE_EXTRA_COMPILERS += sse_cc sse2_cc sse4_cc | ||
| } | ||
| } else:contains(QT_ARCH, arm64) { | ||
| # Unlike the x86 SSE files above, the AArch64 NEON intrinsics need no | ||
| # special compiler flags (NEON is part of the base AArch64 ISA), so | ||
| # they can be compiled like any other source file. | ||
| SOURCES += $$SOURCES_OPUS_ARCH | ||
| } | ||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.