Skip to content

Backport memory optimization for palette mode from dav1d 1.3.0 #4117

Backport memory optimization for palette mode from dav1d 1.3.0

Backport memory optimization for palette mode from dav1d 1.3.0 #4117

name: build and test on x86-64
on:
push:
branches:
- 'main'
pull_request:
jobs:
test-on-ubuntu-latest:
strategy:
matrix:
target: [
"x86_64-unknown-linux-gnu",
"i686-unknown-linux-gnu"
]
build: [
# release build without optimized assembly routines
{name: "release", flags: "--release --no-default-features --features=bitdepth_8,bitdepth_16", timeout_multiplier: 1},
# debug build with optimizations to catch overflows with optimized assembly routines
{name: "opt-dev", flags: "--profile opt-dev", timeout_multiplier: 2}
]
# Test with threads and framedelay
framedelay: [
"",
"-f 1",
"-f 2"
]
runs-on: ubuntu-latest
steps:
- name: install prerequisites
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: meson nasm gcc-multilib
version: 1.0 # version of cache to load
- name: git checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: cache rust toolchain
uses: actions/cache@v3
with:
path: |
~/.rustup/toolchains
~/.rustup/update-hashes
~/.rustup/settings.toml
key: ${{ runner.os }}-${{ matrix.target }}-rust-toolchain-${{ hashFiles('rust-toolchain', 'rust-toolchain.toml') }}
- name: cache rust crates
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: cargo build for ${{ matrix.target }} ${{ matrix.build.name }}
run: |
cargo clean
rustup target add ${{ matrix.target }}
cargo build --target ${{ matrix.target }} ${{ matrix.build.flags }}
- name: meson test for ${{ matrix.target }} ${{ matrix.build.name }}
run: |
.github/workflows/test.sh \
-r target/${{ matrix.target }}/${{ matrix.build.name }}/dav1d \
-s target/${{ matrix.target }}/${{ matrix.build.name }}/seek_stress \
-t ${{ matrix.build.timeout_multiplier }} \
${{ matrix.framedelay }}
- name: copy log files
if: ${{ !cancelled() }}
run: |
cp ${{ github.workspace }}/build/meson-logs/testlog.txt \
${{ github.workspace }}/build/meson-logs/testlog-${{ matrix.target }}-${{ matrix.build.name }}.txt
- name: upload build artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
with:
name: meson-test-logs
path: |
${{ github.workspace }}/build/meson-logs/testlog-*.txt
test-on-macos-latest:
runs-on: macos-latest
steps:
- name: install prerequisites
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: brew install meson nasm
- name: git checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: cache rust toolchain
uses: actions/cache@v3
with:
path: |
~/.rustup/toolchains
~/.rustup/update-hashes
~/.rustup/settings.toml
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain', 'rust-toolchain.toml') }}
- name: cache rust crates
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: cargo build for x86_64-apple-darwin
run: |
cargo build --release
- name: meson test for x86_64-apple-darwin
run: |
.github/workflows/test.sh \
-r target/release/dav1d \
-s target/release/seek_stress
- name: copy log files
if: ${{ !cancelled() }}
run: |
cp ${{ github.workspace }}/build/meson-logs/testlog.txt \
${{ github.workspace }}/build/meson-logs/testlog-x86_64-apple-darwin.txt
- name: upload build artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
with:
name: meson-test-logs
path: |
${{ github.workspace }}/build/meson-logs/testlog-*.txt