Skip to content

Commit 12239ce

Browse files
committed
renaming DNN options in meson
1 parent ca901e6 commit 12239ce

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ cmake:
101101
script:
102102
- ./autogen.sh
103103
- mkdir builddir
104-
- meson setup -Denable-deep-plc=true -Denable-osce=true -Denable-dred=true -Dtests=enabled -Ddocs=enabled -Dbuildtype=release builddir
104+
- meson setup -Ddeep-plc=enabled -Dosce=enabled -Ddred=enabled -Dtests=enabled -Ddocs=enabled -Dbuildtype=release builddir
105105
- meson compile -C builddir
106106
- meson test -C builddir
107107
#- meson dist --no-tests -C builddir

dnn/meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
dnn_sources = sources['DEEP_PLC_SOURCES']
22

33
dred_sources = sources['DRED_SOURCES']
4-
if opt_enable_dred
4+
if opt_dred.enabled()
55
dnn_sources += dred_sources
66
endif
77

88
osce_sources = sources['OSCE_SOURCES']
9-
if opt_enable_osce
9+
if opt_osce.enabled()
1010
dnn_sources += osce_sources
1111
endif
1212

@@ -51,7 +51,7 @@ if host_machine.system() == 'windows'
5151
endif
5252

5353

54-
if opt_enable_deep_plc
54+
if opt_deep_plc.enabled()
5555
dnn_lib = static_library('opus-dnn',
5656
dnn_sources,
5757
c_args: dnn_c_args,

meson.build

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ opts = [
146146
[ 'fixed-point-debug', 'FIXED_DEBUG' ],
147147
[ 'custom-modes', 'CUSTOM_MODES' ],
148148
[ 'float-approx', 'FLOAT_APPROX' ],
149-
[ 'enable-deep-plc', 'ENABLE_DEEP_PLC' ],
150-
[ 'enable-dred', 'ENABLE_DRED' ],
151-
[ 'enable-osce', 'ENABLE_OSCE' ],
152149
[ 'assertions', 'ENABLE_ASSERTIONS' ],
153150
[ 'hardening', 'ENABLE_HARDENING' ],
154151
[ 'fuzzing', 'FUZZING' ],
@@ -164,6 +161,21 @@ foreach opt : opts
164161
set_variable('opt_' + opt[0].underscorify(), opt_foo)
165162
endforeach
166163

164+
feat = [
165+
[ 'deep-plc', 'ENABLE_DEEP_PLC' ],
166+
[ 'dred', 'ENABLE_DRED' ],
167+
[ 'osce', 'ENABLE_OSCE' ],
168+
]
169+
170+
foreach opt : feat
171+
# we assume these are all boolean options
172+
opt_foo = get_option(opt[0])
173+
if opt_foo.enabled()
174+
opus_conf.set(opt[1], 1)
175+
endif
176+
set_variable('opt_' + opt[0].underscorify(), opt_foo)
177+
endforeach
178+
167179
opt_asm = get_option('asm')
168180
opt_rtcd = get_option('rtcd')
169181
opt_intrinsics = get_option('intrinsics')
@@ -175,7 +187,7 @@ if disable_float_api
175187
opus_conf.set('DISABLE_FLOAT_API', 1)
176188
endif
177189

178-
if not get_option('enable-dnn-debug-float')
190+
if not get_option('dnn-debug-float').enabled()
179191
opus_conf.set('DISABLE_DEBUG_FLOAT', 1)
180192
endif
181193

meson_options.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ option('rtcd', type : 'feature', value : 'auto', description : 'Run-time CPU cap
77
option('asm', type : 'feature', value : 'auto', description : 'Assembly optimizations for ARM (fixed-point)')
88
option('intrinsics', type : 'feature', value : 'auto', description : 'Intrinsics optimizations for ARM NEON or x86')
99

10-
option('enable-deep-plc', type : 'boolean', value : false, description : 'Enable Deep Packet Loss Concealment (PLC)')
11-
option('enable-dred', type : 'boolean', value : false, description : 'Enable Deep Redundancy (DRED)')
12-
option('enable-osce', type : 'boolean', value : false, description : 'Enable Opus Speech Coding Enhancement (OSCE)')
13-
option('enable-dnn-debug-float', type : 'boolean', value : false, description : 'Compute DNN using float weights')
10+
option('deep-plc', type : 'feature', value : 'disabled', description : 'Enable Deep Packet Loss Concealment (PLC)')
11+
option('dred', type : 'feature', value : 'disabled', description : 'Enable Deep Redundancy (DRED)')
12+
option('osce', type : 'feature', value : 'disabled', description : 'Enable Opus Speech Coding Enhancement (OSCE)')
13+
option('dnn-debug-float', type : 'feature', value : 'disabled', description : 'Compute DNN using float weights')
1414

1515
option('custom-modes', type : 'boolean', value : false, description : 'Enable non-Opus modes, e.g. 44.1 kHz & 2^n frames')
1616
option('extra-programs', type : 'feature', value : 'auto', description : 'Extra programs (demo and tests)')

tests/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ opus_tests = [
88
['test_opus_projection'],
99
]
1010

11+
if opt_dred.enabled()
12+
opus_tests += [['test_opus_dred', [], 60 * 20]]
13+
endif
14+
1115
foreach t : opus_tests
1216
test_name = t.get(0)
1317
extra_srcs = t.get(1, [])

0 commit comments

Comments
 (0)