1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00
Commit Graph

119489 Commits

Author SHA1 Message Date
1a9a2bafc8 apv_decode: Improve reporting of decode errors
Halt tile component decoding at the first entropy error (this will be a
desync and is not recoverable).  If any tile components contain errors
then discard the frame unless the output-corrupt flag is set.

Also fixes CID 1646764, which is the error case where the tile component
is too large for get_bits to handle.
2025-05-05 17:22:57 +01:00
5acd2145a4 apv_decode: Fix memory leak on decode error 2025-05-05 17:22:57 +01:00
135acc8e61 cbs_apv: Always restore tracing state on split fragment error
Fixes CID 1646769.
2025-05-05 17:22:57 +01:00
a9557c1f26 avcodec/apv_decode: build the lut table only once
No reason to build the exact same table once per decoding thread.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-05 13:19:29 -03:00
0af1d69959 avcodec/hevc/hevcdec: move the slice header buffer overread check up in the function
Abort as soon as we're done reading the slice header instead of running extra checks
that assume slice data may follow.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-05 12:55:03 -03:00
d34c738435 avcodec/hevc/hevcdec: ensure a bit was read when checking for alignment_bit_equal_to_one
Prevents printing bogus errors about the value being 0, when in fact we
overread the available slice buffer.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-05 12:55:03 -03:00
62f7b43b53 tests/api/api-dump-stream-meta-test: Fix leaks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-05 17:03:39 +02:00
f4e72eb5a3 configure: Enable -fno-common for Darwin targets, avoid linker warnings
Since GCC 10 and llvm.org Clang 11, -fno-common is the default.
However Apple's Xcode Clang hasn't followed suit yet, and still
defaults to -fcommon.

Compiling with -fcommon causes uninitialized global variables to
be treated as "common" (which allows multiple object files to have
similar definitions).

Common variables seem to have the issue that their intended alignment
isn't signaled, so the linker assumes that they may need alignment
according to their full size.

With large global tables, this can lead to linker warnings like
this, with Xcode 16.3:

    ld: warning: reducing alignment of section __DATA,__common from 0x8000 to 0x4000 because it exceeds segment maximum alignment

This can be reproduced with a small snippet like this:

    char table[16385];
    int main(int argc, char* argv[]) { return 0; }

