Re: [FFmpeg-devel] [PATCH 0/5] replace scale2ref by scale=rw:rh

2024-04-24 Thread Niklas Haas
On Wed, 24 Apr 2024 16:48:54 +0530 Gyan Doshi wrote: > > > On 2024-04-24 04:21 pm, Niklas Haas wrote: > > As discussed in my previous series for fixing scale2ref[1], this filter > > is fundamentally broken, and the only real fix would be to switch to > > activat

[FFmpeg-devel] [PATCH 5/5] avfilter/scale2ref: deprecate in favor of scale=rw:rh

2024-04-24 Thread Niklas Haas
From: Niklas Haas And remove it from the documentation. --- Changelog | 1 + doc/filters.texi | 73 -- libavfilter/vf_scale.c | 3 ++ 3 files changed, 4 insertions(+), 73 deletions(-) diff --git a/Changelog b/Changelog index

[FFmpeg-devel] [PATCH 4/5] fate/scale2ref_keep_aspect: switch to vf_scale ref_*

2024-04-24 Thread Niklas Haas
From: Niklas Haas --- tests/filtergraphs/scale2ref_keep_aspect | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/filtergraphs/scale2ref_keep_aspect b/tests/filtergraphs/scale2ref_keep_aspect index f407460ec7..00b04fc3d1 100644 --- a/tests/filtergraphs

[FFmpeg-devel] [PATCH 3/5] avfilter/vf_scale: add optional "ref" input

2024-04-24 Thread Niklas Haas
From: Niklas Haas This is automatically enabled if the width/height expressions reference any ref_* variable. This will ultimately serve as a more principled replacement for the fundamentally broken scale2ref. See-Also: https://trac.ffmpeg.org/ticket/10795 --- Changelog | 1

[FFmpeg-devel] [PATCH 2/5] avfilter/vf_scale: switch to FFFrameSync

2024-04-24 Thread Niklas Haas
From: Niklas Haas Preliminary commit, in anticipation of adding support for multiple inputs (with proper synchronization and activate() callback). --- doc/filters.texi | 4 +-- libavfilter/vf_scale.c | 65 +++--- 2 files changed, 63 insertions(+), 6

[FFmpeg-devel] [PATCH 1/5] avfilter/framesync: make framesync_class un-static

2024-04-24 Thread Niklas Haas
From: Niklas Haas And rename to ff_framesync_class. More convenient for downstream users. --- libavfilter/framesync.c | 6 +++--- libavfilter/framesync.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libavfilter/framesync.c b/libavfilter/framesync.c index 1afd70ab21

[FFmpeg-devel] [PATCH 0/5] replace scale2ref by scale=rw:rh

2024-04-24 Thread Niklas Haas
As discussed in my previous series for fixing scale2ref[1], this filter is fundamentally broken, and the only real fix would be to switch to activate(), or ideally FFFrameSync. [1] https://ffmpeg.org//pipermail/ffmpeg-devel/2024-March/323382.html The main thing making this difficult is the fact

[FFmpeg-devel] [PATCH] avfilter/f_sidedata: synchronize with side data list

2024-04-23 Thread Niklas Haas
From: Niklas Haas Add all recently added frame data types, as well as the new name for DETECTION_BBOXES as an alias to the older DETECTION_BOUNDING_BOXES. --- libavfilter/f_sidedata.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libavfilter/f_sidedata.c b

Re: [FFmpeg-devel] [RFC] 5 year plan & Inovation

2024-04-19 Thread Niklas Haas
On Thu, 18 Apr 2024 22:53:51 +0200 Michael Niedermayer wrote: > A plugin system moves this patch-management to people who actually > care, that is the authors of the codecs and (de)muxers. A plugin system will only solve this insomuch as plugin authors will just host their plugin code on GitHub

Re: [FFmpeg-devel] [RFC] 5 year plan & Inovation

2024-04-18 Thread Niklas Haas
On Wed, 17 Apr 2024 15:58:32 +0200 Michael Niedermayer wrote: > Hi all > > The pace of inovation in FFmpeg has been slowing down. > Most work is concentarted nowadays on code refactoring, and adding > support for new codecs and formats. > > Should we > * make a list of longer term goals > *

Re: [FFmpeg-devel] [PATCH v3 08/13] avcodec/dovi_rpudec: make `enable` also affect decoding

2024-04-18 Thread Niklas Haas
On Thu, 18 Apr 2024 13:30:39 +0200 Andreas Rheinhardt wrote: > Niklas Haas: > > From: Niklas Haas > > > > This could be used by codecs to selectively disable parsing Dolby Vision > > RPUs, and is cheap to support. > > --- > > libavcodec/av1dec.c

Re: [FFmpeg-devel] [PATCH v4 0/1] avfilter/vf_colorspace: use colorspace negotiation API

2024-04-17 Thread Niklas Haas
On Thu, 04 Apr 2024 19:05:13 +0200 Nicolas Gaullier wrote: > v4: > - remove dynamic color_range pass-through (which requires changing outlink > dynamically and is forbidden) > - nits style > - commit msg: simplified example (+ removed example for dynamic color_range > pass-through) > >

