rav1e
The fastest and safest AV1 encoder.
Overview
rav1e is an AV1 video encoder. It is designed to eventually cover all use cases, though in its current form it is most suitable for cases where libaom (the reference encoder) is too slow.
Features
- Intra, inter, and switch frames
- 64x64 superblocks
- 4x4 to 64x64 RDO-selected square and 2:1/1:2 rectangular blocks
- DC, H, V, Paeth, smooth, and all directional prediction modes
- DCT, (FLIP-)ADST and identity transforms (up to 64x64, 16x16 and 32x32 respectively)
- 8-, 10- and 12-bit depth color
- 4:2:0 (full support), 4:2:2 and 4:4:4 (limited) chroma sampling
- 11 speed settings (0-10)
- Near real-time encoding at high speed levels
- Constant quantizer and target bitrate (single- and multi-pass) encoding modes
- Still picture mode
Releases
For the foreseeable future, a weekly pre-release of rav1e will be published every Tuesday.
Windows builds
Automated AppVeyor builds can be found here. Click on a build (it is recommended you select a build based on "master"), then click ARTIFACTS to reveal the rav1e.exe download link.
Building
NASM
Some x86_64
-specific optimizations require a recent version of NASM and are enabled by default.
ubuntu 20.04
ubuntu 18.04
# link nasm into $PATH
fedora 31, 32
windows Have a NASM binary in your system PATH.
release binary
To build release binary in target/release/rav1e
run:
cargo build --release
Target-specific builds
The rust autovectorizer can produce a binary that is about 6%-7% faster if it can use avx2
in the general code, you may allow it by issuing:
RUSTFLAGS="-C target-cpu=native" cargo build --release
or
RUSTFLAGS="-C target-feature=+avx2,+fma" cargo build --release
The resulting binary will not work on cpus that do not sport the same set of SIMD extensions enabled.
Building the C-API
rav1e provides a C-compatible set of library, header and pkg-config file.
To build and install it you can use cargo-c:
Compressing video
Input videos must be in y4m format. The monochrome color format is not supported.
Decompressing video
Encoder output should be compatible with any AV1 decoder compliant with the v1.0.0 specification. You can build compatible aomdec using the following:
Configuring
rav1e has several optional features that can be enabled by passing --features to cargo test. Passing --all-features is discouraged.
- asm - enabled by default. When enabled, assembly is built for the platforms supporting it.
- It requires
nasm
onx86_64
. - It requires
gas
onaarch64
.
- It requires
NOTE: SSE2
is always enabled on x86_64
, neon
is always enabled for aarch64, you may set the environment variable RAV1E_CPU_TARGET
to rust
to disable all the assembly-optimized routines at the runtime.
Using the AOMAnalyzer
Local Analyzer
- Download the AOM Analyzer.
- Download inspect.js and inspect.wasm and save them in the same directory.
- Run the analyzer:
AOMAnalyzer path_to_inspect.js output.ivf
Online Analyzer
If your .ivf
file is hosted somewhere (and CORS is enabled on your web server) you can use:
https://arewecompressedyet.com/analyzer/?d=https://people.xiph.org/~mbebenita/analyzer/inspect.js&f=path_to_output.ivf
Design
- src/context.rs - High-level functions that write symbols to the bitstream, and maintain context.
- src/ec.rs - Low-level implementation of the entropy coder, which directly writes the bitstream.
- src/lib.rs - The top level library, contains code to write headers, manage buffers, and iterate through each superblock.
- src/partition.rs - Functions and enums to manage partitions (subdivisions of a superblock).
- src/predict.rs - Intra prediction implementations.
- src/quantize.rs - Quantization and dequantization functions for coefficients.
- src/rdo.rs - RDO-related structures and distortion computation functions.
- src/transform/*.rs - Implementations of DCT and ADST transforms.
- src/util.rs - Misc utility code.
- src/bin/rav1e.rs - rav1e command line tool.
Contributing
Please read our guide to contributing to rav1e.
Getting in Touch
Come chat with us on the IRC channel #daala on Freenode! If you don't have IRC set up you can easily connect from your web browser.