Skip to content

Commit

Permalink
renaming DNN options in meson
Browse files Browse the repository at this point in the history
  • Loading branch information
jmvalin committed Mar 14, 2024
1 parent ca901e6 commit 12239ce
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ cmake:
script:
- ./autogen.sh
- mkdir builddir
- meson setup -Denable-deep-plc=true -Denable-osce=true -Denable-dred=true -Dtests=enabled -Ddocs=enabled -Dbuildtype=release builddir
- meson setup -Ddeep-plc=enabled -Dosce=enabled -Ddred=enabled -Dtests=enabled -Ddocs=enabled -Dbuildtype=release builddir
- meson compile -C builddir
- meson test -C builddir
#- meson dist --no-tests -C builddir
Expand Down
6 changes: 3 additions & 3 deletions dnn/meson.build
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dnn_sources = sources['DEEP_PLC_SOURCES']

dred_sources = sources['DRED_SOURCES']
if opt_enable_dred
if opt_dred.enabled()
dnn_sources += dred_sources
endif

osce_sources = sources['OSCE_SOURCES']
if opt_enable_osce
if opt_osce.enabled()
dnn_sources += osce_sources
endif

Expand Down Expand Up @@ -51,7 +51,7 @@ if host_machine.system() == 'windows'
endif


if opt_enable_deep_plc
if opt_deep_plc.enabled()
dnn_lib = static_library('opus-dnn',
dnn_sources,
c_args: dnn_c_args,
Expand Down
20 changes: 16 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ opts = [
[ 'fixed-point-debug', 'FIXED_DEBUG' ],
[ 'custom-modes', 'CUSTOM_MODES' ],
[ 'float-approx', 'FLOAT_APPROX' ],
[ 'enable-deep-plc', 'ENABLE_DEEP_PLC' ],
[ 'enable-dred', 'ENABLE_DRED' ],
[ 'enable-osce', 'ENABLE_OSCE' ],
[ 'assertions', 'ENABLE_ASSERTIONS' ],
[ 'hardening', 'ENABLE_HARDENING' ],
[ 'fuzzing', 'FUZZING' ],
Expand All @@ -164,6 +161,21 @@ foreach opt : opts
set_variable('opt_' + opt[0].underscorify(), opt_foo)
endforeach

feat = [
[ 'deep-plc', 'ENABLE_DEEP_PLC' ],
[ 'dred', 'ENABLE_DRED' ],
[ 'osce', 'ENABLE_OSCE' ],
]

foreach opt : feat
# we assume these are all boolean options
opt_foo = get_option(opt[0])
if opt_foo.enabled()
opus_conf.set(opt[1], 1)
endif
set_variable('opt_' + opt[0].underscorify(), opt_foo)
endforeach

opt_asm = get_option('asm')
opt_rtcd = get_option('rtcd')
opt_intrinsics = get_option('intrinsics')
Expand All @@ -175,7 +187,7 @@ if disable_float_api
opus_conf.set('DISABLE_FLOAT_API', 1)
endif

if not get_option('enable-dnn-debug-float')
if not get_option('dnn-debug-float').enabled()
opus_conf.set('DISABLE_DEBUG_FLOAT', 1)
endif

Expand Down
8 changes: 4 additions & 4 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ 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('enable-osce', type : 'boolean', value : false, description : 'Enable Opus Speech Coding Enhancement (OSCE)')
option('enable-dnn-debug-float', type : 'boolean', value : false, description : 'Compute DNN using float weights')
option('deep-plc', type : 'feature', value : 'disabled', description : 'Enable Deep Packet Loss Concealment (PLC)')
option('dred', type : 'feature', value : 'disabled', description : 'Enable Deep Redundancy (DRED)')
option('osce', type : 'feature', value : 'disabled', description : 'Enable Opus Speech Coding Enhancement (OSCE)')
option('dnn-debug-float', type : 'feature', value : 'disabled', description : 'Compute DNN using float weights')

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)')
Expand Down
4 changes: 4 additions & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ opus_tests = [
['test_opus_projection'],
]

if opt_dred.enabled()
opus_tests += [['test_opus_dred', [], 60 * 20]]
endif

foreach t : opus_tests
test_name = t.get(0)
extra_srcs = t.get(1, [])
Expand Down

0 comments on commit 12239ce

Please sign in to comment.