[FFmpeg-devel] [RFC] FFmpeg Execution Graph Visualization

2025-03-17 Thread Soft Works
Hello everybody, working on the subject of writing out filtergraph information obviously implies the goal of being able to visualize that data in some way. While I do have something for long, it's tailored for specific workflows and is hardly useful for most. Anyway, it shouldn't be required t

[FFmpeg-devel] [PATCH] avcodec/hevc/hevcdec: Simplify access to luma plane

2025-03-17 Thread Andreas Rheinhardt
Patch attached. - Andreas From 4c0e8ec660092fa4a8ce6ed2a0173395c92dbd93 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 17 Mar 2025 20:01:22 +0100 Subject: [PATCH] avcodec/hevc/hevcdec: Simplify access to luma plane It is always set and does not use subsampling. Signed-off-by: Andr

[FFmpeg-devel] [PATCH v3 07/14] avcodec/sanm: codec23 decoder

2025-03-17 Thread Manuel Lauss
This codec alternatingly skips and changes existing pixels. A second 16bit parameter in the FOBJ header indicates how to do the pixel changes: either by specifying a LUT in the codec datastream or by adding a constant value to the pixel. Signed-off-by: Manuel Lauss --- v2, v3: no changes libavc

[FFmpeg-devel] [PATCH v3 11/14] avcodec/sanm: implement STOR/FTCH for ANIMv1

2025-03-17 Thread Manuel Lauss
Handle STOR/FTCH the same way the RA1 game engine does: On STOR, save the next following FOBJ (not the decoded image) in a buffer; decode it on FTCH. The RA1 codecs and the fobj handler now take an explicit GetByteContext in order to be able to replay stored data. Used extensively by Rebel Assault

[FFmpeg-devel] [PATCH v3 06/14] avcodec/sanm: codec2 decoder

2025-03-17 Thread Manuel Lauss
this codec consists of 4 byte packets: 2bytes delta-x, 1 byte delta-y and 1 byte color to put at that spot. Used in Rebel Assault 1 only. Signed-off-by: Manuel Lauss --- v2, v3: no changes. libavcodec/sanm.c | 20 1 file changed, 20 insertions(+) diff --git a/libavcodec/sa

[FFmpeg-devel] [PATCH v3 03/14] avcodec/sanm: better frame size detection for old codecs

2025-03-17 Thread Manuel Lauss
The size of the video frame (FOBJ) of the old codecs (ANIMv0/1/2) can very reliably be determined: - ANIMv0/1 (=Rebel Assault 1) uses a 384x242 internal buffer for everything. The codec parameters only describe the size and offset of the specific FOBJ on that buffer. - ANIMv2 titles usually us

[FFmpeg-devel] [PATCH v3 10/14] avcodec/sanm: codec37: reimplement comp4

2025-03-17 Thread Manuel Lauss
Compression 4 code 0 means copy from delta buffer without mv, AND start of a skip run. This gets rid of the extra case and column index manipulation and implements this as it is implemented in the original game exe, i.e. as a special case for after mv copy. Signed-off-by: Manuel Lauss --- v3: ch

[FFmpeg-devel] [PATCH v3 09/14] avcodec/sanm: codec4/5/33/34 decoder

2025-03-17 Thread Manuel Lauss
This codec works on 4x4 pixel tiles, which can be generated and read from the datastream. They're both identical, codec5 misses a tile index to skip the current tile. Codecs33/34 are the same as 4/5 but with a different tileset generator. Used only in Rebel Assault 1. Signed-off-by: Manuel Lauss

[FFmpeg-devel] [PATCH v3 08/14] avcodec/sanm: codec21 decoder

2025-03-17 Thread Manuel Lauss
similar to codec23, this one alternatingly skips and writes bytes. Signed-off-by: Manuel Lauss --- v2,v3: no changes libavcodec/sanm.c | 45 + 1 file changed, 45 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 6302c62f43..95ff8

