Skip to content

Commit d7e9123

Browse files
committed
Sync to master version
1 parent da20b55 commit d7e9123

10 files changed

Lines changed: 125 additions & 349 deletions

File tree

code/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ link_directories (
9696
${CODEC_LIB_DIR}
9797
)
9898

99-
if(MULTICHANNEL_BINAURALIZER OR HOA_BINAURALIZER)
100-
link_directories(
101-
${EXTER_LIB_DIR}/binaural
102-
)
103-
endif()
104-
10599
if(BUILD_SHARED_LIBS)
106100
add_library(${PROJECT_NAME} SHARED ${DIR_DEP_EXTERNAL_WAV} ${DIR_IAMF_COMMON}
107101
${DIR_IAMF_DEC_OPUS} ${DIR_IAMF_DEC_AAC} ${DIR_IAMF_DEC_FLAC} ${DIR_IAMF_DEC_PCM} ${DIR_IAMF_DEC})
@@ -118,12 +112,6 @@ if(BUILD_SHARED_LIBS)
118112
target_link_libraries (${PROJECT_NAME} FLAC)
119113
endif()
120114

121-
if(MULTICHANNEL_BINAURALIZER)
122-
target_link_libraries (${PROJECT_NAME} iamf2bear)
123-
endif()
124-
if(HOA_BINAURALIZER)
125-
target_link_libraries (${PROJECT_NAME} iamf2resonance)
126-
endif()
127115
else()
128116
add_library(${PROJECT_NAME} STATIC ${DIR_DEP_EXTERNAL_WAV} ${DIR_IAMF_COMMON}
129117
${DIR_IAMF_DEC_OPUS} ${DIR_IAMF_DEC_AAC} ${DIR_IAMF_DEC_PCM}

code/dep_codecs/build.sh

Lines changed: 24 additions & 207 deletions
Original file line numberDiff line numberDiff line change
@@ -23,114 +23,16 @@
2323
#OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2424
#OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525

26-
set -e
27-
28-
run ()
29-
{
30-
if [ "$VERBOSE" = "yes" ] ; then
31-
echo "##### NEW COMMAND"
32-
echo "$@"
33-
$@ 2>&1
34-
else
35-
if [ -n "$TMPLOG" ] ; then
36-
echo "##### NEW COMMAND" >> $TMPLOG
37-
echo "$@" >> $TMPLOG
38-
$@ 2>&1 | tee -a $TMPLOG
39-
else
40-
$@ > /dev/null 2>&1
41-
fi
42-
fi
43-
}
44-
45-
pattern_match ()
46-
{
47-
echo "$2" | grep -q -E -e "$1"
48-
}
49-
50-
# Find if a given shell program is available.
51-
#
52-
# $1: variable name
53-
# $2: program name
54-
#
55-
# Result: set $1 to the full path of the corresponding command
56-
# or to the empty/undefined string if not available
57-
#
58-
find_program ()
59-
{
60-
eval $1=`command -v $2`
61-
}
62-
63-
prepare_download ()
64-
{
65-
find_program CMD_WGET wget
66-
find_program CMD_CURL curl
67-
find_program CMD_SCRP scp
68-
}
69-
70-
# Download a file with either 'curl', 'wget' or 'scp'
71-
#
72-
# $1: source URL (e.g. http://foo.com, ssh://blah, /some/path)
73-
# $2: target file
74-
download_file ()
75-
{
76-
# Is this HTTP, HTTPS or FTP ?
77-
if pattern_match "^(http|https|ftp):.*" "$1"; then
78-
if [ -n "$CMD_WGET" ] ; then
79-
run $CMD_WGET -O $2 $1
80-
elif [ -n "$CMD_CURL" ] ; then
81-
run $CMD_CURL -L -o $2 $1
82-
else
83-
echo "Please install wget or curl on this machine"
84-
exit 1
85-
fi
86-
return
87-
fi
88-
89-
# Is this SSH ?
90-
# Accept both ssh://<path> or <machine>:<path>
91-
#
92-
if pattern_match "^(ssh|[^:]+):.*" "$1"; then
93-
if [ -n "$CMD_SCP" ] ; then
94-
scp_src=`echo $1 | sed -e s%ssh://%%g`
95-
run $CMD_SCP $scp_src $2
96-
else
97-
echo "Please install scp on this machine"
98-
exit 1
99-
fi
100-
return
101-
fi
102-
103-
# Is this a file copy ?
104-
# Accept both file://<path> or /<path>
105-
#
106-
if pattern_match "^(file://|/).*" "$1"; then
107-
cp_src=`echo $1 | sed -e s%^file://%%g`
108-
run cp -f $cp_src $2
109-
return
110-
fi
111-
}
112-
113-
114-
115-
OPUS_DIR="$( cd "$(dirname "$0")" ; pwd -P )/opus"
116-
AAC_DIR="$( cd "$(dirname "$0")" ; pwd -P )/aac"
117-
FLAC_DIR="$( cd "$(dirname "$0")" ; pwd -P )/flac"
118-
CODECS_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
119-
OPUS_TAR="opus-1.4.tar.gz"
120-
AAC_TAR="fdk-aac-free-2.0.0.tar.gz"
121-
FLAC_TAR="flac-1.4.2.tar.xz"
26+
OPUS_DIR="$( cd "$(dirname "$0")" ; pwd -P )/opus/opus-1.4"
27+
AAC_DIR="$( cd "$(dirname "$0")" ; pwd -P )/aac/fdk-aac-free-2.0.0"
28+
FLAC_DIR="$( cd "$(dirname "$0")" ; pwd -P )/flac/flac-1.4.2"
29+
CODEC_LIB_DIR="$( cd "$(dirname "$0")" ; pwd -P )/lib"
12230

12331
declare -a CONFIG_FLAGS_OPUS
12432
declare -a CONFIG_FLAGS_AAC
12533
declare -a CONFIG_FLAGS_FLAC
126-
CONFIG_FLAGS_OPUS="-DCMAKE_C_FLAGS="-fPIC""
127-
CONFIG_FLAGS_AAC="--enable-static --disable-shared --with-pic"
128-
CONFIG_FLAGS_FLAC="-DWITH_OGG=OFF -DBUILD_CXXLIBS=OFF -DCMAKE_C_FLAGS="-fPIC""
129-
130-
OPUS_DOWNLOAD_LINK="https://downloads.xiph.org/releases/opus/opus-1.4.tar.gz"
131-
AAC_DOWNLOAD_LINK="https://people.freedesktop.org/~wtay/fdk-aac-free-2.0.0.tar.gz"
132-
FLAC_DOWNLOAD_LINK="https://downloads.xiph.org/releases/flac/flac-1.4.2.tar.xz"
133-
34+
CONFIG_FLAGS_AAC="--enable-static --disable-shared"
35+
CONFIG_FLAGS_FLAC="-DWITH_OGG=OFF -DBUILD_CXXLIBS=OFF"
13436

13537
function show_help()
13638
{
@@ -159,30 +61,30 @@ do
15961
want_help=yes ;;
16062

16163
--x86_64-mingw_toolchain)
162-
CONFIG_FLAGS_OPUS="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/x86_64-mingw.cmake -DOPUS_STACK_PROTECTOR=OFF -DCMAKE_C_FLAGS="-fPIC""
163-
CONFIG_FLAGS_AAC="--host=x86_64-w64-mingw32 --enable-static --disable-shared --with-pic"
164-
CONFIG_FLAGS_FLAC="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/x86_64-mingw.cmake -DWITH_OGG=OFF -DBUILD_CXXLIBS=OFF -DWITH_STACK_PROTECTOR=OFF -DCMAKE_C_FLAGS="-fPIC""
64+
CONFIG_FLAGS_OPUS="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/x86_64-mingw.cmake -DOPUS_STACK_PROTECTOR=OFF"
65+
CONFIG_FLAGS_AAC="--host=x86_64-w64-mingw32 --enable-static --disable-shared"
66+
CONFIG_FLAGS_FLAC="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/x86_64-mingw.cmake -DWITH_OGG=OFF -DBUILD_CXXLIBS=OFF -DWITH_STACK_PROTECTOR=OFF"
16567
shift # past argument with no value
16668
;;
16769

16870
--arm64-linux_toolchain)
169-
CONFIG_FLAGS_OPUS="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/arm64-linux.cmake -DOPUS_STACK_PROTECTOR=OFF -DCMAKE_C_FLAGS="-fPIC""
170-
CONFIG_FLAGS_AAC="--host=aarch64-linux-gnu --enable-static --disable-shared --with-pic"
171-
CONFIG_FLAGS_FLAC="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/arm64-linux.cmake -DWITH_OGG=OFF -DBUILD_CXXLIBS=OFF -DWITH_STACK_PROTECTOR=OFF -DCMAKE_C_FLAGS="-fPIC""
71+
CONFIG_FLAGS_OPUS="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/arm64-linux.cmake -DOPUS_STACK_PROTECTOR=OFF"
72+
CONFIG_FLAGS_AAC="--host=aarch64-linux-gnu --enable-static --disable-shared"
73+
CONFIG_FLAGS_FLAC="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/arm64-linux.cmake -DCMAKE_C_FLAGS="-fPIC" -DWITH_OGG=OFF -DBUILD_CXXLIBS=OFF -DWITH_STACK_PROTECTOR=OFF"
17274
shift # past argument with no value
17375
;;
17476

