Commit Graph

113976 Commits

Author SHA1 Message Date
Andreas Rheinhardt
d085f341d6 avformat/hlsenc: Redo checking for strftime %s support to avoid warnings
This is intended to avoid -Wformat= warnings on systems
where %s might not be supported (and also generally emitted
by GCC with -pedantic).

Reviewed-by: Liu Steven <lq@chinaffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-05 15:15:06 +01:00
Zhao Zhili
b0e17e0f95 avcodec/mediacodecenc: Add a hint message to use nv12 pix_fmt
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-05 21:25:56 +08:00
Andreas Rheinhardt
fed46d7706 avformat/avio: Avoid av_strdup(NULL)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-05 12:08:18 +01:00
Andreas Rheinhardt
c856e4c546 avformat/avio: Avoid indirection in ffio_fdopen()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-05 12:08:18 +01:00
Andreas Rheinhardt
57e20dd6b6 avformat/avio: Avoid function pointer casts
It is undefined behaviour to use a different type for a call
than the actual type of the function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-05 12:08:18 +01:00
Andreas Rheinhardt
f0abb44fbf avformat/aviobuf: Move code specific to URLContexts to avio.c
This separates the URL-layer adjacent parts of the code
from the parts that are also usable with custom IO.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-05 12:08:18 +01:00
Andreas Rheinhardt
91745ac233 avutil/hwcontext_qsv: Allocate pub and priv frames hwctx together
This is possible because the lifetime of both coincide.
Besides reducing the number of allocations this also simplifies
access to QSVFramesContext as one no longer has to
go through AVHWFramesInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-05 09:33:28 +01:00
Andreas Rheinhardt
028907b08a avutil/hwcontext_qsv: Allocate public and priv device hwctx together
This is possible because the lifetime of both coincide.
Besides reducing the number of allocations this also simplifies
access to QSVDeviceContext as one no longer has to
go through AVHWDeviceInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-05 09:33:16 +01:00
Andreas Rheinhardt
32fd27df2f avutil/hwcontext_d3d11va: Allocate pub and priv frames hwctx together
This is possible because the lifetime of both coincide.
Besides reducing the number of allocations this also simplifies
access to D3D11VAFramesContext as one no longer has to
go through AVHWFramesInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-05 08:59:35 +01:00
Andreas Rheinhardt
a62c8558ae avutil/hwcontext_dxva2: Allocate pub and priv frames hwctx together
This is possible because the lifetime of both coincide.
Besides reducing the number of allocations this also simplifies
access to DXVA2FramesContext as one no longer has to
go through AVHWFramesInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-05 08:59:26 +01:00
James Almer
44e5749462 avformat/iamfenc: ensure updated extradata is written
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-04 21:14:17 -03:00
James Almer
56d630e6c2 avformat/iamf_writer: update extradata from packet side data
Some encoders, like flac, propagate updated extradata at the end of encoding
as packet side data. Use it to update the relevant codec_config.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-04 21:14:05 -03:00
James Almer
97e1480c8c avformat/mov: set stream index field in tile grids
It was forgotten for grid type derived images.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-04 20:17:52 -03:00
James Almer
8f33d8fa9b avformat/mov: don't mark an item referenced by a grid as dependent if it's the primary item
If it's the primary item, then it's expected to be ready for presentation even
outside of the grid it belongs to.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-04 20:17:41 -03:00
James Almer
d78c75fe49 avformat/mov: fix setting disposition for the first iamf stream
st->disposition will be overwritten with disposition later in the function.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-04 20:17:41 -03:00
Marth64
59981b47db configure: do not specify -ldvdread, as pkg-config check is already done
Reported-by: BtbN
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-03-04 18:54:50 +01:00
Andrew Sayers
b47b2c5b91 fix "@param foo[in/out]" to "@param[in, out] foo"
Fix a few invalid doxygen comments:

    /**
     * @param[in,out] correctly_formatted
     * @param incorrect1[in] - [in] must come immediately after @param
     * @param incorrect2[in/out] - '/' must be ','
     */

Actual command: sed -i -e "s/\(\* .*param\)\( [^\[]*\)\(\[.*\]\)/\1\3\2/g" -e "s/in\//in,/" $( git grep -l "\* .*param .*\[\(in\|out\)" )

Signed-off-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
2024-03-04 17:45:12 +01:00
Andrew Sayers
dea1d7531d fix "param"s that should be "@param"
Actual command: sed -i -e "s/\(^ *\\* \)\(param[^a-z]\)/\1@\2/" $( git grep -l "^ *\\* param[^a-z]" )

Signed-off-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
2024-03-04 17:45:00 +01:00
Andrew Sayers
0dde5c5efa avcodec/avcodec: downgrade multi-member comment to non-Doxygen comment
Doxygen only associates this comment with "pts_correction_num_faulty_pts",
causing it to display incorrectly.

Signed-off-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
2024-03-04 17:40:24 +01:00
Andrew Sayers
899e022cd7 avcodec/ivi: make comments more Doxygen-friendly
Doxygen eats the newline in the first comment, making it harder to read.
Join the lines and add a comma, so source and documentation are equally readable.

