From db1ace5f6a8bf2ea2a6d46af032a3ea81865c79a Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 15 Jun 2015 22:50:29 +0200 Subject: [PATCH] [DEV] add basic lutin interface --- .gitmodules | 3 ++ README.md | 5 +++ lutin_speex-dsp.py | 65 ++++++++++++++++++++++++++++++++++++ lutin_speex-test-denoise.py | 21 ++++++++++++ lutin_speex-test-echo.py | 21 ++++++++++++ lutin_speex-test-jitter.py | 21 ++++++++++++ lutin_speex-test-resample.py | 21 ++++++++++++ speex-dsp | 1 + 8 files changed, 158 insertions(+) create mode 100644 .gitmodules create mode 100644 README.md create mode 100644 lutin_speex-dsp.py create mode 100644 lutin_speex-test-denoise.py create mode 100644 lutin_speex-test-echo.py create mode 100644 lutin_speex-test-jitter.py create mode 100644 lutin_speex-test-resample.py create mode 160000 speex-dsp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..dfc0945 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "speex-dsp"] + path = speex-dsp + url = https://github.com/generic-library/speex-dsp.git diff --git a/README.md b/README.md new file mode 100644 index 0000000..888d700 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +Lutin wrapper +============= + +Used to compile the library with lutin builder interface + diff --git a/lutin_speex-dsp.py b/lutin_speex-dsp.py new file mode 100644 index 0000000..0e77c23 --- /dev/null +++ b/lutin_speex-dsp.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +import lutin.module as module +import lutin.tools as tools + +def get_desc(): + return "Algorithm of speex codec" + + +def create(target): + myModule = module.Module(__file__, 'speex-dsp', 'LIBRARY') + # add the file to compile: + myModule.add_src_file([ + 'speex-dsp/libspeexdsp/filterbank.c', + 'speex-dsp/libspeexdsp/resample.c', + 'speex-dsp/libspeexdsp/scal.c', + 'speex-dsp/libspeexdsp/fftwrap.c', + 'speex-dsp/libspeexdsp/jitter.c', + 'speex-dsp/libspeexdsp/mdf.c', + 'speex-dsp/libspeexdsp/preprocess.c', + 'speex-dsp/libspeexdsp/smallft.c', + 'speex-dsp/libspeexdsp/buffer.c', + 'speex-dsp/libspeexdsp/kiss_fft.c', + 'speex-dsp/libspeexdsp/kiss_fftr.c' + ]) + # name of the dependency + myModule.add_module_depend('z') + myModule.compile_version_CC(1999) + myModule.add_export_path(tools.get_current_path(__file__) + "/speex-dsp/include") + # configure library: + # Make use of ARM4 assembly optimizations + #myModule.compile_flags('c', "-DARM4_ASM=1") + # Make use of ARM5E assembly optimizations + #myModule.compile_flags('c', "-DARM5E_ASM=1") + # Make use of Blackfin assembly optimizations + #myModule.compile_flags('c', "-DBFIN_ASM=1") + # Disable all parts of the API that are using floats + #myModule.compile_flags('c', "-DDISABLE_FLOAT_API=1") + # Enable valgrind extra checks + #myModule.compile_flags('c', "-DENABLE_VALGRIND=1") + # Symbol visibility prefix */ + #define EXPORT __attribute__((visibility("default"))) + myModule.compile_flags('c', "-DEXPORT=''") + # Debug fixed-point implementation */ + #myModule.compile_flags('c', "-DFIXED_DEBUG=1") + # Compile as fixed-point / floating-point + if True: + myModule.compile_flags('c', "-DFIXED_POINT") + else: + myModule.compile_flags('c', "-DFLOATING_POINT") + # Enable NEON support */ + #myModule.compile_flags('c', "-D_USE_NEON=1") + # Enable SSE support */ + myModule.compile_flags('c', "-D_USE_SSE=1") + # Enable SSE2 support */ + myModule.compile_flags('c', "-D_USE_SSE2=1") + # Define to 1 if you have the header file. + myModule.compile_flags('c', "-DHAVE_ALLOCA_H=1") + # Use FFT from OggVorbis */ + myModule.compile_flags('c', "-DUSE_SMALLFT=1") + # Use C99 variable-size arrays */ + myModule.compile_flags('c', "-DVAR_ARRAYS=1") + + return myModule + + diff --git a/lutin_speex-test-denoise.py b/lutin_speex-test-denoise.py new file mode 100644 index 0000000..2757d0d --- /dev/null +++ b/lutin_speex-test-denoise.py @@ -0,0 +1,21 @@ +#!/usr/bin/python +import lutin.module as module +import lutin.tools as tools + +def get_desc(): + return "test: denoise test algorithm" + + +def create(target): + myModule = module.Module(__file__, 'speex-test-denoise', 'BINARY') + # add extra compilation flags : + myModule.add_extra_compile_flags() + # add the file to compile: + myModule.add_src_file([ + 'speex-dsp/libspeexdsp/testdenoise.c' + ]) + # name of the dependency + myModule.add_module_depend('speex-dsp') + return myModule + + diff --git a/lutin_speex-test-echo.py b/lutin_speex-test-echo.py new file mode 100644 index 0000000..467eebb --- /dev/null +++ b/lutin_speex-test-echo.py @@ -0,0 +1,21 @@ +#!/usr/bin/python +import lutin.module as module +import lutin.tools as tools + +def get_desc(): + return "test: echo test algorithm" + + +def create(target): + myModule = module.Module(__file__, 'speex-test-echo', 'BINARY') + # add extra compilation flags : + myModule.add_extra_compile_flags() + # add the file to compile: + myModule.add_src_file([ + 'speex-dsp/libspeexdsp/testecho.c' + ]) + # name of the dependency + myModule.add_module_depend('speex-dsp') + return myModule + + diff --git a/lutin_speex-test-jitter.py b/lutin_speex-test-jitter.py new file mode 100644 index 0000000..8ab7036 --- /dev/null +++ b/lutin_speex-test-jitter.py @@ -0,0 +1,21 @@ +#!/usr/bin/python +import lutin.module as module +import lutin.tools as tools + +def get_desc(): + return "test: jitter test algorithm" + + +def create(target): + myModule = module.Module(__file__, 'speex-test-jitter', 'BINARY') + # add extra compilation flags : + myModule.add_extra_compile_flags() + # add the file to compile: + myModule.add_src_file([ + 'speex-dsp/libspeexdsp/testjitter.c' + ]) + # name of the dependency + myModule.add_module_depend('speex-dsp') + return myModule + + diff --git a/lutin_speex-test-resample.py b/lutin_speex-test-resample.py new file mode 100644 index 0000000..e7527ea --- /dev/null +++ b/lutin_speex-test-resample.py @@ -0,0 +1,21 @@ +#!/usr/bin/python +import lutin.module as module +import lutin.tools as tools + +def get_desc(): + return "test: resample test algorithm" + + +def create(target): + myModule = module.Module(__file__, 'speex-test-resample', 'BINARY') + # add extra compilation flags : + myModule.add_extra_compile_flags() + # add the file to compile: + myModule.add_src_file([ + 'speex-dsp/libspeexdsp/testresample.c' + ]) + # name of the dependency + myModule.add_module_depend('speex-dsp') + return myModule + + diff --git a/speex-dsp b/speex-dsp new file mode 160000 index 0000000..513cb1b --- /dev/null +++ b/speex-dsp @@ -0,0 +1 @@ +Subproject commit 513cb1bdf73247d405d3981ae236a2d2c692c684