[FFmpeg-devel] [PATCH v3 13/14] avcodec/sanm: codec20 decoder

2025-03-17 Thread Manuel Lauss
codec20 is raw uncompressed image data. It is used internally in Rebel Assault 1 as a special format for STOR (when parameter for STOR is set to 3), and is used again in the "Full Throttle Remaster" from 2017. Signed-off-by: Manuel Lauss --- v3: newly added libavcodec/sanm.c | 20 +

[FFmpeg-devel] [PATCH v3 14/14] MAINTAINERS: add Manuel Lauss as sanm.c/smush.c Maintainer

2025-03-17 Thread Manuel Lauss
As requested by Michael Niedermayer. Signed-off-by: Manuel Lauss --- v3: no changes v2: newly added MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9714581c6b..917eca458e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -244,6 +244,7 @@ Codecs:

[FFmpeg-devel] [PATCH v3 12/14] avcodec/sanm: ignore codec45

2025-03-17 Thread Manuel Lauss
Codec45 is used in some RA2 videos on top of codec37. It consists of 2 tables (768 and 32768 bytes), and datapackets like codec2 (delta-x, delta-y) with a pixel counter instead of a color value. It then reads the 4 surrounding pixels, looks up 3 separate values for each in table1, adds them togeth

[FFmpeg-devel] [PATCH v3 05/14] avcodec/sanm: fix codec3

2025-03-17 Thread Manuel Lauss
codec3 is codec1 which writes zero values instead of skipping them. This fixes a lot of RA1 videos. Signed-off-by: Manuel Lauss --- v2, v3: no changes libavcodec/sanm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 395548

[FFmpeg-devel] [PATCH v3 04/14] avcodec/sanm: better ANIMv1 engine support

2025-03-17 Thread Manuel Lauss
- clear the front buffer with color 0 on the first FOBJ. Fixes a lot of Rebel Assault 1 videos and Rebel Assault 2 space scenes (e.g. 08PLAY.SAN which consists only of codec1/2/21 objects which only ever touch parts of the buffer). - for ANIMv1 (Rebel Assault 1): set palette index 0 to all ze

[FFmpeg-devel] [PATCH v3 02/14] avcodec/sanm: FOBJ left/top are signed values

2025-03-17 Thread Manuel Lauss
The left/top parameters of a FOBJ are signed values. Adjust codec1 code accordingly to not draw outside the buffer area. Rebel Assault 1 makes heavy use of this. Signed-off-by: Manuel Lauss --- v2, v3: no changes libavcodec/sanm.c | 33 ++--- 1 file changed, 18 inse

[FFmpeg-devel] [PATCH v3 01/14] avcodec/sanm: disable left/top for fullscreen codecs

2025-03-17 Thread Manuel Lauss
The block-based codecs 37/47/48 work on the full frame, and there's no existing LucasArts game video that uses left/top offsets for these, as it doesn't make sense. Ignore the left/top parameters for these codecs. Signed-off-by: Manuel Lauss --- v2, v3: no changes libavcodec/sanm.c | 32 +++

[FFmpeg-devel] [PATCH v3 00/14] avcodec/sanm: various improvements

2025-03-17 Thread Manuel Lauss
This patchset improves especially support for SMUSHv1 (Rebel Assault 1), adds missing codecs and functions and improves reliability of SMUSHv1/v2. Changes in v3: - fix a bug in #10: did not check buffer size before reading it - removed the check for frame dimensions set-in-stone in #11, which br

Re: [FFmpeg-devel] [PATCH] ffbuild: use response files only if ar accepts them

2025-03-17 Thread Gyan Doshi
On 2025-03-17 09:44 pm, Zhao Zhili wrote: On Mar 17, 2025, at 23:16, Gyan Doshi wrote: This is to not break linking with toolchains that don't support reading args from a 'response file'. --- I've assumed that ld on a system will have same support as ar. configure | 7 +++ ff