17577
--x86-macos_toolchain)
176-
CONFIG_FLAGS_OPUS="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/x86-macos.cmake -DCMAKE_C_FLAGS="-fPIC""
177-
CONFIG_FLAGS_AAC="--host=x86_64-apple-darwin20.4 --enable-static --disable-shared --with-pic"
178-
CONFIG_FLAGS_FLAC="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/x86-macos.cmake -DWITH_OGG=OFF -DBUILD_CXXLIBS=OFF -DCMAKE_C_FLAGS="-fPIC""
78+
CONFIG_FLAGS_OPUS="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/x86-macos.cmake"
79+
CONFIG_FLAGS_AAC="--host=x86_64-apple-darwin20.4 --enable-static --disable-shared"
80+
CONFIG_FLAGS_FLAC="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/x86-macos.cmake -DWITH_OGG=OFF -DBUILD_CXXLIBS=OFF"
17981
shift # past argument with no value
18082
;;
18183

18284
--arm64-ios_toolchain)
18385
CONFIG_FLAGS_OPUS="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/arm64-ios.cmake"
184-
CONFIG_FLAGS_AAC="--host=aarch64-apple-darwin20.4 --enable-static --disable-shared --with-pic"
185-
CONFIG_FLAGS_FLAC="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/arm64-ios.cmake -DWITH_OGG=OFF -DBUILD_CXXLIBS=OFF -DCMAKE_C_FLAGS="-fPIC""
86+
CONFIG_FLAGS_AAC="--host=aarch64-apple-darwin20.4 --enable-static --disable-shared"
87+
CONFIG_FLAGS_FLAC="-DCMAKE_TOOLCHAIN_FILE=../../../build/cmake/toolchains/arm64-ios.cmake -DWITH_OGG=OFF -DBUILD_CXXLIBS=OFF"
18688
shift # past argument with no value
18789
;;
18890

