1*c0909341SAndroid Build Coastguard Worker 2*c0909341SAndroid Build Coastguard Worker 3*c0909341SAndroid Build Coastguard Worker# dav1d 4*c0909341SAndroid Build Coastguard Worker 5*c0909341SAndroid Build Coastguard Worker**dav1d** is an **AV1** cross-platform **d**ecoder, open-source, and focused on speed and correctness. 6*c0909341SAndroid Build Coastguard Worker 7*c0909341SAndroid Build Coastguard WorkerIt is now battle-tested and production-ready and can be used everywhere. 8*c0909341SAndroid Build Coastguard Worker 9*c0909341SAndroid Build Coastguard WorkerThe canonical repository URL for this repo is https://code.videolan.org/videolan/dav1d 10*c0909341SAndroid Build Coastguard Worker 11*c0909341SAndroid Build Coastguard WorkerThis project was partially funded by the *Alliance for Open Media*/**AOM**. 12*c0909341SAndroid Build Coastguard Worker 13*c0909341SAndroid Build Coastguard Worker## Goal and Features 14*c0909341SAndroid Build Coastguard Worker 15*c0909341SAndroid Build Coastguard WorkerThe goal of this project is to provide a decoder for **most platforms**, and achieve the **highest speed** possible to overcome the temporary lack of AV1 hardware decoder. 16*c0909341SAndroid Build Coastguard Worker 17*c0909341SAndroid Build Coastguard WorkerIt supports all features from AV1, including all subsampling and bit-depth parameters. 18*c0909341SAndroid Build Coastguard Worker 19*c0909341SAndroid Build Coastguard WorkerIn the future, this project will host simple tools or simple wrappings *(like, for example, an MFT transform)*. 20*c0909341SAndroid Build Coastguard Worker 21*c0909341SAndroid Build Coastguard Worker## License 22*c0909341SAndroid Build Coastguard Worker 23*c0909341SAndroid Build Coastguard Worker**dav1d** is released under a very liberal license, a contrario from the other VideoLAN projects, so that it can be embedded anywhere, including non-open-source software; or even drivers, to allow the creation of hybrid decoders. 24*c0909341SAndroid Build Coastguard Worker 25*c0909341SAndroid Build Coastguard WorkerThe reasoning behind this decision is the same as for libvorbis, see [RMS on vorbis](https://lwn.net/2001/0301/a/rms-ov-license.php3). 26*c0909341SAndroid Build Coastguard Worker 27*c0909341SAndroid Build Coastguard Worker# Roadmap 28*c0909341SAndroid Build Coastguard Worker 29*c0909341SAndroid Build Coastguard WorkerThe plan is the following: 30*c0909341SAndroid Build Coastguard Worker 31*c0909341SAndroid Build Coastguard Worker### Reached 32*c0909341SAndroid Build Coastguard Worker1. Complete C implementation of the decoder, 33*c0909341SAndroid Build Coastguard Worker2. Provide a usable API, 34*c0909341SAndroid Build Coastguard Worker3. Port to most platforms, 35*c0909341SAndroid Build Coastguard Worker4. Make it fast on desktop, by writing asm for AVX2 chips. 36*c0909341SAndroid Build Coastguard Worker5. Make it fast on mobile, by writing asm for ARMv8 chips, 37*c0909341SAndroid Build Coastguard Worker6. Make it fast on older desktop, by writing asm for SSSE3+ chips, 38*c0909341SAndroid Build Coastguard Worker7. Make high bit-depth fast on mobile, by writing asm for ARMv8 chips. 39*c0909341SAndroid Build Coastguard Worker8. Make it fast on older mobile, by writing asm for ARMv7 chips, 40*c0909341SAndroid Build Coastguard Worker9. Make high bit-depth fast on older mobile, by writing asm for ARMv7 chips, 41*c0909341SAndroid Build Coastguard Worker10. Make high bit-depth fast on desktop, by writing asm for AVX2 chips, 42*c0909341SAndroid Build Coastguard Worker11. Make high bit-depth fast on older desktop, by writing asm for SSSE3+ chips, 43*c0909341SAndroid Build Coastguard Worker12. Improve threading. 44*c0909341SAndroid Build Coastguard Worker 45*c0909341SAndroid Build Coastguard Worker### On-going 46*c0909341SAndroid Build Coastguard Worker13. Improve C code base with [various tweaks](https://code.videolan.org/videolan/dav1d/wikis/task-list), 47*c0909341SAndroid Build Coastguard Worker14. Accelerate for less common architectures, like PPC, SSE2, RISC-V or AVX-512. 48*c0909341SAndroid Build Coastguard Worker 49*c0909341SAndroid Build Coastguard Worker### After 50*c0909341SAndroid Build Coastguard Worker15. Use more GPU decoding, when possible. 51*c0909341SAndroid Build Coastguard Worker 52*c0909341SAndroid Build Coastguard Worker# Contribute 53*c0909341SAndroid Build Coastguard Worker 54*c0909341SAndroid Build Coastguard WorkerCurrently, we are looking for help from: 55*c0909341SAndroid Build Coastguard Worker- C developers, 56*c0909341SAndroid Build Coastguard Worker- asm developers, 57*c0909341SAndroid Build Coastguard Worker- platform-specific developers, 58*c0909341SAndroid Build Coastguard Worker- GPGPU developers, 59*c0909341SAndroid Build Coastguard Worker- testers. 60*c0909341SAndroid Build Coastguard Worker 61*c0909341SAndroid Build Coastguard WorkerOur contributions guidelines are quite strict. We want to build a coherent codebase to simplify maintenance and achieve the highest possible speed. 62*c0909341SAndroid Build Coastguard Worker 63*c0909341SAndroid Build Coastguard WorkerNotably, the codebase is in pure C and asm. 64*c0909341SAndroid Build Coastguard Worker 65*c0909341SAndroid Build Coastguard WorkerWe are on IRC, on the **#dav1d** channel on [*Libera.chat*](http://libera.chat/). If you do not have an IRC Client at hand, use [IRC Web Interface](https://web.libera.chat/#dav1d). 66*c0909341SAndroid Build Coastguard Worker 67*c0909341SAndroid Build Coastguard WorkerSee the [contributions document](CONTRIBUTING.md). 68*c0909341SAndroid Build Coastguard Worker 69*c0909341SAndroid Build Coastguard Worker## CLA 70*c0909341SAndroid Build Coastguard Worker 71*c0909341SAndroid Build Coastguard WorkerThere is no CLA. 72*c0909341SAndroid Build Coastguard Worker 73*c0909341SAndroid Build Coastguard WorkerPeople will keep their copyright and their authorship rights, while adhering to the BSD 2-clause license. 74*c0909341SAndroid Build Coastguard Worker 75*c0909341SAndroid Build Coastguard WorkerVideoLAN will only have the collective work rights. 76*c0909341SAndroid Build Coastguard Worker 77*c0909341SAndroid Build Coastguard Worker## CoC 78*c0909341SAndroid Build Coastguard Worker 79*c0909341SAndroid Build Coastguard WorkerThe [VideoLAN Code of Conduct](https://wiki.videolan.org/CoC) applies to this project. 80*c0909341SAndroid Build Coastguard Worker 81*c0909341SAndroid Build Coastguard Worker# Compile 82*c0909341SAndroid Build Coastguard Worker 83*c0909341SAndroid Build Coastguard Worker1. Install [Meson](https://mesonbuild.com/) (0.49 or higher), [Ninja](https://ninja-build.org/), and, for x86\* targets, [nasm](https://nasm.us/) (2.14 or higher) 84*c0909341SAndroid Build Coastguard Worker2. Run `mkdir build && cd build` to create a build directory and enter it 85*c0909341SAndroid Build Coastguard Worker3. Run `meson setup ..` to configure meson, add `--default-library=static` if static linking is desired 86*c0909341SAndroid Build Coastguard Worker4. Run `ninja` to compile 87*c0909341SAndroid Build Coastguard Worker 88*c0909341SAndroid Build Coastguard Worker## Cross-Compilation for 32- or 64-bit Windows, 32-bit Linux 89*c0909341SAndroid Build Coastguard Worker 90*c0909341SAndroid Build Coastguard WorkerIf you're on a linux build machine trying to compile .exe for a Windows target/host machine, run 91*c0909341SAndroid Build Coastguard Worker 92*c0909341SAndroid Build Coastguard Worker``` 93*c0909341SAndroid Build Coastguard Workermeson setup build --cross-file=package/crossfiles/x86_64-w64-mingw32.meson 94*c0909341SAndroid Build Coastguard Worker``` 95*c0909341SAndroid Build Coastguard Worker 96*c0909341SAndroid Build Coastguard Workeror, for 32-bit: 97*c0909341SAndroid Build Coastguard Worker 98*c0909341SAndroid Build Coastguard Worker``` 99*c0909341SAndroid Build Coastguard Workermeson setup build --cross-file=package/crossfiles/i686-w64-mingw32.meson 100*c0909341SAndroid Build Coastguard Worker``` 101*c0909341SAndroid Build Coastguard Worker 102*c0909341SAndroid Build Coastguard Worker`mingw-w64` is a pre-requisite and should be installed on your linux machine via your preferred method or package manager. Note the binary name formats may differ between distributions. Verify the names, and use `alias` if certain binaries cannot be found. 103*c0909341SAndroid Build Coastguard Worker 104*c0909341SAndroid Build Coastguard WorkerFor 32-bit linux, run 105*c0909341SAndroid Build Coastguard Worker 106*c0909341SAndroid Build Coastguard Worker``` 107*c0909341SAndroid Build Coastguard Workermeson setup build --cross-file=package/crossfiles/i686-linux32.meson 108*c0909341SAndroid Build Coastguard Worker``` 109*c0909341SAndroid Build Coastguard Worker 110*c0909341SAndroid Build Coastguard Worker## Build documentation 111*c0909341SAndroid Build Coastguard Worker 112*c0909341SAndroid Build Coastguard Worker1. Install [doxygen](https://www.doxygen.nl/) and [graphviz](https://www.graphviz.org/) 113*c0909341SAndroid Build Coastguard Worker2. Run `meson setup build -Denable_docs=true` to create the build directory 114*c0909341SAndroid Build Coastguard Worker3. Run `ninja -C build doc/html` to build the docs 115*c0909341SAndroid Build Coastguard Worker 116*c0909341SAndroid Build Coastguard WorkerThe result can be found in `build/doc/html/`. An online version built from master can be found [here](https://videolan.videolan.me/dav1d/). 117*c0909341SAndroid Build Coastguard Worker 118*c0909341SAndroid Build Coastguard Worker# Run tests 119*c0909341SAndroid Build Coastguard Worker 120*c0909341SAndroid Build Coastguard Worker1. In the root directory, run `git clone https://code.videolan.org/videolan/dav1d-test-data.git tests/dav1d-test-data` to fetch the test data repository 121*c0909341SAndroid Build Coastguard Worker2. During meson configuration, specify `-Dtestdata_tests=true` 122*c0909341SAndroid Build Coastguard Worker3. Run `meson test -v` after compiling 123*c0909341SAndroid Build Coastguard Worker 124*c0909341SAndroid Build Coastguard Worker# Support 125*c0909341SAndroid Build Coastguard Worker 126*c0909341SAndroid Build Coastguard WorkerThis project is partially funded by the *Alliance for Open Media*/**AOM** and is supported by TwoOrioles and VideoLabs. 127*c0909341SAndroid Build Coastguard Worker 128*c0909341SAndroid Build Coastguard WorkerThese companies can provide support and integration help, should you need it. 129*c0909341SAndroid Build Coastguard Worker 130*c0909341SAndroid Build Coastguard Worker 131*c0909341SAndroid Build Coastguard Worker# FAQ 132*c0909341SAndroid Build Coastguard Worker 133*c0909341SAndroid Build Coastguard Worker## Why do you not improve libaom rather than starting a new project? 134*c0909341SAndroid Build Coastguard Worker 135*c0909341SAndroid Build Coastguard Worker- We believe that libaom is a very good library. It was however developed for research purposes during AV1 design. 136*c0909341SAndroid Build Coastguard WorkerWe think that an implementation written from scratch can achieve faster decoding, in the same way that *ffvp9* was faster than *libvpx*. 137*c0909341SAndroid Build Coastguard Worker 138*c0909341SAndroid Build Coastguard Worker## Is dav1d a recursive acronym? 139*c0909341SAndroid Build Coastguard Worker 140*c0909341SAndroid Build Coastguard Worker- Yes. 141*c0909341SAndroid Build Coastguard Worker 142*c0909341SAndroid Build Coastguard Worker## Can I help? 143*c0909341SAndroid Build Coastguard Worker 144*c0909341SAndroid Build Coastguard Worker- Yes. See the [contributions document](CONTRIBUTING.md). 145*c0909341SAndroid Build Coastguard Worker 146*c0909341SAndroid Build Coastguard Worker## I am not a developer. Can I help? 147*c0909341SAndroid Build Coastguard Worker 148*c0909341SAndroid Build Coastguard Worker- Yes. We need testers, bug reporters and documentation writers. 149*c0909341SAndroid Build Coastguard Worker 150*c0909341SAndroid Build Coastguard Worker## What about the AV1 patent license? 151*c0909341SAndroid Build Coastguard Worker 152*c0909341SAndroid Build Coastguard Worker- This project is an implementation of a decoder. It gives you no special rights on the AV1 patents. 153*c0909341SAndroid Build Coastguard Worker 154*c0909341SAndroid Build Coastguard WorkerPlease read the [AV1 patent license](doc/PATENTS) that applies to the AV1 specification and codec. 155*c0909341SAndroid Build Coastguard Worker 156*c0909341SAndroid Build Coastguard Worker## Will you care about <my_arch>? <my_os>? 157*c0909341SAndroid Build Coastguard Worker 158*c0909341SAndroid Build Coastguard Worker- We do, but we don't have either the time or the knowledge. Therefore, patches and contributions welcome. 159