Re: [FFmpeg-devel] apsnr's PSNR formula is different from Wikipedia's formula

2024-10-07 Thread Shawn Singh via ffmpeg-devel
On Tue, Oct 1, 2024 at 3:41 PM Jing Lu wrote: > Hi ffmpeg-devel@, > > I recently came across the apnsr filter > , > and the formula for PSNR it uses: > > 2.0 * log(s->max) - log(s->nb_samples / s->chs[ch].uv) > > > which is

[FFmpeg-devel] [PATCH] libavfilter/vf_overlay: fix the displayed flags in CLI documentation

2024-10-07 Thread Thomas Guillory
When displaying help for overlay filter in CLI, the flags for x and y parameters don't have the T flag. However these two parameters do have the capability to be set at runtime, as implemented in commit d2752ef0615. This commit fixes the CLI documentation. --- libavfilter/vf_overlay.c | 5 +++-- 1

[FFmpeg-devel] [PATCH 17/20] avformat/movenc: add support for UYVA pixel format

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libavformat/isom_tags.c | 1 + libavformat/movenc.c| 1 + 2 files changed, 2 insertions(+) diff --git a/libavformat/isom_tags.c b/libavformat/isom_tags.c index 5dd72d570e..836bf14b80 100644 --- a/libavformat/isom_tags.c +++ b/libavformat/isom_tags.c @@ -33,6 +3

[FFmpeg-devel] [PATCH 19/20] avcodec: deprecate v408 de/encoder

2024-10-07 Thread James Almer
The uyva pixel format was recently added, so this lavc workaround is no longer needed. Signed-off-by: James Almer --- libavcodec/allcodecs.c | 2 ++ libavcodec/codec_desc.c| 2 ++ libavcodec/codec_id.h | 2 ++ libavcodec/v408dec.c | 2 ++ libavcodec/v408enc.c | 2 ++ lib

[FFmpeg-devel] [PATCH 18/20] avformat/movenc: add support for VYU444 pixel format

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libavformat/isom_tags.c | 1 + libavformat/movenc.c| 1 + 2 files changed, 2 insertions(+) diff --git a/libavformat/isom_tags.c b/libavformat/isom_tags.c index 836bf14b80..1605a669d3 100644 --- a/libavformat/isom_tags.c +++ b/libavformat/isom_tags.c @@ -33,6 +3

[FFmpeg-devel] [PATCH 20/20] avcodec: deprecate v308 de/encoder

2024-10-07 Thread James Almer
The vyu444 pixel format was recently added, so this lavc workaround is no longer needed. Signed-off-by: James Almer --- libavcodec/allcodecs.c | 2 +- libavcodec/codec_desc.c | 2 +- libavcodec/codec_id.h | 2 +- libavcodec/v308dec.c| 2 ++ libavcodec/v308enc.c| 2 ++ libavformat/isom

[FFmpeg-devel] [PATCH 14/20] avutil/hwcontext_videotoolbox: add support for AYUV pixel format

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- Untested libavutil/hwcontext_videotoolbox.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavutil/hwcontext_videotoolbox.c b/libavutil/hwcontext_videotoolbox.c index 122a61d5e7..1d7dff4a7d 100644 --- a/libavutil/hwcontext_videotoolbox.c +++ b/libavutil/h

[FFmpeg-devel] [PATCH 16/20] avcodec/videotoolbox: choose AYUV pixel format when ideal

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- Untested libavcodec/videotoolbox.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 90c1fbfb10..a606c29ded 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@

[FFmpeg-devel] [PATCH] avcodec/hevc/ps: return a proper error code when we don't support parsing an sps

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libavcodec/hevc/ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/hevc/ps.c b/libavcodec/hevc/ps.c index c773d7d221..2f47410e66 100644 --- a/libavcodec/hevc/ps.c +++ b/libavcodec/hevc/ps.c @@ -1215,7 +1215,7 @@ int ff_hevc_parse_sps

[FFmpeg-devel] [PATCH v2 5/5] swscale/internal: constify and expose ff_swscale()

2024-10-07 Thread Niklas Haas
From: Niklas Haas Used as an intermediate entry point for the new swscale context. The extra constification is a consistency measure, as I want to move the memcpy of stride and plane pointers to the functions that actually need to mutate them. Sponsored-by: Sovereign Tech Fund Signed-off-by: Nik

[FFmpeg-devel] [PATCH v2 3/5] swscale/rgb2xyz: follow convention on image pointers and strides

2024-10-07 Thread Niklas Haas
From: Niklas Haas Instead of taking an int16_t pointer and a stride in halfwords, follow the usual convention of treating all planes and strides as byte-addressed. This does not have any immediate effect but makes these functions more reusable without unintended "gotchas". Sponsored-by: Soverei