Re: [FFmpeg-devel] [PATCH] ffbuild: use response files only if ar accepts them

2025-03-17 Thread Zhao Zhili
> On Mar 17, 2025, at 23:16, Gyan Doshi wrote: > > This is to not break linking with toolchains that don't support reading > args from a 'response file'. > --- > I've assumed that ld on a system will have same support as ar. > > configure | 7 +++ > ffbuild/library.mak | 8 ++

[FFmpeg-devel] [PATCH] ffbuild: use response files only if ar accepts them

2025-03-17 Thread Gyan Doshi
This is to not break linking with toolchains that don't support reading args from a 'response file'. --- I've assumed that ld on a system will have same support as ar. configure | 7 +++ ffbuild/library.mak | 8 2 files changed, 15 insertions(+) diff --git a/configure b/co

Re: [FFmpeg-devel] [PATCH v3] ffbuild: read library linker objects from a file

2025-03-17 Thread Martin Storsjö
On Mon, 17 Mar 2025, Gyan Doshi wrote: On 2025-03-17 05:29 pm, Zhao Zhili wrote: @file doesn’t supported by ar on macOS or BSD. Do we have any FATE clients on these platforms? I remember there were apple machines, but they are not there now. https://fate.ffmpeg.org/ Can we get a definite

[FFmpeg-devel] [PATCH] avfilter/vf_libplacebo: don't explode on zero FPS information

2025-03-17 Thread Niklas Haas
From: Niklas Haas While technically not specifiad as valid by the AVFilterLink documentation, it is currently possible to get an FPS of zero from various sources inside libavfilter (notably vf_buffersrc). Avoid a division by zero and resulting infinity when this happens. --- libavfilter/vf_libp

Re: [FFmpeg-devel] [PATCH v3] ffbuild: read library linker objects from a file

2025-03-17 Thread Gyan Doshi
On 2025-03-17 05:29 pm, Zhao Zhili wrote: On Mar 17, 2025, at 19:45, Gyan Doshi wrote: On 2025-03-17 05:02 pm, Zhao Zhili wrote: On Mar 13, 2025, at 21:02, Gyan Doshi wrote: The linker command can exceed the maximum argument limit on MinGW, especially for libavcodec. The objects list

Re: [FFmpeg-devel] [PATCH 1/5] avcodec/ffv1: fix remap without chroma planes

2025-03-17 Thread Michael Niedermayer
On Sat, Mar 15, 2025 at 01:00:03AM +0100, Michael Niedermayer wrote: > Sponsored-by: Sovereign Tech Fund > Signed-off-by: Michael Niedermayer > --- > libavcodec/ffv1dec.c | 3 +-- > libavcodec/ffv1enc.c | 3 +-- > 2 files changed, 2 insertions(+), 4 deletions(-) will apply patchset with some min

[FFmpeg-devel] [PATCH] avcodec/proresenc_kostya: Don't cast const away needlessly

2025-03-17 Thread Andreas Rheinhardt
Patch attached. - Andreas From 6f4b5047e6eee58259dc5859edbca31bbf6e1865 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 17 Mar 2025 13:20:49 +0100 Subject: [PATCH] avcodec/proresenc_kostya: Don't cast const away needlessly The parameter passed here is unused, so just pass NULL. Sig

Re: [FFmpeg-devel] [PATCH v3] ffbuild: read library linker objects from a file

2025-03-17 Thread Zhao Zhili
> On Mar 17, 2025, at 19:45, Gyan Doshi wrote: > > > > On 2025-03-17 05:02 pm, Zhao Zhili wrote: >> >>> On Mar 13, 2025, at 21:02, Gyan Doshi wrote: >>> >>> The linker command can exceed the maximum argument limit on MinGW, >>> especially for libavcodec. >>> >>> The objects list is now st

Re: [FFmpeg-devel] [PATCH] libavfilter/af_amix: fixed amix format when graph load

