Lets the caller read back the negotiated chroma location and constrain the
sink to a list of accepted ones.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Lets the caller state the chroma siting of the frames it feeds in, which is
what the rest of the graph negotiates against. A tagged source constrains
the link to its own value, an untagged one places no constraint at all,
there being nothing to convert from.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Lets an encoder state which chroma sample locations it can accept, so the
caller can convert to one.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Chroma sample location is the last of the video colorimetry properties
without a negotiated link value, so nothing downstream can ask a filter for
a particular siting and no encoder can constrain the graph. Add it alongside
the existing color space, color range and alpha mode negotiation.
Merge conflicts are resolved by inserting a scale filter, the same way as
for color space and color range.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit just adds the public facing struct definitions and side data.
The struct follows ISO 21496-1 exactly, with a validation function to check
for representable and legal values.
Signed-off-by: Niklas Haas <git@haasn.dev>
av_file_map() maps a private copy of a file by name. Code that shares a
file between processes needs the opposite, a writable mapping backed by
the file, of a descriptor it opened itself, that grows with the file.
Provide it with mmap() on POSIX and with a file mapping object on
Windows, which also extends the file to the requested size.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Add the ASTC codec ID and descriptor together with encoder and decoder
wrappers for Arm's astc-encoder library. Support the four ASTC profiles,
2D and 3D block footprints, LDR RGB/RGBA input, and floating-point HDR
input without clamping the decoded result to 8-bit.
Keep the ASTC image dimensions and compressed block sizes bounded by the
format and packet limits, and pass KTX-provided color profile metadata to
the decoder when no explicit profile was selected.
libastcenc is distributed under the Apache License 2.0, so the library is
only available when FFmpeg is built with --enable-version3; list it with
the other libraries that require that option.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This RVV FDCT is ported from the AArch64 NEON implementation in
libavcodec/aarch64/fdctdsp_neon.S, which is based on libjpeg-turbo.
The original license notice is retained in the assembly file.
Requires RVV 1.0 with 64-bit element support (Zve64x) and VLEN >= 128.
Achieves approximately 3.29x speedup on SG2044 (VLEN=128).
Add FF_DCT_RVV to the public API, bump minor version, and add
Doxygen documentation.
Also:
- Fix include guard in riscv/fdct.h to match file path.
- Use AV_CPU_FLAG_RVV_I64 in automatic dispatch to avoid illegal
instruction on Zve32x-only CPUs.
Signed-off-by: yuanjia <yuan.jia@sanechips.com.cn>
053585bc91 made rendering an already released buffer return
AVERROR(ENOENT), but left the function description saying that
subsequent calls have no effect. It also omitted the API change entry.
DSD (Direct Stream Digital) is one-bit sigma-delta modulated audio,
found on Super Audio CDs and in DSF/DSDIFF files. libavcodec has
several decoders producing it internally (dsd_*, dst, wavpack DSD),
each converting to float PCM as part of decoding, which makes the
bitstream itself inaccessible to API users.
Add a dedicated sample format so raw DSD can be carried through the
pipeline, e.g. for bit-perfect pass-through to DSD capable DACs.
The format has no planar variant, altform references itself.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Skipping prediction complements skip_idct and skip_loop_filter: with
both skip_pred and skip_idct discarding a frame, no pixel of that frame
is needed, so a decoder can drop all pixel operations and output the
frame with only its metadata valid. This allows callers to determine
timestamps, frame types and the reorder delay of a stream at a small
fraction of the cost of a full decode.
9.2.1 makes an inter neighbour unavailable for the coeff_token nC
derivation under constrained intra prediction with slice data
partitioning, and step 7 then drops it from the (nA + nB + 1) >> 1
average. JM instead treats it as available with nN = 0, so it still
contributes. Every partitioned stream in the wild comes from JM or a
derivative, so the decoder has to be able to do both.
Signed-off-by: guy-with-a-why <aaron@iterationlab.io>
The idea was for the suffix to refer to the fact they feature Top Back channels
instead of Top Side, but this distinction is unnecessary given there's no
confusion between back and side like with base level channels (Ls/Rs, Lss/Rss,
Lrs/Rsr), nor known specs where Top Side channels are used without Top Back
also being used.
Signed-off-by: James Almer <jamrial@gmail.com>
In some cases there are compression and resource usage benefits from changing
certain encoder values at runtime over of closing, freeing, allocating and
initializing a whole new encoder. The most obvious case is rate control,
quality settings, and so on. As such, this commit introduces a new function
that attempts to reconfigure an opened encoder with a dictionary of options.
Private options that can be changed are flagged with the runtime AVOption flag.
Global options that can be changed, knowing that each encoder may support some
but not others and as such can't be flagged in the global AVOptions struct,
are signaled the same way through a new field in the FFCodecDefault struct.
An encoder may provide a callback function that will be called for the
reconfiguration process. Simple encoders that can work with only the AVOptions
being reset and don't require any extra steps may just let the default function
be called instead.
Signed-off-by: James Almer <jamrial@gmail.com>
A COMM frame carries both a language and a short content descriptor, so its
only unambiguous metadata key is "comment-<descriptor>-<lang>", while the
extra export of the bare descriptor as a key silently overrides a real tag
whenever the descriptor matches a known tag name such as "album".
Restrict that legacy export to the container-level ID3v2 tag of callers that
ask for it through the new AVFMT_FLAG_LEGACY_ID3V2_COMM_KEYS flag (-fflags
+legacy_id3v2_comm_keys), which is deprecated along with
FF_API_OLD_ID3V2_COMMENT and only exists to give those callers a transition
path.
Decodes the LPCM variant found in DVD-Audio AOB streams. Unlike
DVD-Video LPCM it supports up to 192 kHz sample rates and splits
channels in two channel groups, which may use different quantization.
Samples are grouped in sets of 2 samples over all channels, with the
second channel group's data stored first within each set, as 16-bit
big-endian most significant parts followed by the remaining bits.
Based on information from expired US 6,580,671 patent et al.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Extend the internal CUDA frames context (CUDAFramesContext) to manage
block-linear CUarray surfaces alongside the existing pitched-linear
allocations.
When the frames context format is AV_PIX_FMT_CUARRAY, the caller
(e.g. NVDEC) can fill cuarray_desc and cuarray_num_surfaces before
calling av_hwframe_ctx_init(), which then allocates the CUarray
surfaces.
Also add cuda_transfer_data_from_cuarray() to support hwdownload
from CUarray frames to host memory via cuMemcpy2DAsync.
Co-authored-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Add a new hardware pixel format representing opaque block-linear CUDA
arrays (CUarray). This format is used by NVDEC when decoding into
opaque surfaces registered with cuvidRegisterDecodeSurfaces, and can
be consumed directly by NVENC as CUDA array input without requiring
a pitch-linear copy.
Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Useful for formats where they provide the downmix matrix in the bistream rather
than scale factors for channel groups.
Signed-off-by: James Almer <jamrial@gmail.com>
This allows constraining the set of available backends. This serves as a
better replacement for the "unstable" flag, which is a bit ambiguous. Allows
users to, for example, opt into the memcpy or x86 backend, while excluding
e.g. the upcoming JIT backends.
Signed-off-by: Niklas Haas <git@haasn.dev>
These are needed for interop with e.g. libplacebo, which needs to know the
correct flags to call vkGetDeviceQueue2.
Signed-off-by: Niklas Haas <git@haasn.dev>
It's been replaced with AVStreamGroupLayeredVideo, which is functionally the
same while generic enough to be shared with other kinds of layered video
implementations.
Signed-off-by: James Almer <jamrial@gmail.com>
Carries a raw HEVCDecoderConfigurationRecord for the Dolby Vision
enhancement layer, parsed from the hvcE box (ISOM) or the corresponding
BlockAdditionMapping (Matroska).
av_program_add_stream_index() added in 526efa1053
may fail to carry out its purpose but the lack of
a return value stops callers from catching any error.
Fixed in new function.
This incorrectly lists the libavcodec major version as 60 instead of
62. Also fix the date and commit hash while at it
Fixes: 7faa6ee2aa ("libavformat/matroska: Support smpte 2094-50 metadata")
Signed-off-by: llyyr <llyyr.public@gmail.com>
SMPTE-2094-50 is an upcoming standard that is close to being
finalized.
Define a side data type for carrying this metadata. And add
functions for parsing and writing it. This is very similar to
the handling of HDR10+ metadata.
The spec is available here: https://github.com/SMPTE/st2094-50
Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Another step towards a cleaner API, with a cleaner separation of purposes.
Also avoids wasting a whopping one third of the flag space on what really
shouldn't have been a flag to begin with.
I pre-emptively decided to separate the scaler selection between "scaler"
and "scaler_sub", the latter defining what's used for things like 4:2:0
subsampling.
This allows us to get rid of the awkwardly defined SWS_BICUBLIN flag, in favor
of that just being the natural consequence of using a different scaler_sub.
Lastly, I also decided to pre-emptively axe the poorly defined and
questionable SWS_X scaler, which I doubt ever saw much use. The old flag
is still available as a deprecated flag, anyhow.
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>