Commit Graph

115042 Commits

Author SHA1 Message Date
arch1t3cht e9e1932c1c avcodec/h264dec: Reindent after the previous commit
Signed-off-by: arch1t3cht <arch1t3cht@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-16 16:36:22 +01:00
arch1t3cht 728ffe6ca6 avcodec/h264dec: Handle non-recovered frames when draining
When starting on a SEI recovery point close enough to the end of
the stream that draining starts before the recovery point's frame
is output, there can be non-recovered frames in the delayed picture
buffer that would currently cause the decoder to fail to output a
frame. This commit skips such frames and outputs the first recovered
frame, if there exists one.

Signed-off-by: arch1t3cht <arch1t3cht@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-16 16:36:22 +01:00
arch1t3cht 5a856ac6e6 avcodec/h264dec: Properly mark frames as recovered when draining
When decoding starts at a SEI recovery point very shortly before the
end of the video stream, there can be frames which are decoded before
the recovery point's frame is output and which will only be output once
the draining has started. Previously, these frames would never be set
as recovered. This commit copies the logic from h264_select_output_frame
to send_next_delayed_frame to properly mark such frames as recovered.

Fixes ticket #10936.

Signed-off-by: arch1t3cht <arch1t3cht@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-16 16:36:22 +01:00
James Almer 6b6a0fc53d avformat/iamf_writer: reject duplicated stream ids in a stream group
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-16 11:43:10 -03:00
Antoine SOULIER 257bc2a82a avformat/lc3: add file format for LC3/LC3plus transport
A file format is described in Bluetooth SIG LC3 and ETSI TS 103 634, for
test purpose.
2024-04-15 18:34:12 +02:00
Stefano Sabatini b2bc4ac69e doc/utils/eval: review and extend, clarify ld/st index meaning
Prefer idx in place of id for functions accessing the internal
variables, and add a short introduction to mention them.
2024-04-15 18:32:38 +02:00
Stefano Sabatini 8ceb37d5ad doc/utils/eval: clarify meaning of random* seed value
Possible address trac issue:
http://trac.ffmpeg.org/ticket/10763
2024-04-15 18:30:35 +02:00
Frank Plowman 993c231de0 lavc/vvc: Increase size of ctb_size_y
sps_log2_ctu_size_minus5 is between 0 and 2, with 3 reserved for future
use.  The VVC decoder allows sps_log2_ctu_size_minus5 to be 3, and so
ctb_size_y should be at least 16 bits to prevent overflows.  An
alternative patch would leave sps_log2_ctu_size_minus5 as 8 bits and
disallow sps_log2_ctu_size_minus5 = 3.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-15 21:06:13 +08:00
LuMingYin 5e380bcdb1 avfilter/af_channelsplit: fix memory leak
Signed-off-by: LuMingYin <lumingyindetect@163.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-15 10:30:46 +08:00
Lynne db09f1a5d8
vulkan_av1: add workaround for NVIDIA drivers tested on broken CTS
The first release of the CTS for AV1 decoding had incorrect
offsets for the OrderHints values.
The CTS will be fixed, and eventually, the drivers will be
updated to the proper spec-conforming behaviour, but we still
need to add a workaround as this will take months.

Only NVIDIA use these values at all, so limit the workaround
to only NVIDIA. Also, other vendors don't tend to provide accurate
CTS information.
2024-04-15 02:40:02 +02:00
Mark Thompson 3cca8dfbd8 lavc/vulkan_av1: Use av1dec reference order hint information 2024-04-14 21:05:08 +01:00
Mark Thompson 22ced1edc6 lavc/av1: Record reference ordering information for each frame
This is needed by Vulkan.  Constructing this can't be delegated to CBS
because packets might contain multiple frames (when non-shown frames are
present) but we need separate snapshots immediately before each frame
for the decoder.
2024-04-14 21:05:05 +01:00
Andreas Rheinhardt f48987f609 doc/muxers.texi: Don't use confusing variable name
reserve_index_space is a size, not an index.
Also refer to the variable in the description.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-14 17:25:16 +02:00
Diego Felix de Souza 1f265aa91d avcodec/nvenc: Multi NVENC Split Frame Encoding in HEVC and AV1
When Split frame encoding is enabled, each input frame is partitioned into
horizontal strips which are encoded independently and simultaneously by
separate NVENCs, usually resulting in increased encoding speed compared to
single NVENC encoding.

