1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00
Commit Graph

119504 Commits

Author SHA1 Message Date
Lynne
694ebe890c vulkan_ffv1: improve buffer barrier correctness for slice state
This is likely a nanooptimization, but its more correct.
2025-04-14 06:10:42 +02:00
Lynne
6111aef533 vulkan_ffv1: fix reset shader dependencies
Without a barrier upfront, the reset shader may read data fields not
yet set by the setup shader.
2025-04-14 06:10:42 +02:00
Lynne
b72ada0a96 vulkan_ffv1: fallback to upload if mapping packet fails, fix fallback
The commit which added support for host mapping accidentally broke the
original, upload route.
For drivers without host-mapping (very few), fix it.
2025-04-14 06:10:42 +02:00
Lynne
45d7abf6d9 vulkan_ffv1: init overread/corrupt fields
Forgotten.
2025-04-14 06:10:42 +02:00
Lynne
1f09b55c94 vulkan_ffv1: allocate just as much memory for slice state as needed
Rather than always using the maximum allowed slices, just use the number
of slices present in this frame.
2025-04-14 06:10:41 +02:00
Lynne
fc960dafef vulkan_ffv1: optimize symbol reader
This was the fastest variant tested.
2025-04-14 06:10:41 +02:00
Lynne
defebd74c0 vulkan_ffv1: slightly optimize the range decoder
GPUs have cmovs as standard.
2025-04-14 06:10:41 +02:00
Lynne
d7772da728 vulkan_ffv1: remove unused define
Leftover debug macro.
2025-04-14 06:10:41 +02:00
Lynne
d077e00f3e vulkan_ffv1: enable acceleration on Intel
Fixed by previous commit.
2025-04-14 06:10:41 +02:00
Lynne
a1137f9214 hwcontext_vulkan: disable descriptor buffer extension on Intel
Temporary workaround. Will be replaced with a version check once a fix is
in the works and a known next version for Mesa with a fix is known.
2025-04-14 06:10:41 +02:00
Lynne
79ff1f21c4 vulkan_decode: only create sequence params in end_frame
We tried to create sequence params in both start_frame and end_frame.
This was redundant.

Just always create them in end_frame.
2025-04-14 06:10:40 +02:00
Lynne
4f64df2928 vulkan: remove unused field from exec pools
This used to be involved in a mechanism to switch between queue indices,
but since the rewrite of the rewrite of the rewrite, it was rewritten out.
2025-04-14 06:10:40 +02:00
Lynne
11911aef46 vulkan_shaderc/glslang: print full shaders on TRACE rather than VERBOSE
Way too spammy.
2025-04-14 06:10:40 +02:00
Lynne
7b0156201b vulkan: fix logging level when erroring upon creating shader module 2025-04-14 06:10:34 +02:00
Andreas Rheinhardt
75d5672b4b avcodec/mpegaudioenc: Rename MPA_encode_* -> mpa_encode_*
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
7915e2a095 avcodec/mpegaudioenc: Move PutBitContext to stack
Avoids keeping dangling pointers in the context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
62e1abcf0d avcodec/mpegaudioenc: Don't pad one bit at a time
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
87f3e20931 avcodec/mpegaudioenc: Avoid intermediate buffer
We know the final size before encoding, so we can switch to
ff_get_encode_buffer() which avoids an implicit memcpy().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
6f7ebeff70 avcodec/mpegaudioenc: Combine writing scale factors
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
db75955d60 avcodec/mpegaudioenc_{fixed,float}: Merge encoders
Most of the encoders is the same. So deduplicate them.
This reduces code size from 22410B to 12637B here.
The data in mpegaudiotab.h is also automatically deduplicated.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
13a0d0ade1 avcodec/mpegaudioenc_template: Remove always-false branch
The sample rates here have already been checked generically
via CODEC_SAMPLERATES().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
66310f8a22 avformat/asf_tags: Deduplicate tags
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
413905bff2 avcodec/opus/tab: Deduplicate arrays
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
35fcdb2132 swscale/x86/rgb2rgb: Deduplicate ASM constants
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
044bfc7785 avcodec/aac{enc,}tab: Deduplicate swb tables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
ab1bc2f745 avcodec/aacenc: Remove always-false check
The sample rates have already been checked generically
via AVCodec.supported_samplerates.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
516bcfc169 avutil/aes: Use #if checks instead of if (ARCH_X86)
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:47:32 +02:00
Andreas Rheinhardt
f81ace52f8 avutil/aes: Make aes_init_static() av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:47:26 +02:00
Andreas Rheinhardt
c8c4e55b2b avcodec/motionpixels: Avoid av_unused
Easily possible now that -Wdeclaration-after-statement is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:47:26 +02:00
Andreas Rheinhardt
bf327ac676 avcodec/hq_hqa: Check size before initializing GetByteContext
Enables the compiler to optimize the buf_size assert
in bytestream2_init() away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:49:26 +02:00
Andreas Rheinhardt
16943876f8 avcodec/hq_hqa: Remove implicit always-false checks
This decoder has explicit checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:48:11 +02:00
Andreas Rheinhardt
c39e23cc91 avcodec/hq_hqa: Check available date before allocating frame
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:26:37 +02:00
Andreas Rheinhardt
c1f124f3f0 avcodec/hq_hqa: Use ff_vlc_init_from_lengths()
This allows to avoid the codes table; furthermore, given
that the runs fit into seven bits and level into nine,
one can put them into one int16_t and use as symbols table
in ff_vlc_init_from_lengths().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:26:37 +02:00
Andreas Rheinhardt
9c0d6145c9 avcodec/hq_hqa: Include implicit +1 run in RL VLC table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:25:43 +02:00
Andreas Rheinhardt
ce0074f97b avcodec/hq_hqa: Use RL-VLC table
This moves indirections to init.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:25:29 +02:00
Andreas Rheinhardt
18309fba3c avcodec/hq_hqadata: Avoid relocations
Initialize a list of 128 pointers at decoder init
instead of using a const list of pointers (which
will be initialized at runtime when libavcodec
is loaded when using pic code with Elf); the former
takes only 128 bytes (+ a bit of initialization code),
the latter 1KiB on 64 bit systems (+3KiB on x64 elf
for relocation information).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:24:39 +02:00
Andreas Rheinhardt
c12108cdaa avcodec/hq_hqa: Don't zero in small chunks, don't zero twice
Up until now, hq_decode_block() zeroed every block (of 128 bytes)
before decoding a block; yet this is suboptimal for all modes,
because all modes need to reset all the blocks they use anyway
and so it should be done in one go for all blocks.

