Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@amazon.com>2023-10-18 07:43:03 +0300
committerJean-Marc Valin <jmvalin@amazon.com>2023-10-18 07:43:03 +0300
commit0e397a7241a8dd0021acc0677c80c222c5156440 (patch)
tree01a8978c925fba4b4b570b59bb80d77960712e63
parentaca04ce269eb1e91f353504ed69e15ee3b60fde2 (diff)
Making the build possible without the models
No dependency on the data files if no DNN code enabled
-rw-r--r--Makefile.am8
-rw-r--r--celt/celt_decoder.c3
-rw-r--r--lpcnet_headers.mk20
-rw-r--r--lpcnet_sources.mk1
-rw-r--r--silk/API.h3
-rw-r--r--src/opus_decoder.c5
6 files changed, 31 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am
index 50ff1eb4..452f6d22 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -97,6 +97,14 @@ include lpcnet_headers.mk
include silk_headers.mk
include opus_headers.mk
+LPCNET_HEAD =
+if ENABLE_DEEP_PLC
+LPCNET_HEAD += $(DEEP_PLC_HEAD)
+endif
+if ENABLE_DRED
+LPCNET_HEAD += $(DRED_HEAD)
+endif
+
libopus_la_SOURCES = $(CELT_SOURCES) $(SILK_SOURCES) $(LPCNET_SOURCES) $(OPUS_SOURCES)
libopus_la_LDFLAGS = -no-undefined -version-info @OPUS_LT_CURRENT@:@OPUS_LT_REVISION@:@OPUS_LT_AGE@
libopus_la_LIBADD = $(NE10_LIBS) $(LIBM)
diff --git a/celt/celt_decoder.c b/celt/celt_decoder.c
index 7508a245..dd727976 100644
--- a/celt/celt_decoder.c
+++ b/celt/celt_decoder.c
@@ -50,8 +50,11 @@
#include <stdarg.h>
#include "celt_lpc.h"
#include "vq.h"
+
+#ifdef ENABLE_DEEP_PLC
#include "lpcnet.h"
#include "lpcnet_private.h"
+#endif
/* The maximum pitch lag to allow in the pitch-based PLC. It's possible to save
CPU time in the PLC pitch search by making this smaller than MAX_PERIOD. The
diff --git a/lpcnet_headers.mk b/lpcnet_headers.mk
index f09adf16..c4c8f7d4 100644
--- a/lpcnet_headers.mk
+++ b/lpcnet_headers.mk
@@ -1,9 +1,4 @@
-LPCNET_HEAD = \
-silk/dred_coding.h \
-silk/dred_config.h \
-silk/dred_decoder.h \
-silk/dred_encoder.h \
-dnn/dred_rdovae.h \
+DEEP_PLC_HEAD = \
dnn/lpcnet.h \
dnn/burg.h \
dnn/common.h \
@@ -17,11 +12,18 @@ dnn/tansig_table.h \
dnn/vec.h \
dnn/vec_avx.h \
dnn/vec_neon.h \
+dnn/pitchdnn.h \
+dnn/pitchdnn_data.h
+
+DRED_HEAD = \
+silk/dred_coding.h \
+silk/dred_config.h \
+silk/dred_decoder.h \
+silk/dred_encoder.h \
+dnn/dred_rdovae.h \
dnn/dred_rdovae_constants.h \
dnn/dred_rdovae_enc.h \
dnn/dred_rdovae_enc_data.h \
dnn/dred_rdovae_dec.h \
dnn/dred_rdovae_dec_data.h \
-dnn/dred_rdovae_stats_data.h \
-dnn/pitchdnn.h \
-dnn/pitchdnn_data.h
+dnn/dred_rdovae_stats_data.h
diff --git a/lpcnet_sources.mk b/lpcnet_sources.mk
index b8313f30..051d3c44 100644
--- a/lpcnet_sources.mk
+++ b/lpcnet_sources.mk
@@ -11,6 +11,7 @@ dnn/plc_data.c \
dnn/parse_lpcnet_weights.c \
dnn/pitchdnn.c \
dnn/pitchdnn_data.c
+
DRED_SOURCES = \
dnn/dred_rdovae.c \
dnn/dred_rdovae_enc.c \
diff --git a/silk/API.h b/silk/API.h
index 82ae6811..6e623b84 100644
--- a/silk/API.h
+++ b/silk/API.h
@@ -33,7 +33,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include "errors.h"
#include "entenc.h"
#include "entdec.h"
+
+#ifdef ENABLE_DEEP_PLC
#include "lpcnet_private.h"
+#endif
#ifdef __cplusplus
extern "C"
diff --git a/src/opus_decoder.c b/src/opus_decoder.c
index 1f098e82..0a500398 100644
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -51,7 +51,10 @@
#include "define.h"
#include "mathops.h"
#include "cpu_support.h"
+
+#ifdef ENABLE_DEEP_PLC
#include "dred_rdovae_dec_data.h"
+#endif
struct OpusDecoder {
int celt_dec_offset;
@@ -1125,7 +1128,9 @@ int opus_decoder_get_nb_samples(const OpusDecoder *dec,
}
struct OpusDREDDecoder {
+#ifdef ENABLE_DRED
RDOVAEDec model;
+#endif
int arch;
opus_uint32 magic;
};