diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2023-07-29 03:28:25 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-07-29 03:28:25 +0300 |
commit | 270051aea14e3608f4ef0d678acb8af277320ec5 (patch) | |
tree | 5ba80efbe75ce7c631e02a91632b7cb752959241 | |
parent | 7c10f05170a7a5f65701e8246ac9f6037881df15 (diff) |
Skeleton for FWGAN codeexp-fwgan1
-rw-r--r-- | dnn/fwgan.c | 51 | ||||
-rw-r--r-- | dnn/fwgan.h | 44 | ||||
-rw-r--r-- | lpcnet_headers.mk | 1 | ||||
-rw-r--r-- | lpcnet_sources.mk | 1 |
4 files changed, 97 insertions, 0 deletions
diff --git a/dnn/fwgan.c b/dnn/fwgan.c new file mode 100644 index 00000000..bce3670a --- /dev/null +++ b/dnn/fwgan.c @@ -0,0 +1,51 @@ +/* Copyright (c) 2023 Amazon */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "fwgan.h" +#include "os_support.h" +#include "freq.h" + +void fwgan_init(FWGANState *st, const float *pcm) +{ + OPUS_CLEAR(st, 1); +} + +static void run_fwgan(FWGANState *st, float *pcm, const float *input) +{ + +} + +void fwgan_synthesize(FWGANState *st, float *pcm, const float *features) +{ + float lpc[LPC_ORDER]; + lpc_from_cepstrum(lpc, features); + run_fwgan(st, pcm, features); + /* Run LPC filter. */ +} diff --git a/dnn/fwgan.h b/dnn/fwgan.h new file mode 100644 index 00000000..84749176 --- /dev/null +++ b/dnn/fwgan.h @@ -0,0 +1,44 @@ +/* Copyright (c) 2023 Amazon */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef FWGAN_H +#define FWGAN_H + +#include "freq.h" + +#define FWGAN_CONT_SAMPLES 320 + +typedef struct { + float syn_mem[LPC_ORDER]; +} FWGANState; + +void fwgan_init(FWGANState *st, const float *pcm); + + +void fwgan_synthesize(FWGANState *st, float *pcm, const float *features); + + +#endif /* FWGAN_H */ diff --git a/lpcnet_headers.mk b/lpcnet_headers.mk index dc44429f..93ca74fb 100644 --- a/lpcnet_headers.mk +++ b/lpcnet_headers.mk @@ -8,6 +8,7 @@ dnn/lpcnet.h \ dnn/burg.h \ dnn/common.h \ dnn/freq.h \ +dnn/fwgan.h \ dnn/kiss99.h \ dnn/lpcnet_private.h \ dnn/nnet_data.h \ diff --git a/lpcnet_sources.mk b/lpcnet_sources.mk index adad6dec..4c6e73f3 100644 --- a/lpcnet_sources.mk +++ b/lpcnet_sources.mk @@ -1,6 +1,7 @@ LPCNET_SOURCES = \ dnn/burg.c \ dnn/freq.c \ +dnn/fwgan.c \ dnn/kiss99.c \ dnn/lpcnet.c \ dnn/lpcnet_enc.c \ |