1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00
Commit Graph

117942 Commits

Author SHA1 Message Date
gnattu via ffmpeg-devel
248832dd5b avcodec/bsf/dovi_rpu: remove EL when stripping dovi metadata
When RPU is removed EL should also be removed. This only applies to
HEVC as AV1 based Profile 10 does not support EL at all.

Signed-off-by: Gnattu OC <gnattuoc@me.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-11-28 14:15:50 +01:00
Fei Wang
bc991ca048 lavfi/qsvvpp: Copy frame props before modify it
The changes to output frame props in query_frame overlapped since
578ac59887. Move the copy frame props before the changes.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-28 11:13:25 +08:00
IndecisiveTurtle
351fd8460a vulkan/common: Add put_bytes_count 2024-11-28 10:03:01 +09:00
IndecisiveTurtle
e3ac63b213 vulkan/common: Use u32vec2 buffer type instead of u64
According to the GL_EXT_buffer_reference spec alignment
"must be a power of two and be greater than or equal to the largest scalar/component type in the block."

This means by using u32vec2 we can drop the requirement alignment from 8 bytes to 4 bytes
and save a pack64 call in reverse8 (though I assume in most ISAs that compiles to nothing)

Allows the vc2 vulkan encoder to function without setting PB_UNALIGNED
2024-11-28 09:31:43 +09:00
IndecisiveTurtle
f794ed48c0 vulkan/common: Fix off-by-one error in flush_put_bits
If caller wrote a divisible by eight number of bits it would write an extra byte.
Also increment by to_write instead of BUF_BYTES which overly pads the bitstream.
2024-11-28 09:31:43 +09:00
Ramiro Polla
4e1a91112d tests/fate/filter-video: don't convert owdenoise test to mpeg range 2024-11-28 00:58:21 +01:00
Lynne
187fd52864
vulkan: fix use of atomics for the current context index
The code used to use atomic, but over time, this got broken.
This commit also remmoves the is-the-last-submission-ready
shortcut, which rarely did anything.
There's also value in relying on the fact that contexts
always carry their frames in a strictly incremental order
with no gaps.
2024-11-28 01:29:21 +09:00
Lynne
41f65b7326
vulkan_decode: ensure there's at least one context per decode thread
Otherwise, what may happen is that 2 threads will both write
into the same context.
2024-11-28 01:29:21 +09:00
Lynne
a5e6860a89
vulkan_decode: fix counting for parallelism
ff_vk_exec_pool_init used to multiply the number by
the number of queues, but that got changed, yet this use
of the function was not updated.
2024-11-28 01:29:15 +09:00
Scott Theisen
78c4d6c136 libavcodec/mpeg12dec.c: support DVB CC format 0x0502 in user_data
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-26 19:50:59 -06:00
Marth64
084d3515ca avformat/libssh: fix credential variables typo
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-26 19:50:49 -06:00
Lynne
d4966f0a74
ffv1enc_vulkan: limit parallelism based on VRAM, fallback to host memory 2024-11-26 14:14:16 +01:00
Lynne
5effac3b02
ffv1enc: expose ff_ffv1_encode_buffer_size
The function is quite important to ensure that the output
is always going to be sufficient, and it can change version to
version, so exposing it makes sense.
2024-11-26 14:14:15 +01:00
Lynne
d8f301cdf2
ffv1enc_vulkan: switch to receive_packet
This allows the encoder to fully saturate all queues the GPU
has, giving a good 10% in certain cases and resolutions.

This also improves error resilience if an allocation fails,
and properly cleans up after itself if it does.
2024-11-26 14:14:15 +01:00
Lynne
4fefc6e80c
ffv1enc_vulkan: remove arbitrary limitation of the number of slices 2024-11-26 14:14:15 +01:00
Lynne
ce8a070cf3
vulkan: only wait for fences on uninit if the context had a submission
This fixes a potential deadlock on exit.
2024-11-26 14:14:14 +01:00
Lynne
86e552506d
vulkan: zero out AVBufferRef in case of failure
This resulted in uninit errors and was never caught as
we generally did not use massive allocations before.
2024-11-26 14:14:14 +01:00
Lynne
f582de8f34
vulkan: only apply shortcut for next context selection if selection has a submission 2024-11-26 14:14:14 +01:00
Lynne
8ac49ae9e0
vulkan: add opaque field to execution contexts
Helps keep track of what dispatch happened where.
2024-11-26 14:14:14 +01:00
Lynne
d485420237
hwcontext_vulkan: take disable_multiplane into account when checking for formats 2024-11-26 14:14:13 +01:00
Lynne
cf0961a527
hwcontext_vulkan: require storage properties to claim formats as supported
This function dates back a long time ago, before vkfmt_from_pixfmt2.
When it was converted over, the thought was that this was far too
restrictive to demand storage images for each format.
With the new clever function, it makes sure to check that the compatible
subformats a format can be used as support storage capabilities.

