Skip to content

Commit

Permalink
Update build for LPCNet merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jmvalin committed Jun 21, 2023
1 parent 7458c1b commit bfa01f1
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 61 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "lpcnet"]
path = lpcnet
url = https://github.com/xiph/LPCNet
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ target_include_directories(
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/opus>
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/lpcnet/include
${CMAKE_CURRENT_SOURCE_DIR}/dnn/include
celt
silk)

Expand Down Expand Up @@ -601,7 +601,7 @@ if(OPUS_BUILD_PROGRAMS)
target_include_directories(opus_demo PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(opus_demo PRIVATE silk) # debug.h
target_include_directories(opus_demo PRIVATE celt) # arch.h
target_include_directories(opus_demo PRIVATE lpcnet/include)
target_include_directories(opus_demo PRIVATE dnn/include)
target_link_libraries(opus_demo PRIVATE opus ${OPUS_REQUIRED_LIBRARIES})
target_compile_definitions(opus_demo PRIVATE OPUS_BUILD)

Expand Down Expand Up @@ -652,7 +652,7 @@ if(BUILD_TESTING AND NOT BUILD_SHARED_LIBS)

add_executable(test_opus_encode ${test_opus_encode_sources})
target_include_directories(test_opus_encode
PRIVATE ${CMAKE_CURRENT_BINARY_DIR} celt lpcnet/include)
PRIVATE ${CMAKE_CURRENT_BINARY_DIR} celt dnn/include)
target_link_libraries(test_opus_encode PRIVATE opus)
target_compile_definitions(test_opus_encode PRIVATE OPUS_BUILD)
add_test(NAME test_opus_encode COMMAND ${CMAKE_COMMAND}
Expand All @@ -662,7 +662,7 @@ if(BUILD_TESTING AND NOT BUILD_SHARED_LIBS)

add_executable(test_opus_extensions ${test_opus_extensions_sources})
target_include_directories(test_opus_extensions
PRIVATE ${CMAKE_CURRENT_BINARY_DIR} celt lpcnet/include)
PRIVATE ${CMAKE_CURRENT_BINARY_DIR} celt dnn/include)
target_link_libraries(test_opus_extensions PRIVATE opus)
target_compile_definitions(test_opus_extensions PRIVATE OPUS_BUILD)
add_test(NAME test_opus_extensions COMMAND ${CMAKE_COMMAND}
Expand Down
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DIST_SUBDIRS = doc

AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/celt -I$(top_srcdir)/silk \
-I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed $(NE10_CFLAGS) \
-I$(top_srcdir)/lpcnet/include
-I$(top_srcdir)/dnn/include

include celt_sources.mk
include lpcnet_sources.mk
Expand Down Expand Up @@ -154,7 +154,7 @@ opus_compare_LDADD = $(LIBM)
trivial_example_SOURCES = doc/trivial_example.c
trivial_example_LDADD = libopus.la $(LIBM)

dump_weights_blob_SOURCES = lpcnet/src/write_lpcnet_weights.c
dump_weights_blob_SOURCES = dnn/write_lpcnet_weights.c
dump_weights_blob_LDADD = $(LIBM)
dump_weights_blob_CFLAGS = $(AM_CFLAGS) -DDUMP_BINARY_WEIGHTS

Expand Down
2 changes: 1 addition & 1 deletion autogen.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ for /F "tokens=4 delims= " %%A in ('findstr "download_model.sh" autogen.sh') do
REM Remove trailing ")" character from the model variable
set "model=%model:~0,-1%"

cd lpcnet
cd dnn
call download_model.bat %model%
cd ..

Expand Down
2 changes: 1 addition & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ srcdir=`dirname $0`
test -n "$srcdir" && cd "$srcdir"

git submodule update --init
(cd lpcnet; ./download_model.sh 2ddc476)
(cd dnn; ./download_model.sh 2ddc476)

echo "Updating build configuration files, please wait...."

Expand Down
2 changes: 1 addition & 1 deletion celt/celt_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include "celt_lpc.h"
#include "vq.h"
#include "lpcnet.h"
#include "lpcnet/src/lpcnet_private.h"
#include "dnn/lpcnet_private.h"

/* 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
2 changes: 2 additions & 0 deletions dnn/download_model.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ if not exist %model% (
)

tar -xvzf %model%
move .\src\*.c .
move .\src\*.h .

1 change: 0 additions & 1 deletion lpcnet
Submodule lpcnet deleted from f71541
42 changes: 21 additions & 21 deletions lpcnet_headers.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ silk/dred_coding.h \
silk/dred_config.h \
silk/dred_decoder.h \
silk/dred_encoder.h \
lpcnet/include/dred_rdovae.h \
lpcnet/include/lpcnet.h \
lpcnet/src/burg.h \
lpcnet/src/common.h \
lpcnet/src/freq.h \
lpcnet/src/kiss99.h \
lpcnet/src/lpcnet_private.h \
lpcnet/src/nnet_data.h \
lpcnet/src/nnet.h \
lpcnet/src/plc_data.h \
lpcnet/src/tansig_table.h \
lpcnet/src/vec.h \
lpcnet/src/vec_avx.h \
lpcnet/src/vec_neon.h \
lpcnet/src/dred_rdovae_constants.h \
lpcnet/src/dred_rdovae_enc.h \
lpcnet/src/dred_rdovae_enc_data.h \
lpcnet/src/dred_rdovae_dec.h \
lpcnet/src/dred_rdovae_dec_data.h \
lpcnet/src/dred_rdovae_stats_data.h \
lpcnet/src/pitch.h
dnn/include/dred_rdovae.h \
dnn/include/lpcnet.h \
dnn/burg.h \
dnn/common.h \
dnn/freq.h \
dnn/kiss99.h \
dnn/lpcnet_private.h \
dnn/nnet_data.h \
dnn/nnet.h \
dnn/plc_data.h \
dnn/tansig_table.h \
dnn/vec.h \
dnn/vec_avx.h \
dnn/vec_neon.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/pitch.h
38 changes: 19 additions & 19 deletions lpcnet_sources.mk
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
LPCNET_SOURCES = \
lpcnet/src/burg.c \
lpcnet/src/common.c \
lpcnet/src/freq.c \
lpcnet/src/kiss99.c \
lpcnet/src/lpcnet.c \
lpcnet/src/lpcnet_dec.c \
lpcnet/src/lpcnet_enc.c \
lpcnet/src/lpcnet_plc.c \
lpcnet/src/lpcnet_tables.c \
lpcnet/src/nnet.c \
lpcnet/src/nnet_data.c \
lpcnet/src/plc_data.c \
lpcnet/src/parse_lpcnet_weights.c \
lpcnet/src/dred_rdovae.c \
lpcnet/src/dred_rdovae_enc.c \
lpcnet/src/dred_rdovae_enc_data.c \
lpcnet/src/dred_rdovae_dec.c \
lpcnet/src/dred_rdovae_dec_data.c \
lpcnet/src/dred_rdovae_stats_data.c \
dnn/burg.c \
dnn/common.c \
dnn/freq.c \
dnn/kiss99.c \
dnn/lpcnet.c \
dnn/lpcnet_dec.c \
dnn/lpcnet_enc.c \
dnn/lpcnet_plc.c \
dnn/lpcnet_tables.c \
dnn/nnet.c \
dnn/nnet_data.c \
dnn/plc_data.c \
dnn/parse_lpcnet_weights.c \
dnn/dred_rdovae.c \
dnn/dred_rdovae_enc.c \
dnn/dred_rdovae_enc_data.c \
dnn/dred_rdovae_dec.c \
dnn/dred_rdovae_dec_data.c \
dnn/dred_rdovae_stats_data.c \
silk/dred_encoder.c \
silk/dred_coding.c \
silk/dred_decoder.c
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ host_cpu_family = host_machine.cpu_family()
top_srcdir = meson.current_source_dir()
top_builddir = meson.current_build_dir()

opus_includes = include_directories('.', 'include', 'celt', 'silk', 'lpcnet/include')
opus_includes = include_directories('.', 'include', 'celt', 'silk', 'dnn/include')
opus_public_includes = include_directories('include')

add_project_arguments('-DOPUS_BUILD', language: 'c')
Expand Down
2 changes: 1 addition & 1 deletion silk/API.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "errors.h"
#include "entenc.h"
#include "entdec.h"
#include "lpcnet/src/lpcnet_private.h"
#include "dnn/lpcnet_private.h"

#ifdef __cplusplus
extern "C"
Expand Down
6 changes: 3 additions & 3 deletions silk/dred_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#include "dred_config.h"
#include "dred_rdovae.h"
#include "entcode.h"
#include "lpcnet/src/lpcnet_private.h"
#include "lpcnet/src/dred_rdovae_enc.h"
#include "lpcnet/src/dred_rdovae_enc_data.h"
#include "dnn/lpcnet_private.h"
#include "dnn/dred_rdovae_enc.h"
#include "dnn/dred_rdovae_enc_data.h"

#define RESAMPLING_ORDER 8

Expand Down
2 changes: 1 addition & 1 deletion silk/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ endif
# Perhaps this should be moved into lpcnet itself
lpcnet_sources = sources['LPCNET_SOURCES']

lpcnet_includes = [opus_includes, include_directories('../lpcnet/include')]
lpcnet_includes = [opus_includes, include_directories('../dnn/include')]

lpcnet_c_args = []
if host_machine.system() == 'windows'
Expand Down
2 changes: 1 addition & 1 deletion silk/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.

#ifdef NEURAL_PLC
#include "lpcnet.h"
#include "lpcnet/src/lpcnet_private.h"
#include "dnn/lpcnet_private.h"
#endif

#ifdef ENABLE_NEURAL_FEC
Expand Down
2 changes: 1 addition & 1 deletion src/opus_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include "define.h"
#include "mathops.h"
#include "cpu_support.h"
#include "lpcnet/src/dred_rdovae_dec_data.h"
#include "dnn/dred_rdovae_dec_data.h"

struct OpusDecoder {
int celt_dec_offset;
Expand Down

0 comments on commit bfa01f1

Please sign in to comment.