Re: [FFmpeg-devel] [PATCH v3 00/13] avcodec: add Dolby Vision encoding

2024-04-17 Thread Niklas Haas
On Fri, 12 Apr 2024 13:35:14 +0200 Niklas Haas wrote: > Changes since v2: > - Split up dovi_rpu.c into dovi_rpudec.c and dovi_rpueenc. > - Added missing dependencies of encoders onto dovi_rpueenc > - Clarified and documented semantics of guess_profile() > - Changed misleading

Re: [FFmpeg-devel] [PATCH v2] avcodec/libx264: bump minimum required version to 155

2024-04-15 Thread Niklas Haas
On Fri, 12 Apr 2024 12:45:44 +0200 Niklas Haas wrote: > On Tue, 09 Apr 2024 15:12:05 +0200 Niklas Haas wrote: > > From: Niklas Haas > > > > This version is seven years old, and present in Debian oldoldstable, > > Ubuntu 20.04 and Leap 15.0. > > > > Al

Re: [FFmpeg-devel] [PATCH v5] avcodec/h2645_sei: validate Mastering Display Colour Volume SEI values

2024-04-13 Thread Niklas Haas
On Sat, 13 Apr 2024 17:21:08 +0200 Kacper Michajłow wrote: > As we can read in ST 2086: > > Values outside the specified ranges of luminance and chromaticity values > are not reserved by SMPTE, and can be used for purposes outside the > scope of this standard. > > This is further acknowledged

[FFmpeg-devel] [PATCH v3 07/13] avcodec/dovi_rpuenc: add ff_dovi_configure()

