Skip to content

Commit

Permalink
Merge branch 'master' into CDEF-paralelization
Browse files Browse the repository at this point in the history
  • Loading branch information
master-of-zen authored Mar 17, 2021
2 parents dba4037 + 87c0297 commit 159c96e
Show file tree
Hide file tree
Showing 80 changed files with 21,013 additions and 7,421 deletions.
64 changes: 32 additions & 32 deletions .github/workflows/rav1e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ jobs:
- name: Install sccache
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: 0.2.13
SCCACHE_VERSION: 0.2.15
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
SCCACHE_FILE=sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
curl -L "$LINK/v$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
chmod +x $SCCACHE_FILE/sccache
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Add nasm
Expand All @@ -127,11 +128,11 @@ jobs:
matrix.conf == 'grcov-coveralls'
env:
LINK: https://www.deb-multimedia.org/pool/main/a/aom-dmo
AOM_VERSION: 2.0.1-dmo0~bpo10+1
AOM_VERSION: 2.0.2-dmo0~bpo10+1
AOM_DEV_SHA256: >-
57adde89e7e82da7839298739fe7c481f38daa15b0ca709ecd0881ab60787410
d31eee6524ea64c080312eeafc65355e378e043b1d738ff9b9bde3734a85779c
AOM_LIB_SHA256: >-
cc418d1be85ae01eac96a5501b284554405bf8d73c59395a988de6812c57a84a
db8a04ca0984604f410c6bd8810ee31666a3bfd3964f3109cdb8f1ae33fec664
run: |
echo "$LINK/libaom-dev_${AOM_VERSION}_amd64.deb" >> DEBS
echo "$LINK/libaom2_${AOM_VERSION}_amd64.deb" >> DEBS
Expand All @@ -143,11 +144,11 @@ jobs:
matrix.conf == 'grcov-coveralls' || matrix.conf == 'fuzz' || matrix.conf == 'no-asm-tests'
env:
LINK: https://www.deb-multimedia.org/pool/main/d/dav1d-dmo
DAV1D_VERSION: 0.8.1-dmo1
DAV1D_VERSION: 0.8.2-dmo1
DAV1D_DEV_SHA256: >-
dcf911325699d93a90818e16736e2c93b29d8e7538c1545accd3b25c610876c0
04d30fc34056467b91a627563c61b9a0046a2e084bb649791cd31887a6c76d8e
DAV1D_LIB_SHA256: >-
06f51b9660d413417827270b298e2ad541bd8ddaae7e027ebcb6bb7b6b1ad006
0c3debb3a926e10009503e639dddcfd4082ed6e012340ca49682b738c243dedc
run: |
echo "$LINK/libdav1d-dev_${DAV1D_VERSION}_amd64.deb" >> DEBS
echo "$LINK/libdav1d5_${DAV1D_VERSION}_amd64.deb" >> DEBS
Expand Down Expand Up @@ -392,20 +393,17 @@ jobs:
sccache --stop-server
build-windows:

strategy:
matrix:
conf:
- cargo-build
- cargo-test
- cargo-c
include:
- conf: cargo-build
toolchain: stable
target: x86_64-pc-windows-msvc
- conf: cargo-build
target: aarch64-pc-windows-msvc
- conf: cargo-test
toolchain: stable
target: x86_64-pc-windows-msvc
- conf: cargo-c
toolchain: stable-x86_64-pc-windows-gnu
target: x86_64-pc-windows-gnu

