Skip to content

Commit f96940b

Browse files
committed
Copied from RNNoise directly
1 parent 089290d commit f96940b

9 files changed

+701
-0
lines changed

AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Jean-Marc Valin <jmvalin@jmvalin.ca>
2+
David Rowe <david@rowetel.com>

Makefile.am

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
ACLOCAL_AMFLAGS = -I m4
2+
3+
AM_CFLAGS = -I$(top_srcdir)/include $(DEPS_CFLAGS)
4+
5+
dist_doc_DATA = COPYING AUTHORS README
6+
7+
include_HEADERS = include/rnnoise.h
8+
9+
lib_LTLIBRARIES = librnnoise.la
10+
noinst_HEADERS = src/arch.h \
11+
src/celt_lpc.h \
12+
src/common.h \
13+
src/_kiss_fft_guts.h \
14+
src/kiss_fft.h \
15+
src/opus_types.h \
16+
src/pitch.h \
17+
src/rnn_data.h \
18+
src/rnn.h \
19+
src/tansig_table.h
20+
21+
librnnoise_la_SOURCES = \
22+
src/denoise.c \
23+
src/rnn.c \
24+
src/rnn_data.c \
25+
src/pitch.c \
26+
src/kiss_fft.c \
27+
src/celt_lpc.c
28+
29+
librnnoise_la_LIBADD = $(DEPS_LIBS) $(lrintf_lib) $(LIBM)
30+
librnnoise_la_LDFLAGS = -no-undefined \
31+
-version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
32+
33+
if OP_ENABLE_EXAMPLES
34+
noinst_PROGRAMS = examples/rnnoise_demo
35+
endif
36+
37+
examples_rnnoise_demo_SOURCES = examples/rnnoise_demo.c
38+
examples_rnnoise_demo_LDADD = librnnoise.la
39+
40+
pkgconfigdir = $(libdir)/pkgconfig
41+
pkgconfig_DATA = rnnoise.pc
42+
43+
debug:
44+
$(MAKE) CFLAGS="${CFLAGS} -O0 -ggdb -DOP_ENABLE_ASSERTIONS" all
45+
46+
EXTRA_DIST = \
47+
rnnoise.pc.in \
48+
rnnoise-uninstalled.pc.in \
49+
doc/Doxyfile.in \
50+
doc/Makefile
51+
52+
# Targets to build and install just the library without the docs
53+
librnnoise install-librnnoise: NO_DOXYGEN = 1
54+
55+
rnnoise: all
56+
install-rnnoise: install
57+
58+
# Or just the docs
59+
docs: doc/doxygen-build.stamp
60+
61+
install-docs:
62+
@if [ -z "$(NO_DOXYGEN)" ]; then \
63+
( cd doc && \
64+
echo "Installing documentation in $(DESTDIR)$(docdir)"; \
65+
$(INSTALL) -d $(DESTDIR)$(docdir)/html/search; \
66+
for f in `find html -type f \! -name "installdox"` ; do \
67+
$(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f; \
68+
done ) \
69+
fi
70+
71+
doc/doxygen-build.stamp: doc/Doxyfile \
72+
$(top_srcdir)/include/*.h
73+
@[ -n "$(NO_DOXYGEN)" ] || ( cd doc && doxygen && touch $(@F) )
74+
75+
76+
if HAVE_DOXYGEN
77+
78+
# Or everything (by default)
79+
all-local: docs
80+
81+
install-data-local: install-docs
82+
83+
clean-local:
84+
$(RM) -r doc/html
85+
$(RM) -r doc/latex
86+
$(RM) doc/doxygen-build.stamp
87+
88+
uninstall-local:
89+
$(RM) -r $(DESTDIR)$(docdir)/html
90+
91+
endif
92+
93+
# We check this every time make is run, with configure.ac being touched to
94+
# trigger an update of the build system files if update_version changes the
95+
# current PACKAGE_VERSION (or if package_version was modified manually by a
96+
# user with either AUTO_UPDATE=no or no update_version script present - the
97+
# latter being the normal case for tarball releases).
98+
#
99+
# We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
100+
# simply running autoconf will not actually regenerate configure for us when
101+
# the content of that file changes (due to autoconf dependency checking not
102+
# knowing about that without us creating yet another file for it to include).
103+
#
104+
# The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
105+
# makes that don't support it. The only loss of functionality is not forcing
106+
# an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
107+
# unlikely to be a real problem for any real user.
108+
$(top_srcdir)/configure.ac: force
109+
@case "$(MAKECMDGOALS)" in \
110+
dist-hook) exit 0 ;; \
111+
dist-* | dist | distcheck | distclean) _arg=release ;; \
112+
esac; \
113+
if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
114+
if [ ! -e $(top_srcdir)/package_version ]; then \
115+
echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
116+
fi; \
117+
. $(top_srcdir)/package_version || exit 1; \
118+
[ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
119+
fi; \
120+
touch $@
121+
122+
force:
123+
124+
# Create a minimal package_version file when make dist is run.
125+
dist-hook:
126+
echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
127+
128+
129+
.PHONY: rnnoise install-rnnoise docs install-docs

autogen.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
# Run this to set up the build system: configure, makefiles, etc.
3+
set -e
4+
5+
srcdir=`dirname $0`
6+
test -n "$srcdir" && cd "$srcdir"
7+
8+
echo "Updating build configuration files for rnnoise, please wait...."
9+
10+
autoreconf -isf

configure.ac

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# autoconf source script for generating configure
2+
3+
dnl The package_version file will be automatically synced to the git revision
4+
dnl by the update_version script when configured in the repository, but will
5+
dnl remain constant in tarball releases unless it is manually edited.
6+
m4_define([CURRENT_VERSION],
7+
m4_esyscmd([ ./update_version 2>/dev/null || true
8+
if test -e package_version; then
9+
. ./package_version
10+
printf "$PACKAGE_VERSION"
11+
else
12+
printf "unknown"
13+
fi ]))
14+
15+
AC_INIT([rnnoise],[CURRENT_VERSION],[jmvalin@jmvalin.ca])
16+
AC_CONFIG_SRCDIR([src/denoise.c])
17+
AC_CONFIG_MACRO_DIR([m4])
18+
19+
AC_USE_SYSTEM_EXTENSIONS
20+
AC_SYS_LARGEFILE
21+
22+
AM_INIT_AUTOMAKE([1.11 foreign no-define dist-zip subdir-objects])
23+
AM_MAINTAINER_MODE([enable])
24+
25+
AC_C_INLINE
26+
27+
LT_INIT
28+
29+
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
30+
31+
AC_DEFINE([RNNOISE_BUILD], [], [This is a build of the library])
32+
33+
dnl Library versioning for libtool.
34+
dnl Please update these for releases.
35+
dnl CURRENT, REVISION, AGE
36+
dnl - library source changed -> increment REVISION
37+
dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
38+
dnl - interfaces added -> increment AGE
39+
dnl - interfaces removed -> AGE = 0
40+
41+
OP_LT_CURRENT=4
42+
OP_LT_REVISION=1
43+
OP_LT_AGE=4
44+
45+
AC_SUBST(OP_LT_CURRENT)
46+
AC_SUBST(OP_LT_REVISION)
47+
AC_SUBST(OP_LT_AGE)
48+
49+
CC_CHECK_CFLAGS_APPEND(
50+
[-pedantic -Wall -Wextra -Wno-sign-compare -Wno-parentheses -Wno-long-long])
51+
52+
# Platform-specific tweaks
53+
case $host in
54+
*-mingw*)
55+
# -std=c89 causes some warnings under mingw.
56+
CC_CHECK_CFLAGS_APPEND([-U__STRICT_ANSI__])
57+
# We need WINNT>=0x501 (WindowsXP) for getaddrinfo/freeaddrinfo.
58+
# It's okay to define this even when HTTP support is disabled, as it only
59+
# affects header declarations, not linking (unless we actually use some
60+
# XP-only functions).
61+
AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x501,
62+
[We need at least WindowsXP for getaddrinfo/freeaddrinfo])
63+
host_mingw=true
64+
;;
65+
esac
66+
AM_CONDITIONAL(OP_WIN32, test "$host_mingw" = "true")
67+
68+
AC_ARG_ENABLE([assertions],
69+
AS_HELP_STRING([--enable-assertions], [Enable assertions in code]),,
70+
enable_assertions=no)
71+
72+
AS_IF([test "$enable_assertions" = "yes"], [
73+
AC_DEFINE([OP_ENABLE_ASSERTIONS], [1], [Enable assertions in code])
74+
])
75+
76+
AC_ARG_ENABLE([examples],
77+
AS_HELP_STRING([--disable-examples], [Do not build example applications]),,
78+
enable_examples=yes)
79+
AM_CONDITIONAL([OP_ENABLE_EXAMPLES], [test "$enable_examples" = "yes"])
80+
81+
AS_CASE(["$ac_cv_search_lrintf"],
82+
["no"],[],
83+
["none required"],[],
84+
[lrintf_lib="$ac_cv_search_lrintf"])
85+
86+
LT_LIB_M
87+
88+
AC_SUBST([lrintf_lib])
89+
90+
CC_ATTRIBUTE_VISIBILITY([default], [
91+
CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"])
92+
])
93+
94+
dnl Check for doxygen
95+
AC_ARG_ENABLE([doc],
96+
AS_HELP_STRING([--disable-doc], [Do not build API documentation]),,
97+
[enable_doc=yes]
98+
)
99+
100+
AS_IF([test "$enable_doc" = "yes"], [
101+
AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no])
102+
AC_CHECK_PROG([HAVE_DOT], [dot], [yes], [no])
103+
],[
104+
HAVE_DOXYGEN=no
105+
])
106+
107+
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$HAVE_DOXYGEN" = "yes"])
108+
109+
AC_CONFIG_FILES([
110+
Makefile
111+
rnnoise.pc
112+
rnnoise-uninstalled.pc
113+
doc/Doxyfile
114+
])
115+
AC_CONFIG_HEADERS([config.h])
116+
AC_OUTPUT
117+
118+
AC_MSG_NOTICE([
119+
------------------------------------------------------------------------
120+
$PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK.
121+
122+
Assertions ................... ${enable_assertions}
123+
124+
Hidden visibility ............ ${cc_cv_flag_visibility}
125+
126+
API code examples ............ ${enable_examples}
127+
API documentation ............ ${enable_doc}
128+
------------------------------------------------------------------------
129+
])

doc/Doxyfile.in

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Process with doxygen to generate API documentation
2+
3+
PROJECT_NAME = @PACKAGE_NAME@
4+
PROJECT_NUMBER = @PACKAGE_VERSION@
5+
PROJECT_BRIEF = "RNN-based noise suppressor."
6+
INPUT = @top_srcdir@/include/rnnoise.h
7+
OPTIMIZE_OUTPUT_FOR_C = YES
8+
9+
QUIET = YES
10+
WARNINGS = YES
11+
WARN_IF_UNDOCUMENTED = YES
12+
WARN_IF_DOC_ERROR = YES
13+
WARN_NO_PARAMDOC = YES
14+
15+
JAVADOC_AUTOBRIEF = YES
16+
SORT_MEMBER_DOCS = NO
17+
18+
HAVE_DOT = @HAVE_DOT@

lpcnet-uninstalled.pc.in

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# rnnoise uninstalled pkg-config file
2+
3+
prefix=
4+
exec_prefix=
5+
libdir=${pcfiledir}/.libs
6+
includedir=${pcfiledir}/@top_srcdir@/include
7+
8+
Name: rnnoise uninstalled
9+
Description: RNN-based noise suppression (not installed)
10+
Version: @PACKAGE_VERSION@
11+
Conflicts:
12+
Libs: ${libdir}/librnnoise.la @lrintf_lib@
13+
Cflags: -I${includedir}

lpcnet.pc.in

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# rnnoise installed pkg-config file
2+
3+
prefix=@prefix@
4+
exec_prefix=@exec_prefix@
5+
libdir=@libdir@
6+
includedir=@includedir@
7+
8+
Name: rnnoise
9+
Description: RNN-based noise suppression
10+
Version: @PACKAGE_VERSION@
11+
Conflicts:
12+
Libs: -L${libdir} -lrnnoise
13+
Libs.private: @lrintf_lib@
14+
Cflags: -I${includedir}/

0 commit comments

Comments
 (0)