Commit Graph

117640 Commits

Author SHA1 Message Date
Niklas Haas 67adb30322 swscale: rename SwsContext to SwsInternal
And preserve the public SwsContext as separate name. The motivation here
is that I want to turn SwsContext into a public struct, while keeping the
internal implementation hidden. Additionally, I also want to be able to
use multiple internal implementations, e.g. for GPU devices.

This commit does not include any functional changes. For the most part, it is
a simple rename. The only complications arise from the public facing API
functions, which preserve their current type (and hence require an additional
unwrapping step internally), and the checkasm test framework, which directly
accesses SwsInternal.

For consistency, the affected functions that need to maintain a distionction
have generally been changed to refer to the SwsContext as *sws, and the
SwsInternal as *c.

In an upcoming commit, I will provide a backing definition for the public
SwsContext, and update `sws_internal()` to dereference the internal struct
instead of merely casting it.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-24 22:50:00 +02:00
Soma Lucz 153a6dc8fa doc/ffmpeg: improve -disposition, -stats, and -progress documentation
-disposition:
Clarify the meaning of the default value, and how the '+' and '-'
prefixes work. Add more examples.

-stats:
Clarify that it appears as an "info"-level log.

-progress:
Add info about the "progress" key's value being "continue" or "end".
Add an example of logging to stdout.

Signed-off-by: Soma Lucz <luczsoma@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-10-24 10:45:04 +02:00
James Almer ae0ab5b7ce avcodec/vulkan_video: add mapping for AV_PIX_FMT_Y216
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 20:06:03 -03:00
James Almer 5c622d4cc1 avutil/hwcontext_vulkan: add support for AV_PIX_FMT_Y216
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 20:06:03 -03:00
James Almer e46a506ae0 avcodec/vulkan_video: add proper maps for XV3{0,6}
Forgotten after fd8b0dcfed.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 20:06:03 -03:00
Niklas Haas f1f54d2f82 swscale/x86: use dedicated int for self-modifying MMX dstW
I want to pull options out of SwsInternal, so we need to make this field
a dedicated int that gets updated as appropriate in ff_swscale().

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:12:23 +02:00
Niklas Haas b03c758600 swscale: add sws_is_noop()
Exactly what it says on the tin.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:06:55 +02:00
Niklas Haas 5e50a56b9c swscale: add new frame testing API
Replacing the old sws_isSupported* API with a more consistent family
of functions that follows the same signature and naming convention,
including a placeholder for testing the color space parameters that
we don't currently implement conversions for.

These functions also perform some extra basic sanity checking.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:06:16 +02:00
Niklas Haas e2637a083a swscale/utils: add SwsFormat abstraction and helpers
Groups together all relevant color metadata from an AVFrame. While we could
use AVFrame directly, keeping it a separate struct has three advantages:

1. Functions accepting an SwsFormat will definitely not care about the
   data pointers.
2. It clearly separates sanitized and raw metadata, since the function to
   construct an SwsFormat from an AVFrame will also sanitize.
3. It's slightly more lightweight to pass around.

Move these into a new header file "utils.h" to avoid crowding
swscale_internal.h even more, and also to solve a circular dependency issue
down the line.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:04:06 +02:00
Niklas Haas 87baf9ab2c swscale: add sws_free_context()
Merely a convenience wrapper around sws_freeContext(). The name change is for
parity with the other sws_* functions.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:04:04 +02:00
Niklas Haas 3bf12beae9 swscale: slightly reorder header
I want to start grouping "legacy" functions which I tend to deprecate
together, away from the new ones.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:01:09 +02:00
Niklas Haas fbfea1c644 swscale: publicly typedef struct SwsContext
Slightly more convenient, especially for the upcoming refactor which will
turn SwsContext into a public struct.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:00:54 +02:00
James Almer b520d95467 swscale/output: add Y216LE output support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 14:11:35 -03:00
James Almer 7756cd98ac swscale/input: add Y216LE input support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 14:11:23 -03:00
James Almer f462ba05f5 avutil/pixfmt: add Y216 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 14:11:16 -03:00
Lynne 9eb7e8d2a4
vulkan: move alignment of host-visible allocations outside of ff_vk_alloc_mem
The issue is that if dedicated allocation is used, VkBufferCreateInfo.size
and the actual allocated size mismatched, which is a validation error.
2024-10-23 08:14:10 +02:00
Emily 3565903c63 fate/ffmpeg: add samples dependency to fate-ffmpeg-spec-disposition
This test utilizes an MPEG-TS sample from FATE suite, yet was
marked as not requiring samples.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
2024-10-21 21:19:33 +03:00
James Almer 8d940a07d1 avutil/pixdesc: fix alpha offset for X2{RGB,BGR}10BE
fixes fate-pixelutils

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 10:24:03 -03:00
James Almer 60b8f0d004 fate/filter-video: make fate-filter-pixdesc compare the hashed output with and without pixdesctest filtering
This helps detecting inconsistencies in swscale input/output code and
a av_read_image_line()/av_write_image_line() pass.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:52:58 -03:00
James Almer 0bb53948ac swscale/swscale_unscaled: clear the low bits in planar8ToP01xleWrapper
This makes the unscaled output of p010le and p016le match the generic path.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:52:58 -03:00
James Almer dfd7acf3ed avfilter/vf_pixdesctest: also take into account undefined alpha components
Ensure those bits are copied, which will result in the output being the same as
the input, where swscale set them to the equivalent of fully opaque.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:52:58 -03:00
James Almer 8debc5aa41 avfilter/vsrc_testsrc: use the alpha component information for XV3{0,6} and V30X
And add a few more tests to ensure all the pixfmts affected by this change
are tested.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:52:58 -03:00
James Almer 8f1de9ccd9 avutil/pixdesc: add alpha component information to pixfmts with reserved but undefined alpha bits
This can be useful to simplify certain processes that need to know how many
reserved bits there are and where they are placed, even if they are ultimately
unused, as will be shown in the next commit.
For any other case where the user simply looks at nb_components components, it
will make no difference.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:52:50 -03:00
James Almer 72f8f76d45 avutil/pixdesc: ensure the component being read or writen to is valid
If depth is 0, then the component is invalid/unset.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:43:45 -03:00
Tomas Härdin baa23e40c1 lavf/mxfdec: Set a scan direction explicitly
This prevents a theoretical case where seeks to a gap in an index can cause an infinite loop
2024-10-21 11:14:24 +02:00
Nuo Mi b611410569 avcodec/vvc/thread: Check frame to be non NULL
Fixes: NULL pointer dereference
Fixes: 71303/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-4875859050168320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reported-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-20 20:36:15 +08:00
arch1t3cht 72e5381123 avfilter/vf_subtitles: Respect YCbCr Matrix header
As specified in libass's ass_types.h, the colors or ASS_Images
should be converted to YCbCr using the matrix/range specified in
the track's YCbCrMatrix field (unless that field is set to YCBCR_NONE,
and defaulting to TV.601 if the header is missing).