Doxygen only associates the second comment with cust_dec.
The comments for cust_dec and cust_tab make perfect sense without it,
so downgrade it to a non-doxygen "//" comment.

The third comment was missed by the command in the previous commit,
because it (correctly but uniquely) doesn't have a trailing comma.

Signed-off-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
2024-03-04 17:39:25 +01:00
Andrew Sayers
6096c244bb fix /// comments that should be ///<
Actual command: sed -i -e "s/\([;,] *\)<* *\/\/\/ *<* */\1\/\/\/< /" $( git grep -l "[;,] */// " )

Signed-off-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
2024-03-04 17:38:57 +01:00
Andreas Rheinhardt
ac86b52f80 avutil/hwcontext_vdpau: Don't use AVHWFramesInternal.priv
Use AVHWFramesContext.hwctx instead.
This simplifies access to VDPAUFramesContext as one no longer has
to go through AVHWFramesInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-04 16:26:55 +01:00
Andreas Rheinhardt
f4df14b354 avutil/hwcontext_vdpau: Allocate public and priv device hwctx together
This is possible because the lifetime of both coincide.
Besides reducing the number of allocations this also simplifies
access to VDPAUDeviceContext as one no longer has to
go through AVHWDeviceInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-04 16:26:41 +01:00
Anton Khirnov
e2e2ee7711 fftools/ffplay: stop printing non-public AVCodecContext fields
They are documented as not intended for caller use.
2024-03-04 15:56:48 +01:00
Nuo Mi
72b1237ece avcodec/vvcdec: fix undefined behaviours for derive_affine_mvc
libavcodec/vvc/vvc_inter.c:823:18: runtime error: signed integer overflow: 1426128896 + 1426128896 cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libavcodec/vvc/vvc_inter.c:823:18

Suggested-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-04 20:39:31 +08:00
Nuo Mi
49ba613146 avcodec/vvcdec: fix boundary strength when IBC involved
The following cases should set bs to 1:
If the prediction modes are not the same.
If both prediction modes are MODE_IBC, but the motion vector delta is larger than 8 of 1/16 pixels.
see 8.8.3.5

How to reproduce it:
vvencapp -i sintel_trailer_2k_1080p24.y4m --preset fast --additional "IBC=1" -o sintel.266
ffmpeg -i sintel.266 -f md5 -
md5 will mismatch

Found-by: 6ws at https://github.com/ffvvc/FFmpeg/issues/187#issuecomment-1962842135
2024-03-04 20:39:27 +08:00
Niklas Haas
679d5611ed doc/ffprobe.xsd: add <components> and <pieces>
Originally introduced for dovi side data printing, but not properly
reflected in the xsd.
2024-03-04 12:51:21 +01:00
Niklas Haas
245eb67160 doc/ffprobe.xsd: add frameSideDatumType entry
Frame-level side data attributes are printed with the same key/value
structure as packet-level side data attributes, but this is not
reflected in the XSD.
2024-03-04 12:51:21 +01:00
Andreas Rheinhardt
edfb4325e7 fftools/cmdutils: Inline print_error()
It is only used by ffprobe (once) and ffplay (twice);
inlining it avoids including it unnecessarily into ffmpeg.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-04 12:07:58 +01:00
Marth64
b065ffb295 doc/demuxers: emphasize that DVD demuxer does not do decryption
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-03-04 11:38:25 +01:00
Marth64
e3a137bef3 Changelog: restore new line
A new line was removed in a1304272c3
which breaks consistency in between versions.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-03-04 10:52:12 +01:00
Marth64
01476f752a avformat/dvdvideodec: fix -pgc and -pg options
Rebased on top of recently merged fixes (should apply correctly now).

In merged DVD patch, -pgc and -pg options were broken. While these are
rather advanced options, they are the only means to get content for
some strangely authored discs.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-03-04 10:47:57 +01:00
Martin Storsjö
e30369bc1c aarch64: Use regular hwcaps flags instead of HWCAP_CPUID for CPU feature detection on Linux
This makes the code much simpler (especially for adding support
for other instruction set extensions), avoids needing inline
assembly for this feature, and generally is more of the canonical
way to do this.

The CPU feature detection was added in
493fcde50a, using HWCAP_CPUID.

The argument for using that, was that HWCAP_CPUID was added much
earlier in the kernel (in Linux v4.11), while the HWCAP flags for
individual features always come later. This allows detecting support
for new CPU extensions before the kernel exposes information about
them via hwcap flags.

However in practice, there's probably quite little advantage in this.
E.g. HWCAP2_I8MM was added in Linux v5.10 - long after HWCAP_CPUID,
but there's probably very little practical cases where one would
run a kernel older than that on a CPU that supports those instructions.

Additionally, we provide our own definitions of the flag values to
check (as they are fixed constants anyway), with names not conflicting
with the ones from system headers. This reduces the number of ifdefs
needed, and allows detecting those features even if building with
userland headers that are lacking the definitions of those flags.