2025-03-17 Thread Shiqi Zhu
On Sat, 14 Dec 2024 at 17:59, Anton Khirnov wrote: > > > libavfilter/af_amix: fixed amix format when graph load > > This needs a better explanation of what is being done and why. > > -- > Anton Khirnov Thanks Anton Khirnov, This patch mainly wants to add some attributes to amix. You can fix the

Re: [FFmpeg-devel] [PATCH v3] ffbuild: read library linker objects from a file

2025-03-17 Thread Gyan Doshi
On 2025-03-17 05:02 pm, Zhao Zhili wrote: On Mar 13, 2025, at 21:02, Gyan Doshi wrote: The linker command can exceed the maximum argument limit on MinGW, especially for libavcodec. The objects list is now stored in a file and passed to the linker. --- v3: for reasons unknown to me, stati

Re: [FFmpeg-devel] [PATCH v3] ffbuild: read library linker objects from a file

2025-03-17 Thread Zhao Zhili
> On Mar 13, 2025, at 21:02, Gyan Doshi wrote: > > The linker command can exceed the maximum argument limit on MinGW, > especially for libavcodec. > > The objects list is now stored in a file and passed to the linker. > --- > v3: > for reasons unknown to me, static linking doesn't appear to >

[FFmpeg-devel] [PATCH 04/11] tests/swscale: use yuva444p as reference

2025-03-17 Thread Niklas Haas
From: Niklas Haas Instead of the lossy yuva420p. This does change the results compared to the status quo, but is more reflective of the actual strength of a conversion, since it will faithfully measure the round-trip error from subsampling and upsampling. --- libswscale/tests/swscale.c | 8 -

[FFmpeg-devel] [PATCH 1/3] avcodec/h261enc: Don't use (size_t)-1

2025-03-17 Thread Andreas Rheinhardt
Patches attached. - Andreas From b5391a5fc9049addae418073393765703ecbbf9a Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 17 Mar 2025 09:53:42 +0100 Subject: [PATCH 1/3] avcodec/h261enc: Don't use (size_t)-1 Fixes "runtime error: addition of unsigned offset to 0x765a09523a90 overflo

Re: [FFmpeg-devel] [PATCH 09/11] tests/swscale: calculate theoretical expected SSIM

2025-03-17 Thread Niklas Haas
On Mon, 17 Mar 2025 11:43:55 +0100 Niklas Haas wrote: > From: Niklas Haas > > We can calculate with some confidence the theoretical expected SSIM > from an "ideal" conversion, by computing the reference SSIM level > for an image dithered with uniformly distributed quatization noise. > > This give

[FFmpeg-devel] [PATCH 11/11] tests/swscale: allow setting log verbosity

2025-03-17 Thread Niklas Haas
From: Niklas Haas Helpful for debugging the new swscale code, since it dumps the operations list in verbose logging mode. --- libswscale/tests/swscale.c | 4 1 file changed, 4 insertions(+) diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c index 117ed2144e..0984536555 10

[FFmpeg-devel] [PATCH 10/11] tests/swscale: constrain reference SSIM for low bit depth formats

2025-03-17 Thread Niklas Haas
From: Niklas Haas Sometimes, the reference SSIM is significantly higher than the SSIM level expected for the test. This is the case when the source format has a much lower bit depth than the destination format. In this case, the fact that legacy swscale does not accurately preserve the source dit

[FFmpeg-devel] [PATCH 09/11] tests/swscale: calculate theoretical expected SSIM

2025-03-17 Thread Niklas Haas
From: Niklas Haas We can calculate with some confidence the theoretical expected SSIM from an "ideal" conversion, by computing the reference SSIM level for an image dithered with uniformly distributed quatization noise. This gives us an additional safety net to check for regressions even in the

[FFmpeg-devel] [PATCH 08/11] tests/swscale: remove stray whitespace in scanf format