env:
RUST_BACKTRACE: full
Expand All @@ -416,42 +414,44 @@ jobs:
if: >-
(github.event_name == 'push' && !endsWith(github.event.head_commit.message, 'CI: skip')) ||
(github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.names, 'skip-ci'))
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: ilammy/setup-nasm@v1
- name: Install sccache
run: |
$LINK = "https://github.com/mozilla/sccache/releases/download/0.2.12"
$SCCACHE_FILE = "sccache-0.2.12-x86_64-pc-windows-msvc"
curl -LO "$LINK/$SCCACHE_FILE.tar.gz"
tar xzf "$SCCACHE_FILE.tar.gz"
echo "$Env:GITHUB_WORKSPACE/$SCCACHE_FILE" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install nasm
run: |
$NASM_VERSION="2.15.05"
$LINK = "https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/win64"
$NASM_FILE = "nasm-$NASM_VERSION-win64"
curl --ssl-no-revoke -LO "$LINK/$NASM_FILE.zip"
7z e -y "$NASM_FILE.zip" -o"C:\nasm"
echo "C:\nasm" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Set MSVC x86_64 linker path
if: matrix.target != 'aarch64-pc-windows-msvc'
run: |
$LinkGlob = "VC\Tools\MSVC\*\bin\Hostx64\x64"
$env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer"
$LinkPath = vswhere -latest -products * -find "$LinkGlob" | Select-Object -Last 1
echo "$LinkPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Set MSVC Arm64 linker path
if: matrix.target == 'aarch64-pc-windows-msvc'
run: |
$LinkGlob = "VC\Tools\MSVC\*\bin\Hostx64\Arm64"
$env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer"
$LinkPath = vswhere -latest -products * -find "$LinkGlob" | Select-Object -Last 1
echo "$LinkPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
toolchain: stable
target: ${{ matrix.target }}
override: true
default: true
- name: Install cargo-c
if: matrix.conf == 'cargo-c'
run: |
$LINK = "https://github.com/lu-zero/cargo-c/releases/download/v0.7.1"
$LINK = "https://github.com/lu-zero/cargo-c/releases/download/v0.7.3"
$CARGO_C_FILE = "cargo-c-windows-msvc"
curl -LO "$LINK/$CARGO_C_FILE.zip"
7z e -y "$CARGO_C_FILE.zip" -o"${env:USERPROFILE}\.cargo\bin"
Expand All @@ -464,17 +464,17 @@ jobs:
continue-on-error: true
with:
path: ~/.cargo/registry/cache
key: ${{ runner.os }}-${{ matrix.conf }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-${{ matrix.conf }}-${{ matrix.target }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.conf }}-cargo-registry-
${{ runner.os }}-${{ matrix.conf }}-${{ matrix.target }}-cargo-registry-
- name: Cache sccache output
uses: actions/cache@v2
continue-on-error: true
with:
path: C:\sccache
key: ${{ runner.os }}-${{ matrix.conf }}-sccache-${{ hashFiles('**/Cargo.*') }}
key: ${{ runner.os }}-${{ matrix.conf }}-${{ matrix.target }}-sccache-${{ hashFiles('**/Cargo.*') }}
restore-keys: |
${{ runner.os }}-${{ matrix.conf }}-sccache-
${{ runner.os }}-${{ matrix.conf }}-${{ matrix.target }}-sccache-
- name: Start sccache server
run: |
sccache --start-server
Expand Down
6 changes: 3 additions & 3 deletions .travis/install-aom.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -ex

AOM_VERSION="2.0.1-dmo0~bpo10+1"
AOM_VERSION="2.0.2-dmo0~bpo10+1"
PKG_URL="https://www.deb-multimedia.org/pool/main/a/aom-dmo"
ARCH="arm64"

Expand All @@ -13,8 +13,8 @@ curl -O "${PKG_URL}/libaom-dev_${AOM_VERSION}_${ARCH}.deb" \
-O "${PKG_URL}/libaom2_${AOM_VERSION}_${ARCH}.deb"

sha256sum --check --ignore-missing <<EOF
26fcaf306ab6ca528fb26352460a00aa60b4f0d2cd1ba6c1de4af41352414c71 libaom2_${AOM_VERSION}_${ARCH}.deb
612b6f86a8dff9b6a4cd33216cdaf298605b6818159f8a9a056e7a73ce935481 libaom-dev_${AOM_VERSION}_${ARCH}.deb
2352aa82e15f3936c2dd21d3aee6633b8338e96c09b38b2912aa2c1555a758a2 libaom2_${AOM_VERSION}_${ARCH}.deb
80e7c9ea59f4fc9ac6518e071ee8f86ba2ccec2d5500ea222982fa6dfa21356c libaom-dev_${AOM_VERSION}_${ARCH}.deb
EOF

sudo dpkg -i "libaom2_${AOM_VERSION}_${ARCH}.deb" \
Expand Down
10 changes: 5 additions & 5 deletions .travis/install-dav1d.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -ex

DAV1D_VERSION="0.8.1-dmo1"
DAV1D_VERSION="0.8.2-dmo1"
PKG_URL="https://www.deb-multimedia.org/pool/main/d/dav1d-dmo"

case "$ARCH" in
Expand All @@ -17,10 +17,10 @@ curl -O "$PKG_URL/libdav1d-dev_${DAV1D_VERSION}_$ARCH.deb" \
-O "$PKG_URL/libdav1d5_${DAV1D_VERSION}_$ARCH.deb"

sha256sum --check --ignore-missing <<EOF
dcf911325699d93a90818e16736e2c93b29d8e7538c1545accd3b25c610876c0 libdav1d-dev_${DAV1D_VERSION}_amd64.deb
37094752ae6f8a4c1d6a8267b9632144a235a995f02c5f8bfc69cd8ffc0bb831 libdav1d-dev_${DAV1D_VERSION}_arm64.deb
06f51b9660d413417827270b298e2ad541bd8ddaae7e027ebcb6bb7b6b1ad006 libdav1d5_${DAV1D_VERSION}_amd64.deb
3f35ba159cb76108ba483aedae7acd6eb797bc7cf7a8b0023eeaede2f4b2fbb0 libdav1d5_${DAV1D_VERSION}_arm64.deb
04d30fc34056467b91a627563c61b9a0046a2e084bb649791cd31887a6c76d8e libdav1d-dev_${DAV1D_VERSION}_amd64.deb
0ec130514ce8748a84f4db3d624bf6f20e28dfb0f8a64659a75a8087642269fc libdav1d-dev_${DAV1D_VERSION}_arm64.deb
0c3debb3a926e10009503e639dddcfd4082ed6e012340ca49682b738c243dedc libdav1d5_${DAV1D_VERSION}_amd64.deb
3c29f1782d89f85ac1cc158560828d7e604c7070985e92b7c03135825af478cc libdav1d5_${DAV1D_VERSION}_arm64.deb
EOF