Compiling with -fno-common avoids this issue and warning, and
matches the default behaviour of other compilers. (Compiling with
-fno-common also avoids the risk of accidentally accepting
duplicate definitions of global variables, as long as they are
uninitialized.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-05-05 11:35:11 +03:00
a0349d64fd avformat/apvdec: also look for an au_info PBU during probing
If present, an Access unit information PBU must be the first in an AU.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-04 16:26:57 -03:00
d08c5527cf avcodec/exr: add support for half-float DWAA/B compression
Fixes ticket #11555.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-04 16:22:28 -03:00
0cabfdc8bc avcodec/apv_parser: use an AVBufferRef to avoid data copying
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-04 16:22:14 -03:00
4bfe9c5663 avcodec/cbs: add an AVBufferRef input argument to ff_cbs_read()
To allow taking a reference from an existing buffer outside of AVPackets.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-04 16:22:14 -03:00
fab691edaf avcodec: add APV encoder using liboapv
Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-04 16:21:35 -03:00
7faa560f1a postproc/tests/blocktest: Test several filter combinations
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:27 +02:00
fc3035e3c4 postproc/tests/blocktest: initialize qp array randomly to for testing
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:26 +02:00
71e25beb5c postproc/tests/blocktest: use dimensions
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:26 +02:00
fd9adbdbfb postproc/postprocess_template: fix dering with a 16x16 image
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:26 +02:00
d153b00534 postproc/tests/stripetest: use dimensions
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:25 +02:00
917c15435a libpostproc: check minimum size
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:25 +02:00
26bbca84de postproc/tests: Add test for temporal denoise
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:25 +02:00
75be669ca1 avformat/hls: Fix flash1.bogulus.cfd support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:24 +02:00
f99f223eb1 avformat/hls: Split allowed_segment_extensions off allowed_extensions
This allows the user to set only the one that is needed to ALL or a
specific "wrong" extension like html

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:24 +02:00
1dbc5675c1 fftools/ffprobe: Disable stderr buffering on Windows
An identical call exists in ffmpeg.c

With POSIX/glibc, stderr is already unbuffered (or line-buffered when
a terminal is connected), but not in case of MSVCRT.
Explicitly calling setvbuf() like in this commit, makes the Windows
runtime behave like POSIX, giving the same “print immediately” behavior.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:58:08 +02:00
b322640b4f fftools/ffmpeg: Log exit code on exit
When viewing logs, there are situations where it is not entirely
clear whether ffmpeg CLI has exited gracefully. The two primary cases
are

- A crash/segfault has occured
  Windows for example doesn't output any message to the calling shell
- The process has been terminated (e.g. killed externally)

Printing a message on exit provides a reliable indication that the
process has exited normally.
Printing the exit code is useful as it usually remains invisible
and unnoticed by users running FFmpeg from a shell.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:57:27 +02:00
26429eee22 libavformat/asfdec: Fix regression bug when reading image attachments
Commit c8140fe732 had introduced
a check for value_len > UINT16_MAX.
As a consequence, attached images of sizes larger than UINT16_MAX
could no longer be read.

This is a minimal fix of the regression, avoiding the controversies
of my earlier submission regarding int type handling in asfdec.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:57:15 +02:00
1a083a4d90 fftools/ffmpeg: Include elapsed-time in print_report()
It's a highly useful metric, both at runtime and when viewing logs.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:57:01 +02:00
7a05f57250 avutil/opt: Print default option value for AV_OPT_TYPE_INT64
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:56:46 +02:00
3a93fadac1 avformat/dump: Stream start offsets: change precision and label
- Change precision to 6 digits to align with other printed times
- Change label to just "Start"
- Add 's' unit to format 'start' value for consistency

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:56:04 +02:00
33d0d1c672 avformat/apvdec: don't fill container level fields with codec level info
This is a raw demuxer, it should not read codec level information and export it
as container level information.
The generic demux code will use the recently introduced parser to take care of
that.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-01 22:42:41 -03:00
c4ea4abec2 avcodec: add an APV parser
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-01 22:42:34 -03:00
8ebccdf2a4 avformat/av1dec: fix setting AVPacket->pos in Annex-B demuxer
This demuxers reads encapsulation bytes before reading codec data into the
output packets, so take such offset into consideration.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-01 14:24:04 -03:00
707c04fe06 ffv1enc_vulkan: support 8 and 16-bit 2-plane YUV formats
This adds support for all 8-bit and 16-bit 2-plane formats.
P010 and others require more work as the data's LSB-padded.
2025-05-01 09:34:44 +02:00
33a4d36101 hwcontext_vulkan: support AV_PIX_FMT_GBRP
Support was partially added previously in vulkan.c, but now it's fully
supported.
2025-05-01 09:34:44 +02:00
9c0349cca1 aacdec_usac: correct Mps212 parsing location
It gets parsed after SBR, even if there is no SBR.
2025-05-01 09:34:39 +02:00
e80f32f3bd avcodec/cbs_apv: don't return an error when reading empty buffers
The output will be a fragment with zero units, which is a lot more user friendly
than making them think something went wrong, as it already happens with cbs_av1.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-30 19:15:19 -03:00
a8bae9b18d fate: Add test for APV 422-10 profile
Bitstream generated using the reference encoder, then edited to fix the
colour description and an extra metadata block added.  FFmpeg decoder
output is identical to the reference decoder output.

The content used is the first three frames of "Waterfall" from the SVT
Open Content Video Test Suite 2022.  This is copyright Sveriges
Television AB and is used under the Creative Commons Attribution 4.0
International License.
2025-04-30 22:57:56 +01:00
585455f7b3 apv_decode: Replace division with shift
The compiler can't see that this should be a shift and generates a real
division which is slow enough to appear in profiles on its own.
2025-04-30 22:57:56 +01:00
0b588bfb51 avcodec/apv_dsp: Fix left-shift of negative value
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-30 23:38:21 +02:00
c681d8e8a8 avformat/apvdec: Remove inappropriate INIT_CLEANUP flag
The init-cleanup flag makes no sense for a demuxer without
a read_close() function.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-30 23:34:47 +02:00
f98c63e417 avformat/apvdec: Fix seeking
pkt->pos pointed to the actual packet data, not to the start
of the access unit.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-30 23:34:28 +02:00
8279d02cf1 avformat/apvdec: Check before access
The signature check would segfault in case the packet could not
be allocated or if nothing could be read.
Furthermore, read_packet callbacks are supposed to return zero
on success, yet the current code returned the size of the packet.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-30 23:33:39 +02:00
0a12b84d3b avformat/apvdec: Use ffio_read_size()
Fixes potential use of uninitialized data.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-30 23:32:55 +02:00
48c0dba23b avformat/hls: Fix Youtube AAC
Fixes: Ticket11435
Fixes: yt-dlp -f 234+270 https://www.youtube.com/live/l8PMl7tUDIE

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-30 00:06:17 +02:00
2431fd0b27 tests: Add stream dump test API util, use it to dump stream data for chained ogg/{vorbis, opus, flac} streams.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-30 00:03:00 +02:00
d82016c730 avformat/hls: add fmp4 to allowed_extensions
Fixes: yt-dlp/issues/12700

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-29 22:59:24 +02:00
68644994fd avformat/hls: Add ec3 to allowed_extensions
Fixes part of Ticket11435
Fixes: Elisa Viihde (Finnish online recording service)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-29 22:59:24 +02:00
0da6ddfc01 avformat/hls: Point user to how to easily contribute a fix for missing extensions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-29 22:59:23 +02:00
2352145e41 avformat/hls: Add cmfv and cmfa to allowed_extensions
Fixes: www.nicovideo.jp
Fixes: Ticket11526
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-29 22:59:23 +02:00
ab8e160f71 avcodec: Fix fate-checkasm-hevc_pel failed on LA.
Some loop counters were initialized incorrectly.
This patch enhances the handling of loop iterations and residual parts.

Reviewed-by: 陈昊 <chenhao@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-29 22:59:23 +02:00
d9bd8e9eb1 doc/ffprobe: remove entry for show_format_entry
The option was removed in 1dd6363581.
2025-04-29 14:42:01 +05:30