ipred: Fix compilation with MSVC
c8da122c1d09a242e74ff34b3c230e3f5eab501b broke compilation with
MSVC.
MSVC has a nonstandard handling of __VA_ARGS__ with macros; when
one macro invokes another macro, __VA_ARGS__ gets treated as one
single parameter and can't map to more than one parameter in the
invoked macro. (In other words, when calling another macro,
__VA_ARGS__ must map in its entirety to a ... parameter of the
other macro.)
Modern versions of MSVC do implement the correct mode as well,
but defaults to the old one for backwards compatibility. To
choose the new mode, we'd have to build our code with
-Zc:preprocessor.
To avoid the issue, define all the individual parameters to the
FILTER() macros (so they don't need to be split up from __VA_ARGS__),
and define all the fixed parameters to the FILTER_TYPES() macro.
This fixes errors like this:
../src/ipred_tmpl.c(1149): warning C4003: not enough arguments for function-like macro invocation 'FILTER_TYPE'
../src/ipred_tmpl.c(1149): error C2059: syntax error: ']'
See [1], [2] and [3] for more discussion on the matter.
[1] https://stackoverflow.com/a/5134656/3115956
[2] https://stackoverflow.com/a/7459803/3115956
[2] https://learn.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview?view=msvc-160
dav2d is an AV2 cross-platform decoder, open-source, and focused on speed and correctness. It is based on our popular dav1d decoder.
It is a quite early project, should not be used in production, notably since the AV2 specification is not final.
The canonical repository URL for this repo is https://code.videolan.org/videolan/dav2d .
This project is edited by VideoLAN as part of its membership by the Alliance for Open Media/AOM.
The goal of this project is to provide a decoder for most platforms, and achieve the highest speed possible to overcome the temporary lack of AV2 hardware decoder.
It will support all features from AV2, including all subsampling and bit-depth parameters.
In the future, this project will host simple tools or simple wrappings.
dav2d is released under a very liberal license, a contrario from the other VideoLAN projects, so that it can be embedded anywhere, including non-open-source software; or even drivers, to allow the creation of hybrid decoders.
The reasoning behind this decision is the same as for libvorbis, see RMS on vorbis.
Please note that the license does not grant you any patents rights from AOM.
The plan is the following:
Currently, we are looking for help from:
Our contributions guidelines are quite strict. We want to build a coherent codebase to simplify maintenance and achieve the highest possible speed.
Notably, the codebase is in pure C and asm.
We are on IRC, on the #dav2d channel on Libera.chat. If you do not have an IRC Client at hand, use IRC Web Interface.
See the contributions document.
There is no CLA.
People will keep their copyright and their authorship rights, while adhering to the BSD 2-clause license.
VideoLAN will only have the collective work rights.
The VideoLAN Code of Conduct applies to this project.
mkdir build && cd build to create a build directory and enter itmeson setup .. to configure meson, add --default-library=static if static linking is desiredninja to compileFollowing are modification of step 3 and 4, for specific purpose.
If you're on a linux build machine trying to compile .exe for a Windows target/host machine, configure meson like this
meson setup .. --cross-file=../package/crossfiles/x86_64-w64-mingw32.meson
or, for 32-bit:
meson setup .. --cross-file=../package/crossfiles/i686-w64-mingw32.meson
mingw-w64 is a pre-requisite and should be installed on your linux machine via your preferred method or package manager. Note the binary name formats may differ between distributions. Verify the names, and use alias if certain binaries cannot be found.
For 32-bit linux, run
meson setup .. --cross-file=../package/crossfiles/i686-linux32.meson
meson setup .. -Denable_docs=true to configure meson to generate docs from the build directory.ninja doc/html to build the docsThe result can be found in build/doc/html/. An online version built from master can be found here.
git clone https://code.videolan.org/videolan/dav2d-test-data.git tests/dav2d-test-data to fetch the test data repository-Dtestdata_tests=truemeson test -v after compilingThis project is partially funded by members of the Alliance for Open Media/AOM - Google, Meta and Netflix, and is supported by Arm, TwoOrioles and VideoLabs.
Some of these companies may provide support and integration help, should you need it.
Please read the AOMedia patent license that applies to the AV2 specification and codec.