@@ -198,114 +100,29 @@ if test "x$want_help" = xyes; then
198100
show_help
199101
fi
200102

201-
#Delete old libraries
202-
rm -rf $CODECS_DIR/lib
203-
204-
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>Codec Download<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
205-
206-
CLEAN=yes
207-
DOWNLOAD=yes
208-
209-
if [ $CLEAN = yes ] ; then
210-
echo "Cleaning: $OPUS_DIR"
211-
rm -f -r $OPUS_DIR
212-
213-
echo "Cleaning: $AAC_DIR"
214-
rm -f -r $AAC_DIR
215-
216-
echo "Cleaning: $FLAC_DIR"
217-
rm -f -r $FLAC_DIR
218-
219-
mkdir $OPUS_DIR
220-
mkdir $AAC_DIR
221-
mkdir $FLAC_DIR
222-
[ "$DOWNLOAD" = "yes" ] || exit 0
223-
fi
224-
225-
#Download OPUS
226-
if [ ! -f $OPUS_DIR/$OPUS_TAR ]
227-
then
228-
echo "Downloading opus please wait..."
229-
prepare_download
230-
download_file $OPUS_DOWNLOAD_LINK $OPUS_DIR/$OPUS_TAR
231-
fi
232-
233-
if [ ! -f $OPUS_DIR/$OPUS_TAR ]
234-
then
235-
echo "Failed to download opus! Please download manually\nand save it in this directory as $OPUS_TAR"
236-
exit 1
237-
fi
238-
239-
if [ -f $OPUS_DIR/$OPUS_TAR ]
240-
then
241-
echo "Unpacking opus"
242-
tar -zxf $OPUS_DIR/$OPUS_TAR -C $OPUS_DIR
243-
fi
244-
245-
#Download AAC
246-
if [ ! -f $AAC_DIR/$AAC_TAR ]
247-
then
248-
echo "Downloading aac please wait..."
249-
prepare_download
250-
download_file $AAC_DOWNLOAD_LINK $AAC_DIR/$AAC_TAR
251-
fi
252-
253-
if [ ! -f $AAC_DIR/$AAC_TAR ]
254-
then
255-
echo "Failed to download aac! Please download manually\nand save it in this directory as $AAC_TAR"
256-
exit 1
257-
fi
258-
259-
if [ -f $AAC_DIR/$AAC_TAR ]
260-
then
261-
echo "Unpacking aac"
262-
tar -zxf $AAC_DIR/$AAC_TAR -C $AAC_DIR
263-
fi
264-
265-
#Download FLAC
266-
if [ ! -f $FLAC_DIR/$FLAC_TAR ]
267-
then
268-
echo "Downloading flac please wait..."
269-
prepare_download
270-
download_file $FLAC_DOWNLOAD_LINK $FLAC_DIR/$FLAC_TAR
271-
fi
272-
273-
if [ ! -f $FLAC_DIR/$FLAC_TAR ]
274-
then
275-
echo "Failed to download flac! Please download manually\nand save it in this directory as $FLAC_TAR"
276-
exit 1
277-
fi
278-
279-
if [ -f $FLAC_DIR/$FLAC_TAR ]
280-
then
281-
echo "Unpacking flac"
282-
tar -xf $FLAC_DIR/$FLAC_TAR -C $FLAC_DIR
283-
fi
284-
285-
286103