For the alpha mode (where blocks need not be coded) all blocks
are zeroed initially anyway, because decode_block() might not
be doing it, so zeroing there again for the coded blocks is
a waste.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:22:49 +02:00
Andreas Rheinhardt
12c9ffa569 avcodec/hq: Include alpha in cbp VLC table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:21:29 +02:00
Andreas Rheinhardt
e38616c4ac avcodec/hq{xvlc,_hqadata}: Deduplicate and hardcode cbp table
This table is so small (32 elements amounting to 128 bytes)
that it is more efficient size-wise to hardcode it instead
of initializing it at runtime.

Also stop duplicating it in hq_hqa.o and hqx.o.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:14:51 +02:00
Andreas Rheinhardt
30996b7195 avcodec/avcodec: Remove always-false check
avcodec_free_context() only calls ff_codec_close() if there
is an AVCodecContext and avcodec_open2() unconditionally
dereferences the AVCodecContext*.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-12 09:58:58 +02:00
Andreas Rheinhardt
cf1c52c5c6 avcodec/h261dec: Set pict_type during init
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-12 09:58:58 +02:00
Andreas Rheinhardt
88d8150de7 avcodec/h261dec: Export key frame information
Implements ticket #8343.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-12 09:58:58 +02:00
Andreas Rheinhardt
6a202c3431 avcodec/asvenc: Use tighter MAX_MB_SIZE constant
Also document the constant.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-12 09:58:12 +02:00
Andreas Rheinhardt
9bb617b3e7 avcodec/asvenc: Don't use FF_INPUT_BUFFER_MIN_SIZE
ASV-1/2 does not really have a header and so using
FF_INPUT_BUFFER_MIN_SIZE is wasteful as well as ugly
(such bounds should be codec-specific).

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-12 09:57:13 +02:00
Dmitrii Ovchinnikov
b02985b12c avcodec/amfenc_av1: Add B-frame QP control 2025-04-11 12:21:37 +02:00
Zhao Zhili
f702cf422a avcodec/mediacodecdec: Reset optional fields when parse format
Parse format can be called multiple times, e.g., when resolution
changed. If getInt32 fails, optional member variables will retain
their previously set values without modification. This can be a
big problem for new resolution with old crop info.

This patch reset optional fields to zero when getInt32 failed.
2025-04-11 17:26:15 +08:00
softworkz
93ae305ce1 fftools/ffprobe: Rename AVTextFormatContext variables (w => tfc)
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-11 03:06:48 +02:00
softworkz
15e99b2398 fftools/ffprobe: Rename writer_print_section_* and WriterContext
separated for better clarity of the preceding commit

Signed-off-by: softworkz <softworkz@hotmail.com>
ren
2025-04-11 03:06:47 +02:00
softworkz
d7a3f68fea fftools/ffprobe: Change to use textformat api
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-11 03:06:47 +02:00
softworkz
97d680d450 fftools/textformat: Extract and generalize textformat api from ffprobe.c
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-11 03:06:47 +02:00