Skip to content
Snippets Groups Projects
Forked from Xiph.Org / rav1e
1209 commits behind the upstream repository.
user avatar
Raphaël Zumer authored
This also extracts the unsafe top-left pixel access from the native predictor function.

smooth@2018-06-15T19:42:21.397Z -> paeth@2018-06-16T00:12:39.612Z

   PSNR | PSNR Cb | PSNR Cr | PSNR HVS |    SSIM | MS SSIM | CIEDE 2000
-2.2074 | -4.3757 | -5.0621 |  -0.9361 | -0.3539 | -0.1071 |    -2.5839
1394095d
History

The fastest and safest AV1 encoder.

Build Status

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
  • H, V, and DC prediction modes
  • 4x4 DCT and ADST transforms
  • ~5 fps encoding @ 480p (see issue #124)

Building

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
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
make -j8
./aomdec ../output.ivf -o output.y4m

Design

  • src/lib.rs - The top level library, contains code to write headers, manage buffers, and iterate throught each superblock.
  • src/ec.rs - Low-level implementation of the entropy coder, which directly writes the bitstream.
  • src/context.rs - High-level functions that write symbols to the bitstream, and maintain context.
  • 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/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.