sudo dpkg -i "libdav1d5_${DAV1D_VERSION}_$ARCH.deb" \
Expand Down
7 changes: 4 additions & 3 deletions .travis/install-sccache.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash
set -ex

SCCACHE_VERSION="0.2.13"
SCCACHE_VERSION="0.2.15"

export RUSTC_WRAPPER=sccache

if [ "$(sccache --version)" = "sccache $SCCACHE_VERSION" ]; then
echo "Using cached directory."
elif [ "$ARCH" = "x86_64" ]; then
curl -L "https://github.com/mozilla/sccache/releases/download/$SCCACHE_VERSION/sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz" | tar xz
mv -f "sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl/sccache" "$DEPS_DIR/bin/sccache"
curl -L "https://github.com/mozilla/sccache/releases/download/v$SCCACHE_VERSION/sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz" | tar xz
mv -f "sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl/sccache" "$DEPS_DIR/bin/sccache"
chmod +x "$DEPS_DIR/bin/sccache"
else
RUSTC_WRAPPER='' cargo install --version "$SCCACHE_VERSION" --root "$DEPS_DIR" --no-default-features sccache
fi
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ cargo bench --features=bench
Install `cargo-fuzz` with `cargo install cargo-fuzz`. Running fuzz targets with stable Rust requires `--sanitizer=none` or the shorter `-s none`.

* List the fuzz targets with `cargo fuzz list`.
* Run a fuzz target with `cargo fuzz run --santizer=none <target>`.
* Run a fuzz target with `cargo fuzz run --sanitizer=none <target>`.
* Parallel fuzzing: `cargo fuzz run -s none --jobs <n> <target> -- -workers=<n>`.
* Bump the "slow unit" time limit: `cargo fuzz run -s none <target> -- -report_slow_units=600`.
* Make the fuzzer generate long inputs right away: `cargo fuzz run -s none <target> -- -max_len=256 -len_control=0`.
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rav1e"
version = "0.4.0"
version = "0.5.0-alpha"
authors = ["Thomas Daede <tdaede@xiph.org>"]
edition = "2018"
build = "build.rs"
Expand Down Expand Up @@ -60,7 +60,7 @@ dump_lookahead_data = ["byteorder", "image"]
arg_enum_proc_macro = "0.3"
bitstream-io = "1"
cfg-if = "1.0"
clap = { version = "2", optional = true, default-features = false }
clap = { version = "2", optional = true, default-features = false, features = ["color"] }
libc = "0.2"
y4m = { version = "0.7", optional = true }
backtrace = { version = "0.3", optional = true }
Expand Down Expand Up @@ -114,7 +114,7 @@ signal-hook = { version = "0.3", optional = true }
[dev-dependencies]
assert_cmd = "1.0"
criterion = "0.3"
pretty_assertions = "0.6"
pretty_assertions = "0.7"
interpolate_name = "0.2.2"
rand = "0.8"
rand_chacha = "0.3"
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ For the foreseeable future, a weekly pre-release of rav1e will be [published](ht

## Building

### Toolchain: Rust
rav1e currently requires Rust 1.44.1 or later to build.

### Dependency: NASM
Some `x86_64`-specific optimizations require [NASM](https://nasm.us/) `2.14.02` or newer and are enabled by default.

Expand Down
7 changes: 6 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ fn build_nasm_files() {
"src/x86/ipred_ssse3.asm",
"src/x86/itx.asm",
"src/x86/itx_ssse3.asm",
"src/x86/looprestoration16_avx2.asm",
"src/x86/mc_avx2.asm",
"src/x86/mc16_avx2.asm",
"src/x86/mc_avx512.asm",
Expand All @@ -98,7 +99,10 @@ fn build_nasm_files() {
"src/x86/sad_avx.asm",
"src/x86/satd.asm",
"src/x86/sse.asm",
"src/x86/cdef.asm",
"src/x86/cdef_rav1e.asm",
"src/x86/cdef_sse.asm",
"src/x86/cdef16_avx2.asm",
"src/x86/cdef16_sse.asm",
"src/x86/tables.asm",
];

Expand Down Expand Up @@ -175,6 +179,7 @@ fn build_asm_files() {

fn rustc_version_check() {
// This should match the version in the CI
// Make sure to updated README.md when this changes.
const REQUIRED_VERSION: &str = "1.44.1";
if version().unwrap() < Version::parse(REQUIRED_VERSION).unwrap() {
eprintln!("rav1e requires rustc >= {}.", REQUIRED_VERSION);
Expand Down
Loading

0 comments on commit 159c96e

Please sign in to comment.