Commit Graph

118387 Commits

Author SHA1 Message Date
Ramiro Polla
f3837d7e21 checkasm/sw_range_convert: indent after previous couple of commits
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:30:24 +01:00
Ramiro Polla
d1cf450895 checkasm/sw_range_convert: test all supported bit depths
This commit also reduces the number of times ff_sws_init_scale() gets
called (only once per bit depth), and the number of times randomize_buffers()
gets called (only if the function must be checked).

Benchmarks are only performed on bit depths 8 and 16 (since they are
different functions, and not only different constants).

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:30:24 +01:00
Ramiro Polla
e916b70b15 checkasm/sw_range_convert: only run benchmarks on largest input width
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:30:24 +01:00
Ramiro Polla
e912eeba81 checkasm/sw_range_convert: reduce number of input sizes tested
Reduce input sizes to 8 (to test that the function works with widths
smaller than the vector length) and 1920 (raising the largest input
size to improve benchmark results).

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:30:24 +01:00
Ramiro Polla
37f0cd8d05 checkasm/sw_range_convert: use YUV pixel formats instead of YUVJ
We are already setting the range, so we can use regular YUV pixel
formats instead of YUVJ.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:30:23 +01:00
Ramiro Polla
1113b2c658 checkasm: use FF_ARRAY_ELEMS instead of hardcoding size of arrays
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:30:23 +01:00
Ramiro Polla
615d3764e8 swscale/range_convert: indent after previous commit
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:30:23 +01:00
Ramiro Polla
185d00d146 swscale/range_convert: drop redundant conditionals from arch-specific init functions
These conditions are already checked for in the main init function.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:29:34 +01:00
Ramiro Polla
92cd703a80 swscale/range_convert: call arch-specific init functions from main init function
This commit also fixes the issue that the call to ff_sws_init_range_convert()
from sws_init_swscale() was not setting up the arch-specific optimizations.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:28:25 +01:00
Marton Balint
40bae4af26 avutil/wchar_filename: re-introduce explicit cast of void* to char*
Fixes compile error on windows with decklink:

In file included from ./libavformat/os_support.h:175,
                 from ./libavformat/internal.h:30,
                 from libavdevice/decklink_common.cpp:25:
./libavutil/wchar_filename.h: In function 'int wchartocp(unsigned int, const wchar_t*, char**)':
./libavutil/wchar_filename.h:59:32: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
   59 |     *filename = av_malloc_array(num_chars, sizeof **filename);
      |                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                |
      |                                void*

Regression since e9e8bea2e79bc3c481a6f81f75f6c871e3e0f367.

Fixes ticket #11103.

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:23:44 +01:00
Zhao Zhili
69c79bb32a tests/fate-run: Fix pixdesc failure
-u and -q doesn't work together for diff on macOS.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:23:44 +01:00
Zhao Zhili
f3741f017b avcodec/mediacodecdec_common: Workaround MTK broken crop implementation
MediaTek SOC return broken crop info, e.g.,
width: int32(3840) height: int32(2160) crop: Rect(0, 0, 318, 238)

It will notify the right crop info with infoOutputFormatChanged, but
too late.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:23:44 +01:00
Zhao Zhili
05dfc5d97b avcodec/mediacodecenc: Extract configOBUs from AV1CodecConfigurationRecord
MediaCodec can generate AV1CodecConfigurationRecord, which shouldn't
be put into packet->data. Skip four bytes and extract configOBUs
if it exist.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:23:44 +01:00
Zhao Zhili
4538551b20 fftools/ffplay: use swapchain_colorspace_hint to get better HDR support
For example, the default surface configuration on macOS is:
VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_PASS_THROUGH_EXT

