We have new option in clang (https://github.com/llvm/llvm-project/pull/124834)
to mark globals to be allocated in non-large sections. We can mark all globals
that are referenced from hardcoded assembly (which implicitly references globals
assuming they are in non-large sections) with this attribute to avoid running
into problems when dav1d is built with -mcmodel=medium with clang.
This is possible, because we no longer generate version.h at compile
time.
Reverts header change from 7629402bbd to
preserve the same behaviour as before.
This makes `#include <dav1d/dav1d.h>` work correctly as we point to the
parent include directory, same as in the normal installation.
Also fixes conflict of including "version.h" which may already exist in
parent project or another subproject. Be more specific about the
headers. Normally it works, but when building as subproject version.h is
generated in build directory, so it no longer is prioritized when
including from dav1d.h and other header with the same name may be
included.
Avoid wrapping external includes in extern "C" blocks. Also wrap all public headers in extern "C" blocks to allow them to be selectively included in C++ projects.
Fixes https://code.videolan.org/videolan/dav1d/-/issues/422.
Nothing in the spec prevents a Temporal Unit from having more than one Metadata
OBU of type ITU-T T.35, so export them as an array instead of only exporting
the last one we parse.
This is backwards compatible with the previous implementation, as users unaware
of this change can ignore the n_itut_t35 field and still access the first (or
only) entry in the array as they have been doing until now.
Dav1dRef is an opaque struct to the API user, and they have no business
with these fields at all, so move them to the internal picture struct.
Signed-off-by: James Almer <jamrial@gmail.com>
Nothing in the spec prevents a Temporal Unit from having more than one Metadata
OBU of type ITU-T T.35, so export them as an array instead of only exporting
the last one we parse.
This is backwards compatible with the previous implementation, as users unaware
of this change can ignore the n_itut_t35 field and still access the first (or
only) entry in the array as they have been doing until now.
Signed-off-by: James Almer <jamrial@gmail.com>
'-fvisibility=hidden' only applies to definitions, not declarations,
so the compiler has to be conservative about how references to global
data symbols are performed.
Explicitly specifying the visibility allows for better code generation.
Section 6.4.2 (Color config semantics) of the AV1 spec says:
If matrix_coefficients is equal to MC_IDENTITY, it is a requirement of
bitstream conformance that subsampling_x is equal to 0 and
subsampling_y is equal to 0.
Add Dav1dSettings.strict_std_compliance flag which, when set, allows
aborting decoding when such standard-compliance violations fail, even
though they don't affect decoding. In CLI, this flag can be accessed
using -strict.
This change is motivated by a desire to be able to toggle between CPU
and GPU film gain synthesis in players such as VLC. Because VLC
initializes the codec before the vout (and, indeed, the active vout
module may change in the middle of decoding), it cannot make the
decision of whether to apply film grain in libdav1d as part of codec
initialization. It needs to be decided on a frame-by-frame basis
depending on whether the currently active vout supports film grain
synthesis or not.
Using the new API, users like VLC can simply set `apply_grain` to 0 and
then manually call `dav1d_apply_grain` whenever the vout does not
support GPU film grain synthesis. As a side note, `dav1d_apply_grain`
could also technically be called from dedicated worker threads,
something that libdav1d does not currently do internally.
The alternative to this solution would have been to allow changing
Dav1dSettings at runtime, but that would be more invasive and a proper
API would also need to take other settings into consideration, some of
which can't be changed as easily as `apply_grain`. This commit
represents a stop-gap solution.
Bump the minor version to allow clients to depend on this API.
Merges the 3 threading parameters into a single `--threads=` argument.
Frame threading can still be controlled via the `--framedelay=` argument.
Internally, the threading model is now a global thread/task pool design.
Co-authored-by: Ronald S. Bultje <rsbultje@gmail.com>
Helps differentiating actual errors in the buffer data or passed-in arguments
with scenarios like empty buffers or containing OBUs other than Sequence
Header.