-
Notifications
You must be signed in to change notification settings - Fork 47
/
build_codec.sh
executable file
·141 lines (122 loc) · 3.51 KB
/
build_codec.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/bin/bash
# exit on failure
set -e
# exit on unassigned variable
set -u
echo "Building codec '${CODEC}' (using BUILD_OPTIONS '${BUILD_OPTIONS}')"
case "${CODEC}" in
daala)
cd ${CODECS_SRC_DIR}/${CODEC}
gcc -print-prog-name=cc1
gcc -print-search-dirs
./autogen.sh
./configure --enable-static --disable-shared --disable-player --disable-dump-images --enable-logging --enable-dump-recons ${BUILD_OPTIONS}
make -j$(nproc)
;;
thor | thor-rt)
cd ${CODECS_SRC_DIR}/${CODEC}
make
;;
x264)
cd ${CODECS_SRC_DIR}/x264
./configure ${BUILD_OPTIONS} --enable-pic
make
;;
x265 | x265-rt)
cd ${CODECS_SRC_DIR}/x265/build/linux
cmake -D ENABLE_SHARED=no ${BUILD_OPTIONS} ../../source/
make
;;
xvc)
mkdir -p xvc/build
pushd xvc/build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DENABLE_ASSERTIONS=OFF $BUILD_OPTIONS ..
make -j4
popd
;;
xvc)
mkdir -p xvc/build
pushd xvc/build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DENABLE_ASSERTIONS=OFF $BUILD_OPTIONS ..
make -j4
popd
;;
vp10 | vp10-rt)
cd ${CODECS_SRC_DIR}/${CODEC}
./configure --enable-vp10 ${BUILD_OPTIONS}
make
;;
av1 | av1-rt)
cd ${CODECS_SRC_DIR}/${CODEC}
echo "-- Starting x86_64 Build --"
if [[ "${BUILD_OPTIONS}" == *"--enable"* ]]; then
# legacy configure build
./configure --enable-av1 --enable-debug --disable-unit-tests --disable-docs ${BUILD_OPTIONS}
make -j$(nproc)
mkdir -p x86_64
mv aomenc aomdec x86_64/
else
rm -rf cmake-build || true
mkdir cmake-build
pushd cmake-build
cmake ../ -DENABLE_TESTS=0 -DENABLE_DOCS=0 -DCMAKE_BUILD_TYPE=Release -DAOM_EXTRA_C_FLAGS=-UNDEBUG -DAOM_EXTRA_CXX_FLAGS=-UNDEBUG ${BUILD_OPTIONS}
make -j$(nproc)
popd
mkdir -p x86_64
mv cmake-build/aomenc cmake-build/aomdec x86_64/
fi
echo "-- Finished x86_64 Build --"
echo "-- Starting Analyzer Build --"
${APP_DIR}/build_av1_analyzer.sh || true
echo "-- Finished Analyzer Build --"
echo "Note: Analyzer errors will not prevent the run from completing."
mv x86_64/* ./
;;
av2* | avm*)
cd ${CODECS_SRC_DIR}/av2
echo "-- Starting x86_64 Build --"
rm -rf cmake-build || true
mkdir cmake-build
pushd cmake-build
if [[ "${ARCH}" == "aarch64" ]]; then
ARCH_OPTIONS="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/toolchains/arm64-linux-gcc.cmake"
else
ARCH_OPTIONS=""
fi
cmake ../ -DENABLE_TESTS=0 -DENABLE_DOCS=0 -DCMAKE_BUILD_TYPE=Release ${ARCH_OPTIONS} ${BUILD_OPTIONS}
make -j$(nproc)
popd
mkdir -p "$ARCH"
mv cmake-build/aomenc cmake-build/aomdec ./
echo "-- Finished $ARCH Build --"
;;
vp8 | vp8-rt)
cd ${CODECS_SRC_DIR}/vp8
CONFIG_DIR=${CODECS_SRC_DIR}/vp8/ ./configure --enable-vp8 --disable-vp9 ${BUILD_OPTIONS}
CONFIG_DIR=${CODECS_SRC_DIR}/vp8/ make
;;
vp9 | vp9-rt)
cd ${CODECS_SRC_DIR}/vp9
CONFIG_DIR=${CODECS_SRC_DIR}/vp9/ ./configure --enable-vp9 --disable-vp8 ${BUILD_OPTIONS}
CONFIG_DIR=${CODECS_SRC_DIR}/vp9/ make
;;
rav1e)
cd ${CODECS_SRC_DIR}/rav1e
cargo build --release ${BUILD_OPTIONS}
;;
svt-av1*)
cd ${CODECS_SRC_DIR}/svt-av1
cd Build/linux
./build.sh --cc=gcc --cxx=g++ --release --static
;;
vvc-vtm*)
cd ${CODECS_SRC_DIR}/vvc-vtm
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j 8
;;
*)
echo "Unknown codec '${CODEC}'" >&2
exit 1
esac