Signed-off-by: Diego Felix de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-04-13 18:00:43 +02:00
Kacper Michajłow 1c45104f74 avcodec/h2645_sei: validate Mastering Display Colour Volume SEI values
As we can read in ST 2086:

Values outside the specified ranges of luminance and chromaticity values
are not reserved by SMPTE, and can be used for purposes outside the
scope of this standard.

This is further acknowledged by ITU-T H.264 and ITU-T H.265. Which says
that values out of range are unknown or unspecified or specified by
other means not specified in this Specification.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-04-13 17:50:49 +02:00
Zhao Zhili 65c1c83ca4 avformat/tls_mbedtls: Pass FLAG_NONBLOCK to underlying transport
This fix rtmps failure since rtmps requires nonblocking read.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-12 15:24:17 +08:00
Shiyou Yin 2a7d622ddd
swscale: [LA] Optimize swscale funcs in input.c
Optimized 7 funcs with LSX and LASX:
1. yuy2ToUV_c
2. yvy2ToUV_c
3. uyvyToUV_c
4. nv12ToUV_c
5. nv21ToUV_c
6. abgrToA_c
7. rgbaToA_c

Reviewed-by: colleague of Shiyou Yin
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-11 23:53:59 +02:00
Shiyou Yin 8b76df9142
swscale: [LA] Optimize yuv2plane1_8_c.
Reviewed-by: colleague of Shiyou Yin
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-11 23:53:59 +02:00
Shiyou Yin f3fe2cb5f7
swscale: [LA] Optimize range convert for yuvj420p.
Reviewed-by: 陈昊 <chenhao@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-11 23:53:41 +02:00
James Almer dd5f665b40 avutil/frame: free the old side data buffer before replacing it
Fixes memleaks reported by ASAN/Valgrind.

Reported-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 12:32:13 -03:00
James Almer 6d0c89980c avcodec/hevcdec: export global side data in AVCodecContext
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:48:39 -03:00
James Almer 6def8e3923 avcodec/decode: add AVFrameSideData helper wrappers that don't depend on frames
They will be useful to fill arrays stored in other structs.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:46:23 -03:00
James Almer 6d760c666d avutil/mastering_display_metadata: add a new allocator function that returns a size
av_mastering_display_metadata_alloc() is not useful in scenarios where you need to
know the runtime size of AVMasteringDisplayMetadata.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:46:18 -03:00
James Almer adb67bba06 avutil/version: bump minor after recent AVFrame API additions
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:43:51 -03:00
James Almer 662dbf826d avutil/frame: add helper to remove side data of a given type from an array
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 09:18:19 -03:00
James Almer 55621f6fae avutil/frame: add a flag to allow overwritting existing entries
Enable it only for side data types that don't allow more than one entry.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 09:18:19 -03:00
James Almer a16338089c avutil/frame: add helper for adding side data w/ AVBufferRef to array
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 09:18:19 -03:00
Martin Storsjö e4f5c2414b tests/movenc: Validate that normal muxer usage doesn't print warnings
We have test to make sure that certain configurations do print
warnings. However, the normal operation of the muxer within this
test always printed a warning, so those tests to check for
extra warnings didn't essentially guard anything.

The warning that always was printed, "track 1: codec frame size is
not set" was not present in the libav fork where this testcase
originated, it was removed in f234e8a32e.

Set the frame size for the audio stream to silence the warning,
and use this frame size in a couple later calculations, and check
that one test configuration doesn't print warnings.

