Commit Graph

117851 Commits

Author SHA1 Message Date
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 a6c58353ac.

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 459a1512f1,
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
Lynne c918b42dcd
vulkan: retrieve Vulkan 1.1 properties
Required to know the subgroup size.
2024-11-18 07:45:46 +01:00
Lynne 16fa710340
vulkan: fix printing descriptors to shader for shaders with no descriptors 2024-11-18 07:45:46 +01:00
Lynne a516b2da22
vulkan: add support for 10-bit planar RGB 2024-11-18 07:45:46 +01:00
Lynne eb8f3b8460
hwcontext_vulkan: fix planar RGB images
They were non-working for quite a while.
2024-11-18 07:45:41 +01:00
Rémi Denis-Courmont bbb0fdedb7 lavc/h264idct: fix RISC-V group multiplier
After the branch, the expected SEW/LMUL ratio is 1 byte/vector.
So we have to set the same ratio before branching (QEMU does not care,
but real hardware does).
2024-11-17 16:35:27 +02:00
tangsha 8a5b74f98b delete unused variable ret 2024-11-17 20:56:41 +08:00
Rémi Denis-Courmont 1912c86af6 sws/range_convert: fix RISC-V chrFromJpeg 2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont 55aa81d5cc checkasm: add RISC-V vector width to arch info 2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont 42dd1f1cf1 tests/cpu: print the RISC-V Vector length 2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont fd8cbfec3d lavc/vp8dsp: remove RISC-V table alignment
These values are bytes and need not be aligned.
2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont 690c015758 lavc/h264dsp: remove RISC-V table alignment
These values are bytes and need not be aligned.
2024-11-17 11:28:21 +02:00
Marth64 1d55f54846 avformat/dvdvideodec: don't allow seeking beyond dvdnav reported duration
There is no reason to accept timestamp values beyond what dvdnav
reported as the duration of the title.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 0912407b9d avformat/dvdvideodec: discard duplicate or partial AC3 samples
Some DVD muxers signal segments to start with duplicate audio samples
when starting extraction from a chapter marker or terminate seamless PGs
on partial audio samples (causing corrupt AC3 frames). Clean up after
these muxers by tracking frames with duplicate PTS and eliminating
partial AC3 frames.

This results in smoother chapter extraction and overall seeking experience,
with linear PTS and AC3 delay within 32ms (1 frame) away from the video.

The issue was not apparent until the flushing pattern was replaced with
a full subdemux reset, as the flushing dropped the frames prematurely,
along side others, as such they were never present to begin with.
2024-11-16 14:40:51 -06:00
Marth64 f2f238c3a4 avformat/dvdvideodec: drop packets with unset PTS or DTS
The packets effectively serve no purpose and we are already
dropping packets with PTS less than 0. This also creates
for a smoother seeking experience after the subdemuxer
reset fix.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 3656379d92 avformat/dvdvideodec: remove unnecessary need_parsing argument
The value is always AVSTREAM_PARSE_HEADERS.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 a2c57e27d6 avformat/dvdvideodec: open subdemuxer after initializing IFO headers
It is wasteful to open the subdemuxer if an error occurs while
initializing streams or reading IFO headers.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00