2024-04-12 Thread Niklas Haas
From: Niklas Haas We need to set up the configuration struct appropriately based on the codec type, colorspace metadata, and presence/absence of an EL (though, we currently don't support an EL). When present, we use the signalled RPU data header to help infer (and validate) the right values

[FFmpeg-devel] [PATCH v3 08/13] avcodec/dovi_rpudec: make `enable` also affect decoding

2024-04-12 Thread Niklas Haas
From: Niklas Haas This could be used by codecs to selectively disable parsing Dolby Vision RPUs, and is cheap to support. --- libavcodec/av1dec.c | 1 + libavcodec/dovi_rpu.h| 2 ++ libavcodec/dovi_rpudec.c | 6 ++ libavcodec/hevcdec.c | 1 + libavcodec/libdav1d.c| 1 + 5

[FFmpeg-devel] [PATCH v3 06/13] avcodec/dovi_rpu: split into dovi_rpu.c and dovi_rpudec.c

2024-04-12 Thread Niklas Haas
From: Niklas Haas To allow compiling the decoding objects without the encoding objects and vice versa. Common helpers that users of both APIs need are put into the shared dovi_rpu.c. --- libavcodec/Makefile | 2 +- libavcodec/dovi_rpu.c| 624

[FFmpeg-devel] [PATCH v3 05/13] configure: rename dovi_rpu subsystem to dovi_rpudec

2024-04-12 Thread Niklas Haas
From: Niklas Haas To distinguish it from the to-be-added dovi_rpuenc. --- configure | 10 +- libavcodec/Makefile | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 55f1fc354d..c1e1ece1e2 100755 --- a/configure +++ b/configure

[FFmpeg-devel] [PATCH v3 11/13] avcodec/libaomenc: implement dolby vision coding

2024-04-12 Thread Niklas Haas
From: Niklas Haas --- configure | 2 +- libavcodec/libaomenc.c | 28 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/configure b/configure index d25d0f6907..bf63c831af 100755 --- a/configure +++ b/configure @@ -3485,7 +3485,7

[FFmpeg-devel] [PATCH v3 04/13] avcodec/dovi_rpu: expose guess_profile(), clarify semantics

2024-04-12 Thread Niklas Haas
From: Niklas Haas To allow internally re-using it for both the encoder and decoder. This is based on HEVC only, H.264/AV1 use their own (hopefully correctly signalled) profiles (and in particular, the AV1 decoders implicitly default the correct profile in the absence of a configuration record

[FFmpeg-devel] [PATCH v3 13/13] avcodec/libsvtav1: implement dolby vision coding

2024-04-12 Thread Niklas Haas
From: Niklas Haas --- configure | 1 + libavcodec/libsvtav1.c | 34 ++ 2 files changed, 35 insertions(+) diff --git a/configure b/configure index cce37bb32e..6fbd0e44ff 100755 --- a/configure +++ b/configure @@ -3534,6 +3534,7

[FFmpeg-devel] [PATCH v3 03/13] avcodec/dovi_rpu: clarify error on missing RPU VDR

2024-04-12 Thread Niklas Haas
From: Niklas Haas The code was written under the misguided assumption that these fields would only be present when the value changes, however this does not match the actual patent specification, which says that streams are required to either always signal this metadata, or never signal

[FFmpeg-devel] [PATCH v3 12/13] avcodec/libx265: implement dolby vision coding

2024-04-12 Thread Niklas Haas
From: Niklas Haas libx265 supports these natively, we just need to attach the generated NALs to the x265picture, as well as setting the appropriate DV profile. --- configure| 2 +- libavcodec/libx265.c | 40 2 files changed, 41 insertions

[FFmpeg-devel] [PATCH v3 10/13] avformat/movenc: warn if dovi cfg ignored

2024-04-12 Thread Niklas Haas
From: Niklas Haas Since this is guarded behind strict unofficial, we should warn if the user feeds a dolby vision stream to this muxer, as it will otherwise result in a broken file. --- libavformat/movenc.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git

[FFmpeg-devel] [PATCH v3 09/13] avcodec/dovi_rpuenc: add ff_dovi_rpu_generate()

2024-04-12 Thread Niklas Haas
From: Niklas Haas This function takes a decoded AVDOVIMetadata struct and turns it back into a binary RPU. Verified using existing tools, and matches the bitstream in official reference files. I decided to just roll the EMDF and NAL encapsulation into this function because the end user

[FFmpeg-devel] [PATCH v3 02/13] avcodec/dovi_rpu: properly replace context header

2024-04-12 Thread Niklas Haas
From: Niklas Haas This was never set in ff_dovi_ctx_replace(), leading to possibly out-of-date when copying from one thread to another. --- libavcodec/dovi_rpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c index d95c7e03af..bfb7b9fe66 100644

[FFmpeg-devel] [PATCH v3 01/13] avcodec/dovi_rpu: store entire config record

2024-04-12 Thread Niklas Haas
From: Niklas Haas And make it public. For encoding, users may also be interested in the configured level and compatibility ID. So generalize the dv_profile field and just expose the whole configuration record. This makes the already rather reductive ff_dovi_update_cfg() function almost wholly

[FFmpeg-devel] [PATCH v3 00/13] avcodec: add Dolby Vision encoding

2024-04-12 Thread Niklas Haas
Changes since v2: - Split up dovi_rpu.c into dovi_rpudec.c and dovi_rpueenc. - Added missing dependencies of encoders onto dovi_rpueenc - Clarified and documented semantics of guess_profile() - Changed misleading commit message ___ ffmpeg-devel mailing

Re: [FFmpeg-devel] [PATCH v2] avcodec/libx264: bump minimum required version to 155

2024-04-12 Thread Niklas Haas
On Tue, 09 Apr 2024 15:12:05 +0200 Niklas Haas wrote: > From: Niklas Haas > > This version is seven years old, and present in Debian oldoldstable, > Ubuntu 20.04 and Leap 15.0. > > Allows cleaning up the file substantially. In particular, this is > motivated by the d

[FFmpeg-devel] [TC] Technical decision on S302M non-PCM decoding

2024-04-12 Thread Niklas Haas
le operations (e.g. S302M -> Dolby E -> MXF remux). Regarding Gyan Doshi's main objection that doing so would possibly delete S302M metadata (e.g. S-ADM), it was observed that if the need for such metadata truly arises, it should either be parsed by FFmpeg or attached as an opaque side data bl

Re: [FFmpeg-devel] [PATCH] avcodec/libx264: bump minimum required version to 160

2024-04-10 Thread Niklas Haas
On Wed, 10 Apr 2024 15:18:52 +0200 Michael Niedermayer wrote: > On Tue, Apr 09, 2024 at 02:53:28PM +0200, Niklas Haas wrote: > > On Sat, 06 Apr 2024 22:28:26 +0200 Michael Niedermayer > > wrote: > > > On Fri, Apr 05, 2024 at 07:44:52PM +0200, Niklas Haas wrote: &

Re: [FFmpeg-devel] [PATCH v2 16/17] fftools/ffmpeg_filter: propagate codec yuv metadata to filters

2024-04-10 Thread Niklas Haas
On Wed, 10 Apr 2024 14:59:15 +0200 Michael Niedermayer wrote: > On Wed, Apr 10, 2024 at 12:29:06PM +0200, Niklas Haas wrote: > > On Wed, 10 Apr 2024 03:25:45 +0200 Michael Niedermayer > > wrote: > > > On Mon, Apr 08, 2024 at 02:57:20PM +0200, Niklas Haas wrote: &

Re: [FFmpeg-devel] [PATCH v2 14/17] fftools/ffmpeg_filter: simplify choose_pix_fmts

2024-04-10 Thread Niklas Haas
On Wed, 10 Apr 2024 03:13:02 +0200 Michael Niedermayer wrote: > On Mon, Apr 08, 2024 at 02:57:18PM +0200, Niklas Haas wrote: > > From: Niklas Haas > > > > The only meaningful difference between choose_pix_fmts and the default > > code was the inclusion of an ext

Re: [FFmpeg-devel] [PATCH v2 16/17] fftools/ffmpeg_filter: propagate codec yuv metadata to filters

2024-04-10 Thread Niklas Haas
On Wed, 10 Apr 2024 12:29:06 +0200 Niklas Haas wrote: > On Wed, 10 Apr 2024 03:25:45 +0200 Michael Niedermayer > wrote: > > On Mon, Apr 08, 2024 at 02:57:20PM +0200, Niklas Haas wrote: > > > From: Niklas Haas > > > > > > To convert between colo

Re: [FFmpeg-devel] [PATCH v2 16/17] fftools/ffmpeg_filter: propagate codec yuv metadata to filters

2024-04-10 Thread Niklas Haas
On Wed, 10 Apr 2024 03:25:45 +0200 Michael Niedermayer wrote: > On Mon, Apr 08, 2024 at 02:57:20PM +0200, Niklas Haas wrote: > > From: Niklas Haas > > > > To convert between color spaces/ranges, if needed by the codec > > properties. > > ---

Re: [FFmpeg-devel] [PATCH v2 02/11] avcodec/dovi_rpu: properly replace context header

2024-04-09 Thread Niklas Haas
On Tue, 09 Apr 2024 17:36:30 +0200 Andreas Rheinhardt wrote: > Niklas Haas: > > From: Niklas Haas > > > > This was never set in ff_dovi_ctx_replace(), leading to possibly > > out-of-date when copying from a sub-thread to the main thread. > > --- &

Re: [FFmpeg-devel] [PATCH v2 04/11] avcodec/dovi_rpu: clarify semantics of guess_profile()

2024-04-09 Thread Niklas Haas
On Tue, 09 Apr 2024 17:37:32 +0200 Andreas Rheinhardt wrote: > Niklas Haas: > > From: Niklas Haas > > > > This is based on HEVC only, H.264/AV1 use their own (hopefully correctly > > signalled) profiles. > > --- > > libavcodec/dovi_rpu.c | 5 +++--

[FFmpeg-devel] [PATCH v2] avcodec/libx264: bump minimum required version to 155

2024-04-09 Thread Niklas Haas
From: Niklas Haas This version is seven years old, and present in Debian oldoldstable, Ubuntu 20.04 and Leap 15.0. Allows cleaning up the file substantially. In particular, this is motivated by the desire to stop relying on init_static_data. --- configure| 2 +- libavcodec/libx264

Re: [FFmpeg-devel] [PATCH v2 13/17] fftools/ffmpeg_filter: set strict_std_compliance

2024-04-09 Thread Niklas Haas
On Mon, 08 Apr 2024 14:57:17 +0200 Niklas Haas wrote: > From: Niklas Haas > > For avcodec_get_supported_config(), which requires this value be set on > the actual ost->enc_ctx being queried. > --- > fftools/ffmpeg_filter.c | 16 ++-- > 1 file changed, 6 ins

Re: [FFmpeg-devel] [PATCH v2 09/17] avcodec/codec_internal: nuke init_static_data()

2024-04-09 Thread Niklas Haas
On Mon, 08 Apr 2024 14:57:13 +0200 Niklas Haas wrote: > From: Niklas Haas > > All hail get_supported_config() > --- > libavcodec/allcodecs.c | 7 +-- > libavcodec/codec_internal.h | 8 > 2 files changed, 1 insertion(+), 14 deletions(-) > > diff --g

[FFmpeg-devel] [PATCH v2 10/11] avcodec/libx265: implement dolby vision coding

2024-04-09 Thread Niklas Haas
From: Niklas Haas libx265 supports these natively, we just need to attach the generated NALs to the x265picture, as well as setting the appropriate DV profile. --- libavcodec/libx265.c | 40 1 file changed, 40 insertions(+) diff --git a/libavcodec

[FFmpeg-devel] [PATCH v2 09/11] avcodec/libaomenc: implement dolby vision coding

2024-04-09 Thread Niklas Haas
From: Niklas Haas --- libavcodec/libaomenc.c | 28 1 file changed, 28 insertions(+) diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index 4a71bba9c9c..b43a902a384 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -43,6 +43,7

[FFmpeg-devel] [PATCH v2 08/11] avformat/movenc: warn if dovi cfg ignored

2024-04-09 Thread Niklas Haas
From: Niklas Haas Since this is guarded behind strict unofficial, we should warn if the user feeds a dolby vision stream to this muxer, as it will otherwise result in a broken file. --- libavformat/movenc.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git

[FFmpeg-devel] [PATCH v2 07/11] avcodec/dovi_rpu: add ff_dovi_rpu_generate()

2024-04-09 Thread Niklas Haas
From: Niklas Haas This function takes a decoded AVDOVIMetadata struct and turns it back into a binary RPU. Verified using existing tools, and matches the bitstream in official reference files. I decided to just roll the EMDF and NAL encapsulation into this function because the end user

[FFmpeg-devel] [PATCH v2 05/11] avcodec/dovi_rpu: add ff_dovi_configure()

2024-04-09 Thread Niklas Haas
From: Niklas Haas We need to set up the configuration struct appropriately based on the codec type, colorspace metadata, and presence/absence of an EL (though, we currently don't support an EL). When present, we use the signalled RPU data header to help infer (and validate) the right values

[FFmpeg-devel] [PATCH v2 06/11] avcodec/dovi_rpu: make `enable` also affect decoding

2024-04-09 Thread Niklas Haas
From: Niklas Haas This could be used by codecs to selectively disable parsing Dolby Vision RPUs, and is cheap to support. --- libavcodec/av1dec.c | 1 + libavcodec/dovi_rpu.c | 6 ++ libavcodec/dovi_rpu.h | 2 ++ libavcodec/hevcdec.c | 1 + libavcodec/libdav1d.c | 1 + 5 files changed

[FFmpeg-devel] [PATCH v2 11/11] avcodec/libsvtav1: implement dolby vision coding

2024-04-09 Thread Niklas Haas
From: Niklas Haas --- libavcodec/libsvtav1.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 105c3369c0f..cd62103dba4 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -23,6 +23,7

[FFmpeg-devel] [PATCH v2 04/11] avcodec/dovi_rpu: clarify semantics of guess_profile()

2024-04-09 Thread Niklas Haas
From: Niklas Haas This is based on HEVC only, H.264/AV1 use their own (hopefully correctly signalled) profiles. --- libavcodec/dovi_rpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c index 267e52ceb66..4da711d763e 100644

[FFmpeg-devel] [PATCH v2 03/11] avcodec/dovi_rpu: clarify error on missing RPU VDR

2024-04-09 Thread Niklas Haas
From: Niklas Haas The code was written under the misguided assumption that these fields would only be present when the value changes, however this does not match the actual patent specification, which says that streams are required to either always signal this metadata, or never signal

[FFmpeg-devel] [PATCH v2 02/11] avcodec/dovi_rpu: properly replace context header

2024-04-09 Thread Niklas Haas
From: Niklas Haas This was never set in ff_dovi_ctx_replace(), leading to possibly out-of-date when copying from a sub-thread to the main thread. --- libavcodec/dovi_rpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c index d95c7e03af9

[FFmpeg-devel] [PATCH v2 01/11] avcodec/dovi_rpu: store entire config record

2024-04-09 Thread Niklas Haas
From: Niklas Haas And make it public. For encoding, users may also be interested in the configured level and compatibility ID. So generalize the dv_profile field and just expose the whole configuration record. This makes the already rather reductive ff_dovi_update_cfg() function almost wholly

[FFmpeg-devel] [PATCH v2 00/11] avcodec: add Dolby Vision encoding

2024-04-09 Thread Niklas Haas
Changes since v1: - Moved dolbyvision option from AVCodecContext to DOVIContext, and add an explicit option only to codecs that use it - Changed its type to AV_OPT_TYPE_BOOL - Made it control decoding as well as encoding, so you can use `-dolbyvision off` as an input option to suppress it -

Re: [FFmpeg-devel] [PATCH] avcodec/libx264: bump minimum required version to 160

2024-04-09 Thread Niklas Haas
On Sat, 06 Apr 2024 22:28:26 +0200 Michael Niedermayer wrote: > On Fri, Apr 05, 2024 at 07:44:52PM +0200, Niklas Haas wrote: > > From: Niklas Haas > > > > This version is four years old, and present in Debian oldstable, Ubuntu > > 22.04 and Leap 15.1. > > Ubun

Re: [FFmpeg-devel] [PATCH 01/11] avcodec: add avcodec_get_supported_config()

2024-04-08 Thread Niklas Haas
On Mon, 08 Apr 2024 22:18:33 +0200 Michael Niedermayer wrote: > On Fri, Apr 05, 2024 at 08:57:11PM +0200, Niklas Haas wrote: > > From: Niklas Haas > > > > This replaces the myriad of existing lists in AVCodec by a unified API > > call, allowing us to (ultimately) t

[FFmpeg-devel] [PATCH v2 11/17] fftools: drop unused/hacky macros

2024-04-08 Thread Niklas Haas
From: Niklas Haas Having macros initialize local variables seems strange to me, and there are no more current users of these macros. (The one that was commented out was incorrect anyway, since the macro has changed in the meantime) --- fftools/cmdutils.h | 13 - fftools

[FFmpeg-devel] [PATCH v2 10/17] fftools/opt_common: switch to avcodec_get_supported_config()

2024-04-08 Thread Niklas Haas
From: Niklas Haas While rewriting this macro, I decided to make it a bit more flexible so it can work for all of the fields (including future fields) in a more generic way, and to also print the channel layout using an AVBPrint to avoid hard-coding the assumption that the length is less than 128

[FFmpeg-devel] [PATCH v2 09/17] avcodec/codec_internal: nuke init_static_data()

2024-04-08 Thread Niklas Haas
From: Niklas Haas All hail get_supported_config() --- libavcodec/allcodecs.c | 7 +-- libavcodec/codec_internal.h | 8 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index a9f1797930a..1f22e06e710 100644

[FFmpeg-devel] [PATCH v2 08/17] avcodec/mjpegenc: switch to get_supported_config()

2024-04-08 Thread Niklas Haas
From: Niklas Haas This codec's capabilities should be set dynamically based on the value of strict_std_compliance, when available. This will allow us to finally get rid of the strictness hack in ffmpeg_filter.c. --- libavcodec/mjpegenc.c | 21 +++-- 1 file changed, 19 insertions

[FFmpeg-devel] [PATCH v2 07/17] avcodec/libaomenc: switch to get_supported_config()

2024-04-08 Thread Niklas Haas
From: Niklas Haas --- libavcodec/libaomenc.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index 5023d2fda42..0488e5c3c9a 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c

[FFmpeg-devel] [PATCH v2 06/17] avcodec/libvpxenc: switch to get_supported_config()

2024-04-08 Thread Niklas Haas
From: Niklas Haas --- libavcodec/libvpxenc.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index cdb83312614..64dc69f8547 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -2087,13

[FFmpeg-devel] [PATCH v2 05/17] avcodec/libx265: switch to get_supported_config()

2024-04-08 Thread Niklas Haas
From: Niklas Haas --- libavcodec/libx265.c | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index 3533ac5cc1f..e36a1eb9505 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -892,14 +892,24

[FFmpeg-devel] [PATCH v2 16/17] fftools/ffmpeg_filter: propagate codec yuv metadata to filters

2024-04-08 Thread Niklas Haas
From: Niklas Haas To convert between color spaces/ranges, if needed by the codec properties. --- fftools/ffmpeg_filter.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 83259416a68..a40c6f381f2

[FFmpeg-devel] [PATCH v2 14/17] fftools/ffmpeg_filter: simplify choose_pix_fmts

2024-04-08 Thread Niklas Haas
From: Niklas Haas The only meaningful difference between choose_pix_fmts and the default code was the inclusion of an extra branch for `keep_pix_fmt` being true. However, in this case, we either: 1. Force the specific `ofp->format` that we inherited from ofilter_bind_ost, or if no for

[FFmpeg-devel] [PATCH v2 17/17] fftools/ffmpeg_filter: remove YUVJ hack

2024-04-08 Thread Niklas Haas
From: Niklas Haas This is no longer needed, since we now correctly negotiate the required range from the mjpeg encoder via avcodec_get_supported_config(). --- fftools/ffmpeg_filter.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/fftools/ffmpeg_filter.c b/fftools

[FFmpeg-devel] [PATCH v2 13/17] fftools/ffmpeg_filter: set strict_std_compliance

2024-04-08 Thread Niklas Haas
From: Niklas Haas For avcodec_get_supported_config(), which requires this value be set on the actual ost->enc_ctx being queried. --- fftools/ffmpeg_filter.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filte

[FFmpeg-devel] [PATCH v2 15/17] fftools/ffmpeg_filter: switch to avcodec_get_supported_config()

2024-04-08 Thread Niklas Haas
From: Niklas Haas I preserved the no-op condition on `!ch_layouts`, even though I suspect it's not actually needed. --- fftools/ffmpeg_filter.c | 59 - 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/fftools/ffmpeg_filter.c b/fftools

[FFmpeg-devel] [PATCH v2 12/17] fftools/ffmpeg_mux_init: switch to avcodec_get_supported_config()

2024-04-08 Thread Niklas Haas
From: Niklas Haas --- fftools/ffmpeg_mux_init.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index d3d7d022ff6..4f8c81102d3 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c

[FFmpeg-devel] [PATCH v2 04/17] avcodec/allcodecs: add backcompat for new config API

2024-04-08 Thread Niklas Haas
From: Niklas Haas In order to avoid breaking older clients not yet using the new API, we need to add backwards compatibility for codecs which have switched from init_static() to get_supported_config(). This function can be removed entirely once the deprecated static fields are removed

[FFmpeg-devel] [PATCH v2 03/17] avcodec/encode: switch to avcodec_get_supported_config()

2024-04-08 Thread Niklas Haas
From: Niklas Haas --- libavcodec/encode.c | 88 - 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 34658d13d0c..d0e79379048 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c

[FFmpeg-devel] [PATCH v2 02/17] avcodec: add avcodec_get_supported_config()

2024-04-08 Thread Niklas Haas
From: Niklas Haas This replaces the myriad of existing lists in AVCodec by a unified API call, allowing us to (ultimately) trim down the sizeof(AVCodec) quite substantially, while also making this more trivially extensible. In addition to the already covered lists, add two new entries for color

[FFmpeg-devel] [PATCH v2 01/17] avcodec/internal: add FFCodec.color_ranges

2024-04-08 Thread Niklas Haas
From: Niklas Haas I went through all codecs and put them into five basic categories: 1. JPEG range only 2. MPEG range only 3. Explicitly tagged 4. Broken (codec supports both but encoder ignores tags) 5. N/A (headerless or pseudo-formats) Filters in category 5 remain untouched. The rest gain

[FFmpeg-devel] [PATCH v2 00/17] Add avcodec_get_supported_config()

2024-04-08 Thread Niklas Haas
Changes since v1: - Add implementation of AV_CODEC_CONFIG_COLOR_RANGE for all codecs - Use AVBPrint instead of char desc[128] for printing channel descriptions - Implement new constraints inside fftools/ffmpeg_filter.c - Remove old YUVJ/MJPEG strictness hack

Re: [FFmpeg-devel] [PATCH 08/11] fftools/opt_common: switch to avcodec_get_supported_config()

2024-04-08 Thread Niklas Haas
On Sat, 06 Apr 2024 21:10:45 -0300 James Almer wrote: > On 4/6/2024 8:38 AM, Niklas Haas wrote: > > On Fri, 05 Apr 2024 16:36:50 -0300 James Almer wrote: > >> On 4/5/2024 3:57 PM, Niklas Haas wrote: > >>> From: Niklas Haas > >>> > >>> While

Re: [FFmpeg-devel] [PATCH 01/11] avcodec: add avcodec_get_supported_config()

2024-04-08 Thread Niklas Haas
On Sun, 07 Apr 2024 01:16:39 +0200 Michael Niedermayer wrote: > On Fri, Apr 05, 2024 at 08:57:11PM +0200, Niklas Haas wrote: > > From: Niklas Haas > > > > This replaces the myriad of existing lists in AVCodec by a unified API > > call, allowing us to (ultimately) t

Re: [FFmpeg-devel] [PATCH] avcodec/hevcdec: fix segfault on invalid film grain metadata

2024-04-08 Thread Niklas Haas
On Sat, 06 Apr 2024 13:14:45 +0200 Niklas Haas wrote: > From: Niklas Haas > > Invalid input files may contain film grain metadata which survives > ff_h274_film_grain_params_supported() but does not pass > av_film_grain_params_select(), leading to a SIGSEGV on hevc_frame_

Re: [FFmpeg-devel] [PATCH 08/11] fftools/opt_common: switch to avcodec_get_supported_config()

2024-04-06 Thread Niklas Haas
On Fri, 05 Apr 2024 16:36:50 -0300 James Almer wrote: > On 4/5/2024 3:57 PM, Niklas Haas wrote: > > From: Niklas Haas > > > > While rewriting this macro, I decided to make it a bit more flexible so > > it can work for all of the fields (including future fields

[FFmpeg-devel] [PATCH] avcodec/hevcdec: fix segfault on invalid film grain metadata

2024-04-06 Thread Niklas Haas
From: Niklas Haas Invalid input files may contain film grain metadata which survives ff_h274_film_grain_params_supported() but does not pass av_film_grain_params_select(), leading to a SIGSEGV on hevc_frame_end(). Fix this by duplicating the av_film_grain_params_select() check at frame init

Re: [FFmpeg-devel] [PATCH 01/11] avcodec: add avcodec_get_supported_config()

2024-04-05 Thread Niklas Haas
On Fri, 05 Apr 2024 20:57:11 +0200 Niklas Haas wrote: > From: Niklas Haas > In addition to the already covered lists, add two new entries for color > space and color range, mirroring the newly added negotiable fields in > libavfilter. If this passes review, I will submit a s

[FFmpeg-devel] [PATCH 11/11] fftools/ffmpeg_filter: switch to avcodec_get_supported_config()

2024-04-05 Thread Niklas Haas
From: Niklas Haas I preserved the no-op condition on `!ch_layouts`, even though I suspect it's not actually needed. --- fftools/ffmpeg_filter.c | 59 - 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/fftools/ffmpeg_filter.c b/fftools

[FFmpeg-devel] [PATCH 10/11] fftools/ffmpeg_mux_init: switch to avcodec_get_supported_config()

2024-04-05 Thread Niklas Haas
From: Niklas Haas --- fftools/ffmpeg_mux_init.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index d3d7d022ff6..508c4f7a697 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c

[FFmpeg-devel] [PATCH 08/11] fftools/opt_common: switch to avcodec_get_supported_config()

2024-04-05 Thread Niklas Haas
From: Niklas Haas While rewriting this macro, I decided to make it a bit more flexible so it can work for all of the fields (including future fields) in a more generic way. --- fftools/opt_common.c | 86 ++-- 1 file changed, 43 insertions(+), 43 deletions

[FFmpeg-devel] [PATCH 09/11] fftools: drop unused/hacky macros

2024-04-05 Thread Niklas Haas
From: Niklas Haas Having macros initialize local variables seems strange to me, and there are no more current users of these macros. (The one that was commented out was incorrect anyway, since the macro has changed in the meantime) --- fftools/cmdutils.h | 13 - fftools

[FFmpeg-devel] [PATCH 07/11] avcodec/codec_internal: nuke init_static_data()

2024-04-05 Thread Niklas Haas
From: Niklas Haas All hail get_supported_config() --- libavcodec/allcodecs.c | 7 +-- libavcodec/codec_internal.h | 8 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index a9f1797930a..1f22e06e710 100644

[FFmpeg-devel] [PATCH 06/11] avcodec/libaomenc: switch to get_supported_config()

2024-04-05 Thread Niklas Haas
From: Niklas Haas --- libavcodec/libaomenc.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index 4a71bba9c9c..899aa2b261f 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c

[FFmpeg-devel] [PATCH 05/11] avcodec/libvpxenc: switch to get_supported_config()

2024-04-05 Thread Niklas Haas
From: Niklas Haas --- libavcodec/libvpxenc.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index bcbdc4981e5..ac7f01e2aa9 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -2086,13

[FFmpeg-devel] [PATCH 04/11] avcodec/libx265: switch to get_supported_config()

2024-04-05 Thread Niklas Haas
From: Niklas Haas --- libavcodec/libx265.c | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index 0645cd20457..ff1e8463aa1 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -892,14 +892,24

[FFmpeg-devel] [PATCH 03/11] avcodec/allcodecs: add backcompat for new config API

2024-04-05 Thread Niklas Haas
From: Niklas Haas In order to avoid breaking older clients not yet using the new API, we need to add backwards compatibility for codecs which have switched from init_static() to get_supported_config(). This function can be removed entirely once the deprecated static fields are removed

[FFmpeg-devel] [PATCH 02/11] avcodec/encode: switch to avcodec_get_supported_config()

2024-04-05 Thread Niklas Haas
From: Niklas Haas --- libavcodec/encode.c | 88 - 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 34658d13d0c..d0e79379048 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c

[FFmpeg-devel] [PATCH 01/11] avcodec: add avcodec_get_supported_config()

2024-04-05 Thread Niklas Haas
From: Niklas Haas This replaces the myriad of existing lists in AVCodec by a unified API call, allowing us to (ultimately) trim down the sizeof(AVCodec) quite substantially, while also making this more trivially extensible. In addition to the already covered lists, add two new entries for color

[FFmpeg-devel] [PATCH] avcodec/libx264: bump minimum required version to 160

2024-04-05 Thread Niklas Haas
From: Niklas Haas This version is four years old, and present in Debian oldstable, Ubuntu 22.04 and Leap 15.1. Allows cleaning up both the configure check and the file substantially. In particular, this is motivated by the desire to stop relying on init_static_data. --- configure

Re: [FFmpeg-devel] [PATCH v4 1/1] avfilter/vf_colorspace: use colorspace negotiation API

2024-04-05 Thread Niklas Haas
On Thu, 04 Apr 2024 19:05:14 +0200 Nicolas Gaullier wrote: > Fixes a regression due to the fact that the colorspace filter does > not use the new API introduced by 8c7934f73ab6c568acaa. > The scale filter uses it since 45e09a30419cc2a7251e, and the setparams > filter since 3bf80df3ccd32aed23f0.

Re: [FFmpeg-devel] [PATCH v3 2/2] avfilter/vf_colorspace: Use colorspace negotiation API

2024-04-04 Thread Niklas Haas
On Thu, 04 Apr 2024 12:01:36 + Nicolas Gaullier wrote: > >De : Niklas Haas > >Envoyé : jeudi 4 avril 2024 12:18 > >> --- a/libavfilter/vf_colorspace.c > >> +++ b/libavfilter/vf_colorspace.c > >> @@ -433,8 +433,7 @@ static int create_filtergraph(

Re: [FFmpeg-devel] [PATCH v3 2/2] avfilter/vf_colorspace: Use colorspace negotiation API

2024-04-04 Thread Niklas Haas
On Tue, 02 Apr 2024 15:05:59 +0200 Nicolas Gaullier wrote: > Fixes a regression due to the fact that the colorspace filter does > not use the new API introduced by 8c7934f73ab6c568acaa. > The scale filter uses it since 45e09a30419cc2a7251e, and the setparams > filter since 3bf80df3ccd32aed23f0.

Re: [FFmpeg-devel] [PATCH 1/2] avcodec: add YUV color space metadata to AVCodec

2024-04-03 Thread Niklas Haas
On Sun, 24 Mar 2024 14:04:37 +0100 Andreas Rheinhardt wrote: > Niklas Haas: > > On Mon, 05 Feb 2024 19:04:30 +0100 Andreas Rheinhardt > > wrote: > >> This presumes the relevant states to be a cartesian product. Which need > >> not be true. A callback would

[FFmpeg-devel] [PATCH 10/10] avformat/movenc: warn if dovi cfg ignored

2024-04-03 Thread Niklas Haas
From: Niklas Haas Since this is guarded behind strict unofficial, we should warn if the user feeds a dolby vision stream to this muxer, as it will otherwise result in a broken file. --- libavformat/movenc.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git

[FFmpeg-devel] [PATCH 08/10] avcodec/libaomenc: implement dolby vision coding

2024-04-03 Thread Niklas Haas
From: Niklas Haas --- libavcodec/libaomenc.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index d660afab4ec..6bc46ec6e28 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -43,6 +43,7

[FFmpeg-devel] [PATCH 09/10] avcodec/libx265: implement dolby vision coding

2024-04-03 Thread Niklas Haas
From: Niklas Haas libx265 supports these natively, we just need to attach the generated NALs to the x265picture, as well as setting the appropriate DV profile. --- libavcodec/libx265.c | 36 1 file changed, 36 insertions(+) diff --git a/libavcodec/libx265.c

[FFmpeg-devel] [PATCH 07/10] avcodec/dovi_rpu: add ff_dovi_rpu_generate()

2024-04-03 Thread Niklas Haas
From: Niklas Haas This function takes a decoded AVDOVIMetadata struct and turns it back into a binary RPU. Verified using existing tools, and matches the bitstream in official reference files. I decided to just roll the EMDF and NAL encapsulation into this function because the end user

[FFmpeg-devel] [PATCH 06/10] avcodec/dovi_rpu: add ff_dovi_configure()

2024-04-03 Thread Niklas Haas
From: Niklas Haas We need to set up the configuration struct appropriately based on the codec type, colorspace metadata, and presence/absence of an EL (though, we currently don't support an EL). When present, we use the signalled RPU data header to help infer (and validate) the right values

  1   2   3   4   5   6   7   8   >