Setting the frame size apparently changes the rounding of a timestamp
in the ismv muxing testcase.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-11 14:08:55 +03:00
Andreas Rheinhardt 497a0f839d avformat/img2: Avoid relocations for ff_img_tags
The strings here are so short that using a pointer is wasteful
(the longest string takes nine bytes; on 64 bit systems,
the pointer+padding already take 12 bytes). So avoid them
and add asserts to ensure that no one ever tries to use a too
long tag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 1533351990 avcodec/flacenc: Avoid shift where possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 0458fdbeed avcodec/ac3enc: Avoid calculating the CRC multiple times
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 28ffc39808 avcodec/ac3enc: Move EAC-3 specific initialization to eac3enc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 2281ab5c24 avcodec/ac3enc: Avoid function pointers to initialize MDCT
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 6c55cb95ed avcodec/ac3enc_float: Remove uninformative error message
AVERROR(ENOMEM) is enough.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 3cd136bc12 avcodec/ac3enc: Deduplicate copying input samples
These memcpy operands only depend upon sizeof(SampleType)
(and this size is actually the same for both the fixed-point
and the floating-point encoders for most (all supported?)
systems).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 7311a9086e avcodec/ac3enc: Deduplicate allocating buffers
These allocations only depend upon sizeof(SampleType)
(and this size is actually the same for both the fixed-point
and the floating-point encoders for most (all supported?)
systems).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 2fcc50d1f5 avcodec/ac3enc: Share more code between fixed/float encoders
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 1042ee36cd avcodec/ac3enc: Move ff_ac3_validate_metadate() upwards
Will avoid a forward declaration in the next commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 6244ecf8ec avcodec/ac3enc: Use common encode_frame function
This is in preparation for sharing even more stuff
common to the fixed and floating-point encoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt fee093a570 avcodec/ac3enc: Remove disabled code for RealAudio variant of AC-3
Implicitly disabled by 4679a474f0.
Given that no one has ever complained about this, this commit
removes the now dead code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:52:46 +02:00
Andreas Rheinhardt 27a830c1d8 avcodec/ac3enc: Remove always-false sample rate check
encode_preinit_audio() already checks that the sample rate
is among AVCodec.supported_samplerates.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt e878ec7eb2 avcodec/ac3enc: Avoid copying strings
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt 8261d5d38c avcodec/ac3enc: Use bit-operations for bit-mask
Simply masking the LFE bit is more natural than subtracting
if set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt b3d12fe200 avcodec/ac3enc: Remove redundant channel layout checks
These are all checked generically via AVCodec.ch_layouts
in encode_preinit_audio().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt 13daafd5c0 avcodec/ac3enc: Don't overwrite AVCodecContext.ch_layout
This is unnecessary (the channel layout guessing code became
moot when the channel layouts were enforced generically)
and also dangerous, as a custom channel layout mapping
would leak in case one was used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt c3fb0c5bab avcodec/ac3enc: Don't presume ch_layout to be AV_CHANNEL_ORDER_NATIVE
It is perfectly legal for users to use a custom layout
that is equivalent to a supported native one.
In this case the union in AVChannelLayout is not an uint64_t mask,
but a pointer to a custom map.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Anton Khirnov 0e4dfa4709 Revert "bsf: use standard include paths"
This reverts commit 41b73ae883.

This patch was pushed extremely quickly, without giving developers the
time to object.
2024-04-10 15:17:54 +02:00
J. Dekker 985fdf8e3d tests/checkasm: add exclude_guest for non-x86 linux perf
The exclude_guest option only has an effect on x86. Omitting
'exclude_guest' defaults to zero which implies that you can count guest
events should you run one. Some non-x86 kernels just ignore it, while
others (e.g. the Asahi Linux kernels) require the user to explicitly set
the option to 1, i.e. the only behaviour that makes sense when counting
guest events isn't supported.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-04-10 13:37:40 +02:00
Lynne 89a9042291
lavc/avfft: fix RDFT wrapper stride
Per the lavu/tx docs:

> * For forward transforms (R2C), stride must be the spacing between two
> * samples in bytes. For inverse transforms, the stride must be set
> * to the spacing between two complex values in bytes.

The code did the reverse.
The stride parameter is currently not respected for RDFT transforms,
but has to be correct, for a potential future change.
2024-04-10 13:22:18 +02:00
Fei Wang 0534d2ac84 lavfi/dnn_backend_torch: Include mem.h
Fix build fail since 790f793844.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-04-10 18:18:49 +08:00