shithub: opus

Download patch

ref: 12239ced101ffee481781a2eb3b8c88bea523085
parent: ca901e65aab8d4b5b85d2cb2649819c24e0b1602
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Thu Mar 14 11:17:33 EDT 2024

renaming DNN options in meson

--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -101,7 +101,7 @@
   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
--- 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 @@
 endif
 
 
-if opt_enable_deep_plc
+if opt_deep_plc.enabled()
  dnn_lib = static_library('opus-dnn',
   dnn_sources,
   c_args: dnn_c_args,
--- a/meson.build
+++ b/meson.build
@@ -146,9 +146,6 @@
   [ '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 @@
   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 @@
   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
 
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -7,10 +7,10 @@
 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)')
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -8,6 +8,10 @@
   ['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, [])
--