Alliance for Open Media Video Codec reference implementation (Mozilla branch)
Перейти к файлу
Ralph Giles 46b7bb243b
Merge pull request #8 from Mozilla-GitHub-Standards/master
Add Mozilla Code of Conduct
2019-03-31 20:33:42 -07:00
aom scaling: Add kf numerator for resize and superres 2017-06-16 22:14:57 +00:00
aom_dsp Fwd txfm and quantizer HBD/LBD data paths co-exist 2017-06-28 17:40:28 +00:00
aom_mem Build static libaom without internal deps in CMake. 2017-06-20 19:57:02 +00:00
aom_ports Build static libaom without internal deps in CMake. 2017-06-20 19:57:02 +00:00
aom_scale Build static libaom without internal deps in CMake. 2017-06-20 19:57:02 +00:00
aom_util Build static libaom without internal deps in CMake. 2017-06-20 19:57:02 +00:00
av1 Add NCOBMC_ADAPT_WEIGHT as another motion mode 2017-06-28 23:09:25 +00:00
build Sync CMake build with the configure build. 2017-06-28 22:08:44 +00:00
examples analyzer: support high bitdepth and low bitdepth 2017-06-28 19:58:28 -04:00
test Remove references to a previously removed variable 2017-06-28 23:39:16 +00:00
third_party Suppress some static analysis issues 2017-04-30 21:58:18 +00:00
tools AV1 offline probability optimizer 2017-06-29 03:25:01 +00:00
.clang-format .clang-format: update to 3.9.1 2017-02-15 22:24:03 -08:00
.gitattributes Initial WebM release 2010-05-18 11:58:33 -04:00
.gitignore vp8_multi_resolution_encoder.sh: remove file 2016-09-09 18:46:40 +00:00
.mailmap Strip redundant entries from .mailmap 2015-12-07 09:03:00 -08:00
AUTHORS Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
CHANGELOG Remove armv6 references from the build system. 2017-05-15 19:06:31 +00:00
CMakeLists.txt Add shared library support to the CMake build. 2017-06-20 19:24:53 +00:00
CODE_OF_CONDUCT.md Add Mozilla Code of Conduct file 2019-03-30 00:09:49 -07:00
LICENSE Use AOMedia's Patents and LICENSE files 2016-09-06 16:09:03 -07:00
PATENTS Use AOMedia's Patents and LICENSE files 2016-09-06 16:09:03 -07:00
README Add README.md. 2017-06-13 15:14:39 +00:00
README.md Make sure Python is present before pulling in gtest. 2017-06-21 02:25:59 +00:00
aomdec.c Fix unit tests with --disable-lowbitdepth 2017-06-15 18:27:52 +00:00
aomenc.c scaling: Fix scaling numerator arguments for KFs 2017-06-23 21:59:58 +00:00
aomenc.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
aomstats.c Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
aomstats.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
args.c args.c: fix range check in int/uint 2017-04-05 05:46:17 +00:00
args.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
codereview.settings codereview.settings: update gerrit info 2017-03-01 00:46:10 +00:00
configure AV1 offline probability optimizer 2017-06-29 03:25:01 +00:00
docs.cmake Add doxygen template to CMake docs target. 2017-06-06 20:20:44 +00:00
docs.mk change to use aomedia copyright notice 2016-09-23 15:37:36 -07:00
examples.mk Remove CONFIG_{DE,EN}CODERS from the build system. 2017-05-24 19:08:40 +00:00
ivfdec.c Cast allocated pointers to proper types. 2017-03-09 01:34:26 +00:00
ivfdec.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
ivfenc.c Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
ivfenc.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
keywords.dox Initial WebM release 2010-05-18 11:58:33 -04:00
libs.doxy_template Remove doxygen XML configuration. 2017-05-30 07:36:16 -07:00
libs.mk Remove CONFIG_{DE,EN}CODERS from the build system. 2017-05-24 19:08:40 +00:00
mainpage.dox Port renaming changes from AOMedia 2016-08-31 18:19:03 -07:00
md5_utils.c Port renaming changes from AOMedia 2016-08-31 18:19:03 -07:00
md5_utils.h top-level: add extern "C" to headers 2014-01-23 19:42:59 -08:00
rate_hist.c Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
rate_hist.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
solution.mk Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
tools.mk AV1 offline probability optimizer 2017-06-29 03:25:01 +00:00
tools_common.c Remove CONFIG_{DE,EN}CODERS from the CMake build. 2017-05-22 22:35:37 +00:00
tools_common.h Remove CONFIG_{DE,EN}CODERS from the CMake build. 2017-05-22 22:35:37 +00:00
usage.dox Port renaming changes from AOMedia 2016-08-31 18:19:03 -07:00
usage_cx.dox Port renaming changes from AOMedia 2016-08-31 18:19:03 -07:00
usage_dx.dox Port renaming changes from AOMedia 2016-08-31 18:19:03 -07:00
video_common.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
video_reader.c Cast allocated pointers to proper types. 2017-03-09 01:34:26 +00:00
video_reader.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
video_writer.c Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
video_writer.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
warnings.c Remove rt deadline. 2017-04-17 23:17:34 +00:00
warnings.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
webmdec.cc webm_read_frame: avoid NULL dereference 2017-04-28 02:14:48 +00:00
webmdec.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
webmenc.cc Add compiler warning flag -Wextra and fix related warnings. 2016-10-20 15:49:16 -07:00
webmenc.h Add compiler warning flag -Wextra and fix related warnings. 2016-10-20 15:49:16 -07:00
y4menc.c apply clang-format 2017-02-15 22:27:12 -08:00
y4menc.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
y4minput.c Change to use aom copyright notice 2016-09-02 08:22:07 -07:00
y4minput.h Change to use aom copyright notice 2016-09-02 08:22:07 -07:00

