From 12239ced101ffee481781a2eb3b8c88bea523085 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Thu, 14 Mar 2024 15:17:33 -0400 Subject: [PATCH] renaming DNN options in meson --- .gitlab-ci.yml | 2 +- dnn/meson.build | 6 +++--- meson.build | 20 ++++++++++++++++---- meson_options.txt | 8 ++++---- tests/meson.build | 4 ++++ 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be6af9585..47c63e8f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/dnn/meson.build b/dnn/meson.build index 737d4a028..7b324016c 100644 --- a/dnn/meson.build +++ b/dnn/meson.build @@ -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 @@ -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, diff --git a/meson.build b/meson.build index 5638dd1d5..d040ddfd7 100644 --- a/meson.build +++ b/meson.build @@ -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' ], @@ -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') @@ -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 diff --git a/meson_options.txt b/meson_options.txt index 46099276d..a2981d0b3 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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)') diff --git a/tests/meson.build b/tests/meson.build index 1c1ddf07c..1a4040b5c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -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, [])