1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-19 05:49:09 +02:00

117867 Commits

Author SHA1 Message Date
James Almer
b328bf8f7e avformat/mov: rename MOVCtts.duration to offset
The value is a timestamp offset, not a duration.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 20:50:05 -03:00
Scott Theisen
0dceced45c avformat/mpegts: add DVB descriptor_tag values already in use
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-22 21:11:18 +01:00
James Almer
46c6ca3ed1 avcodec/libfdk-aacenc: export CPB properties
Needed to signal the muxer that the stream is VBR.

Finishes fixing ticket #11303.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:57:03 -03:00
James Almer
944212acad avformat/movenc: don't write a calculated avgBitrate when the provided one is unset
avgBitrate == 0 is used to signal a VBR track, so if that value is propagated by an
encoder, don't overwrite it with a calculated value based on track size.

Part of a fix for ticket #11303.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:57:03 -03:00
James Almer
5813e5aa34 avformat/hevc: fix writing hvcC when no arrays are provided in hvcC-formatted input
Don't reject extradata with missing PS NALUs if array_completeness is not
requested.

Fixes a regression since a696b28886.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:52:31 -03:00
James Almer
f0051604c7 avformat/movenc: don't write PS NALUs in hvcC for codec tag hvc1
array_completeness shall be 1 for those tracks.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:49:32 -03:00
Pavel Koshevoy
46cb7b8d9d avutil/frame: also align data pointers in av_frame_get_buffer()
This avoids unpleasant surprises to av_frame_get_buffer callers
that explicitly specified 64-byte alignment and didn't get
AVFrame.data pointers that are 64-byte aligned.

For example, see https://github.com/sekrit-twc/zimg/issues/212

Although the zscale issue has already been resolved by other means
it would still be prudent to improve the behavior of av_frame_get_buffer
to fix any unknown and future instances of similar issues.

Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:43:55 -03:00
James Almer
ea91d978e3 avutil/frame: fix setting plane_padding
STRIDE_ALIGN is a lavc define and is not necessarely 32. And align may be <= 0 at the
point plane_padding is being set.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:43:55 -03:00
James Almer
09122bd15c avutil/frame: use size_t for total_size in get_video_buffer()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:43:55 -03:00
Niklas Haas
2d077f9acd swscale/internal: group user-facing options together
This is a preliminary step to separating these into a new struct. This
commit contains no functional changes, it is a pure search-and-replace.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-21 12:49:56 +01:00
Niklas Haas
10d1be2621 swscale/internal: use static_assert for enforcing offsets
Instead of sprinkling av_assert0 into random init functions.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-21 12:47:43 +01:00
Niklas Haas
55d5eae411 swscale/options: cosmetic changes
Reorganize the list, fix whitespace, make indentation consistent, and
rename some descriptions for clarity, consistency or informativeness.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-21 12:47:14 +01:00
Peter Ross
f298507323 avcodec/mm: decode raw chunk type and skip unknown audio chunk type 2024-11-21 19:41:12 +11:00
Peter Ross
66124bc368 avcodec/mm: don't fail if x offset exceeds frame width 2024-11-21 19:41:12 +11:00
Peter Ross
63ea1660fa avcodec/mm: decode partial palette 2024-11-21 19:41:12 +11:00
Peter Ross
ac2442f0a7 avcodec/mm: set audio pts proportionally to audio offset 2024-11-21 19:41:12 +11:00
Marth64
3528bfed45 avformat/smoothstreamingenc: check return value of avcodec_parameters_copy()
Written in the dominant style of the surrounding code block.

