blob: e1975610520554602b8c13c4ef558e4b46d3a3da [file] [log] [blame]
Paweł Hajdan9ab47772013-08-02 03:08:421Welcome to the WebM VP8/VP9 Codec SDK!
John Koleszar0ea50ce2010-05-18 15:58:332
3COMPILING THE APPLICATIONS/LIBRARIES:
4 The build system used is similar to autotools. Building generally consists of
5 "configuring" with your desired build options, then using GNU make to build
6 the application.
7
8 1. Prerequisites
John Koleszar94c52e42010-06-18 16:39:219
James Zernd699ef42025-01-13 21:15:0410 * All x86 targets require the NASM[0] or Yasm[1] assembler be installed[2].
Jerome Jiang24b43c42021-03-09 00:07:0211 * All Windows builds require that Cygwin[3] or MSYS2[4] be installed.
12 * Building the documentation requires Doxygen[5]. If you do not
James Zernf8630c72014-05-10 18:15:1113 have this package, the install-docs option will be disabled.
Jerome Jiang24b43c42021-03-09 00:07:0214 * Downloading the data for the unit tests requires curl[6] and sha1sum.
John Koleszar00748632012-06-20 21:45:2215 sha1sum is provided via the GNU coreutils, installed by default on
16 many *nix platforms, as well as MinGW and Cygwin. If coreutils is not
17 available, a compatible version of sha1sum can be built from
Jerome Jiang24b43c42021-03-09 00:07:0218 source[7]. These requirements are optional if not running the unit
John Koleszar00748632012-06-20 21:45:2219 tests.
John Koleszar94c52e42010-06-18 16:39:2120
James Zernd699ef42025-01-13 21:15:0421 [0]: https://www.nasm.us/
John Koleszar0ea50ce2010-05-18 15:58:3322 [1]: http://www.tortall.net/projects/yasm
Johann7a9a46f2018-03-19 23:46:0623 [2]: For Visual Studio the base yasm binary (not vsyasm) should be in the
24 PATH for Visual Studio. For VS2017 it is sufficient to rename
25 yasm-<version>-<arch>.exe to yasm.exe and place it in:
26 Program Files (x86)/Microsoft Visual Studio/2017/<level>/Common7/Tools/
James Zernc358ac42025-01-14 21:06:2827 The MSYS2 version of the yasm binary can also be used and avoids an
28 issue caused by a missing Visual C++ Redistributable install (Visual
29 Studio 2010, MSVCR100.dll).
Johann7a9a46f2018-03-19 23:46:0630 [3]: http://www.cygwin.com
Jerome Jiang24b43c42021-03-09 00:07:0231 [4]: http://www.msys2.org/
32 [5]: http://www.doxygen.org
33 [6]: http://curl.haxx.se
34 [7]: http://www.microbrew.org/tools/md5sha1sum/
John Koleszar94c52e42010-06-18 16:39:2135
John Koleszar0ea50ce2010-05-18 15:58:3336 2. Out-of-tree builds
37 Out of tree builds are a supported method of building the application. For
38 an out of tree build, the source tree is kept separate from the object
39 files produced during compilation. For instance:
40
41 $ mkdir build
42 $ cd build
43 $ ../libvpx/configure <options>
44 $ make
45
46 3. Configuration options
47 The 'configure' script supports a number of options. The --help option can be
48 used to get a list of supported options:
49 $ ../libvpx/configure --help
50
Johann20521c32018-03-27 19:59:1551 4. Compiler analyzers
52 Compilers have added sanitizers which instrument binaries with information
53 about address calculation, memory usage, threading, undefined behavior, and
54 other common errors. To simplify building libvpx with some of these features
55 use tools/set_analyzer_env.sh before running configure. It will set the
56 compiler and necessary flags for building as well as environment variables
57 read by the analyzer when testing the binaries.
58 $ source ../libvpx/tools/set_analyzer_env.sh address
59
60 5. Cross development
John Koleszar0ea50ce2010-05-18 15:58:3361 For cross development, the most notable option is the --target option. The
62 most up-to-date list of supported targets can be found at the bottom of the
63 --help output of the configure script. As of this writing, the list of
64 available targets is:
65
Johann0c0a0502016-12-30 00:31:2266 arm64-android-gcc
James Zern77f5c3d2016-07-28 05:10:0967 arm64-darwin-gcc
James Zern979e27c2020-09-25 20:21:1168 arm64-darwin20-gcc
James Zern3d57fb62023-05-06 01:56:5969 arm64-darwin21-gcc
70 arm64-darwin22-gcc
James Zernf9b7c852023-12-04 21:25:0171 arm64-darwin23-gcc
James Zern6e23d972024-11-19 20:29:5972 arm64-darwin24-gcc
James Zern77f5c3d2016-07-28 05:10:0973 arm64-linux-gcc
Johannb85ac112019-02-01 21:49:0074 arm64-win64-gcc
Jon Kunkeee6f889c2018-11-12 21:40:5675 arm64-win64-vs15
James Zern3fe13652023-05-05 23:56:5176 arm64-win64-vs16
77 arm64-win64-vs16-clangcl
78 arm64-win64-vs17
79 arm64-win64-vs17-clangcl
Fritz Koenigd8305732012-01-06 19:50:0580 armv7-android-gcc
Paweł Hajdan9ab47772013-08-02 03:08:4281 armv7-darwin-gcc
John Koleszar0ea50ce2010-05-18 15:58:3382 armv7-linux-rvct
83 armv7-linux-gcc
Paweł Hajdan9ab47772013-08-02 03:08:4284 armv7-none-rvct
Johannb85ac112019-02-01 21:49:0085 armv7-win32-gcc
Ghislain MARY3067c342015-07-28 14:37:0986 armv7-win32-vs14
Gregor Jasnybcfd9c92017-05-23 07:30:4487 armv7-win32-vs15
James Zernf9b7c852023-12-04 21:25:0188 armv7-win32-vs16
89 armv7-win32-vs17
Tom Finegancd2088b2014-06-11 01:52:5890 armv7s-darwin-gcc
James Zern77f5c3d2016-07-28 05:10:0991 armv8-linux-gcc
James Zern3d57fb62023-05-06 01:56:5992 loongarch32-linux-gcc
93 loongarch64-linux-gcc
John Koleszar0ea50ce2010-05-18 15:58:3394 mips32-linux-gcc
Gordana Cmiljanovic1c31e3e2014-08-07 17:09:4795 mips64-linux-gcc
Johannf80be222018-01-04 18:54:2896 ppc64le-linux-gcc
Paweł Hajdan9ab47772013-08-02 03:08:4297 sparc-solaris-gcc
98 x86-android-gcc
John Koleszar0ea50ce2010-05-18 15:58:3399 x86-darwin8-gcc
100 x86-darwin8-icc
101 x86-darwin9-gcc
102 x86-darwin9-icc
Paweł Hajdan9ab47772013-08-02 03:08:42103 x86-darwin10-gcc
104 x86-darwin11-gcc
105 x86-darwin12-gcc
106 x86-darwin13-gcc
Johannbb5a39c2015-03-23 22:33:17107 x86-darwin14-gcc
James Zern77f5c3d2016-07-28 05:10:09108 x86-darwin15-gcc
Jerome Jiang6d38ad42017-01-27 01:53:00109 x86-darwin16-gcc
Johannb85ac112019-02-01 21:49:00110 x86-darwin17-gcc
Tom Finegancd2088b2014-06-11 01:52:58111 x86-iphonesimulator-gcc
John Koleszar0ea50ce2010-05-18 15:58:33112 x86-linux-gcc
113 x86-linux-icc
Paweł Hajdan9ab47772013-08-02 03:08:42114 x86-os2-gcc
John Koleszar0ea50ce2010-05-18 15:58:33115 x86-solaris-gcc
Paweł Hajdan9ab47772013-08-02 03:08:42116 x86-win32-gcc
Ghislain MARY3067c342015-07-28 14:37:09117 x86-win32-vs14
Gregor Jasnybcfd9c92017-05-23 07:30:44118 x86-win32-vs15
Johanndaefbf22019-10-29 17:19:43119 x86-win32-vs16
Gregor Jasnycafe7cc2022-02-10 08:01:49120 x86-win32-vs17
James Zern5da87e82015-07-24 21:24:20121 x86_64-android-gcc
John Koleszar0ea50ce2010-05-18 15:58:33122 x86_64-darwin9-gcc
Paweł Hajdan9ab47772013-08-02 03:08:42123 x86_64-darwin10-gcc
124 x86_64-darwin11-gcc
125 x86_64-darwin12-gcc
126 x86_64-darwin13-gcc
Johannbb5a39c2015-03-23 22:33:17127 x86_64-darwin14-gcc
James Zern77f5c3d2016-07-28 05:10:09128 x86_64-darwin15-gcc
Jerome Jiang6d38ad42017-01-27 01:53:00129 x86_64-darwin16-gcc
Johannb85ac112019-02-01 21:49:00130 x86_64-darwin17-gcc
Johann5ed18012019-10-23 17:50:31131 x86_64-darwin18-gcc
Johann3ef630a2020-03-31 06:52:30132 x86_64-darwin19-gcc
James Zern979e27c2020-09-25 20:21:11133 x86_64-darwin20-gcc
James Zern3d57fb62023-05-06 01:56:59134 x86_64-darwin21-gcc
135 x86_64-darwin22-gcc
James Zernf9b7c852023-12-04 21:25:01136 x86_64-darwin23-gcc
James Zern6e23d972024-11-19 20:29:59137 x86_64-darwin24-gcc
Tom Finegancd2088b2014-06-11 01:52:58138 x86_64-iphonesimulator-gcc
John Koleszar0ea50ce2010-05-18 15:58:33139 x86_64-linux-gcc
Paweł Hajdan9ab47772013-08-02 03:08:42140 x86_64-linux-icc
John Koleszar0ea50ce2010-05-18 15:58:33141 x86_64-solaris-gcc
Paweł Hajdan9ab47772013-08-02 03:08:42142 x86_64-win64-gcc
Ghislain MARY3067c342015-07-28 14:37:09143 x86_64-win64-vs14
Gregor Jasnybcfd9c92017-05-23 07:30:44144 x86_64-win64-vs15
Johanndaefbf22019-10-29 17:19:43145 x86_64-win64-vs16
Gregor Jasnycafe7cc2022-02-10 08:01:49146 x86_64-win64-vs17
John Koleszar0ea50ce2010-05-18 15:58:33147 generic-gnu
148
149 The generic-gnu target, in conjunction with the CROSS environment variable,
150 can be used to cross compile architectures that aren't explicitly listed, if
151 the toolchain is a cross GNU (gcc/binutils) toolchain. Other POSIX toolchains
152 will likely work as well. For instance, to build using the mipsel-linux-uclibc
153 toolchain, the following command could be used (note, POSIX SH syntax, adapt
154 to your shell as necessary):
155
Johanna31a58d2010-10-07 18:13:36156 $ CROSS=mipsel-linux-uclibc- ../libvpx/configure
John Koleszar0ea50ce2010-05-18 15:58:33157
158 In addition, the executables to be invoked can be overridden by specifying the
James Zernb0c9d0c2024-06-11 20:46:00159 environment variables: AR, AS, CC, CXX, LD, STRIP. Additional flags can be
160 passed to these executables with ASFLAGS, CFLAGS, CXXFLAGS, and LDFLAGS.
John Koleszar0ea50ce2010-05-18 15:58:33161
Johann20521c32018-03-27 19:59:15162 6. Configuration errors
John Koleszar0ea50ce2010-05-18 15:58:33163 If the configuration step fails, the first step is to look in the error log.
James Zerne636af12013-07-18 21:17:00164 This defaults to config.log. This should give a good indication of what went
John Koleszar0ea50ce2010-05-18 15:58:33165 wrong. If not, contact us for support.
166
James Zern4bbca2e2014-05-30 23:37:39167VP8/VP9 TEST VECTORS:
168 The test vectors can be downloaded and verified using the build system after
169 running configure. To specify an alternate directory the
170 LIBVPX_TEST_DATA_PATH environment variable can be used.
171
172 $ ./configure --enable-unit-tests
173 $ LIBVPX_TEST_DATA_PATH=../libvpx-test-data make testdata
174
James Zern15f29ef2016-07-28 05:16:51175CODE STYLE:
176 The coding style used by this project is enforced with clang-format using the
177 configuration contained in the .clang-format file in the root of the
178 repository.
179
180 Before pushing changes for review you can format your code with:
181 # Apply clang-format to modified .c, .h and .cc files
182 $ clang-format -i --style=file \
183 $(git diff --name-only --diff-filter=ACMR '*.[hc]' '*.cc')
184
185 Check the .clang-format file for the version used to generate it if there is
186 any difference between your local formatting and the review system.
187
188 See also: http://clang.llvm.org/docs/ClangFormat.html
189
Zoltan Kuscsik7eec1092023-12-13 15:13:00190PROFILE GUIDED OPTIMIZATION (PGO)
James Zern84082512024-02-05 21:19:30191 Profile Guided Optimization can be enabled for Clang builds using the
192 commands:
Zoltan Kuscsik7eec1092023-12-13 15:13:00193
194 $ export CC=clang
195 $ export CXX=clang++
James Zern84082512024-02-05 21:19:30196 $ ../libvpx/configure --enable-profile
Zoltan Kuscsik7eec1092023-12-13 15:13:00197 $ make
198
James Zern84082512024-02-05 21:19:30199 Generate one or multiple PGO profile files by running vpxdec or vpxenc. For
200 example:
Zoltan Kuscsik7eec1092023-12-13 15:13:00201
James Zern84082512024-02-05 21:19:30202 $ ./vpxdec ../vpx/out_ful/vp90-2-sintel_1280x546_tile_1x4_1257kbps.webm \
203 -o - > /dev/null
Zoltan Kuscsik7eec1092023-12-13 15:13:00204
205 To convert and merge the raw profile files, use the llvm-profdata tool:
206
James Zern84082512024-02-05 21:19:30207 $ llvm-profdata merge -o perf.profdata default_8382761441159425451_0.profraw
Zoltan Kuscsik7eec1092023-12-13 15:13:00208
209 Then, rebuild the project with the new profile file:
210
211 $ make clean
James Zern84082512024-02-05 21:19:30212 $ ../libvpx/configure --use-profile=perf.profdata
Zoltan Kuscsik7eec1092023-12-13 15:13:00213 $ make
214
James Zern84082512024-02-05 21:19:30215 Note: Always use the llvm-profdata from the toolchain that is used for
216 compiling the PGO-enabled binary.
Zoltan Kuscsik7eec1092023-12-13 15:13:00217
James Zern84082512024-02-05 21:19:30218 To observe the improvements from a PGO-enabled build, enable and compare the
219 list of failed optimizations by using the -Rpass-missed compiler flag. For
220 example, to list the failed loop vectorizations:
Zoltan Kuscsik7eec1092023-12-13 15:13:00221
James Zern84082512024-02-05 21:19:30222 $ ../libvpx/configure --use-profile=perf.profdata \
223 --extra-cflags=-Rpass-missed=loop-vectorize
Zoltan Kuscsik7eec1092023-12-13 15:13:00224
James Zern84082512024-02-05 21:19:30225 For guidance on utilizing PGO files to identify potential optimization
226 opportunities, see: tools/README.pgo.md
Zoltan Kuscsikc6a8fa22024-02-01 08:18:04227
John Koleszar0ea50ce2010-05-18 15:58:33228SUPPORT
229 This library is an open source project supported by its community. Please
James Zern5ea87122016-07-28 05:10:02230 email [email protected] for help.
John Koleszar0ea50ce2010-05-18 15:58:33231
James Zern9a1e8ae2024-07-18 22:24:12232BUG REPORTS
233 Bug reports can be filed in the libvpx issue tracker:
234 https://issues.webmproject.org/.
James Zern50aa6cc2024-08-26 22:30:01235 For security reports, select 'Security report' from the Template dropdown.