README.md

AV1 Codec Library

Building the library and applications

Prerequisites

  1. CMake version 3.5 or higher.
  2. Git.
  3. Perl.
  4. For x86 targets, yasm, which is preferred, or a recent version of nasm.
  5. Building the documentation requires doxygen.
  6. Building the unit tests requires Python.

Basic build

CMake replaces the configure step typical of many projects. Running CMake will produce configuration and build files for the currently selected CMake generator. For most systems the default generator is Unix Makefiles. The basic form of a makefile build is the following:

$ cmake path/to/aom
$ make

The above will generate a makefile build that produces the AV1 library and applications for the current host system after the make step completes successfully. The compiler chosen varies by host platform, but a general rule applies: On systems where cc and c++ are present in $PATH at the time CMake is run the generated build will use cc and c++ by default.

Configuration options

The AV1 codec library has a great many configuration options. These come in two varieties:

  1. Build system configuration options. These have the form ENABLE_FEATURE.
  2. AV1 codec configuration options. These have the form CONFIG_FEATURE.

Both types of options are set at the time CMake is run. The following example enables ccache and disables high bit depth:

$ cmake path/to/aom -DENABLE_CCACHE=1 -DCONFIG_HIGHBITDEPTH=0
$ make

The available configuration options are too numerous to list here. Build system configuration options can be found at the top of the CMakeLists.txt file found in the root of the AV1 repository, and AV1 codec configuration options can currently be found in the file build/cmake/aom_config_defaults.cmake.

Dylib builds

A dylib (shared object) build of the AV1 codec library can be enabled via the CMake built in variable BUILD_SHARED_LIBS:

$ cmake path/to/aom -D BUILD_SHARED_LIBS=1
$ make

This is currently only supported on non-Windows targets.

Cross compiling

For the purposes of building the AV1 codec and applications and relative to the scope of this guide, all builds for architectures differing from the native host architecture will be considered cross compiles. The AV1 CMake build handles cross compiling via the use of toolchain files included in the AV1 repository. The toolchain files available at the time of this writing are:

  • arm64-ios.cmake
  • arm64-linux-gcc.cmake
  • armv7-ios.cmake
  • armv7-linux-gcc.cmake
  • armv7s-ios.cmake
  • mips32-linux-gcc.cmake
  • mips64-linux-gcc.cmake
  • x86-ios-simulator.cmake
  • x86-linux.cmake
  • x86-macos.cmake
  • x86_64-ios-simulator.cmake