Reviewed-by: ePirat <epirat07@gmail.com>
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-20 23:36:13 -06:00
Scott Theisen
be784e95ac avformat/mpegts: add support for ATSC E-AC-3 streams
ATSC A/52:2018 Digital Audio Compression (AC-3, E-AC-3), Annex G
defines stream_type 0x87 for E-AC-3 bit streams.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-21 00:59:09 +01:00
Michael Niedermayer
7051825b01
doc/developer: Document relationship between git accounts and MAINTAINERS
This should have been documented long ago and i thought it was

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-20 21:28:14 +01:00
Michael Niedermayer
edc4855f77
doc/infra: Document trac backup system
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-20 21:28:13 +01:00
Michael Niedermayer
8a21d8baf9
doc/infra: clarify domain name servers
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-20 21:28:13 +01:00
Richard Mitic
67c2f80d2c libaformat/mp3dec: Register the MIME type "audio/mpeg" to the mp3 decoder.
Some mp3 files look surprisingly like mpeg PS streams. In order for us
to hint to ffmpeg that the file really is mp3, we can deliver it with a
mime type. The mp3 probe therefore needs to have a mime type registered,
(which is previously did not).
2024-11-20 15:48:19 +01:00
Zhao Zhili
05e079c948 avcodec/mediacodecenc: add async mode support
It has better performance than poll in a loop.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-20 19:23:51 +08:00
Zhao Zhili
9aacbfb6ca avcodec/mediacodec_wrapper: add async mode support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-20 19:23:13 +08:00
Zhao Zhili
fa2ff5effc avcodec/mediacodecenc: Add operating_rate option
For example, with
./ffmpeg -operating_rate 400 -hwaccel mediacodec -i test.mp4 -an \
  -c:v h264_mediacodec -operating_rate 400 -b:v 5M -f null -
The transcoding speed is 254 FPS.
Without -operating_rate on dec/enc, the speed is 148 FPS.
With -operating_rate on decoder only, the speed is 239 FPS.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-20 19:22:58 +08:00
Zhao Zhili
46ad1abd36 avcodec/mediacodecdec: Add operating_rate option
The codec wants to know whether the usecase is realtime playback
or full-speed transcoding, or playback at a higher speed. The codec
runs faster when operating_rate higher than framerate.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-20 19:20:59 +08:00
Zhao Zhili
a8375346eb fftools/ffplay_renderer: Fix a typo
The typo has no real effect except confusing.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reported-by: Chen Haibo
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2024-11-20 19:17:37 +08:00
Lynne
aad40fed33
vulkan: fix sw_frame_deps counter
The code used as a basis was the buffer dependency code, where the
counter was incremented after each buffer, but for the sw_frame dep
API, we only support adding individual frames at a time.
2024-11-20 05:47:41 +01:00
Lynne
4d3e96c90c
lavc/vulkan/common: fix reverse4's incorrect swizzle
The function is responsible for converting little to big endian.
It had an incorrect swizzle for the last 2 bytes.
2024-11-20 05:23:36 +01:00
Lynne
9691ac6af2
ffv1enc_vulkan: increase max outstanding byte count to 16bit
The issue is that at higher resolutions, the outstanding byte counter
overflowed in case the image had a lot of blank areas.
2024-11-20 05:23:35 +01:00
Lynne
ebf5264c93
ffv1enc_vulkan: fix PCM encoding
This line was mysteriously deleted.
2024-11-20 05:23:35 +01:00
Lynne
eb536d97a0
ffv1enc_vulkan: support buffers larger than 4GiB
Unlike the software FFv1 encoder, none of our buffers are allocated by
FFmpeg, which supports at most 4GiB large allocations.

For really large sizes, the maximum size of the buffer can exceed 4GiB,
which the software encoder optimistically tries to allocate as 4GiB
in the hopes that the encoder will compress to under that amount.

We can just let Vulkan allocate us a larger buffer, and switch to
64-bit offsets.
2024-11-20 05:23:05 +01:00
Leandro Santiago
69cbda5770 lavfi/vf_drawtext: fix memory management when destroying font face
Ref https://trac.ffmpeg.org/ticket/11152

According to harfbuzz docs, hb_ft_font_set_funcs() does not need to be
called, as, quoted:

```
An #hb_font_t object created with hb_ft_font_create()
is preconfigured for FreeType font functions and does not
require this function to be used.
```

Using this function seems to cause memory management issues between
harfbuzz and freetype, and could be eliminated.

This commit also call hb_ft_font_changed() when the underlying FC_Face
changes size, as stated on hardbuzz:

```
HarfBuzz also provides a utility function called hb_ft_font_changed() that you should call
whenever you have altered the properties of your underlying FT_Face, as well as a hb_ft_get_face()
that you can call on an hb_font_t font object to fetch its underlying FT_Face.
```

Finally, the execution order between hb_font_destroy() and
hb_buffer_destroy() is flipped to match the order of creation of
the respective objects.