Also, slightly older versions of QEMU, e.g. 6.2 in Ubuntu 22.04,
do expose support for these features via HWCAP flags, but the
emulated cpuid registers are missing the bits for exposing e.g. I8MM.
(This issue is fixed in later versions of QEMU though.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-03-04 10:13:31 +02:00
Andreas Rheinhardt
4ed0fea0fa avcodec/aactab: Deduplicate ltp_coef and tns_tmp2_map tables
This will allow to make aac_defines.h decoder-only.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-04 02:11:53 +01:00
Andreas Rheinhardt
b9dea251d5 avcodec/aacdec: Move buffer to reduce padding
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-04 02:11:50 +01:00
Andreas Rheinhardt
aaf26cffba avcodec/lpc: Split inline functions into a header of their own
And move compute_ref_coefs() to its only user: lpc.c
There is no overlap between the users of compute_lpc_coefs()
and lpc proper.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-04 02:11:38 +01:00
Andreas Rheinhardt
08aa791d20 avcodec/lpc: Don't use AAC defines directly
It leads to defines for the AAC decoder being included
outside of the AAC decoder.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-04 02:11:19 +01:00
Marton Balint
0aaee4741c avformat/mpegts: detect synchronous metadata KLV more reliably
The mpegts code historically tries to strip (the first) metadata access unit
header from synchronous KLV metadata, but the detection for such streams was
unreliable causing strips of asynchronous metadata or ID3 as well.

MISB ST 1402 specifies required stream type, stream id and registration
descriptor (which eventually maps to the codec ID) so let's use all of these
for reliable detection.

Fixes a regression caused by 468615f204.

Fixes ticket #10828, #10883.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-04 00:33:20 +01:00
Andreas Rheinhardt
c0a1ce1c40 avutil/hwcontext_opencl: Allocate pub and priv frames hwctx together
This is possible because the lifetime of both coincide.
Besides reducing the number of allocations this also simplifies
access to OpenCLFramesContext as one no longer has to
go through AVHWFramesInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-04 00:05:11 +01:00
Andreas Rheinhardt
c305dbf745 avutil/hwcontext_opencl: Allocate pub and priv device hwctx together
This is possible because the lifetime of both coincide.
Besides reducing the number of allocations this also simplifies
access to OpenCLDeviceContext as one no longer has to
go through AVHWDeviceInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-04 00:04:38 +01:00
Andreas Rheinhardt
1b7308b61d avutil/vulkan: Remove unused ff_vk_set_descriptor_sampler()
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-03 22:56:25 +01:00
Andreas Rheinhardt
c346c097af avutil/vulkan: Make ff_vk_set_descriptor_image() static
Only used in vulkan.c.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-03 22:56:21 +01:00
Andreas Rheinhardt
c0d31cec7f avutil/vulkan: Avoid shadowing
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-03 22:56:17 +01:00
Andreas Rheinhardt
0a05577d1e avutil/vulkan_loader: Avoid relocations for strings
To do so, concatenate all the names together to one big string
name1\0name2\0....lastname\0\0. This avoids the pointer in
the FunctionLoadInfo structure and thereby moves vk_load_info
into .rodata (and makes it smaller by 888B).

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-03 22:56:07 +01:00
Andreas Rheinhardt
674f20813d avutil/vulkan_loader: Use smaller types
Saves 16B per entry here (four of these 16 bytes are padding);
leads to 1776 B of savings in each file that uses
ff_vk_load_functions().

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-03 22:55:52 +01:00
Andreas Rheinhardt
e9b4f4461f avutil/vulkan_loader: Avoid redundant strings and relocations
There are three possible names for the functions requested;
they only differ in an extension: "", "EXT" or "KHR".
Yet vk_load_info contained pointers to all these strings.
This is wasteful and this commit changes it to avoid
the latter two strings. This saves 6353B of strings,
1776 B of .data.rel.ro as well as 5328 B due to the removed
relocations (corresponding to 2 * 111 removed pointers)
in lavc/vulkan_decode.o alone (ff_vk_load_functions()
is inlined in lavfi/vulkan_filter.c, lavu/hwcontext_vulkan.c
and lavc_vulkan_decode.c, so the savings are three times
this for shared builds; for static builds, the number may
be smaller depending upon whether strings are deduplicated).

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-03 22:55:44 +01:00
Andreas Rheinhardt
e429b0fdb7 avutil/vulkan: Don't autoinclude vulkan_loader.h
Only include it where necessary.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-03 22:55:26 +01:00
Andreas Rheinhardt
a172d80703 avcodec/x86/fpel: Remove remnants of MMX
Since 7cad4dba50
averaging functions only exist for MMXEXT and SSE2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-03 19:48:41 +01:00
Andreas Rheinhardt
cb15b7b29e avcodec/vulkan_video: Don't use sparse table
ff_vk_codec_map currently is an array indexed by AVCodecID;
it has AV_CODEC_ID_FIRST_AUDIO (= 65536) entries, but uses
only three of them; only 24B of 1MiB were actually used

This commit fixes this by adding an AVCodecID field to the table
and making it non-sparse.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-03 17:17:13 +01:00
Andreas Rheinhardt
c6e1793e7a fftools/ffprobe: Print dispositions generically
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-03 17:16:45 +01:00