Skip to content

Commit

Permalink
Making the build possible without the models
Browse files Browse the repository at this point in the history
No dependency on the data files if no DNN code enabled
  • Loading branch information
jmvalin committed Oct 18, 2023
1 parent aca04ce commit 0e397a7
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
8 changes: 8 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions celt/celt_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 11 additions & 9 deletions lpcnet_headers.mk
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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
1 change: 1 addition & 0 deletions lpcnet_sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 3 additions & 0 deletions silk/API.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions src/opus_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
};
Expand Down

0 comments on commit 0e397a7

Please sign in to comment.