The following example demonstrates use of the x86-macos.cmake toolchain file on a x86_64 MacOS host:

$ cmake path/to/aom \
  -DCMAKE_TOOLCHAIN_FILE=path/to/aom/build/cmake/toolchains/x86-macos.cmake
$ make

To build for an unlisted target creation of a new toolchain file is the best solution. The existing toolchain files can be used a starting point for a new toolchain file since each one exposes the basic requirements for toolchain files as used in the AV1 codec build.

As a temporary work around an unoptimized AV1 configuration that builds only C and C++ sources can be produced using the following commands:

$ cmake path/to/aom -DAOM_TARGET_CPU=generic
$ make

In addition to the above it's important to note that the toolchain files suffixed with gcc behave differently than the others. These toolchain files attempt to obey the $CROSS environment variable.

Microsoft Visual Studio builds

Building the AV1 codec library in Microsoft Visual Studio is supported. The following example demonstrates generating projects and a solution for the Microsoft IDE:

# This does not require a bash shell; command.exe is fine.
$ cmake path/to/aom -G "Visual Studio 15 2017"

Xcode builds

Building the AV1 codec library in Xcode is supported. The following example demonstrates generating an Xcode project:

$ cmake path/to/aom -G Xcode

Testing the AV1 codec

Testing basics

Currently there are two types of tests in the AV1 codec repository:

  1. Unit tests.
  2. Example tests.

The unit tests can be run at build time:

# Before running the make command the LIBAOM_TEST_DATA_PATH environment
# variable should be set to avoid downloading the test files to the
# cmake build configuration directory.
$ cmake path/to/aom
# Note: The AV1 CMake build creates many test targets. Running make
# with multiple jobs will speed up the test run significantly.
$ make runtests

The example tests require a bash shell and can be run in the following manner:

# See the note above about LIBAOM_TEST_DATA_PATH above.
$ cmake path/to/aom
$ make
# It's best to build the testdata target using many make jobs.
# Running it like this will verify and download (if necessary)
# one at a time, which takes a while.
$ make testdata
$ path/to/aom/test/examples.sh --bin-path examples

IDE hosted tests

By default the generated projects files created by CMake will not include the runtests and testdata rules when generating for IDEs like Microsoft Visual Studio and Xcode. This is done to avoid intolerably long build cycles in the IDEs-- IDE behavior is to build all targets when selecting the build project options in MSVS and Xcode. To enable the test rules in IDEs the ENABLE_IDE_TEST_HOSTING variable must be enabled at CMake generation time:

# This example uses Xcode. To get a list of the generators
# available, run cmake with the -G argument missing its
# value.
$ cmake path/to/aom -DENABLE_IDE_TEST_HOSTING=1 -G Xcode

Downloading the test data

The fastest and easiest way to obtain the test data is to use CMake to generate a build using the Unix Makefiles generator, and then to build only the testdata rule:

$ cmake path/to/aom -G "Unix Makefiles"
# 28 is used because there are 28 test files as of this writing.
$ make -j28 testdata

The above make command will only download and verify the test data.

Coding style

The coding style used by this project is enforced with clang-format using the configuration contained in the .clang-format file in the root of the repository.

Before pushing changes for review you can format your code with:

# Apply clang-format to modified .c, .h and .cc files
$ clang-format -i --style=file \
  $(git diff --name-only --diff-filter=ACMR '*.[hc]' '*.cc')

Check the .clang-format file for the version used to generate it if there is any difference between your local formatting and the review system.

See also: http://clang.llvm.org/docs/ClangFormat.html

Support

This library is an open source project supported by its community. Please please email aomediacodec@jointdevelopment.kavi.com for help.

Bug reports

Bug reports can be filed in the Alliance for Open Media issue tracker.