Re: [FFmpeg-devel] [PATCH 5/6] swscale/swscale_unscaled: clear the low bits in planar8ToP01xleWrapper

2024-10-20 Thread Michael Niedermayer
On Sun, Oct 20, 2024 at 08:56:07PM -0300, James Almer wrote: > On 10/20/2024 8:52 PM, Michael Niedermayer wrote: > > On Fri, Oct 18, 2024 at 11:34:47PM -0300, James Almer wrote: > > > This makes the unscaled output of p010le and p016le match the generic > > > path. > > > > > > Signed-off-by: Jame

Re: [FFmpeg-devel] [PATCH v4 2/6] avutil/pixdesc: add alpha component information to pixfmts with reserved but undefined alpha bits

2024-10-20 Thread Michael Niedermayer
On Fri, Oct 18, 2024 at 11:34:44PM -0300, James Almer wrote: > 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 u

Re: [FFmpeg-devel] [PATCH 5/6] swscale/swscale_unscaled: clear the low bits in planar8ToP01xleWrapper

2024-10-20 Thread James Almer
On 10/20/2024 8:52 PM, Michael Niedermayer wrote: On Fri, Oct 18, 2024 at 11:34:47PM -0300, James Almer wrote: This makes the unscaled output of p010le and p016le match the generic path. Signed-off-by: James Almer --- libswscale/swscale_unscaled.c | 6 +++--- tests/ref/fate/filter

Re: [FFmpeg-devel] [PATCH v2 3/6] avfilter/vsrc_testsrc: use the alpha component information for XV3{0, 6} and V30X

2024-10-20 Thread Michael Niedermayer
On Fri, Oct 18, 2024 at 11:34:45PM -0300, James Almer wrote: > And add a few more tests to ensure all the pixfmts affected by this change > are tested. > > Signed-off-by: James Almer > --- > libavfilter/vsrc_testsrc.c | 7 ++- > tests/fate/filter-video.mak | 6

Re: [FFmpeg-devel] [PATCH 4/6] avfilter/vf_pixdesctest: also take into account undefined alpha components

2024-10-20 Thread Michael Niedermayer
On Fri, Oct 18, 2024 at 11:34:46PM -0300, James Almer wrote: > 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 > --- > libavfilter/vf_pixdesctest.c

Re: [FFmpeg-devel] [PATCH 5/6] swscale/swscale_unscaled: clear the low bits in planar8ToP01xleWrapper

2024-10-20 Thread Michael Niedermayer
On Fri, Oct 18, 2024 at 11:34:47PM -0300, James Almer wrote: > This makes the unscaled output of p010le and p016le match the generic path. > > Signed-off-by: James Almer > --- > libswscale/swscale_unscaled.c | 6 +++--- > tests/ref/fate/filter-pixdesc-p010le| 2 +- > tests/ref/fate

Re: [FFmpeg-devel] [PATCH 6/6] fate/filter-video: make fate-filter-pixdesc compare the hashed output with and without pixdesctest filtering

2024-10-20 Thread Michael Niedermayer
On Fri, Oct 18, 2024 at 11:34:48PM -0300, James Almer wrote: > 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 > --- > tests/fate-run.sh | 21 + > tests/fate/fi

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/mjpegdec: silently ignore APPx stubs

2024-10-20 Thread Michael Niedermayer
On Thu, Oct 17, 2024 at 01:00:12PM +0200, Ramiro Polla wrote: > Consider APPx fields that are too short to contain an id field (32-bit) > as stubs, and silently ignore them. > > This has been seen in the MJPEG output from some webcams (such as the > Logitech C270 and C920) and the JPEG images embe

[FFmpeg-devel] [PATCH] avcodec/eatgq: decode motion vector macroblocks

2024-10-20 Thread Peter Ross
--- sample: https://discmaster.textfiles.com/file/22091/SSERVCD_50A.bin/DEMOS/NBA97/NBA97.EXE/WESTERN.UV libavcodec/codec_desc.c | 2 +- libavcodec/eatgq.c | 50 + 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/libavcodec/codec_desc.

[FFmpeg-devel] [PATCH] fate/ffmpeg: add samples requirement to fate-ffmpeg-spec-disposition

2024-10-20 Thread Jan Ekström
This tests utilizes an MPEG-TS sample from FATE suite, yet is marked as not requiring samples. This fixes running `make fate` without SAMPLES being set. Reported-by: Sebastian Ramacher --- tests/fate/ffmpeg.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fate/ffmpe

[FFmpeg-devel] [PATCH v3 10/18] swscale/x86: use dedicated int for self-modifying MMX dstW

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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 --- libswscale/swscale.c | 1 + libswscale/swscale_internal.h | 3 +

