rav1e: 最快,最安全的AV1编码器

JohnsonLyndon 发布于8月前 阅读606次
0 条评论

The fastest and safest AV1 encoder.


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.


  • Intra frames
  • 64x64 superblocks
  • 4x4 to 32x32 RDO-selected square blocks
  • DC, H, V, Paeth, and smooth prediction modes
  • 4x4 DCT and ADST transforms
  • ~5 fps encoding @ 480p


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.

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

sudo apt install yasm

Compressing video

Input videos must be 8-bit 4:2:0, in y4m format.

cargo run --bin rav1e -- input.y4m -o output.ivf

Decompressing video

mkdir aom_test
cd aom_test
make -j8
./aomdec ../output.ivf -o output.y4m


  • 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 throught 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/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.


Check code formatting with rustfmt before submitting a PR.

cargo +nightly fmt -- --check

You should also try clippy .

cargo +nightly clippy

查看原文: rav1e: The fastest and safest AV1 encoder

  • bluelion
  • organicrabbit
需要 登录 后回复方可回复, 如果你还没有账号你可以 注册 一个帐号。