Signed-off-by: Leandro Santiago <leandrosansilva@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-19 23:50:49 +01:00
James Almer
9d8f7bf4b8 tests/checkasm/diracdsp: fix alignment for src and ombc_weight buffers
They are supposed to be 16 byte aligned, not 8.
Should fix crashes in some systems.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-19 12:32:49 -03:00
Eugene Zemtsov
e9c3698ed2 avcodec/decode: Fix incorrect enum type used in side_data_map()
It's AVPacketSideDataType, not AVFrameSideDataType.

Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-18 15:55:57 -06:00
James Almer
d6b39373a2 avcodec/ffv1enc: restore header writing behavior for version > 1
Broken by accident in a6c58353ac0.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-18 18:21:54 -03:00
Brad Smith
f3eca3f387 libavutil/riscv: Make use of elf_aux_info() on FreeBSD / OpenBSD riscv
libavutil/riscv: Make use of elf_aux_info() on FreeBSD / OpenBSD riscv

FreeBSD/OpenBSD riscv have elf_aux_info().

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-11-18 22:09:07 +02:00
Rémi Denis-Courmont
607d4cca8e riscv/h264dsp: remove spurious instruction 2024-11-18 22:02:19 +02:00
Lynne
66093c5b94 ffv1enc_vulkan: restrict number of execution contexts to 1
This only leads to wasting memory in a single-threaded operation.
Limit this to 1 for now and leave a comment.
2024-11-18 20:04:24 +01:00
Rémi Denis-Courmont
b75dff0e20 lavc/h264dsp: fix R-V V weight_pixels pointer arithmetic
As of 459a1512f13ae1fdd404ff9281b02d225ac70a09,
the code is unrolled to process two rows per iteration.
The output cursor thus needs to be incremented by twice the
stride, which is taken care of with SH1ADD. However the original
ADD from the original implemetation was incorrectly left over.
2024-11-18 20:04:58 +02:00
Rémi Denis-Courmont
e29432e6bb lavu/riscv: fix compilation without Vector support
The half-baked assembler in Clang 16 and earlier can't process our
RISC-V assembler. This adds yet another work around that.

If you must use Clang, please use version 17 or later.
2024-11-18 20:04:38 +02:00
Lynne
970d57988d
lavc: bump minor version for FFv1 Vulkan encoder 2024-11-18 08:00:26 +01:00
Lynne
ed2391d341
ffv1enc: add a Vulkan encoder
This commit implements a standard, compliant, version 3 and version 4
FFv1 encoder, entirely in Vulkan. The encoder is written in standard
GLSL and requires a Vulkan 1.3 supporting GPU with the BDA extension.

The encoder can use any amount of slices, but nominally, should use
32x32 slices (1024 in total) to maximize parallelism.

All features are supported, as well as all pixel formats.
This includes:
 - Rice
 - Range coding with a custom quantization table
 - PCM encoding

CRC calculation is also massively parallelized on the GPU.

Encoding of unaligned dimensions on subsampled data requires
version 4, or requires oversizing the image to 64-pixel alignment
and cropping out the padding via container flags.

Performance-wise, this makes 1080p real-time screen capture possible
at 60fps on even modest GPUs.
2024-11-18 07:54:22 +01:00
Lynne
a6c58353ac
ffv1enc: move slice allocation out of generic encode init 2024-11-18 07:54:22 +01:00
Lynne
12ea1cde57
ffv1enc: move plane info init into a separate function 2024-11-18 07:54:21 +01:00
Lynne
f4b5068c3b
ffv1enc: expose ff_ffv1_write_extradata 2024-11-18 07:54:21 +01:00
Lynne
a13ef376da
ffv1enc: split off encoder initialization into a separate function 2024-11-18 07:54:21 +01:00
Lynne
91a4f1539f
.gitignore: add exclusions for shader .c files 2024-11-18 07:54:21 +01:00
Lynne
d0ab49e3e7
hwcontext_vulkan: add the mapped software frame as an upload dependency
We do uploads asynchronously, and we map the software frames in
order to avoid 2-stage copying. However, whilst we added a dependency
upon the mapped buffers, we did not add the original frame backing
those buffers as a dependency.

This caused issues on RADV, particularly with RGB images.
2024-11-18 07:54:20 +01:00
Lynne
1876026f83
vulkan: add ff_vk_exec_add_dep_sw_frame
Some software frames may be mapped, and we'd like to have
them as proper dependencies.
2024-11-18 07:54:20 +01:00