• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

src/H03-May-2022-164,211145,185

.cargo-checksum.jsonH A D03-May-202289 11

.cargo_vcs_info.jsonH A D01-Jan-197074 65

Cargo.lockH A D01-Jan-197040.6 KiB1,6621,485

Cargo.tomlH A D01-Jan-19704.7 KiB252198

Cargo.toml.orig-cargoH A D01-Jan-19703.9 KiB167147

LICENSEH A D01-Jan-19701.3 KiB2620

PATENTSH A D01-Jan-19705.6 KiB10985

README.mdH A D01-Jan-19705.9 KiB177138

build.rsH A D01-Jan-19708.5 KiB296249

cbindgen.tomlH A D01-Jan-1970434 2117

README.md

1# rav1e [![Travis Build Status](https://travis-ci.org/xiph/rav1e.svg?branch=master)](https://travis-ci.org/xiph/rav1e)  [![Actions Status](https://github.com/xiph/rav1e/workflows/rav1e/badge.svg)](https://github.com/xiph/rav1e/actions) [![Coverage Status](https://coveralls.io/repos/github/xiph/rav1e/badge.svg?branch=master)](https://coveralls.io/github/xiph/rav1e?branch=master)
2
3The fastest and safest AV1 encoder.
4
5<details>
6<summary><b>Table of Content</b></summary>
7
8- [Overview](#overview)
9- [Features](#features)
10- [Documentation](#documentation)
11- [Releases](#releases)
12- [Building](#building)
13  - [Dependency: NASM](#dependency-nasm)
14  - [Release binary](#release-binary)
15  - [Unstable features](#unstable-features)
16  - [Target-specific builds](#target-specific-builds)
17  - [Building the C-API](#building-the-c-api)
18- [Usage](#usage)
19  - [Compressing video](#compressing-video)
20  - [Decompressing video](#decompressing-video)
21  - [Configuring](#configuring)
22    - [Features](#features-1)
23- [Contributing](#contributing)
24- [Getting in Touch](#getting-in-touch)
25</details>
26
27## Overview
28rav1e 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.
29
30## Features
31* Intra, inter, and switch frames
32* 64x64 superblocks
33* 4x4 to 64x64 RDO-selected square and rectangular blocks
34* DC, H, V, Paeth, smooth, and all directional prediction modes
35* DCT, (FLIP-)ADST and identity transforms (up to 64x64, 16x16 and 32x32 respectively)
36* 8-, 10- and 12-bit depth color
37* 4:2:0, 4:2:2 and 4:4:4 chroma sampling
38* 11 speed settings (0-10, exhaustive to near real-time)
39* Constant quantizer and target bitrate (single- and multi-pass) encoding modes
40* Still picture mode
41
42## Documentation
43Find the documentation in [`doc/`](doc/README.md)
44
45## Releases
46For the foreseeable future, a weekly pre-release of rav1e will be [published](https://github.com/xiph/rav1e/releases) every Tuesday.
47
48## Building
49
50### Dependency: NASM
51Some `x86_64`-specific optimizations require [NASM](https://nasm.us/) `2.14.02` or newer and are enabled by default.
52
53The CI is testing against `nasm 2.15.05`, so bugs for other versions might happen. If you find one please open an issue!
54
55<details>
56<summary>
57Install nasm
58</summary>
59
60**ubuntu 20.04** (`nasm 2.14.02`)
61```sh
62sudo apt install nasm
63```
64**ubuntu 18.04** (`nasm 2.14.02`)
65```sh
66sudo apt install nasm-mozilla
67# link nasm into $PATH
68sudo ln /usr/lib/nasm-mozilla/bin/nasm /usr/local/bin/
69```
70**fedora 31, 32** (`nasm 2.14.02`)
71```sh
72sudo dnf install nasm
73```
74**windows** (`nasm 2.15.05`) <br/>
75Have a [NASM binary](https://www.nasm.us/pub/nasm/releasebuilds/) in your system PATH.
76```sh
77$NASM_VERSION="2.15.05" # or newer
78$LINK="https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/win64"
79curl --ssl-no-revoke -LO "$LINK/nasm-$NASM_VERSION-win64.zip"
807z e -y "nasm-$NASM_VERSION-win64.zip" -o "C:\nasm"
81# set path for the current sessions
82set PATH="%PATH%;C:\nasm"
83```
84**macOS** (`nasm 2.15.05`)
85```sh
86brew install nasm
87```
88
89</details>
90
91### Release binary
92To build release binary in `target/release/rav1e` run:
93
94```sh
95cargo build --release
96```
97
98### Unstable features
99Experimental API and Features can be enabled by using the `unstable` feature.
100
101```sh
102cargo build --features <feature>,unstable
103```
104
105#### Current unstable features
106- Channel API:
107```sh
108cargo build --features channel-api,unstable
109```
110
111
112Those Features and API are bound to change and evolve, do not rely on them staying the same over releases.
113
114### Target-specific builds
115The 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:
116
117```sh
118RUSTFLAGS="-C target-cpu=native" cargo build --release
119# or
120RUSTFLAGS="-C target-feature=+avx2,+fma" cargo build --release
121```
122
123The resulting binary will not work on cpus that do not sport the same set of SIMD extensions enabled.
124
125> **NOTE** : You may use `rustc --print target-cpus` to check if the cpu is supported, if not `-C target-cpu=native` would be a no-op.
126
127### Building the C-API
128**rav1e** provides a C-compatible set of library, header and pkg-config file.
129
130To build and install it you can use [cargo-c](https://crates.io/crates/cargo-c):
131
132```sh
133cargo install cargo-c
134cargo cinstall --release
135```
136
137## Usage
138### Compressing video
139Input videos must be in [y4m format](https://wiki.multimedia.cx/index.php/YUV4MPEG2). The monochrome color format is not supported.
140
141```sh
142cargo run --release --bin rav1e -- input.y4m -o output.ivf
143```
144
145_(Find a y4m-file for testing at [`tests/small_input.y4m`](tests/small_input.y4m) or at http://ultravideo.cs.tut.fi/#testsequences)_
146
147### Decompressing video
148Encoder output should be compatible with any AV1 decoder compliant with the v1.0.0 specification. You can build compatible aomdec using the following:
149
150```sh
151mkdir aom_test && cd aom_test
152cmake /path/to/aom -DAOM_TARGET_CPU=generic -DCONFIG_AV1_ENCODER=0 -DENABLE_TESTS=0 -DENABLE_DOCS=0 -DCONFIG_LOWBITDEPTH=1
153make -j8
154./aomdec ../output.ivf -o output.y4m
155```
156
157### Configuring
158rav1e has several optional features that can be enabled by passing `--features` to cargo. Passing `--all-features` is discouraged.
159
160#### Features
161Find a full list in feature-table in [`Cargo.toml`](Cargo.toml)
162
163* `asm` - enabled by default. When enabled, assembly is built for the platforms supporting it.
164  * `x86_64`: Requires [`nasm`](#dependency-nasm).
165  * `aarch64`
166    * Requires `gas`
167    * Alternative: Use `clang` assembler by setting `CC=clang`
168
169**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.
170
171## Contributing
172Please read our guide to [contributing to rav1e](CONTRIBUTING.md).
173
174## Getting in Touch
175Come chat with us on the IRC channel #daala on Freenode! If you don't have IRC set
176up you can easily connect from your [web browser](http://webchat.freenode.net/?channels=%23daala).
177