2025-03-17 Thread Niklas Haas
From: Niklas Haas --- libswscale/tests/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c index daf6cf769c..47c58524f6 100644 --- a/libswscale/tests/swscale.c +++ b/libswscale/tests/swscale.c @@ -388,7 +388,7 @@ s

[FFmpeg-devel] [PATCH 07/11] tests/swscale: check supported inputs for legacy swscale separately

2025-03-17 Thread Niklas Haas
From: Niklas Haas The new code path supports more formats, so we can't test them all against the legacy implementation. --- libswscale/tests/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c index a2b960faa3..daf

[FFmpeg-devel] [PATCH 06/11] tests/swscale: print performance stats on exit

2025-03-17 Thread Niklas Haas
From: Niklas Haas --- libswscale/tests/swscale.c | 47 ++ 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c index ea6c57ff2a..a2b960faa3 100644 --- a/libswscale/tests/swscale.c +++ b/libswsca

[FFmpeg-devel] [PATCH 05/11] tests/swscale: switch from MSE to SSIM

2025-03-17 Thread Niklas Haas
From: Niklas Haas And bias it towards Y. This is much better at ignoring errors due to differing dither patterns, and rewards algorithms that lower luma noise at the cost of higher chroma noise. The (0.8, 0.1, 0.1) weights for YCbCr are taken from the paper: "Understanding SSIM" by Jim Nilsson

[FFmpeg-devel] [PATCH 03/11] tests/swscale: print speedup numbers in color

2025-03-17 Thread Niklas Haas
From: Niklas Haas --- libswscale/tests/swscale.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c index bdfea4e761..3f140f51f7 100644 --- a/libswscale/tests/swscale.c +++ b/libswscale/tests/swscale.c @@ -

[FFmpeg-devel] [PATCH 02/11] tests/swscale: allow testing only unscaled convertors

2025-03-17 Thread Niklas Haas
From: Niklas Haas I need this to be able to test the new unscaled conversion code more quickly. We re-order the flags order to make 0 the first entry, so we don't set any flags when performing unscaled tests. --- libswscale/tests/swscale.c | 29 + 1 file changed, 25 i

[FFmpeg-devel] [PATCH 01/11] tests/swscale: allow choosing specific flags and dither mode

2025-03-17 Thread Niklas Haas
From: Niklas Haas So I can quickly iterate on the new swscale code. --- libswscale/tests/swscale.c | 42 -- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c index 2e83197694..0027139154 100

Re: [FFmpeg-devel] [PATCH v3] ffbuild: read library linker objects from a file

2025-03-17 Thread Gyan Doshi
On 2025-03-15 01:26 pm, Gyan Doshi wrote: On 2025-03-13 06:32 pm, Gyan Doshi wrote: The linker command can exceed the maximum argument limit on MinGW, especially for libavcodec. The objects list is now stored in a file and passed to the linker. --- v3:    for reasons unknown to me, static l

Re: [FFmpeg-devel] [PATCH] doc/filters: Add CUDA Video Filters section for CUDA-based and CUDA+NPP based filters.

2025-03-17 Thread Gyan Doshi
On 2025-03-17 11:25 am, Gyan Doshi wrote: On 2025-03-17 12:45 am, Danil Iashchenko wrote: Hi Gyan and Michael, Thank you for reviewing the patch and providing feedback! I've addressed all the issues and resubmitting the patch (built and tested with Texinfo 7.1.1). Per Gyan's suggestion,

Re: [FFmpeg-devel] [PATCH] doc/filters: Add CUDA Video Filters section for CUDA-based and CUDA+NPP based filters.

2025-03-17 Thread Gyan Doshi
On 2025-03-17 12:45 am, Danil Iashchenko wrote: Hi Gyan and Michael, Thank you for reviewing the patch and providing feedback! I've addressed all the issues and resubmitting the patch (built and tested with Texinfo 7.1.1). Per Gyan's suggestion, I'm resubmitting since Patchwork was down when