Showing 381 changed files with 46,786 additions and 11,389 deletions.
28 changes: 28 additions & 0 deletions .cmake-format.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -----------------------------
# Options affecting formatting.
# -----------------------------
with section("format"):
# How wide to allow formatted cmake files
line_width = 130

# How many spaces to tab for indent
tab_size = 4

# If an argument group contains more than this many sub-groups (parg or kwarg
# groups) then force it to a vertical layout.
max_subgroups_hwrap = 3

# If a positional argument group contains more than this many arguments, then
# force it to a vertical layout.
max_pargs_hwrap = 10

# If a statement is wrapped to more than one line, than dangle the closing
# parenthesis on its own line.
dangle_parens = True

# ------------------------------------------------
# Options affecting comment reflow and formatting.
# ------------------------------------------------
with section("markup"):
# enable comment markup parsing and reflow
enable_markup = False
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* text=auto
*.sh text eol=lf
*.y4m -text -diff
65 changes: 65 additions & 0 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 'Cache for all OSes'
description: 'Needs to be called before any call to ext/.cmd|sh or cmake'
inputs:
extra-key:
description: 'Extra cache key to use in the cache name. Useful when several caches are used in one workflow.'
default: ''
use-meson:
description: 'Whether meson is used'
default: false
use-rust:
description: 'Whether rust is used'
default: false
outputs:
ext-cache-hit:
value: ${{ steps.cache-ext.outputs.cache-hit }}
runs:
using: "composite"
steps:
- name: Find workflow path
env:
WORKFLOW_REF: ${{ github.workflow_ref }}
id: workflow-info
run: |
# Remove repository path.
END=(${WORKFLOW_REF/*.github/.github})
# Remove branch reference starting with @.
MIDDLE=(${END/%@*/})
echo "Current workflow path is: ${MIDDLE}"
echo "path=${MIDDLE}" >> "$GITHUB_OUTPUT"
shell: bash
- name: Generate meson cache key
if: ${{ inputs.use-meson == 'true' }}
run: |
echo "MESON_KEY=meson-`meson --version`" >> $GITHUB_ENV
shell: bash
- name: Generate empty meson cache key
if: ${{ inputs.use-meson != 'true' }}
run: |
echo "MESON_KEY=meson-none" >> $GITHUB_ENV
shell: bash
- name: Generate cargo cache key
if: ${{ inputs.use-rust == 'true' }}
id: cargo-key
run: |
echo "key=cargo-registry-${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-${{ inputs.extra-key }}-${{ hashFiles('.github/action/**', steps.workflow-info.outputs.path, 'CMakeLists.txt', 'cmake/Modules/Findrav1e.cmake', 'cmake/Modules/LocalRav1e.cmake', 'ext/rav1e.cmd') }}" >> "$GITHUB_OUTPUT"
shell: bash
- name: Cache all of cargo
if: ${{ inputs.use-rust == 'true' }}
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
continue-on-error: true
with:
path: ~/.cargo
key: ${{ steps.cargo-key.outputs.key }}-${{ github.run_id }}
restore-keys: ${{ steps.cargo-key.outputs.key }}
- name: Cache external dependencies in ext
id: cache-ext
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ext
key: ext-${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-${{ inputs.extra-key }}-${{ env.MESON_KEY }}-${{ hashFiles('.github/action/**', steps.workflow-info.outputs.path, 'ext/*.cmd', 'ext/*.sh') }}
- name: Cache external dependencies in build/_deps
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: build/_deps
key: deps-${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-${{ inputs.extra-key }}-${{ env.MESON_KEY }}-${{ hashFiles('.github/action/**', steps.workflow-info.outputs.path, 'CMakeLists.txt', 'cmake/Modules/*') }}
43 changes: 43 additions & 0 deletions .github/actions/setup-common/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'Common setup for all OSes'
description: 'Installs common dependencies'
inputs:
codec-aom:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-dav1d:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-rav1e:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
oldest-cmake:
description: 'Can take the values: true, false. Only useful on Linux to force using the minimum required CMake'
default: 'false'
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.x'
- name: Set up CMake 3.13
if: ${{ runner.os == 'Linux' && inputs.oldest-cmake == 'true' }}
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2
with:
# Use the minimum required version of cmake.
cmake-version: '3.13.x'
- name: Print CMake version
run: cmake --version
shell: bash
- name: Set up ninja
uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # v4
- name: Set up nasm
if: ${{ inputs.codec-aom == 'LOCAL' || inputs.codec-dav1d == 'LOCAL' }}
uses: ilammy/setup-nasm@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1
- name: Set up rust
if: ${{ inputs.codec-rav1e == 'LOCAL' }}
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: stable
override: true
94 changes: 94 additions & 0 deletions .github/actions/setup-linux/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: 'Setup on Linux'
description: 'Installs dependencies and sets env variables specific to Linux'
inputs:
codec-aom:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-dav1d:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
edfault: 'OFF'
codec-rav1e:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
extra-cache-key:
description: 'Extra cache key to use in the cache name. Useful when several caches are used in one workflow.'
default: ''
gcc-version:
description: 'Can be empty, in which case CC and CXX are not overriden'
default: ''
gtest:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
libxml2:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
libyuv:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
oldest-cmake:
description: 'Can take the values: true, false'
default: 'false'
outputs:
ext-cache-hit:
value: ${{ steps.cache.outputs.ext-cache-hit }}
runs:
using: "composite"
steps:
- name: Install non-library dependencies
run: |
sudo apt update -y
sudo apt install -y imagemagick libjpeg-turbo8-dev libpng-dev
shell: bash
- name: Install libaom library
if: ${{ inputs.codec-aom == 'SYSTEM' }}
run:
sudo apt install -y libaom-dev
shell: bash
- name: Install libdav1d library
if: ${{ inputs.codec-dav1d == 'SYSTEM' }}
run:
sudo apt install -y libdav1d-dev
shell: bash
- name: Install rav1e library
if: ${{ inputs.codec-rav1e == 'SYSTEM' }}
run:
sudo apt install -y librav1e-dev
shell: bash
- name: Install libxml2 library
if: ${{ inputs.libxml2 == 'SYSTEM' }}
run:
sudo apt install -y libxml2
shell: bash
- name: Install libyuv library
if: ${{ inputs.libyuv == 'SYSTEM' }}
run:
sudo apt install -y libyuv-dev
shell: bash
- name: Set up meson
if: ${{ inputs.codec-dav1d == 'LOCAL' }}
run:
sudo apt install -y meson
shell: bash
- name: Set up gtest
if: ${{ inputs.gtest == 'SYSTEM' }}
run:
sudo apt install -y libgtest-dev
shell: bash

- uses: ./.github/actions/setup-common
with:
codec-aom: ${{ inputs.codec-aom }}
codec-dav1d: ${{ inputs.codec-dav1d }}
codec-rav1e: ${{ inputs.codec-rav1e }}
oldest-cmake: ${{ inputs.oldest-cmake }}
- uses: ./.github/actions/cache
id: cache
with:
extra-key: ${{ inputs.extra-cache-key }}
use-meson: ${{ inputs.codec-dav1d == 'LOCAL' }}
use-rust: ${{ inputs.codec-rav1e == 'LOCAL' }}

- name: Set GCC & G++ compiler
if: ${{ inputs.gcc-version != '' }}
run: echo "CC=gcc-${{ inputs.gcc-version }}" >> $GITHUB_ENV && echo "CXX=g++-${{ inputs.gcc-version }}" >> $GITHUB_ENV
shell: bash
67 changes: 67 additions & 0 deletions .github/actions/setup-macos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: 'Setup on macOS'
description: 'Installs dependencies specific to macOS'
inputs:
codec-aom:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-dav1d:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-rav1e:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
gtest:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
extra-cache-key:
description: 'Extra cache key to use in the cache name. Useful when several caches are used in one workflow.'
default: ''
outputs:
ext-cache-hit:
value: ${{ steps.cache.outputs.ext-cache-hit }}
runs:
using: "composite"
steps:
# github actions overwrites brew's python. Force it to reassert itself, by running in a separate step.
# Borrowed from https://github.com/mesonbuild/meson/blob/aab2533ab4f7f4c16991620b400d71782f89be1c/.github/workflows/macos.yml#L87-L92
# until https://github.com/actions/setup-python/issues/577 is fixed.
- name: unbreak python in github actions
run: |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/2to3*' \
-o -lname '*/Library/Frameworks/Python.framework/idle3*' \
-o -lname '*/Library/Frameworks/Python.framework/pydoc3*' \
-o -lname '*/Library/Frameworks/Python.framework/python3*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
shell: bash
- name: Install non-library dependencies
run: brew install imagemagick
shell: bash
- name: Install AOM library
if: ${{ inputs.codec-aom == 'SYSTEM' }}
run: brew install aom
shell: bash
- name: Install dav1d library
if: ${{ inputs.codec-dav1d == 'SYSTEM' }}
run: brew install dav1d
shell: bash
- name: Set up meson
if: ${{ inputs.codec-dav1d == 'LOCAL' }}
run: brew install meson
shell: bash
- name: Set up gtest
if: ${{ inputs.gtest == 'SYSTEM' }}
run: brew install googletest
shell: bash

- uses: ./.github/actions/setup-common
with:
codec-aom: ${{ inputs.codec-aom }}
codec-dav1d: ${{ inputs.codec-dav1d }}
codec-rav1e: ${{ inputs.codec-rav1e }}
- uses: ./.github/actions/cache
id: cache
with:
extra-key: ${{ inputs.extra-cache-key }}
use-meson: ${{ inputs.codec-dav1d == 'LOCAL' }}
use-rust: ${{ inputs.codec-rav1e == 'LOCAL' }}
39 changes: 39 additions & 0 deletions .github/actions/setup-windows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Setup on Windows'
description: 'Installs dependencies specific to Windows'
inputs:
codec-aom:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-dav1d:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-rav1e:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
extra-cache-key:
description: 'Extra cache key to use in the cache name. Useful when several caches are used in one workflow.'
default: ''
outputs:
ext-cache-hit:
value: ${{ steps.cache.outputs.ext-cache-hit }}
runs:
using: "composite"
steps:
- name: Setup Developer Command Prompt for Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@v1
- name: Set up meson
if: ${{ inputs.codec-dav1d == 'LOCAL' }}
run: pip install meson
shell: bash

- uses: ./.github/actions/setup-common
with:
codec-aom: ${{ inputs.codec-aom }}
codec-dav1d: ${{ inputs.codec-dav1d }}
codec-rav1e: ${{ inputs.codec-rav1e }}
- uses: ./.github/actions/cache
id: cache
with:
extra-key: ${{ inputs.extra-cache-key }}
use-meson: ${{ inputs.codec-dav1d == 'LOCAL' }}
use-rust: ${{ inputs.codec-rav1e == 'LOCAL' }}
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
Loading