[FFmpeg-devel] [PATCH v2 1/5] swscale/rgb2xyz: minor style fixes

2024-10-07 Thread Niklas Haas
From: Niklas Haas Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas --- libswscale/swscale.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 0abc84d33b..fa8eed10d9 100644 --- a/libswscale/swscale.c

[FFmpeg-devel] [PATCH v2 2/5] swscale/rgb2xyz: add explicit width parameter

2024-10-07 Thread Niklas Haas
From: Niklas Haas This fixes an 11-year-old bug in the rgb2xyz functions, when used with a negative stride. The current loop bounds turned it into a no-op. Additionally, this increases performance on highly cropped images, whose stride may be substantially higher than the effective width. Spons

[FFmpeg-devel] [PATCH v2 4/5] swscale/rgb2xyz: expose these functions internally

2024-10-07 Thread Niklas Haas
From: Niklas Haas --- libswscale/swscale.c | 12 ++-- libswscale/swscale_internal.h | 6 ++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 2d7b987071..5f77cad402 100644 --- a/libswscale/swscale.c +++ b/libsw

[FFmpeg-devel] [PATCH 4/5] fftools/ffmpeg_filter: do not leak graph_desc on fg_create() failure

2024-10-07 Thread Anton Khirnov
fg_create() is passed a malloced string and assumed to always tak ownership of it. --- fftools/ffmpeg_filter.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index faab003e71..4d444c161f 100644 --- a/fftools/ffmpeg_filter.c

[FFmpeg-devel] [PATCH 2/5] fftools/cmdutils: do not treat single '-' as an option in locate_option()

2024-10-07 Thread Anton Khirnov
Fixes early parsing of trailing -v/-loglevel while using '-' to output to stdout. --- fftools/cmdutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 9eb49dbf20..8ac20bf049 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils

[FFmpeg-devel] [PATCH 1/5] fftools/cmdutils: group related calls together

2024-10-07 Thread Anton Khirnov
For readability only, should have no functional effect. --- fftools/cmdutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 9beed94ead..9eb49dbf20 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -551,11 +551,12 @@ s

[FFmpeg-devel] [PATCH v2 05/20] swscale/input: add AYUV input support

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libswscale/input.c | 35 +++ libswscale/utils.c | 1 + 2 files changed, 36 insertions(+) diff --git a/libswscale/input.c b/libswscale/input.c index 2a7a6c91dd..fd8077c455 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -

[FFmpeg-devel] [PATCH v2 07/20] swscale/input: add VYU444 input support

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libswscale/input.c | 24 libswscale/utils.c | 1 + 2 files changed, 25 insertions(+) diff --git a/libswscale/input.c b/libswscale/input.c index 15b0957fce..721f3a9645 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -746,6 +746,

[FFmpeg-devel] [PATCH v2 06/20] swscale/input: add UYVA input support

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libswscale/input.c | 14 ++ libswscale/utils.c | 1 + 2 files changed, 15 insertions(+) diff --git a/libswscale/input.c b/libswscale/input.c index fd8077c455..15b0957fce 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -736,6 +736,16 @@ stat

Re: [FFmpeg-devel] [PATCH 09/12] swscale/internal: constify SwsFunc

2024-10-07 Thread Niklas Haas
On Mon, 07 Oct 2024 16:53:41 -0400 Sean McGovern wrote: > Hi, > > On Sun, Oct 6, 2024 at 6:31 PM Michael Niedermayer > wrote: > > > > On Sat, Oct 05, 2024 at 09:24:00PM +0200, Niklas Haas wrote: > > > From: Niklas Haas > > > > > > I want to move away from having random leaf processing functions

Re: [FFmpeg-devel] [PATCH 12/12] swscale/input: parametrize ff_sws_init_input_funcs() pointers

2024-10-07 Thread Niklas Haas
On Mon, 07 Oct 2024 20:14:50 -0300 James Almer wrote: > On 10/5/2024 4:24 PM, Niklas Haas wrote: > > From: Niklas Haas > > > > Following the precedent set by ff_sws_init_output_funcs(). > > > > Sponsored-by: Sovereign Tech Fund > > Signed-off-by: Niklas Haas > > --- > > libswscale/input.c

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/hevc/ps: print a more accurate message when parsing an SPS for an unsupported layer

2024-10-07 Thread Anton Khirnov
Quoting James Almer (2024-10-03 19:54:28) > With multilayer001.heic: > > Before: > [hevc @ ...] Scalability type 2 not supported > [hevc @ ...] Ignoring unsupported VPS extension > [hevc @ ...] The following bit-depths are currently specified: 8, 9, 10 and > 12 bits, chroma_format_idc is 0, depth

Re: [FFmpeg-devel] [PATCH] configure: add spirv_compiler to avfilter_suggest as well

