wrenc

October 12, 2022 ยท View on GitHub

wrenc is an experimental H.266/VVC encoder implemented in Rust.

The latest evaluation dashboard can be found here.

Requirements

  • Rust 1.66.0-nightly or later
  • Python 3.10 for running evaluation scripts
  • Node.js & yarn for building an evaluation dashboard

Supported features

Codec-specific features

FeatureAvailabilityRemarks
CTU size32x32-
CT size32x32 or 16x16 or 8x8 or 4x4-
Tile1 tile per picture-
Slice1 slice per picture-
Sub-pictureNo-
Slice typeI only-
Chroma formatYCbCr420 only-
Color depth8-bit only-
Intra predictionPLANAR or DC or ANGULARX or CCLMX-
Transform skipYes*Not elaborately tested
Transform size64x64 or 32x32 or 16x16 or 8x8 or 4x4-
LFNSTNo-
Loop filterNo-
Dependent quantizationYes-

Encoder-specific features

FeatureAvailabilityRemarks
Input formatRaw YUV only-
Input protocolFile or Unix Pipe-
Input resolutionWidth and height should be multiples of 32To be fixed
Output protocolFile only-
CT partition searchExhaustive search by RD costs-
Intra prediction searchStep search by RD costs-
Rate controlFixed QP only-
SIMDUtilize AVX2 when supported-

Build

# building wrenc for debug
cargo build

# building wrenc for development
cargo build --profile dev

# building wrenc for release
cargo build --release

# building an evaluation dashboard
cd tools/dashboard
yarn
node_modules/.bin/webpack

Usage

Run wrenc

# running wrenc for a file input
cargo run --release --bin wrenc -- -i /path/to/video.yuv --input-size {WIDTH}x{HEIGHT} --num-pictures NUM_OF_FRAMES -o /path/to/output.vvc --output-size {WIDTH}x{HEIGHT} [--qp QP] [--max-split-depth MAX_SPLIT_DEPTH] [--reconst /path/to/reconstructed.yuv] [--extra-params KEY1=VAL1[,KEY2=VAL2,...]]

# running wrenc for a pipe input
ffmpeg -i /path/to/input.mp4 -f rawvideo -pix_fmt yuv420p -s {WIDTH}x{HEIGHT} - | cargo run --release --bin wrenc -- -i - --input-size {WIDTH}x{HEIGHT} --num-pictures NUM_OF_FRAMES -o /path/to/output.vvc --output-size {WIDTH}x{HEIGHT} [--qp QP] [--max-split-depth MAX_SPLIT_DEPTH] [--reconst /path/to/reconstructed.yuv] [--extra-params KEY1=VAL1[,KEY2=VAL2,...]]

Evaluation

The following command will run wrenc on test videos with some presets of parameters specified in tools/evaluation/config.json. The result will be generated as summary.json.

cd tools/evaluation

# for pipenv users
pipenv shell
pipenv install

# otherwise
pip install -r requirements.txt

python evaluate_mp.py --threads NUM_OF_THREADS

The following command will run the evaluation, update the dashboard and export it as docs/index.html.

scripts/update_dashboard.sh

Test

# unit tests
cargo test

# integration tests
VTM_ROOT=/path/to/vtm/bin scripts/integration_test.sh

# check coding style
cargo fmt --all --check --verbose
cargo clippy --all-targets --all-features