With HDR10 content and swapchain_colorspace_hint, the surface
configuration updated to:
VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_HDR10_ST2084_EXT

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-31 08:23:43 +01:00
Paul B Mahol
9194248796 avfilter/ardftsrc_template: change from tukey to planck-taper window
Gives less artifacts.
2024-10-30 09:07:44 +01:00
Paul B Mahol
12afae0ac5 avutil/tx: fix signed integer overflow 2024-10-29 20:31:37 +01:00
Paul B Mahol
3e785c16c5 avutil/tx_template: remove invalid code, and fix min_len for bailey 2024-10-29 19:45:27 +01:00
Paul B Mahol
a164309cb4 avfilter/af_ardftsrc: check for eof early 2024-10-29 14:23:31 +01:00
Paul B Mahol
eb3ad9302b avfilter/vf_waveform: fix crash when graticule is shown 2024-10-29 09:14:28 +01:00
Paul B Mahol
a74760358e avfilter/surround_template: no need to use FFMIN3 2024-10-28 19:07:57 +01:00
Paul B Mahol
df485f8ede avfilter/surround_template: revert same scaling for forward and backward transform 2024-10-28 17:40:38 +01:00
Paul B Mahol
d2c7ed2fd0 avfilter/surround_template: reduce x/y center channel strength 2024-10-28 16:42:19 +01:00
Paul B Mahol
462283e8b8 avfilter/avf_showspatial: fix output for extreme panning 2024-10-28 15:51:29 +01:00
Paul B Mahol
676ed56e24 avfilter/avf_showspatial: remove scaling for transform 2024-10-28 09:18:31 +01:00
Paul B Mahol
6cdd6b5457 avfilter/surround_template: fix output for extreme panning 2024-10-28 09:15:29 +01:00
Paul B Mahol
c4941f7e60 avfilter/avf_showspatial: change output pixel format 2024-10-27 21:16:32 +01:00
Paul B Mahol
87af6f2d26 avfillter/af_surround: fix calculations 2024-10-27 21:16:30 +01:00
James Almer
53d5bb94f6 avutil/hwcontext_d3d11va: drop duplicate pixfmt entry
Added by accident in ca71b0b807b4d5588ec765976b8b18d3efde40fb.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 14:43:37 +02:00
Paul B Mahol
373147dd71 avfilter/surround_template: do normalization for power factors 2024-10-26 10:44:27 +02:00
James Almer
4b40c46ab3 libavutil/hwcontext_d3d11va: use the XV48 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:06 +02:00
James Almer
c84b4800e1 libavutil/hwcontext_dxva2: use the XV48 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:06 +02:00
James Almer
247af34ac0 avfilter/vsrc_testsrc: add support for XV48
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:06 +02:00
James Almer
d79e73e4be avformat/riff: map Y416 fourcc to RAWVIDEO decoder
As defined in https://learn.microsoft.com/en-us/windows/win32/medfound/10-bit-and-16-bit-yuv-video-formats#422-formats

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:06 +02:00
James Almer
da92f615b6 swscale/output: add XV48 output support
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:06 +02:00
James Almer
fdb4a8944e swscale/input: add XV48 input support
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:06 +02:00
James Almer
5eee9aef71 avutil/pixfmt: add XV48 pixel format
Much like XV30 and XV36 in d75c4693fe,
XV48 is added to support 16bit 4:4:4 as defined by Microsoft.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:05 +02:00
James Almer
0ff5f0f722 libavutil/hwcontext_d3d11va: use the Y216 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:05 +02:00
James Almer
ebcb351da4 libavutil/hwcontext_dxva2: use the Y216 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:05 +02:00
James Almer
014e99eb2b avformat/riff: map Y210 and Y216 fourcc to RAWVIDEO decoder
As defined in https://learn.microsoft.com/en-us/windows/win32/medfound/10-bit-and-16-bit-yuv-video-formats#422-formats

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:05 +02:00
Michael Niedermayer
c40bdd53ed avformat/mpegts: Initialize predefined_SLConfigDescriptor_seen
Fixes: use of uninitialized variable
Fixes: 368729566/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGTS_fuzzer-6044501804646400

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:05 +02:00
Michael Niedermayer
36049cd54c avformat/mxfdec: Fix overflow in midpoint computation
Fixes: signed integer overflow: 4611686016549392399 + 9223372033098784800 cannot be represented in type 'long long'
Fixes: 368503277/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5928227458056192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:05 +02:00
Michael Niedermayer
d30e00fcba swscale/output: used unsigned for bit accumulation
Fixes: Integer overflow
Fixes: 368725672/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5009093023563776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:05 +02:00
Michael Niedermayer
1509526901 swscale/rgb2rgb_template: Fix ff_rgb24toyv12_c() with odd height
Fixes: out of array access
Fixes: 368143798/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6475823425585152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:05 +02:00
Dale Curtis
b00a93d711 avcodec/h2645: allocate film grain metadata dynamically
Film grain support adds a huge amount of overhead to the H264Context
structure for a feature that is rarely used. On low end devices or
pages that have lots of media this bloats memory usage rapidly.

This changes the static film grain metadata allocations to be dynamic
which reduces the H264Context size from 851808 bytes to 53444 bytes.

Bug: https://crbug.com/359358875
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Niklas Haas <git@haasn.dev>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:28:04 +02:00
Michael Niedermayer
ac75e76e8d avcodec/ffv1: Implement new slice tiling
This fixes corner cases (requires version 4 or a spec update)

Fixes: Ticket5548

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:25:18 +02:00
Michael Niedermayer
f7299fba2a avcodec/rangecoder: only perform renorm check/loop for callers that need it
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:25:18 +02:00
Niklas Haas
7d8a5e3aee 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:25:17 +02:00
Soma Lucz
07239fb054 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-26 09:18:34 +02:00
Paul B Mahol
8020860b1d avfilter/af_surround: add support for two more channels 2024-10-25 23:32:05 +02:00
Paul B Mahol
8ce6abcc05 avfilter/surround_template: simplify 2024-10-25 22:41:28 +02:00