2024-10-07 Thread Hendrik Leppkes
On Mon, Oct 7, 2024 at 9:15 AM Lynne via ffmpeg-devel wrote: > > If someone were to enable libglslang/libshaderc, and then disable > all Vulkan filters, they would have the same issue as the earlier > fix for libavcodec. If you run such a setup, shouldn't the code that uses this then be excluded?

[FFmpeg-devel] [PATCH] configure: add spirv_compiler to avfilter_suggest as well

2024-10-07 Thread Lynne via ffmpeg-devel
If someone were to enable libglslang/libshaderc, and then disable all Vulkan filters, they would have the same issue as the earlier fix for libavcodec. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 1006ac98e2..461586cdb8 100755 --- a/

[FFmpeg-devel] [PATCH] configure: explicitly disable spirv_compiler

2024-10-07 Thread Lynne via ffmpeg-devel
spirv_compiler is an undeclared variable that was spontaneously enabled if libshaderc or libglslang were detected, and served as a way to enable filters. However, it being undeclared had the effect that it was neither considered explicitly disabled nor enabled if libshaderc or libglslang were dete

Re: [FFmpeg-devel] [PATCH] configure: add spirv_compiler to avfilter_suggest as well

2024-10-07 Thread Lynne via ffmpeg-devel
On 07/10/2024 09:28, Hendrik Leppkes wrote: On Mon, Oct 7, 2024 at 9:15 AM Lynne via ffmpeg-devel wrote: If someone were to enable libglslang/libshaderc, and then disable all Vulkan filters, they would have the same issue as the earlier fix for libavcodec. If you run such a setup, shouldn't

[FFmpeg-devel] [PATCH 3/5] fftools/ffmpeg_opt: add a struct to be passed as opaque to global-option handlers

2024-10-07 Thread Anton Khirnov
Will be useful in following commits. --- fftools/ffmpeg_opt.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index f639a1cf0a..052e68e943 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -86,6 +8

[FFmpeg-devel] [PATCH 5/5] fftools/ffmpeg: supply hw device context to probe-filtergraphs

2024-10-07 Thread Anton Khirnov
I.e. those that are only used to figure out input/output counts, since some filters might expect a valid hw device in init and refuse to initalize otherwise. This requires complex filtergraphs to be created in a separate step after parsing global options, after all hw devices are guaranteed to exi

Re: [FFmpeg-devel] [PATCH 04/12] swscale/internal: swap SWS_DITHER_NONE and SWS_DITHER_AUTO

2024-10-07 Thread Niklas Haas
On Mon, 07 Oct 2024 00:15:32 +0200 Michael Niedermayer wrote: > On Sat, Oct 05, 2024 at 09:23:55PM +0200, Niklas Haas wrote: > > From: Niklas Haas > > > > This is done for consistency with the other public enums which will be > > added in the upcoming swscale API refactor. I went through the cod

Re: [FFmpeg-devel] [PATCH] libavfilter/vf_overlay: fix the displayed flags in CLI documentation

2024-10-07 Thread Gyan Doshi
On 2024-10-07 05:14 pm, Thomas Guillory wrote: When displaying help for overlay filter in CLI, the flags for x and y parameters don't have the T flag. However these two parameters do have the capability to be set at runtime, as implemented in commit d2752ef0615. This commit fixes the CLI docum

Re: [FFmpeg-devel] [PATCH] avcodec/decode: clean-up if get_hw_frames_parameters fails

2024-10-07 Thread Thomas Guillem via ffmpeg-devel
On Mon, Oct 7, 2024, at 17:12, Rémi Denis-Courmont wrote: > Le 30 septembre 2024 17:27:46 GMT+09:00, Thomas Guillem via > ffmpeg-devel a écrit : >>Fixes the following assert: >> >>[7f1df83d17e0] vaapi generic error: avcodec_get_hw_frames_parameters >>failed: -22 >>Assertion p_dst->hwaccel_

[FFmpeg-devel] [PATCH] avcodec/decode: clean-up if get_hw_frames_parameters fails

2024-10-07 Thread Thomas Guillem via ffmpeg-devel
Fixes the following assert: [7f1df83d17e0] vaapi generic error: avcodec_get_hw_frames_parameters failed: -22 Assertion p_dst->hwaccel_threadsafe || (!dst->hwaccel && !dst->internal->hwaccel_priv_data) failed at libavcodec/pthread_frame.c:349 Reproduced from VLC with VAAPI, when fallbacking

[FFmpeg-devel] [PATCH 03/20] avutil/pixfmt: add UYVA pixel format

2024-10-07 Thread James Almer
This maps to the YpCbCrA8 pixel format as defined by Apple, which is ordered Cb Y' Cr A. Signed-off-by: James Almer --- libavutil/pixdesc.c | 13 + libavutil/pixfmt.h | 2 ++ libavutil/tests/pixfmt_best.c| 1 + tests/ref/fate/imgutils |