This gets rid of fake support for RGB48/RGB96 which some implementations
offer but don't support using as storage images.
2024-11-26 14:14:13 +01:00
Lynne
f65e51293a
hwcontext_vulkan: add support for AV_PIX_FMT_GBRAP10/12/14 2024-11-26 14:14:13 +01:00
Lynne
7c52dda55f
hwcontext_vulkan: add support for AV_PIX_FMT_GBRP12/14/16 2024-11-26 14:14:12 +01:00
Lynne
08fb505a66
hwcontext_vulkan: add support for AV_PIX_FMT_GRAY10/12/14 2024-11-26 14:14:07 +01:00
Koushik Dutta
ac3f69a4b9 avfilter/scale_vt: implement frame crop
The crop filter has no effect on scale_vt:

-vf crop=100:100,scale_vt=300x300

Hardware frames (AV_PIX_FMT_FLAG_HWACCEL) are expected to use the crop_* properties,
as seen in the implementation vf_crop.c.

Signed-off-by: Koushik Dutta <koushd@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-26 11:54:28 +08:00
Koushik Dutta
352333543c avfilter/scale_vt: implement negative width/height aspect ratio sizing
Signed-off-by: Koushik Dutta <koushd@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-26 11:26:38 +08:00
Sean McGovern
7104818066 libavcodec: various: remove empty directories originally for legacy DSP code
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-26 11:26:11 +08:00
Marton Balint
1402a2ac3b avcodec/dnxuc_parser: rework DNXUC parser
The current parser does things which a parser should not, like skipping parts
of the packet header, but it does not actually able to packetize a raw DNXUC
bitstream.

Rework the parser logic to work similar to other parsers and be able to
correctly packetize raw DNXUC bitstreams.

Bump minor version because the DNXUC codec packet format changes with this.
Normally this would be a breaking change, but in this particular case it should
not cause any issues in practice because the DNXUC codec is relatively new and
we never added a decoder for it.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-25 22:16:34 +01:00
Marton Balint
aea63ea7f5 avformat/framecrc: add AVFMT_NODIMENSIONS flag
Framecrc does not need frame dimensions to work correctly.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-25 22:16:34 +01:00
J. Dekker
d89fbfd4df avcodec: deprecate sonic
This is an experimental and research codec of which ffmpeg is the only
encoder and decoder, development has stalled since 2013 and these files
don't exist in the wild.

Deprecate the encoders to be removed next major bump, decoders to be
removed one bump afterwards. We also disable the the encoders by default
in configure, the decoders should be disabled by default next bump.

Signed-off-by: J. Dekker <jdek@itanimul.li>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2024-11-25 14:34:55 -05:00
James Almer
19f7dae81a avformat/mov: add missing stts array syncing in mov_build_index
Also fix checks for sc->stts_count that assume it may not be in sync with
sample count.
Missed in 865c73c86f. Fixes parsing durations in
some cases.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-25 14:40:15 -03:00
James Almer
0e07a70611 avcodec/ac3dec: fix downmix logic for eac3
Ensure downmixed is only set once during init, as it used to be.

Fixes a regression since acbb2777e2.
Fixes ticket #11321

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-25 14:40:15 -03:00
Rémi Denis-Courmont
f8e91ab05f lavc/h264idct: fix compilation for RV32IMA 2024-11-25 19:29:21 +02:00
Rémi Denis-Courmont
f2b945147d lavc/vp8dsp: fix compilation for RV32IMA 2024-11-25 19:29:21 +02:00
Rémi Denis-Courmont
d3acffae7a lavc/pixblockdsp: fix compilation for RV32IMA 2024-11-25 19:29:21 +02:00
Rémi Denis-Courmont
63922ba5dc lavu/float_dsp: fix compilation with RISC-V ILP32 ABI 2024-11-25 19:29:21 +02:00
Rémi Denis-Courmont
da1ab7940e riscv: remove unnecessary #include's 2024-11-25 19:29:21 +02:00
Marvin Scholz
51a20517d2 doc: add styles for good/bad code examples
Makes it easier to immediately see if the code examples given in the
style documentation are good or bad examples, making it harder to
accidentally confuse a bad example for a good one.
2024-11-25 17:17:57 +01:00
Marvin Scholz
9cdd3cbe9b doc/developer: add examples to clarify code style
Given the frequency that new developers, myself included, get the
code style wrong, it is useful to add some examples to clarify how
things should be done.
2024-11-25 17:17:56 +01:00
Marvin Scholz
83c1c622a5 MAINTAINERS: Add myself as Darwin maintainer
I do some development and usage of FFmpeg regularly on macOS and sent
some patches to fix issues specific to Darwin in the past so I think it
makes sense to add myself as maintainer so people know they can ping me
if required, for Darwin specific issues/testing.