[FFmpeg-devel] [PATCH v3 12/18] swscale: organize and better document flags

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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_

[FFmpeg-devel] [PATCH v3 09/18] swscale/internal: use static_assert for enforcing offsets

2024-10-20 Thread Niklas Haas
From: Niklas Haas Instead of sprinkling av_assert0 into random init functions. Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas --- libswscale/swscale_internal.h | 11 +++ libswscale/utils.c| 2 -- libswscale/x86/swscale.c | 4 3 files changed, 11 in

[FFmpeg-devel] [PATCH v3 08/18] swscale/options: cosmetic changes

2024-10-20 Thread Niklas Haas
From: Niklas Haas Reorganize the list, fix whitespace, make indentation consistent, and rename some descriptions for clarity, consistency or informativeness. Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas --- libswscale/options.c | 86 ++--

[FFmpeg-devel] [PATCH v3 05/18] swscale/utils: add SwsFormat abstraction and helpers

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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 ra

[FFmpeg-devel] [PATCH v3 07/18] swscale: add sws_is_noop()

2024-10-20 Thread Niklas Haas
From: Niklas Haas Exactly what it says on the tin. Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas --- libswscale/swscale.h | 6 ++ libswscale/utils.c | 14 ++ 2 files changed, 20 insertions(+) diff --git a/libswscale/swscale.h b/libswscale/swscale.h index ba94

[FFmpeg-devel] [PATCH v3 06/18] swscale: add new frame testing API

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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 perfor

[FFmpeg-devel] [PATCH v3 17/18] tests/swscale: add a benchmarking mode

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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 --- libswscale/tests/swscale.c | 93 -- 1 file changed,

[FFmpeg-devel] [PATCH v3 18/18] avfilter/vf_scale: switch to new swscale API

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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 --- libavfilt

[FFmpeg-devel] [PATCH v3 15/18] swscale: introduce new, dynamic scaling API

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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 ex

[FFmpeg-devel] [PATCH v3 16/18] tests/swscale: rewrite on top of new API

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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 t

[FFmpeg-devel] [PATCH v3 13/18] swscale/internal: expose sws_init_single_context() internally

2024-10-20 Thread Niklas Haas
From: Niklas Haas Used by the graph API swscale wrapper, for now. Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas --- libswscale/swscale_internal.h | 3 +++ libswscale/utils.c| 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale_in

[FFmpeg-devel] [PATCH v3 14/18] swscale/graph: add new high-level scaler dispatch mechanism

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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 passe

[FFmpeg-devel] [PATCH v3 04/18] swscale: add sws_free_context()

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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 --- libswscale/swscale.h | 7 +++ libswscale/utils.c | 10 ++ 2 files changed, 17 i

[FFmpeg-devel] [PATCH v3 03/18] swscale: slightly reorder header

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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 --- libswscale/swscale.h | 34 +- 1 file changed, 17 insertions(+), 17 deletion

[FFmpeg-devel] [PATCH v3 00/18] major refactor and new scaling API

2024-10-20 Thread Niklas Haas
Changes since v2: - rebase on top of current master - remove the duplication between the internal and external options, in favor of using indirect reference instead - some refactors to the SwsGraph internal API - fixed flags integer type (avoids breakage on big endian) - fixed build on 32bit x86

[FFmpeg-devel] [PATCH v3 01/18] swscale: publicly typedef struct SwsContext

2024-10-20 Thread Niklas Haas
From: Niklas Haas 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 --- libswscale/swscale.h | 36 ++-- 1 file changed, 18 insertions(+), 1

Re: [FFmpeg-devel] [PATCH] tests/fate/filter-video: don't convert owdenoise test to mpeg range

2024-10-20 Thread Michael Niedermayer
Hi Ramiro On Thu, Oct 17, 2024 at 01:13:39PM +0200, Ramiro Polla wrote: > On Sun, Sep 29, 2024 at 5:38 PM Ramiro Polla wrote: > > > > --- > > The new owdenoise-scenwin-jpeg.raw reference file is available at > > https://0x0.st/XguT.raw > > > > tests/fate/filter-video.mak | 4 ++-- > > 1 file ch

Re: [FFmpeg-devel] [PATCH] lavu/common: Fix AV_CEIL_RSHIFT for unsigned LHS

2024-10-20 Thread Michael Niedermayer
On Fri, Oct 18, 2024 at 06:48:40PM +0100, Frank Plowman wrote: > On 15/10/2024 21:23, Frank Plowman wrote: > > On 14/10/2024 23:26, Michael Niedermayer wrote: > >> On Sat, Oct 05, 2024 at 03:38:05PM -0700, Frank Plowman wrote: > >>> The first branch of this ternary expression was intended to avoid

Re: [FFmpeg-devel] [PATCH] Added support to enable VBV-End feature with x265 encode