[FFmpeg-devel] [PATCH 02/20] avutil/pixfmt: add AYUV pixel format

2024-10-07 Thread James Almer
This maps to the AYpCbCr8 pixel format as defined by Apple, which is ordered A Y’ Cb Cr. Signed-off-by: James Almer --- libavutil/pixdesc.c | 13 + libavutil/pixfmt.h | 2 ++ libavutil/tests/pixfmt_best.c| 1 + tests/ref/fate/imgutils |

[FFmpeg-devel] [PATCH 01/20] swscale/output: add missing yuv2packed1 and yuv2packed2 support for VUY{X, A}

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- FATE tests don't seem to trigger this. libswscale/output.c | 106 1 file changed, 106 insertions(+) diff --git a/libswscale/output.c b/libswscale/output.c index 31921a3cce..e5d555f76f 100644 --- a/libswscale/output.c ++

[FFmpeg-devel] [PATCH 04/20] avutil/pixfmt: add VYU444 pixel format

2024-10-07 Thread James Almer
This maps to the 444YpCbCr8 pixel format as defined by Apple, which is ordered Cr Y' Cb. Signed-off-by: James Almer --- libavutil/pixdesc.c | 11 +++ libavutil/pixfmt.h | 2 ++ libavutil/tests/pixfmt_best.c| 1 + tests/ref/fate/imgutils | 2 ++

[FFmpeg-devel] [PATCH 07/20] swscale/input: add VYU444 input support

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libswscale/input.c | 24 libswscale/utils.c | 1 + 2 files changed, 25 insertions(+) diff --git a/libswscale/input.c b/libswscale/input.c index 3a93ac18e4..fe3e419edc 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -746,6 +746,

[FFmpeg-devel] [PATCH 06/20] swscale/input: add UYVA input support

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libswscale/input.c | 15 +++ libswscale/utils.c | 1 + 2 files changed, 16 insertions(+) diff --git a/libswscale/input.c b/libswscale/input.c index 9fe5ef47ce..3a93ac18e4 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -736,6 +736,16 @@ sta

[FFmpeg-devel] [PATCH 09/20] swscale/output: add UYVA output support

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libswscale/output.c | 56 libswscale/utils.c | 2 +- tests/ref/fate/filter-pixdesc-uyva | 1 + tests/ref/fate/filter-pixfmts-copy | 1 + tests/ref/fate/filter-pixfmts-crop | 1

[FFmpeg-devel] [PATCH 10/20] swscale/output: add VYU444 output support

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libswscale/output.c | 43 libswscale/utils.c | 2 +- tests/ref/fate/filter-pixdesc-vyu444 | 1 + tests/ref/fate/filter-pixfmts-copy | 1 + tests/ref/fate/filter-pixfmts-crop | 1

[FFmpeg-devel] [PATCH 05/20] swscale/input: add AYUV input support

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libswscale/input.c | 35 +++ libswscale/utils.c | 1 + 2 files changed, 36 insertions(+) diff --git a/libswscale/input.c b/libswscale/input.c index d171394bb2..9fe5ef47ce 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -

[FFmpeg-devel] [PATCH 13/20] avformat/riff: map v308 fourcc to RAWVIDEO decoder

2024-10-07 Thread James Almer
There's no need to keep using a custom decoder for this pixel format. Signed-off-by: James Almer --- libavcodec/raw.c | 1 + libavformat/riff.c | 2 +- tests/ref/fate/filter-pixdesc-vyu444 | 2 +- tests/ref/fate/filter-pixfmts-copy | 2 +-

[FFmpeg-devel] [PATCH 12/20] avformat/riff: map v408 fourcc to RAWVIDEO decoder

2024-10-07 Thread James Almer
There's no need to keep using a custom decoder for this pixel format. Signed-off-by: James Almer --- libavcodec/raw.c | 1 + libavformat/riff.c | 2 +- tests/ref/fate/filter-pixdesc-uyva | 2 +- tests/ref/fate/filter-pixfmts-copy | 2 +-

[FFmpeg-devel] [PATCH 08/20] swscale/output: add AYUV output support

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libswscale/output.c | 56 libswscale/utils.c | 2 +- tests/ref/fate/filter-pixdesc-ayuv | 1 + tests/ref/fate/filter-pixfmts-copy | 1 + tests/ref/fate/filter-pixfmts-crop | 1

[FFmpeg-devel] [PATCH 11/20] avformat/riff: map y408 fourcc to RAWVIDEO decoder

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libavcodec/raw.c | 1 + libavformat/riff.c | 1 + tests/ref/fate/filter-pixdesc-ayuv | 2 +- tests/ref/fate/filter-pixfmts-copy | 2 +- tests/ref/fate/filter-pixfmts-crop | 2 +- tests/ref/fate/filter-p