287104
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>OPUS Compile<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
288-
cd $OPUS_DIR/opus-1.4
105+
cd $OPUS_DIR
289106
rm -rf build
290107
cmake -B build ./ $CONFIG_FLAGS_OPUS
291108
cmake --build build --clean-first
292-
cmake --install build --prefix $CODECS_DIR
109+
cp -f build/libopus.a $CODEC_LIB_DIR
293110

294111
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>AAC Compile<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
295-
cd $AAC_DIR/fdk-aac-free-2.0.0
112+
cd $AAC_DIR
296113
rm -rf build
297114
mkdir build
298115
cd build
299-
../configure $CONFIG_FLAGS_AAC --prefix=$CODECS_DIR
116+
../configure $CONFIG_FLAGS_AAC
300117
make
301-
make install
118+
cp -f .libs/libfdk-aac.a $CODEC_LIB_DIR
302119

303120
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>FLAC Compile<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
304-
cd $FLAC_DIR/flac-1.4.2
121+
cd $FLAC_DIR
305122
rm -rf build
306123
cmake -B build ./ $CONFIG_FLAGS_FLAC
307124
cmake --build build --clean-first
308-
cmake --install build --prefix $CODECS_DIR
125+
cp -f build/src/libFLAC/libFLAC.a $CODEC_LIB_DIR
309126

310127

311128

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
README.md
22
=========
3-
# Dependent Externals Libraries
3+
# Dependent Codec Libraries
44

55
## Contents
66
1. [Downloading the opensource](#Downloading-the-opensource)
@@ -10,20 +10,21 @@ README.md
1010

1111

1212
## Downloading the opensource
13-
1. [bear](https://github.com/ebu/bear)
14-
2. [resonance-audio](https://github.com/resonance-audio/resonance-audio)
15-
13+
1. [visr](https://github.com/ebu/bear/releases/download/v0.0.1-pre/visr-0.13.0-pre-5e13f020.zip)
14+
2. [boost](https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.zip)
15+
16+
Please download the opensource and unzip to directory separately as following:
17+
~~~
18+
rd-audio-visr-public-master
19+
boost_1_82_0
20+
~~~
1621

1722
## Building the libraries
1823

1924
### Prerequisites
2025
1. [CMake](https://cmake.org) version 3.6 or higher.
21-
2. [boost](https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.zip), version 1.82
22-
~~~
23-
$ ./bootstrap.sh --with-toolset=gcc
24-
$ ./b2 toolset=gcc
25-
$ ./b2 install
26-
~~~
26+
2. Tool chains if need cross compiling.
27+
2728

2829
### Basic build
2930
"build.sh" is an example to build, you can run it directly at your side.

0 commit comments

Comments
 (0)