Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2023-11-29 03:14:27 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2023-11-29 03:14:27 +0300
commitc28b0f10bc6f683ddfb025781960f92d1d3b52e1 (patch)
treeff52fb8e8081c868c2a3e523ad2b3a33a69f51f0
parent147b72293f0bc2e3cb17c3f2dc6c21d9d599ec70 (diff)
Trying to fix/update meson build
Still don't quite know what I'm doing
-rw-r--r--celt/meson.build4
-rw-r--r--dnn/meson.build59
-rw-r--r--meson.build7
-rw-r--r--meson_options.txt3
-rw-r--r--silk/meson.build32
-rw-r--r--src/meson.build2
-rw-r--r--tests/meson.build2
7 files changed, 82 insertions, 27 deletions
diff --git a/celt/meson.build b/celt/meson.build
index ad95d949..7852fc15 100644
--- a/celt/meson.build
+++ b/celt/meson.build
@@ -6,6 +6,8 @@ celt_sse2_sources = sources['CELT_SOURCES_SSE2']
celt_sse4_1_sources = sources['CELT_SOURCES_SSE4_1']
+celt_avx2_sources = sources['CELT_SOURCES_AVX2']
+
celt_neon_intr_sources = sources['CELT_SOURCES_ARM_NEON_INTR']
celt_static_libs = []
@@ -14,7 +16,7 @@ if host_cpu_family in ['x86', 'x86_64'] and opus_conf.has('OPUS_HAVE_RTCD')
celt_sources += sources['CELT_SOURCES_X86_RTCD']
endif
-foreach intr_name : ['sse', 'sse2', 'sse4_1', 'neon_intr']
+foreach intr_name : ['sse', 'sse2', 'sse4_1', 'avx2', 'neon_intr']
have_intr = get_variable('have_' + intr_name)
if not have_intr
continue
diff --git a/dnn/meson.build b/dnn/meson.build
new file mode 100644
index 00000000..877f6434
--- /dev/null
+++ b/dnn/meson.build
@@ -0,0 +1,59 @@
+dnn_sources = sources['DEEP_PLC_SOURCES']
+
+dred_sources = sources['DRED_SOURCES']
+if opt_enable_dred
+ dnn_sources += dred_sources
+endif
+
+dnn_sources_sse2 = sources['DNN_SOURCES_SSE2']
+dnn_sources_sse4_1 = sources['DNN_SOURCES_SSE4_1']
+dnn_sources_avx2 = sources['DNN_SOURCES_AVX2']
+
+dnn_sources_neon_intr = sources['DNN_SOURCES_NEON']
+dnn_sources_dotprod = sources['DNN_SOURCES_DOTPROD']
+
+dnn_includes = [opus_includes]
+dnn_static_libs = []
+
+if host_cpu_family in ['x86', 'x86_64'] and opus_conf.has('OPUS_HAVE_RTCD')
+ dnn_sources += sources['DNN_SOURCES_X86_RTCD']
+endif
+
+if host_cpu_family in ['arm', 'aarch64'] and have_arm_intrinsics_or_asm
+ if opus_conf.has('OPUS_HAVE_RTCD')
+ dnn_sources += sources['DNN_SOURCES_ARM_RTCD']
+ endif
+endif
+
+foreach intr_name : ['sse2', 'sse4_1', 'avx2', 'neon_intr']
+ have_intr = get_variable('have_' + intr_name)
+ if not have_intr
+ continue
+ endif
+
+ intr_sources = get_variable('dnn_sources_' + intr_name)
+
+ intr_args = get_variable('opus_@0@_args'.format(intr_name), [])
+ dnn_static_libs += static_library('dnn_' + intr_name, intr_sources,
+ c_args: intr_args,
+ include_directories: dnn_includes,
+ install: false)
+endforeach
+
+dnn_c_args = []
+if host_machine.system() == 'windows'
+ dnn_c_args += ['-DDLL_EXPORT']
+endif
+
+
+if opt_enable_deep_plc
+ dnn_lib = static_library('opus-dnn',
+ dnn_sources,
+ c_args: dnn_c_args,
+ include_directories: dnn_includes,
+ link_whole: [dnn_static_libs],
+ dependencies: libm,
+ install: false)
+else
+ dnn_lib = []
+endif
diff --git a/meson.build b/meson.build
index eb604e26..e64e6e28 100644
--- a/meson.build
+++ b/meson.build
@@ -146,6 +146,8 @@ opts = [
[ 'fixed-point-debug', 'FIXED_DEBUG' ],
[ 'custom-modes', 'CUSTOM_MODES' ],
[ 'float-approx', 'FLOAT_APPROX' ],
+ [ 'enable-deep-plc', 'ENABLE_DEEP_PLC' ],
+ [ 'enable-dred', 'ENABLE_DRED' ],
[ 'assertions', 'ENABLE_ASSERTIONS' ],
[ 'hardening', 'ENABLE_HARDENING' ],
[ 'fuzzing', 'FUZZING' ],
@@ -342,7 +344,7 @@ arm_neon_intr_link_args = ['-mfpu=neon']
have_sse = false
have_sse2 = false
have_sse4_1 = false
-have_avx = false # no avx opus code yet
+have_avx2 = false # no avx opus code yet
have_neon_intr = false
intrinsics_support = []
@@ -425,7 +427,7 @@ if not opt_intrinsics.disabled()
[ 'SSE', 'xmmintrin.h', '__m128', '_mm_setzero_ps()', ['-msse'] ],
[ 'SSE2', 'emmintrin.h', '__m128i', '_mm_setzero_si128()', ['-msse2'] ],
[ 'SSE4.1', 'smmintrin.h', '__m128i', '_mm_setzero_si128(); mtest = _mm_cmpeq_epi64(mtest, mtest)', ['-msse4.1'] ],
- [ 'AVX', 'immintrin.h', '__m256', '_mm256_setzero_ps()', ['-mavx'] ],
+ [ 'AVX2', 'immintrin.h', '__m256i', '_mm256_abs_epi32(_mm256_setzero_si256())', ['-mavx', '-mfma', '-mavx2'] ],
]
foreach intrin : x86_intrinsics
@@ -581,6 +583,7 @@ endforeach
subdir('include')
subdir('celt')
subdir('silk')
+subdir('dnn')
subdir('src')
configure_file(output: 'config.h', configuration: opus_conf)
diff --git a/meson_options.txt b/meson_options.txt
index 360ff263..d558ee07 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -7,6 +7,9 @@ option('rtcd', type : 'feature', value : 'auto', description : 'Run-time CPU cap
option('asm', type : 'feature', value : 'auto', description : 'Assembly optimizations for ARM (fixed-point)')
option('intrinsics', type : 'feature', value : 'auto', description : 'Intrinsics optimizations for ARM NEON or x86')
+option('enable-deep-plc', type : 'boolean', value : false, description : 'Enable Deep Packet Loss Concealment (PLC)')
+option('enable-dred', type : 'boolean', value : false, description : 'Enable Deep Redundancy (DRED)')
+
option('custom-modes', type : 'boolean', value : false, description : 'Enable non-Opus modes, e.g. 44.1 kHz & 2^n frames')
option('extra-programs', type : 'feature', value : 'auto', description : 'Extra programs (demo and tests)')
option('assertions', type : 'boolean', value : false, description : 'Additional software error checking')
diff --git a/silk/meson.build b/silk/meson.build
index 610fef2d..80a59b05 100644
--- a/silk/meson.build
+++ b/silk/meson.build
@@ -2,6 +2,8 @@ silk_sources = sources['SILK_SOURCES']
silk_sources_sse4_1 = sources['SILK_SOURCES_SSE4_1']
+silk_sources_avx2 = sources['SILK_SOURCES_AVX2']
+
silk_sources_neon_intr = sources['SILK_SOURCES_ARM_NEON_INTR']
silk_sources_fixed_neon_intr = sources['SILK_SOURCES_FIXED_ARM_NEON_INTR']
@@ -10,6 +12,10 @@ silk_sources_fixed = sources['SILK_SOURCES_FIXED']
silk_sources_fixed_sse4_1 = sources['SILK_SOURCES_FIXED_SSE4_1']
+silk_sources_float_sse4_1 = []
+silk_sources_float_neon_intr = []
+silk_sources_float_avx2 = sources['SILK_SOURCES_FLOAT_AVX2']
+
silk_sources_float = sources['SILK_SOURCES_FLOAT']
if opt_fixed_point
@@ -31,7 +37,7 @@ if host_cpu_family in ['arm', 'aarch64'] and have_arm_intrinsics_or_asm
endif
endif
-foreach intr_name : ['sse4_1', 'neon_intr']
+foreach intr_name : ['sse4_1', 'avx2', 'neon_intr']
have_intr = get_variable('have_' + intr_name)
if not have_intr
continue
@@ -40,6 +46,8 @@ foreach intr_name : ['sse4_1', 'neon_intr']
intr_sources = get_variable('silk_sources_' + intr_name)
if opt_fixed_point
intr_sources += get_variable('silk_sources_fixed_' + intr_name)
+ else
+ intr_sources += get_variable('silk_sources_float_' + intr_name)
endif
intr_args = get_variable('opus_@0@_args'.format(intr_name), [])
@@ -54,30 +62,10 @@ if host_machine.system() == 'windows'
silk_c_args += ['-DDLL_EXPORT']
endif
-# ----------------------- lpcnet ---------------------------------------------
-# Perhaps this should be moved into lpcnet itself
-lpcnet_sources = sources['LPCNET_SOURCES']
-
-lpcnet_includes = [opus_includes, include_directories('../dnn')]
-
-lpcnet_c_args = []
-if host_machine.system() == 'windows'
- lpcnet_c_args += ['-DDLL_EXPORT']
-endif
-
-lpcnet_lib = static_library('silk-lpcnet',
- lpcnet_sources,
- c_args: lpcnet_c_args,
- include_directories: lpcnet_includes,
- dependencies: libm,
- install: false)
-
-# ----------------------- lpcnet ---------------------------------------------
-
silk_lib = static_library('opus-silk',
silk_sources,
c_args: silk_c_args,
include_directories: silk_includes,
- link_whole: [silk_static_libs, lpcnet_lib],
+ link_whole: [silk_static_libs],
dependencies: libm,
install: false)
diff --git a/src/meson.build b/src/meson.build
index 87902e34..5537c67c 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -17,7 +17,7 @@ opus_lib = library('opus',
darwin_versions: macosversion,
c_args: opus_lib_c_args,
include_directories: opus_includes,
- link_whole: [celt_lib, silk_lib],
+ link_whole: [celt_lib, silk_lib, dnn_lib],
dependencies: libm,
install: true)
diff --git a/tests/meson.build b/tests/meson.build
index 69a8352e..5f78985f 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -21,7 +21,7 @@ foreach t : opus_tests
# This test uses private symbols
if test_name == 'test_opus_projection'
exe_kwargs = {
- 'link_with': [celt_lib, silk_lib],
+ 'link_with': [celt_lib, silk_lib, dnn_lib],
'objects': opus_lib.extract_all_objects(),
}
endif