[FFmpeg-devel] [PATCH 15/20] avutil/hwcontext_videotoolbox: add support for UYVA pixel format

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- Untested libavutil/hwcontext_videotoolbox.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavutil/hwcontext_videotoolbox.c b/libavutil/hwcontext_videotoolbox.c index 1d7dff4a7d..d77b6168f7 100644 --- a/libavutil/hwcontext_videotoolbox.c +++ b/libavutil/h

Re: [FFmpeg-devel] [PATCH] avcodec/decode: clean-up if get_hw_frames_parameters fails

2024-10-07 Thread Rémi Denis-Courmont
Le 30 septembre 2024 17:27:46 GMT+09:00, Thomas Guillem via ffmpeg-devel a écrit : >Fixes the following assert: > >[7f1df83d17e0] vaapi generic error: avcodec_get_hw_frames_parameters >failed: -22 >Assertion p_dst->hwaccel_threadsafe || (!dst->hwaccel && >!dst->internal->hwaccel_priv_data

Re: [FFmpeg-devel] [PATCH 04/12] swscale/internal: swap SWS_DITHER_NONE and SWS_DITHER_AUTO

2024-10-07 Thread Michael Niedermayer
On Mon, Oct 07, 2024 at 06:47:24PM +0200, Niklas Haas wrote: > On Mon, 07 Oct 2024 00:15:32 +0200 Michael Niedermayer > wrote: > > On Sat, Oct 05, 2024 at 09:23:55PM +0200, Niklas Haas wrote: > > > From: Niklas Haas > > > > > > This is done for consistency with the other public enums which will

Re: [FFmpeg-devel] [PATCH 04/12] swscale/internal: swap SWS_DITHER_NONE and SWS_DITHER_AUTO

2024-10-07 Thread Niklas Haas
On Mon, 07 Oct 2024 20:03:06 +0200 Michael Niedermayer wrote: > On Mon, Oct 07, 2024 at 06:47:24PM +0200, Niklas Haas wrote: > > On Mon, 07 Oct 2024 00:15:32 +0200 Michael Niedermayer > > wrote: > > > On Sat, Oct 05, 2024 at 09:23:55PM +0200, Niklas Haas wrote: > > > > From: Niklas Haas > > >

Re: [FFmpeg-devel] [PATCH v2 1/5] swscale/rgb2xyz: minor style fixes

2024-10-07 Thread Michael Niedermayer
On Mon, Oct 07, 2024 at 07:52:59PM +0200, Niklas Haas wrote: > From: Niklas Haas > > Sponsored-by: Sovereign Tech Fund > Signed-off-by: Niklas Haas > --- > libswscale/swscale.c | 16 +++- > 1 file changed, 7 insertions(+), 9 deletions(-) ok thx [...] -- Michael GnuPG fingerp

Re: [FFmpeg-devel] [PATCH v2 2/5] swscale/rgb2xyz: add explicit width parameter

2024-10-07 Thread Michael Niedermayer
On Mon, Oct 07, 2024 at 07:53:00PM +0200, Niklas Haas wrote: > From: Niklas Haas > > This fixes an 11-year-old bug in the rgb2xyz functions, when used with a > negative stride. The current loop bounds turned it into a no-op. > > Additionally, this increases performance on highly cropped images,

Re: [FFmpeg-devel] [PATCH v2 3/5] swscale/rgb2xyz: follow convention on image pointers and strides

2024-10-07 Thread Michael Niedermayer
On Mon, Oct 07, 2024 at 07:53:01PM +0200, Niklas Haas wrote: > From: Niklas Haas > > Instead of taking an int16_t pointer and a stride in halfwords, follow the > usual convention of treating all planes and strides as byte-addressed. > > This does not have any immediate effect but makes these fun

Re: [FFmpeg-devel] [PATCH v2 4/5] swscale/rgb2xyz: expose these functions internally

2024-10-07 Thread Michael Niedermayer
On Mon, Oct 07, 2024 at 07:53:02PM +0200, Niklas Haas wrote: > From: Niklas Haas > > --- > libswscale/swscale.c | 12 ++-- > libswscale/swscale_internal.h | 6 ++ > 2 files changed, 12 insertions(+), 6 deletions(-) if they will be used, sure ok thx [...] -- Michael

Re: [FFmpeg-devel] [PATCH 04/12] swscale/internal: swap SWS_DITHER_NONE and SWS_DITHER_AUTO

2024-10-07 Thread Michael Niedermayer
On Mon, Oct 07, 2024 at 08:09:19PM +0200, Niklas Haas wrote: > On Mon, 07 Oct 2024 20:03:06 +0200 Michael Niedermayer > wrote: > > On Mon, Oct 07, 2024 at 06:47:24PM +0200, Niklas Haas wrote: > > > On Mon, 07 Oct 2024 00:15:32 +0200 Michael Niedermayer > > > wrote: > > > > On Sat, Oct 05, 2024

Re: [FFmpeg-devel] [PATCH v2 5/5] swscale/internal: constify and expose ff_swscale()

2024-10-07 Thread Michael Niedermayer
On Mon, Oct 07, 2024 at 07:53:03PM +0200, Niklas Haas wrote: > From: Niklas Haas > > Used as an intermediate entry point for the new swscale context. The extra > constification is a consistency measure, as I want to move the memcpy of > stride and plane pointers to the functions that actually nee

[FFmpeg-devel] [PATCH 24/26] avformat/riff: map v410 fourcc to RAWVIDEO decoder

2024-10-07 Thread James Almer
There's no need to keep using a custom decoder for this pixel format. Signed-off-by: James Almer --- libavcodec/raw.c | 1 + libavformat/riff.c | 1 + tests/ref/fate/filter-pixdesc-v30xle | 2 +- tests/ref/fate/filter-pixfmts-copy | 2 +- t

[FFmpeg-devel] [PATCH 25/26] avformat/movenc: add support for V410 pixel format

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libavformat/isom_tags.c | 1 + libavformat/movenc.c| 1 + 2 files changed, 2 insertions(+) diff --git a/libavformat/isom_tags.c b/libavformat/isom_tags.c index 1e3495f0e2..e999aa7fef 100644 --- a/libavformat/isom_tags.c +++ b/libavformat/isom_tags.c @@ -35,6 +3

[FFmpeg-devel] [PATCH 23/26] swscale/output: add V30X output support

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libswscale/output.c | 31 libswscale/utils.c | 2 +- tests/ref/fate/filter-pixdesc-v30xle | 1 + tests/ref/fate/filter-pixfmts-copy | 1 + tests/ref/fate/filter-pixfmts-crop | 1

[FFmpeg-devel] [PATCH 26/26] avcodec: deprecate v410 de/encoder

2024-10-07 Thread James Almer
The V30X pixel format was recently added, so this lavc workaround is no longer needed. Signed-off-by: James Almer --- libavcodec/allcodecs.c | 2 +- libavcodec/codec_desc.c | 2 ++ libavcodec/codec_id.h | 2 ++ libavcodec/v410dec.c| 2 ++ libavcodec/v410enc.c| 2 ++ libavformat/isom_t

[FFmpeg-devel] [PATCH 22/26] swscale/input: add V30X input support

2024-10-07 Thread James Almer
Signed-off-by: James Almer --- libswscale/input.c | 26 ++ libswscale/utils.c | 1 + 2 files changed, 27 insertions(+) diff --git a/libswscale/input.c b/libswscale/input.c index 7237333e56..3d97c555a3 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -764,6 +76

[FFmpeg-devel] [PATCH 21/26] avutil/pixfmt: add V30X pixel format

2024-10-07 Thread James Almer
This maps to the 444YpCbCr10 pixel format as defined by Apple. Signed-off-by: James Almer --- libavutil/pixdesc.c | 23 +++ libavutil/pixfmt.h | 4 tests/ref/fate/imgutils | 4 tests/ref/fate/sws-pixdesc-query | 7 +++ 4 fi

Re: [FFmpeg-devel] [PATCH 13/20] avformat/riff: map v308 fourcc to RAWVIDEO decoder

2024-10-07 Thread James Almer
On 10/7/2024 5:43 PM, Michael Niedermayer wrote: On Mon, Oct 07, 2024 at 09:29:48AM -0300, James Almer wrote: There's no need to keep using a custom decoder for this pixel format. Signed-off-by: James Almer --- libavcodec/raw.c | 1 + libavformat/riff.c

[FFmpeg-devel] [PATCH v3 04/17] avformat/dvdvideodec: remove "auto" value for -pg option, default to 1

2024-10-07 Thread Marth64
The default "auto" mode is effectively useless; the reasonable default use case is to use the first PG (segment) of the selected PGC for both menus and standard titles. Just default the value to 1, since the option is irrelevant unless -pgc is also set. Note that this should not break users using

[FFmpeg-devel] [PATCH v3 00/17] avformat/dvdvideodec: bugfixes and menu chapter markers

2024-10-07 Thread Marth64
This set aims to fix subtle desync issues when handling discontinuities, do some cleanup, and improve menu support. Effectively a refresh of v2 set with added patches. Compared to v2: * Patches 01-11 are the same except fixed (1) sorting typos, (2) missing doc update. * Drops corrupt or duplicate

[FFmpeg-devel] [PATCH v3 03/17] avformat/dvdvideodec: measure duration of the current menu VOBU in state

2024-10-07 Thread Marth64
This will be a pre-requisite to calculating chapter markers for menus. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index da41a9d329..18c356c132 100644 --- a/libavformat/dvdvideodec.

[FFmpeg-devel] [PATCH v3 02/17] avformat/dvdvideodec: fix menu PGC number off-by-one in state

2024-10-07 Thread Marth64
Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 4e33d1aba6..da41a9d329 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -344,7 +344,7 @@ st

[FFmpeg-devel] [PATCH v3 01/17] avformat/dvdvideodec: remove unused headers

2024-10-07 Thread Marth64
Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 6bd1dbc17f..4e33d1aba6 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -44,8 +44,6 @@ #include "libavuti

[FFmpeg-devel] [PATCH v3 09/17] avformat/dvdvideodec: reset the subdemuxer on discontinuity instead of flushing

2024-10-07 Thread Marth64
DVDs naturally consist of segmented MPEG-PS blobs within a VOB (i.e. VOBs are not linear). NAV packs set the segment boundaries. When switching between segments, discontinuities occur and thus the subdemuxer needs to be reset. The current approach to manage this is by invoking ff_read_frame_flush()

[FFmpeg-devel] [PATCH v3 14/17] avformat/dvdvideodec: remove unnecessary need_parsing argument

2024-10-07 Thread Marth64
The value is always AVSTREAM_PARSE_HEADERS. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 72565ee125..d64a678589 100644 --- a/libavformat

[FFmpeg-devel] [PATCH v3 13/17] avformat/dvdvideodec: open subdemuxer after initializing IFO headers

2024-10-07 Thread Marth64
It is wasteful to open the subdemuxer if an error occurs while initializing streams or reading IFO headers. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvide

[FFmpeg-devel] [PATCH v3 16/17] avformat/dvdvideodec: discard duplicate or partial AC3 samples

2024-10-07 Thread Marth64
Some DVD muxers signal segments to start with duplicate audio samples when starting extraction from a chapter marker or terminate seamless PGs on partial audio samples (causing corrupt AC3 frames). Clean up after these muxers by tracking frames with duplicate PTS and eliminating partial AC3 frames.

[FFmpeg-devel] [PATCH v3 12/17] avformat/dvdvideodec: remove auto value for menu_lu option

2024-10-07 Thread Marth64
The "auto" mode serves no functional purpose except for logging a message and setting the value to 1. The documentation clearly explains what the option is for. Signed-off-by: Marth64 --- doc/demuxers.texi | 2 +- libavformat/dvdvideodec.c | 9 + 2 files changed, 2 insertions(+),

[FFmpeg-devel] [PATCH v3 15/17] avformat/dvdvideodec: drop packets with unset PTS or DTS

2024-10-07 Thread Marth64
The packets effectively serve no purpose and we are already dropping packets with PTS less than 0. This also creates for a smoother seeking experience after the subdemuxer reset fix. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 29 - 1 file changed, 12 inser

[FFmpeg-devel] [PATCH v3 08/17] avformat/dvdvideodec: simplify dvdvideo_read_packet()

2024-10-07 Thread Marth64
The function has a few branches where it discards frames via FFERROR_REDO; consolidate is via a goto block to simplify the function and improve readability. Logging still maintains all the relevant details for the reason of the discard. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 44 +

[FFmpeg-devel] [PATCH v3 05/17] avformat/dvdvideodec: move memcpy below missed NAV packet warning

2024-10-07 Thread Marth64
Readability improvement; the warning can be bundled beneath the preceding validations rather than awkwardly between the memcpy and return. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/dvdvideodec.c b/liba

[FFmpeg-devel] [PATCH v3 17/17] avformat/dvdvideodec: don't allow seeking beyond dvdnav reported duration

2024-10-07 Thread Marth64
There is no reason to accept timestamp values beyond what dvdnav reported as the duration of the title. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 06f842cc1c.

[FFmpeg-devel] [PATCH v3 07/17] avformat/dvdvideodec: enable chapter calculation for menus

2024-10-07 Thread Marth64
Menus are generally segmented by cell, so use them as the marker delimiters. Requires preindex option to be enabled. Signed-off-by: Marth64 --- doc/demuxers.texi | 1 - libavformat/dvdvideodec.c | 53 ++- 2 files changed, 35 insertions(+), 19 deletion

[FFmpeg-devel] [PATCH v3 06/17] avformat/dvdvideodec: standardize the NAV packet event signal

2024-10-07 Thread Marth64
This consolidates the FFERROR_REDO handling of NAV packets to dvdvideo_subdemux_read_data(), is a pre-requisite to calculating chapter markers for menus, and a pre-requisite to fixing the frame desync issue when the subdemuxer is flushed. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 31

[FFmpeg-devel] [PATCH v3 11/17] avformat/dvdvideodec: default menu_vts option to 1 and clarify description

2024-10-07 Thread Marth64
Menu 0 is the VIDEO_TS root menu, which does not appear to be used commonly for menu segments. Instead, default to the menu of VTS 1. Signed-off-by: Marth64 --- doc/demuxers.texi | 2 +- libavformat/dvdvideodec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/

[FFmpeg-devel] [PATCH v3 10/17] avformat/dvdvideodec: check the length of a NAV packet when reading titles

2024-10-07 Thread Marth64
Some discs present titles with bogus NAV packets. We apply this check for menus and for title MPEG blocks, but we should also apply it for NAV packets during title demuxing. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libavforma

Re: [FFmpeg-devel] [PATCH 12/12] swscale/input: parametrize ff_sws_init_input_funcs() pointers

2024-10-07 Thread James Almer
On 10/5/2024 4:24 PM, Niklas Haas wrote: From: Niklas Haas Following the precedent set by ff_sws_init_output_funcs(). Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas --- libswscale/input.c| 388 +- libswscale/swscale.c | 3

Re: [FFmpeg-devel] [PATCH 13/20] avformat/riff: map v308 fourcc to RAWVIDEO decoder

2024-10-07 Thread Michael Niedermayer
On Mon, Oct 07, 2024 at 09:29:48AM -0300, James Almer wrote: > There's no need to keep using a custom decoder for this pixel format. > > Signed-off-by: James Almer > --- > libavcodec/raw.c | 1 + > libavformat/riff.c | 2 +- > tests/ref/fate/filter-p

Re: [FFmpeg-devel] [PATCH 09/12] swscale/internal: constify SwsFunc

2024-10-07 Thread Sean McGovern
Hi, On Sun, Oct 6, 2024 at 6:31 PM Michael Niedermayer wrote: > > On Sat, Oct 05, 2024 at 09:24:00PM +0200, Niklas Haas wrote: > > From: Niklas Haas > > > > I want to move away from having random leaf processing functions mutate > > plane pointers, and while we're at it, we might as well make th

[FFmpeg-devel] [PATCH v2 13/20] avformat/riff: map v308 fourcc to RAWVIDEO decoder

2024-10-07 Thread James Almer
There's no need to keep using a custom decoder for this pixel format. Signed-off-by: James Almer --- libavcodec/raw.c | 1 + libavformat/riff.c | 1 + tests/ref/fate/filter-pixdesc-vyu444 | 2 +- tests/ref/fate/filter-pixfmts-copy | 2 +- t

[FFmpeg-devel] [PATCH v2 12/20] avformat/riff: map v408 fourcc to RAWVIDEO decoder

2024-10-07 Thread James Almer
There's no need to keep using a custom decoder for this pixel format. Signed-off-by: James Almer --- libavcodec/raw.c | 1 + libavformat/riff.c | 1 + tests/ref/fate/filter-pixdesc-uyva | 2 +- tests/ref/fate/filter-pixfmts-copy | 2 +- t

Re: [FFmpeg-devel] [PATCH 09/12] swscale/internal: constify SwsFunc

2024-10-07 Thread Sean McGovern
Hi, On Mon, Oct 7, 2024 at 8:22 PM Niklas Haas wrote: > > On Mon, 07 Oct 2024 16:53:41 -0400 Sean McGovern wrote: > > Hi, > > > > On Sun, Oct 6, 2024 at 6:31 PM Michael Niedermayer > > wrote: > > > > > > On Sat, Oct 05, 2024 at 09:24:00PM +0200, Niklas Haas wrote: > > > > From: Niklas Haas > >

Re: [FFmpeg-devel] [PATCH 04/12] swscale/internal: swap SWS_DITHER_NONE and SWS_DITHER_AUTO

2024-10-07 Thread Tobias Rapp
On 07/10/2024 20:09, Niklas Haas wrote: On Mon, 07 Oct 2024 20:03:06 +0200 Michael Niedermayer wrote: On Mon, Oct 07, 2024 at 06:47:24PM +0200, Niklas Haas wrote: On Mon, 07 Oct 2024 00:15:32 +0200 Michael Niedermayer wrote: On Sat, Oct 05, 2024 at 09:23:55PM +0200, Niklas Haas wrote: Fr

Re: [FFmpeg-devel] [PATCH 09/12] swscale/internal: constify SwsFunc

2024-10-07 Thread Martin Storsjö
On Tue, 8 Oct 2024, Niklas Haas wrote: Sorry for not checking this earlier, but PowerPC 32- and 64-bit builds with AltiVec enabled now fail with: src/libswscale/ppc/yuv2yuv_altivec.c: In function ‘ff_get_unscaled_swscale_ppc’: src/libswscale/ppc/yuv2yuv_altivec.c:199:33: error: assignment to ‘S