2024-10-20 Thread Michael Niedermayer
On Thu, Oct 17, 2024 at 02:29:36PM +0530, Yaswanth Sastry wrote: > Hi Michael, > Here is the updated patch to support Vbv-end Feature,the API in the patch > is expected to work with X265_BUILD >= 213 only. [...] > fftools/ffmpeg_enc.c |2 ++ > libavcodec/avcodec.h |1 + > libavcodec/libx

Re: [FFmpeg-devel] [PATCH] lavc/vvc: Validate subpartitioning structure

2024-10-20 Thread Frank Plowman
On 16/10/2024 13:17, Nuo Mi wrote: > On Tue, Oct 15, 2024 at 7:54 AM Frank Plowman wrote: > >> Thank you for your reply. >> >> On 14/10/2024 16:16, Nuo Mi wrote: >>> On Mon, Oct 14, 2024 at 3:14 AM Frank Plowman >> wrote: >>> On 13/10/2024 05:43, Nuo Mi wrote: > On Sun, Oct 6, 2024 at

[FFmpeg-devel] [PATCH 2/4] avfilter/scale_cuda: implement frame crop

2024-10-20 Thread Koushik Dutta
The crop filter has no effect on scale_cuda: -vf crop=100:100,scale_cuda=300x300 Hardware frames (AV_PIX_FMT_FLAG_HWACCEL) are expected to use the crop_* properties, as seen in the implementation vf_crop.c. The current workaround is to hwdownload the full frame and perform the crop on CPU. Sig

Re: [FFmpeg-devel] [PATCH] avcodec/vvc/thread: Check frame to be non NULL

2024-10-20 Thread Nuo Mi
On Wed, Oct 16, 2024 at 8:20 PM Nuo Mi wrote: > > > On Mon, Oct 14, 2024 at 11:25 PM Nuo Mi wrote: > >> Fixes: NULL pointer dereference >> Fixes: >> 71303/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-4875859050168320 >> >> Found-by: continuous fuzzing process >> https://github.co

[FFmpeg-devel] [PATCH] libavutil/ppc: Include the hardware feature flags like the other archs

2024-10-20 Thread Brad Smith
libavutil/ppc: Include the hardware feature flags like the other archs Also include the hardware feature flags like the other archs do and clean up the code a bit. Tested on Linux POWER8. Signed-off-by: Brad Smith --- libavutil/ppc/cpu.c | 35 +-- 1 file changed

[FFmpeg-devel] [PATCH 3/4] avfilter/scale_qsv: implement frame crop

2024-10-20 Thread Koushik Dutta
The crop filter has no effect on scale_qsv: -vf crop=100:100,scale_qsv=300x300 Hardware frames (AV_PIX_FMT_FLAG_HWACCEL) are expected to use the crop_* properties, as seen in the implementation vf_crop.c. This patch is slightly different from the previously submitted patches since qsv supports

[FFmpeg-devel] [PATCH 1/4] avfilter/scale_vt: implement frame crop

2024-10-20 Thread Koushik Dutta
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. The current workaround is to hwdownload the full frame and perform the crop on CPU. Signed-

[FFmpeg-devel] [PATCH 4/4] avfilter/scale_vt: implement negative width/height aspect ratio sizing

2024-10-20 Thread Koushik Dutta
Signed-off-by: Koushik Dutta --- libavfilter/vf_scale_vt.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_scale_vt.c b/libavfilter/vf_scale_vt.c index 3da46a6cd5..3785b884d9 100644 --- a/libavfilter/vf_scale_vt.c +++ b/libavfilter/vf_scale_vt.c @@

Re: [FFmpeg-devel] [PATCH v2] fate: skip encoded output hashing for tests that depend on zlib

2024-10-20 Thread Michael Niedermayer
On Sat, Oct 19, 2024 at 07:22:23PM -0300, James Almer wrote: > On 10/19/2024 7:09 PM, Michael Niedermayer wrote: > > On Sat, Oct 19, 2024 at 10:33:58AM -0300, James Almer wrote: > > > As there's no guarantee that the output will be exactly the same across > > > implementations, > > > just don't te

Re: [FFmpeg-devel] [PATCH v2 02/19] swscale: rename SwsContext to SwsInternal

2024-10-20 Thread Niklas Haas
On Sat, 19 Oct 2024 23:37:17 +0200 Michael Niedermayer wrote: > On Thu, Oct 17, 2024 at 02:28:54PM +0200, Niklas Haas wrote: > > On Mon, 14 Oct 2024 20:58:31 +0200 Michael Niedermayer > > wrote: > > > On Mon, Oct 14, 2024 at 08:33:50PM +0200, Niklas Haas wrote: > > > > On Mon, 14 Oct 2024 19:49