README.md 2.59 KB
Newer Older
Thomas Daede's avatar
Thomas Daede committed
1
The fastest and safest AV1 encoder.
Thomas Daede's avatar
Thomas Daede committed
2

Thomas Daede's avatar
Thomas Daede committed
3 4 5 6 7 8 9 10 11 12 13 14
[![Build Status](https://travis-ci.org/xiph/rav1e.svg?branch=master)](https://travis-ci.org/xiph/rav1e)

# Overview

rav1e is an experimental 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.

Because AV1 is not yet frozen, it relies on an exact decoder version and configuration that is periodically updated.

# Features

* Intra frames
* 64x64 superblocks
Raphael Zumer's avatar
Raphael Zumer committed
15 16
* 4x4 to 32x32 RDO-selected square blocks
* DC, H, V, Paeth, and smooth prediction modes
Thomas Daede's avatar
Thomas Daede committed
17
* 4x4 DCT and ADST transforms
Raphael Zumer's avatar
Raphael Zumer committed
18
* ~5 fps encoding @ 480p
Thomas Daede's avatar
Thomas Daede committed
19 20

# Building
21

22 23 24 25 26 27 28 29
This repository uses a git submodule, to initialize it, do:

```
git submodule update --init
```

This is also required everytime you switch branch or pull code and the submodule changed.

30
In order to build the codec, you need yasm. To install this on Ubuntu or Linux Mint, run:
31 32

```
33
sudo apt install yasm
34
```
Thomas Daede's avatar
Thomas Daede committed
35 36 37

# Compressing video

Thomas Daede's avatar
Thomas Daede committed
38
Input videos must be 8-bit 4:2:0, in y4m format.
39

Thomas Daede's avatar
Thomas Daede committed
40
```
41
cargo run --bin rav1e -- input.y4m -o output.ivf
Thomas Daede's avatar
Thomas Daede committed
42 43 44 45
```
# Decompressing video

```
46 47
mkdir aom_test
cd aom_test
Thomas Daede's avatar
Thomas Daede committed
48
cmake ../aom_build/aom -DAOM_TARGET_CPU=generic -DCONFIG_AV1_ENCODER=0 -DCONFIG_UNIT_TESTS=0 -DENABLE_DOCS=0 -DCONFIG_EXT_PARTITION=0 -DCONFIG_EXT_PARTITION_TYPES=0 -DCONFIG_OBU=0 -DCONFIG_FILTER_INTRA=0 -DCONFIG_EXT_SKIP=0 -DCONFIG_LV_MAP=1 -DCONFIG_INTRABC=0 -DCONFIG_MONO_VIDEO=0 -DCONFIG_Q_ADAPT_PROBS=0 -DCONFIG_SCALABILITY=0
Thomas Daede's avatar
Thomas Daede committed
49 50 51
make -j8
./aomdec ../output.ivf -o output.y4m
```
Thomas Daede's avatar
Thomas Daede committed
52 53 54 55

# Design

* src/context.rs - High-level functions that write symbols to the bitstream, and maintain context.
Raphael Zumer's avatar
Raphael Zumer committed
56 57
* 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 throught each superblock.
Thomas Daede's avatar
Thomas Daede committed
58 59 60
* 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.
Raphael Zumer's avatar
Raphael Zumer committed
61
* src/rdo.rs - RDO-related structures and distortion computation functions.
Thomas Daede's avatar
Thomas Daede committed
62 63 64 65
* src/transform.rs - Implementations of DCT and ADST transforms.
* src/bin/rav1e.rs - rav1e command line tool.
* src/bin/rav1erepl.rs - Command line tool for debugging.
* aom_build/ - Local submodule of libaom. Some C functions and constants are used directly. Also used for benchmarking and testing.
Michael Bebenita's avatar
Michael Bebenita committed
66 67 68 69 70 71 72 73

# Contributing

Check code formatting with [rustfmt](https://github.com/rust-lang-nursery/rustfmt) before submitting a PR.

```
cargo +nightly fmt -- --check
```