I have both Intel and Apple Silicon (aarch64) machines as well as older
Macs for testing on older macOS versions if necessary.
2024-11-25 17:16:39 +01:00
Marvin Scholz
6b9f4f36f7 swscale/internal: fix typo in loongarch specific code
Regression from 2d077f9acd
2024-11-25 17:15:00 +01:00
Niklas Haas
bcbf3a5630 avfilter/vf_scale: fix off-by-one in loop bounds
Results in over-read of the array. Fortunately, the excess element was
never actually used, but it still triggers ASAN (and could in theory trigger
a segfault).

Fixes: 04ce01df0b
2024-11-25 14:40:49 +01:00
Leo Izen
3c3bf6c109
MAINTAINERS: list csp.c and csp.h maintainers
Ronald S. Bultje wrote most of the code before there was a refactor
and condense (which I mostly wrote). As such, listing both him and myself
as maintainers of csp.h and csp.h, which previously had no maintainer
listed at all (after conferring on IRC).

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2024-11-25 07:13:44 -05:00
Niklas Haas
04ce01df0b avfilter/vf_scale: switch to new swscale API
Most logic from this filter has been co-opted into swscale itself,
allowing the resulting filter to be substantially simpler as it no
longer has to worry about context initialization, interlacing, etc.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:03:54 +01:00
Niklas Haas
3edd1e42b9 tests/swscale: add a benchmarking mode
With the ability to set the thread count as well. This benchmark includes
the constant overhead of context initialization.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:03:54 +01:00
Niklas Haas
59c39a79ca tests/swscale: rewrite on top of new API
This rewrite cleans up the code to use AVFrames and the new swscale API. The
log format has also been simplified and expanded to account for the new
options. (Not yet implemented)

The self testing code path has also been expanded to test the new swscale
implementation against the old one, to serve as an unchanging reference. This
does not accomplish much yet, but serves as a framework for future work.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:03:54 +01:00
Niklas Haas
2a091d4f2e swscale: introduce new, dynamic scaling API
As part of a larger, ongoing effort to modernize and partially rewrite
libswscale, it was decided and generally agreed upon to introduce a new
public API for libswscale. This API is designed to be less stateful, more
explicitly defined, and considerably easier to use than the existing one.

Most of the API work has been already accomplished in the previous commits,
this commit merely introduces the ability to use sws_scale_frame()
dynamically, without prior sws_init_context() calls. Instead, the new API
takes frame properties from the frames themselves, and the implementation is
based on the new SwsGraph API, which we simply reinitialize as needed.

This high-level wrapper also recreates the logic that used to live inside
vf_scale for scaling interlaced frames, enabling it to be reused more easily
by end users.

Finally, this function is designed to simply copy refs directly when nothing
needs to be done, substantially improving throughput of the noop fast path.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:03:50 +01:00
Niklas Haas
bf738412e8 swscale/graph: add new high-level scaler dispatch mechanism
This interface has been designed from the ground up to serve as a new
framework for dispatching various scaling operations at a high level. This
will eventually replace the old ad-hoc system of using cascaded contexts,
as well as allowing us to plug in more dynamic scaling passes requiring
intermediate steps, such as colorspace conversions, etc.

The starter implementation merely piggybacks off the existing sws_init() and
sws_scale(), functions, though it does bring the immediate improvement of
splitting up cascaded functions and pre/post conversion functions into
separate filter passes, which allows them to e.g. be executed in parallel
even when the main scaler is required to be single threaded. Additionally,
a dedicated (multi-threaded) noop memcpy pass substantially improves
throughput of that fast path.

Follow-up commits will eventually expand this to move all of the scaling
decision logic into the graph init function, and also eliminate some of the
current special cases.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:02:16 +01:00
Niklas Haas
c461dcf291 swscale/internal: expose sws_init_single_context() internally
Used by the graph API swscale wrapper, for now.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:02:16 +01:00
Niklas Haas
fb16964009 swscale: organize and better document flags
Group them into an enum rather than random #defines, and document their
behavior a bit more obviously.

Of particular note, I discovered that SWS_DIRECT_BGR is not referenced
anywhere else in the code base. As such, I have moved it to the deprecated
section, alongside SWS_ERROR_DIFFUSION.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:02:12 +01:00