1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00
Commit Graph

1852 Commits

Author SHA1 Message Date
Kacper Michajłow
c200628eac avcodec: add AV_CODEC_CONFIG_CHROMA_LOCATION
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>
2026-10-01 14:31:15 +00:00
Kacper Michajłow
08a654a564 avfilter: add link negotiation for AVChromaLocation
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>
2026-10-01 14:31:15 +00:00
Niklas Haas
caa5824750 avformat: add AV_STREAM_GROUP_PARAMS_GAIN_MAP
To identify ISO 21496-1 gain maps.

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-09-30 14:37:55 +02:00
Niklas Haas
b917a0fe1e avutil/gain_map: add AVGainMapParams and side data type
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>
2026-09-30 14:37:26 +02:00
James Almer
c6ea3979ef doc/APIchanges: add entries and version bump for the recent commits
Accidentally forgotten in the corresponding changes.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-09-27 20:32:38 -03:00
Kacper Michajłow
dea75789c3 avutil/file: add av_file_map_shared() and av_file_unmap_shared()
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>
2026-09-23 16:50:45 +02:00
Jun Zhao
6e9100c648 lavc: add ASTC encoder/decoder via libastcenc
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>
2026-09-14 12:44:07 +00:00
yuanjia
c2bb5aa8d8 avcodec/riscv: add vector FDCT implementation
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>
2026-09-11 15:59:03 +00:00
Zhao Zhili
903325e279 avcodec/mediacodec: document the ENOENT return of buffer release
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.
2026-09-09 11:29:23 +08:00
Kacper Michajłow
655dc1af76 avutil/samplefmt: add AV_SAMPLE_FMT_DSD
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>
2026-09-06 00:48:24 +02:00
Michael Niedermayer
359bd3b8af avcodec: add AVCodecContext.skip_pred
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.
2026-09-05 01:38:48 +00:00
guy-with-a-why
74f1a4a160 avcodec: add FF_BUG_H264_DP_NNZ
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>
2026-08-31 18:13:21 +00:00
James Almer
0e45eebe49 avutil/channel_layout: remove back suffix from some layouts
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>
2026-08-23 13:28:20 -03:00
James Almer
763c3356f1 avcodec/codec: rename encoder reconf codec cap
It was commited only a day ago, and the new name is more accurate, so this change should be safe.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-08-14 10:31:57 -03:00
James Almer
3776aadf4b avcodec/encode: add a function to gracefully reconfigure an encoder
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>
2026-08-13 11:03:51 -03:00
Romain Beauxis
e5ecfe8970 avformat/id3v2: make legacy COMM descriptor-as-key behavior opt-in
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.
2026-08-12 12:39:44 +00:00
Kacper Michajłow
047eb18451 avcodec: add PCM DVD-Audio decoder
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>
2026-07-28 17:54:07 +02:00
Romain Beauxis
b0c702aec2 libavformat/id3v2: deprecate legacy COMM descriptor-as-key behavior 2026-07-18 09:59:57 -05:00
Timo Rothenpieler
ef3dcf4ea6 avutil/hwcontext_cuda: add CUarray surface pool support
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>
2026-07-14 19:45:02 +00:00
Diego de Souza
c7546ce0ea avutil/pixfmt: add AV_PIX_FMT_CUARRAY for opaque CUDA block-linear surfaces
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>
2026-07-14 19:45:02 +00:00
James Almer
7e68fdd4da avutil/frame: add a new side data type for downmix matrix
Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-11 19:32:17 -03:00
James Almer
56e39bd20b avutil/downmix_info: add a new API to propagate pre-made downmix matrixes
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>
2026-07-11 19:32:17 -03:00
Vignesh Venkat
7c4e41b54c avcodec: Add itut-t35 metadata as a codec type
Signed-off-by: Vignesh Venkat <vigneshv@google.com>
2026-07-10 01:56:22 +00:00
James Almer
32a256f619 avcodec: add a graph based bitstream filtering API
Tagged experimental for now, as it may see modifications depending on
requirements.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-06 13:26:02 -03:00
Michael Niedermayer
b140509940 pre branch Update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-26 02:26:01 +02:00
Andreas Rheinhardt
762b94e672 libs: Bump major version of all libraries
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-23 19:15:57 +02:00
Lynne
61693f6c35 hwcontext_vulkan: switch to VkAccessFlagBits2 2026-06-23 19:15:57 +02:00
Andreas Rheinhardt
191be14fb6 avcodec/packet: Accept const dictionaries in av_packet_pack_dictionary()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-23 19:15:57 +02:00
Lynne
12dc67b6fe lavu/frame: add camera raw codec side data
Required to correctly present raw video.
Codec-specific since I'd like to support ARRIRAW in the future, which
has a different format.
2026-06-10 02:38:35 +09:00
Niklas Haas
972c0cf91f swscale: add new SwsContext.backends option
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>
2026-06-03 21:39:55 +00:00
Niklas Haas
9fe5758da5 avutil/hwcontext_vulkan: publicly expose queue device creation flags
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>
2026-06-02 13:32:43 +02:00
James Almer
f778a7e241 avformat: deprecate AVStreamGroupLCEVC
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>
2026-05-31 03:43:29 +00:00
Kacper Michajłow
d7c7ee4e2e avformat: add AV_STREAM_GROUP_PARAMS_DOLBY_VISION
This uses existing AVStreamGroupLayeredVideo.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 03:43:29 +00:00
Kacper Michajłow
1e3883df9f avformat: rename AVStreamGroupLCEVC to AVStreamGroupLayeredVideo
It will be reused for other similar groups.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 03:43:29 +00:00
Romain Beauxis
5f6dff5e7d avcodec/packet: add AV_PKT_DATA_HEVC_CONF side data type
Carries a raw HEVCDecoderConfigurationRecord for the Dolby Vision
enhancement layer, parsed from the hvcE box (ISOM) or the corresponding
BlockAdditionMapping (Matroska).
2026-05-30 17:37:28 +00:00
Romain Beauxis
274bc5f9ae avformat: deprecate FF_FDEBUG_TS in favor of AV_FDEBUG_TS, add AV_FDEBUG_ID3V2
Signed-off-by: Romain Beauxis <romain.beauxis@gmail.com>
2026-05-22 08:20:13 -05:00
James Almer
a5822fca94 avformat/avformat: add a Track Reference Stream Group
Signed-off-by: James Almer <jamrial@gmail.com>
2026-05-17 11:16:51 -03:00
James Almer
c0bdc3b62a avformat/avformat: add an AVOutputFormat capability flag to signal fixed frame size is needed.
And set it on the IAMF muxer.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-05-16 13:55:22 -03:00
James Almer
b1120b1ed8 avcodec: add a flag to force encoders to use fixed size frames
Signed-off-by: James Almer <jamrial@gmail.com>
2026-05-16 13:55:22 -03:00
Marvin Scholz
99908c6e05 avutil: add IAMF frame side data types
These contain the same data as the packet side data equivalents.
2026-05-13 15:19:11 +02:00
Gyan Doshi
5c557dd5d5 avformat: add av_program_copy()
Helper to transfer programs from one muxing context to another.
2026-05-05 12:54:36 +05:30
Gyan Doshi
7623379a77 avformat: add av_program_add_stream_index2()
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.
2026-05-05 12:51:54 +05:30
llyyr
4af27ba4ca doc/APIchanges: fix date and version in latest entry
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>
2026-04-19 15:37:33 +00:00
Vignesh Venkat
7faa6ee2aa libavformat/matroska: Support smpte 2094-50 metadata
Add support for parsing and muxing smpte 2094-50 metadata. It will
be stored as an ITUT-T35 message in the BlockAdditional element with
an AddId type of 4 (which is reserved for ITUT-T35 in the matroska
spec).

https://www.matroska.org/technical/codec_specs.html#itu-t35-metadata

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
2026-04-17 18:51:25 +00:00
James Almer
492e6e68dc doc/APIchanges: fix date and version in the latest entry
Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-09 17:21:28 -03:00
Vignesh Venkat
6ba6db4f19 libavutil: Add functions for SMPTE-2094-50 HDR metadata
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>
2026-04-09 20:01:00 +00:00
Lynne
c102e89448 hwcontext_vulkan: deprecate AVVulkanDeviceContext.lock/unlock_queue
Without replacement, as VK_KHR_internally_synchronized_queues will be required.
2026-03-14 17:05:06 +00:00
Niklas Haas
3503b19711 swscale: add enum SwsScaler, SwsContext.scaler to replace legacy flags
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>
2026-03-12 22:09:04 +01:00
James Almer
927c81b569 avutil/version: bump after recent additions
Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-12 17:18:00 -03:00
Michael Niedermayer
5e933b463b doc/APIchanges: Fill in missing values
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-08 02:29:20 +01:00