This does not affect any subtitles generated or transcoded by ffmpeg,
since these contain a 'YCbCrMatrix: None' header.

Signed-off-by: arch1t3cht <arch1t3cht@gmail.com>
Signed-off-by: rcombs <rcombs@rcombs.me>
2024-10-19 11:08:34 -05:00
Marvin Scholz c98810ab47 avcodec/hw_base_encode: fix use after free on close
The way the linked list of images was freed caused a
use after free, by accessing pic->next after pic was
already freed.

Regression from 48a1a12968

Fix CID1633236
2024-10-18 11:18:41 +02:00
Lynne dfaade76db
vulkan: move buffer allocation av_log message
Its more useful when buffers are allocated, not in the
pool.
2024-10-18 11:18:35 +02:00
James Almer 1edc748eff avformat/movenc: explicitly support V30XLE and not the host native endian version
Should fix fate-vsynth*-v410 on BE targets.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 21:20:27 -03:00
James Almer 6cf4186d1b fate/vcodec: update reference files for v410 vsynth tests
Forgotten in 601a347946.

Found-by: ramiro
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 17:04:57 -03:00
James Almer f0e6296dde swscale/output: fix alpha endianness in XV36
Mistakenly written in native endianness in 42098f9266.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 12:18:35 -03:00
James Almer 062fcacc8f avfilter/vsrc_testsrc: fill the xv30le alpha bits
As with other pixel formats, set the undefined alpha bits to opaque.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:59:30 -03:00
James Almer 601a347946 swscale/output: fill the xv30le alpha bits
As with other pixel formats, set the undefined alpha bits to opaque.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:59:24 -03:00
James Almer 5601c5bb2e avfilter/vsrc_testsrc: add support for XV36 and AYUV64
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer 08c632ec0f swscale/output: add AYUV64BE output support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer 5a699c8db9 swscale/input: add AYUV64BE input support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer 42098f9266 swscale/output: add X36VBE output support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer e012a7a24a swscale/input: add X36VBE input support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer 2137346324 swscale/output: fill all the xv36le alpha bits
The format is 10 bit per component, not 8.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer e1d1ba4cbc tests/checkasm/sw_rgb: don't write random data past the end of the buffer
Should fix fate-checkasm-sw_rgb under gcc-ubsan.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com>
2024-10-17 13:08:39 +02:00
Ramiro Polla d2ed52dc02 avdevice/dshow: fix unused variable warning
The acaps variable was used outside of the #if DSHOWDEBUG block with
a1c4929f, but it is no longer used outside of the block since f125c504.
2024-10-17 13:04:17 +02:00
Anton Khirnov c034213083 lavfi/vsrc_perlin: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov e0aa644978 lavfi/vsrc_life: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov 2094a7256c lavfi/vsrc_life: avoid modifying the context in query_formats()
It is supposed to be free of side effects. Do it in init instead.
2024-10-17 11:00:35 +02:00
Anton Khirnov d08feb9003 lavfi/vf_zscale: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov 6bff95be03 lavfi/vf_weave: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov ab01f0522b lavfi/vf_vpp_qsv: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov e5b530f137 lavfi/vf_vmafmotion: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov 73c863fad8 lavfi/vf_v360: convert to query_func2() 2024-10-17 11:00:35 +02:00