Re: [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo_enc: Reject input incompatible with chroma subsampling

2024-04-08 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2024-04-06 12:23:49) > Fixes ticket #10952. > > Discovered by: Zeng Yunxiang > Signed-off-by: Andreas Rheinhardt > --- > I am pretty sure that a lot of other encoders don't handle this well > either. Maybe we should handle this more generically in > ff_encode_preinit?

Re: [FFmpeg-devel] [PATCH] avcodec/vvc/ps: reset sps_id_used on PS uninit

2024-04-08 Thread Frank Plowman
On 07/04/2024 15:48, James Almer wrote: > On 4/7/2024 10:38 AM, Nuo Mi wrote: >> On Sun, Apr 7, 2024 at 11:05 AM James Almer wrote: >> >>> Signed-off-by: James Almer >>> --- >>>   libavcodec/vvc/ps.c | 1 + >>>   1 file changed, 1 insertion(+) >>> >>> diff --git a/libavcodec/vvc/ps.c b/libavcodec/

Re: [FFmpeg-devel] [PATCH 4/5] avformat/mxfdec: Check index_edit_rate

2024-04-08 Thread Tomas Härdin
tor 2024-04-04 klockan 00:51 +0200 skrev Michael Niedermayer: > Fixes: Assertion b >=0 failed at libavutil/mathematics.c:62 > Fixes: 67811/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer- > 5108429687422976 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/mas

Re: [FFmpeg-devel] [PATCH v4 0/5] avcodec/ac3: Add aarch64 NEON DSP

2024-04-08 Thread Martin Storsjö
On Sat, 6 Apr 2024, Geoff Hill wrote: Thanks Martin for your review and testing. Here's v4 with the following changes: * Use fmal in sum_square_butterfly_float loop. Faster. * Removed redundant loop bound zero checks in extract_exponents, sum_square_bufferfly_int32 and sum_square_bufferf

[FFmpeg-devel] [PATCH] aarch64: ac3dsp: Simplify the end of ff_ac3_sum_square_butterfly_float_neon

2024-04-08 Thread Martin Storsjö
Before: Cortex A53 A72 A78 ac3_sum_square_bufferfly_float_neon: 1005.7 516.5 224.5 After: ac3_sum_square_bufferfly_float_neon: 981.7 504.5 223.2 --- libavcodec/aarch64/ac3dsp_neon.S | 16 1 file changed, 4 insertions(+), 12 deletions(-)

Re: [FFmpeg-devel] [EXT] Re: Query from Reuters on XZ, open source, and Microsoft

2024-04-08 Thread Tomas Härdin
ons 2024-04-03 klockan 19:26 + skrev Satter, Raphael (Reuters) via ffmpeg-devel: >   *   What’s the solution here? Your talk mentioned paying > developers, getting an SLA, or hiring them as consultants … but why > would companies bother when they can just free ride? I asked the same > question

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_end(). > > Fix this by d

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) trim down the sizeof(AVCodec) q

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 rewriting this macro, I decided to make it a bit more f

[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 _

[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 an

[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 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 @@ -56

[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. --- liba

[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 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

[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_filter.c ind

[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_filt

[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 format was

[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 100644

[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 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 +20

[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 @@ -1398

[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 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 --- a/liba

[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 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_f

Re: [FFmpeg-devel] FFmpeg TC input needed

2024-04-08 Thread Gyan Doshi
Ping x2. On 2024-04-02 10:55 am, Gyan Doshi wrote: Ping. As the TC rules matter has been concluded, this should go ahead. Regards, Gyan On 2024-02-17 05:15 pm, Gyan Doshi wrote: Issue: Patch: avcodec/s302m: enable non-PCM decoding URL: https://patchwork.ffmpeg.org/project/ffmpeg/patch/202

[FFmpeg-devel] [PATCH v2 1/2] configure,etc: unify shebang usage

2024-04-08 Thread J. Dekker
In some cases, these scripts can be called directly by packagers, and some systems require the interpreter to be explicit. Signed-off-by: J. Dekker --- configure | 3 ++- doc/texidep.pl| 2 +- ffbuild/libversion.sh | 1 + tests/fate-run.sh | 2 +- tests/fate.sh |

[FFmpeg-devel] [PATCH v2 2/2] configure: simplify bigendian check

2024-04-08 Thread J. Dekker
The preferred way to use LTO is --enable-lto but often times packagers still end up with -flto in cflags for various reasons. Using grep on binary object files is brittle and relies on specific object representation, which in the case of LLVM bitcode, debug-info or other intermediary formats can fa

[FFmpeg-devel] [PATCH] avformat/tls_mbedtls: Pass FLAG_NONBLOCK to underlying transport

2024-04-08 Thread Zhao Zhili
From: Zhao Zhili This fix rtmps failure since rtmps requires nonblocking read. Signed-off-by: Zhao Zhili --- libavformat/tls_mbedtls.c | 4 1 file changed, 4 insertions(+) diff --git a/libavformat/tls_mbedtls.c b/libavformat/tls_mbedtls.c index 8503523b6d..f51cf43b1c 100644 --- a/libavfo

Re: [FFmpeg-devel] [PATCH] avformat/tls_mbedtls: Pass FLAG_NONBLOCK to underlying transport

2024-04-08 Thread Dennis Mungai
On Mon, 8 Apr 2024 at 16:26, Zhao Zhili wrote: > From: Zhao Zhili > > This fix rtmps failure since rtmps requires nonblocking read. > > Signed-off-by: Zhao Zhili > --- > libavformat/tls_mbedtls.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/libavformat/tls_mbedtls.c b/libavform

Re: [FFmpeg-devel] [PATCH] avformat/tls_mbedtls: Pass FLAG_NONBLOCK to underlying transport

2024-04-08 Thread Zhao Zhili
> On Apr 8, 2024, at 21:32, Dennis Mungai wrote: > > On Mon, 8 Apr 2024 at 16:26, Zhao Zhili wrote: > >> From: Zhao Zhili >> >> This fix rtmps failure since rtmps requires nonblocking read. >> >> Signed-off-by: Zhao Zhili >> --- >> libavformat/tls_mbedtls.c | 4 >> 1 file changed, 4 i

Re: [FFmpeg-devel] [PATCH] avcodec/vvc/ps: reset sps_id_used on PS uninit

2024-04-08 Thread Nuo Mi
On Mon, Apr 8, 2024 at 4:37 PM Frank Plowman wrote: > On 07/04/2024 15:48, James Almer wrote: > > On 4/7/2024 10:38 AM, Nuo Mi wrote: > >> On Sun, Apr 7, 2024 at 11:05 AM James Almer wrote: > >> > >>> Signed-off-by: James Almer > >>> --- > >>> libavcodec/vvc/ps.c | 1 + > >>> 1 file changed,

Re: [FFmpeg-devel] FFmpeg TC input needed

2024-04-08 Thread Paul B Mahol
How dare you to question LibAV overlords decisions here! On Mon, Apr 8, 2024 at 3:12 PM Gyan Doshi wrote: > Ping x2. > > On 2024-04-02 10:55 am, Gyan Doshi wrote: > > Ping. > > > > As the TC rules matter has been concluded, this should go ahead. > > > > Regards, > > Gyan > > > > > > On 2024-02-1

Re: [FFmpeg-devel] [PATCH] avformat/lc3: Add file format for LC3/LC3plus transport

2024-04-08 Thread Stefano Sabatini
On date Saturday 2024-04-06 21:08:19 +, ffmpeg-devel Mailing List wrote: > From: Antoine SOULIER > > A file format is described in Bluetooth SIG LC3 and ETSI TS 103 634, for > test purpose. This is the format implemented here. > --- > Changelog| 1 + > doc/muxers.texi

Re: [FFmpeg-devel] [EXT] Re: Query from Reuters on XZ, open source, and Microsoft

2024-04-08 Thread Nicolas George
Tomas Härdin (12024-04-08): > We could always start licensing the project under a less permissive > license like the GPL or the AGPL and then charge for exceptions. This > tactic goes by the name of license trolling, and was successfully used > by FFmbc for a while. Why do you say that when you kn

Re: [FFmpeg-devel] [PATCH] avcodec/vvc/ps: reset sps_id_used on PS uninit

2024-04-08 Thread Frank Plowman
On 08/04/2024 15:12, Nuo Mi wrote: > On Mon, Apr 8, 2024 at 4:37 PM Frank Plowman wrote: > >> On 07/04/2024 15:48, James Almer wrote: >>> On 4/7/2024 10:38 AM, Nuo Mi wrote: On Sun, Apr 7, 2024 at 11:05 AM James Almer wrote: > Signed-off-by: James Almer > --- > libavcode

[FFmpeg-devel] [PATCH] avutil/hwcontext_d3d12va: wait the texture is used before to free it.

2024-04-08 Thread Renan Lavarec via ffmpeg-devel
From: Renan Lavarec 124602499+rlavarec-g...@users.noreply.github.com Date: Mon, 8 Apr 2024 14:38:10 +0200 Subject: [PATCH] avutil/hwcontext_d3d12va: wait the texture is used inside the GPU before to free it. fix: ID3D12Resource2::: CORRUPTI

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo_enc: Reject input incompatible with chroma subsampling

2024-04-08 Thread Michael Niedermayer
On Mon, Apr 08, 2024 at 12:51:08AM +0200, Andreas Rheinhardt wrote: > Andreas Rheinhardt: > > Fixes ticket #10952. > > > > Discovered by: Zeng Yunxiang > > Signed-off-by: Andreas Rheinhardt > > --- > > I am pretty sure that a lot of other encoders don't handle this well > > either. Maybe we shoul

[FFmpeg-devel] [PATCH] lavc/vvc: Fix left shifts of negative values

2024-04-08 Thread Frank Plowman
All these variables lie in the range [-12..12] Signed-off-by: Frank Plowman --- libavcodec/vvc/ps.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/vvc/ps.c b/libavcodec/vvc/ps.c index 3c71c34bae..1b23675c98 100644 --- a/libavcodec/vvc/ps.c +++ b/libav

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo_enc: Reject input incompatible with chroma subsampling

2024-04-08 Thread Michael Niedermayer
On Mon, Apr 08, 2024 at 12:51:08AM +0200, Andreas Rheinhardt wrote: > Andreas Rheinhardt: > > Fixes ticket #10952. > > > > Discovered by: Zeng Yunxiang > > Signed-off-by: Andreas Rheinhardt > > --- > > I am pretty sure that a lot of other encoders don't handle this well > > either. Maybe we shoul

[FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: Fix 1 line and one column images

2024-04-08 Thread Michael Niedermayer
Fixes: Ticket10952 Fixes: poc21ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/mpegvideo_enc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index d1b19178247..40844b2f682 100644 --- a/libavcodec/mpegvideo_

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo_enc: Reject input incompatible with chroma subsampling

2024-04-08 Thread Anton Khirnov
Quoting Michael Niedermayer (2024-04-08 18:07:31) > Also please dont apply stuff like this with a 1 day warning, i just saw this > now > > dropping support for odd resolutions is a major change and not ok Maybe such things would happen less frequently if your private testsuite was less private.

Re: [FFmpeg-devel] [EXT] Re: Query from Reuters on XZ, open source, and Microsoft

2024-04-08 Thread Paul B Mahol
On Mon, Apr 8, 2024 at 4:41 PM Nicolas George wrote: > Tomas Härdin (12024-04-08): > > We could always start licensing the project under a less permissive > > license like the GPL or the AGPL and then charge for exceptions. This > > tactic goes by the name of license trolling, and was successfull

Re: [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: Fix 1 line and one column images

2024-04-08 Thread Paul B Mahol
On Mon, Apr 8, 2024 at 6:49 PM Michael Niedermayer wrote: > Fixes: Ticket10952 > Fixes: poc21ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/mpegvideo_enc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvi

Re: [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: Fix 1 line and one column images

2024-04-08 Thread Andreas Rheinhardt
Paul B Mahol: > On Mon, Apr 8, 2024 at 6:49 PM Michael Niedermayer > wrote: > >> Fixes: Ticket10952 >> Fixes: poc21ffmpeg >> Signed-off-by: Michael Niedermayer >> --- >> libavcodec/mpegvideo_enc.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/libavcodec/mpegvid

Re: [FFmpeg-devel] Query from Reuters on XZ, open source, and Microsoft

2024-04-08 Thread Romain Beauxis
On Wed, Apr 3, 2024, 11:39 Kieran Kunhya via ffmpeg-devel < ffmpeg-devel@ffmpeg.org> wrote: > Hi Raphael, > > I was the author of the tweet and I gave a short talk about this topic at > Demuxed at a video conference last year: > https://m.youtube.com/watch?v=OIyOEuQQsCQ&t=930s > > That said this i

[FFmpeg-devel] [PATCH] lavc/vvc_parser: Fix integer overflow calculating framerate

2024-04-08 Thread Frank Plowman
num_units_in_tick and time_scale are both 32-bit unsigned integers. Storing them as ints was causing overflows. Signed-off-by: Frank Plowman --- libavcodec/vvc_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/vvc_parser.c b/libavcodec/vvc_parser.c index

Re: [FFmpeg-devel] [PATCH] lavc/vvc_parser: Fix integer overflow calculating framerate

2024-04-08 Thread James Almer
On 4/8/2024 3:20 PM, Frank Plowman wrote: num_units_in_tick and time_scale are both 32-bit unsigned integers. Storing them as ints was causing overflows. Signed-off-by: Frank Plowman --- libavcodec/vvc_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcode

Re: [FFmpeg-devel] [PATCH 4/5] avformat/mxfdec: Check index_edit_rate

2024-04-08 Thread Marton Balint
On Mon, 8 Apr 2024, Tomas Härdin wrote: tor 2024-04-04 klockan 00:51 +0200 skrev Michael Niedermayer: Fixes: Assertion b >=0 failed at libavutil/mathematics.c:62 Fixes: 67811/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer- 5108429687422976 Found-by: continuous fuzzing process https://g

Re: [FFmpeg-devel] [PATCH v2 1/4] avformat/mov_chan: check channel count of layout tags at compile time

2024-04-08 Thread Marton Balint
On Wed, 3 Apr 2024, Marton Balint wrote: We can do this by using an X-macro for channel map declaration and doing a static_assert() in one pass for the check. Thanks for Andreas Rheinhardt for the suggestion. Will apply the series. Regards, Marton Signed-off-by: Marton Balint --- libav

[FFmpeg-devel] [PATCH v2 01/27] avcodec/threadprogress: Add new API for frame-threaded progress

2024-04-08 Thread Andreas Rheinhardt
The API is similar to the ThreadFrame API, with the exception that it no longer has an included AVFrame and that it has its own mutexes and condition variables which makes it more independent of pthread_frame.c. One can wait on anything via a ThreadProgress. One just has to ensure that the lifetime

[FFmpeg-devel] [PATCH v2 02/27] avcodec/decode: Add new ProgressFrame API

2024-04-08 Thread Andreas Rheinhardt
Frame-threaded decoders with inter-frame dependencies use the ThreadFrame API for syncing. It works as follows: During init each thread allocates an AVFrame for every ThreadFrame. Thread A reads the header of its packet and allocates a buffer for an AVFrame with ff_thread_get_ext_buffer() (which

[FFmpeg-devel] [PATCH v2 03/27] avcodec/mimic: Switch to ProgressFrames

2024-04-08 Thread Andreas Rheinhardt
Avoids implicit av_frame_ref() and therefore allocations and error checks. Reviewed-by: Anton Khirnov Signed-off-by: Andreas Rheinhardt --- libavcodec/mimic.c | 61 +- 1 file changed, 22 insertions(+), 39 deletions(-) diff --git a/libavcodec/mimic.c

[FFmpeg-devel] [PATCH v2 04/27] avcodec/vp3: Switch to ProgressFrames

2024-04-08 Thread Andreas Rheinhardt
Avoids implicit av_frame_ref() and therefore allocations and error checks. It also avoids explicitly allocating the AVFrames (done implicitly when getting the buffer) and it also allows to reuse the flushing code for freeing the ProgressFrames. Reviewed-by: Anton Khirnov Signed-off-by: Andreas Rh

[FFmpeg-devel] [PATCH v2 05/27] avcodec/vp9: Switch to ProgressFrames

2024-04-08 Thread Andreas Rheinhardt
This already fixes a race in the vp9-encparams test. In this test, side data is added to the current frame after having been decoded (and therefore after ff_thread_finish_setup() has been called). Yet the update_thread_context callback called ff_thread_ref_frame() and therefore av_frame_ref() with

[FFmpeg-devel] [PATCH v2 06/27] avcodec/vp9: Fix race when attaching side-data for show-existing frame

2024-04-08 Thread Andreas Rheinhardt
When outputting a show-existing frame, the VP9 decoder simply created a reference to said frame and returned it immediately to the caller, without waiting for it to have finished decoding. In case of frame-threading it is possible for the frame to only be decoded while it was waiting to be output.

[FFmpeg-devel] [PATCH v2 07/27] avcodec/vp9: Reduce wait times

2024-04-08 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/vp9.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index e0bc313301..bdfa543188 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -1569,14 +1569,15 @@ static int vp9_decode_frame

[FFmpeg-devel] [PATCH v2 08/27] avcodec/vp9: Simplify replacing VP9Frame

2024-04-08 Thread Andreas Rheinhardt
ff_thread_progress_replace() can handle a blank ProgressFrame as src (in which case it simply unreferences dst), but not a NULL one. So add a blank frame to be used as source for this case, so that we can use the replace functions to simplify vp9_frame_replace(). Signed-off-by: Andreas Rheinhardt

[FFmpeg-devel] [PATCH v2 09/27] avcodec/vp9: Replace atomic_store() by atomic_init()

2024-04-08 Thread Andreas Rheinhardt
This part of the code is not slice-threaded and they are semantically an initialization, so use atomic_init() instead of the potentially expensive atomic_store() (which uses sequentially consistent memory ordering). Also remove the initial initialization directly after allocating this array. Sign

[FFmpeg-devel] [PATCH v2 10/27] avcodec/pthread_frame: Add API to share RefStruct refs just once

2024-04-08 Thread Andreas Rheinhardt
This is useful when the lifetime of the object to be shared is the whole decoding process as it allows to avoid having to sync them every time in update_thread_context. Signed-off-by: Andreas Rheinhardt --- libavcodec/decode.c| 7 +++ libavcodec/pthread_frame.c | 20

[FFmpeg-devel] [PATCH v2 11/27] avcodec/wavpack: Use ThreadProgress API

2024-04-08 Thread Andreas Rheinhardt
It is more natural given that WavPack doesn't need the data of the previous frame at all; it just needs the DSD context. Signed-off-by: Andreas Rheinhardt --- libavcodec/wavpack.c | 133 --- 1 file changed, 75 insertions(+), 58 deletions(-) diff --git a/l

[FFmpeg-devel] [PATCH v2 12/27] avcodec/wavpack: Move initializing DSD data to a better place

2024-04-08 Thread Andreas Rheinhardt
Namely to code that is only executed if we are indeed initializing a DSD context. Signed-off-by: Andreas Rheinhardt --- libavcodec/wavpack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 83f42f392d..6fd297a002 100644 --- a

[FFmpeg-devel] [PATCH v2 13/27] avcodec/wavpack: Only reset DSD context upon parameter change

2024-04-08 Thread Andreas Rheinhardt
The current code resets it all the time unless we are decoding a DSD frame with identical parameters to the last frame. Signed-off-by: Andreas Rheinhardt --- libavcodec/wavpack.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack

[FFmpeg-devel] [PATCH v2 14/27] avcodec/wavpack: Optimize always-false comparison away

2024-04-08 Thread Andreas Rheinhardt
Also use the correct type limit SIZE_MAX; INT_MAX comes from a time when this used av_buffer_allocz() which used an int at the time. Signed-off-by: Andreas Rheinhardt --- libavcodec/wavpack.c | 5 - libavcodec/wavpack.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib

[FFmpeg-devel] [PATCH v2 15/27] avcodec/wavpack: Move transient variable from context to stack

2024-04-08 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/wavpack.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 6ab9088213..d4cf489c0f 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -103,7 +103,6 @@ type

[FFmpeg-devel] [PATCH v2 16/27] avcodec/vp8: Convert to ProgressFrame API

2024-04-08 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/pthread_frame.c | 2 +- libavcodec/vp8.c | 104 - libavcodec/vp8.h | 5 +- libavcodec/webp.c | 3 +- 4 files changed, 40 insertions(+), 74 deletions(-) diff --git a/libavcodec/

[FFmpeg-devel] [PATCH v2 17/27] avcodec/vp8: Mark flushing functions as av_cold

2024-04-08 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/vp8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index a1443f6571..f37938ad27 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -128,7 +128,7 @@ static void vp8_release_frame(VP

[FFmpeg-devel] [PATCH v2 18/27] avcodec/codec_internal: Remove FF_CODEC_CAP_ALLOCATE_PROGRESS

2024-04-08 Thread Andreas Rheinhardt
Before commit f025b8e110b36c1cdb4fb56c4cd57aeca1767b5b, every frame-threaded decoder used ThreadFrames, even when they did not have any inter-frame dependencies at all. In order to distinguish those decoders that need the AVBuffer for progress communication from those that do not (to avoid the allo

[FFmpeg-devel] [PATCH v2 20/27] avcodec/pngdec: Switch to ProgressFrames

2024-04-08 Thread Andreas Rheinhardt
Avoids implicit av_frame_ref() and therefore allocations and error checks. It also avoids explicitly allocating the AVFrames (done implicitly when getting the buffer). Signed-off-by: Andreas Rheinhardt --- libavcodec/pngdec.c | 67 ++--- 1 file changed, 27

[FFmpeg-devel] [PATCH v2 21/27] avcodec/ffv1dec: Switch to ProgressFrames

2024-04-08 Thread Andreas Rheinhardt
Avoids implicit av_frame_ref() and therefore allocations and error checks. It also avoids explicitly allocating the AVFrames (done implicitly when getting the buffer). It also fixes a data race: The AVFrame's sample_aspect_ratio is currently updated after ff_thread_finish_setup() and this write is

[FFmpeg-devel] [PATCH v2 22/27] avcodec/qsv: Use RefStruct API for memory id (mids) array

2024-04-08 Thread Andreas Rheinhardt
Avoids allocations and therefore error checks and cleanup code; also avoids indirections. Signed-off-by: Andreas Rheinhardt --- libavcodec/qsv.c | 55 +++ libavcodec/qsv_internal.h | 11 libavcodec/qsvdec.c | 3 ++- libavcodec/qsvenc.c

[FFmpeg-devel] [PATCH v2 23/27] avcodec/rkmppdec: Fix double-free on error

2024-04-08 Thread Andreas Rheinhardt
After having created the AVBuffer that is put into frame->buf[0], ownership of several objects (namely an AVDRMFrameDescriptor, an MppFrame and some AVBufferRefs framecontextref and decoder_ref) has passed to the AVBuffer and therefore to the frame. Yet it has nevertheless been freed manually on er

[FFmpeg-devel] [PATCH v2 24/27] avcodec/rkmppdec: Check av_buffer_ref()

2024-04-08 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/rkmppdec.c | 4 1 file changed, 4 insertions(+) diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c index 6889545b20..4e14d09c7c 100644 --- a/libavcodec/rkmppdec.c +++ b/libavcodec/rkmppdec.c @@ -450,6 +450,10 @@ static int rkmpp_retri

[FFmpeg-devel] [PATCH v2 25/27] avcodec/rkmppdec: Use RefStruct API for references to decoder itself

2024-04-08 Thread Andreas Rheinhardt
Avoids boilerplate code when creating the context and avoids allocations and therefore whole error paths when creating references to it. Also avoids an indirection and improves type-safety. Signed-off-by: Andreas Rheinhardt --- libavcodec/rkmppdec.c | 46 +++--

[FFmpeg-devel] [PATCH v2 26/27] avcodec/rkmppdec: Allocate AVDRMFrameDescriptor and frame ctx jointly

2024-04-08 Thread Andreas Rheinhardt
Avoids an allocation and therefore one error path. Signed-off-by: Andreas Rheinhardt --- libavcodec/rkmppdec.c | 39 +++ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c index e137e7e820..47b076dbd8

[FFmpeg-devel] [PATCH v2 27/27] avcodec/v4l2_(m2m|buffers): Use RefStruct API for context references

2024-04-08 Thread Andreas Rheinhardt
Avoids allocations and therefore error checks; also avoids indirections and allows to remove the boilerplate code for creating an object with a dedicated free function. Signed-off-by: Andreas Rheinhardt --- This patch is also still untested. libavcodec/v4l2_buffers.c | 7 +++ libavcodec/v4

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

2024-04-08 Thread Michael Niedermayer
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) trim down the sizeof(AVCodec) quite > substantially, while also making this more trivially extensible. >

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

2024-04-08 Thread Michael Niedermayer
On Mon, Apr 08, 2024 at 10:18:33PM +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) trim down the sizeof(AVCod

[FFmpeg-devel] [PATCH v2 19/27] avcodec/hevcdec: Switch to ProgressFrames

2024-04-08 Thread Andreas Rheinhardt
Avoids implicit av_frame_ref() and therefore allocations and error checks. It also avoids explicitly allocating the AVFrames (done implicitly when getting the buffer). Signed-off-by: Andreas Rheinhardt --- libavcodec/hevc_filter.c | 8 libavcodec/hevc_mvs.c| 6 +++--- libavcodec/h

Re: [FFmpeg-devel] Query from Reuters on XZ, open source, and Microsoft

2024-04-08 Thread Vittorio Giovara
On Mon, Apr 8, 2024 at 2:14 PM Romain Beauxis wrote: > I would like to offer a constructive feedback really not intended as > trolling. I believe that supporting a more modern development workflow such > as the GitHub PR or gitlab MR would go very long way in helping onboarding > new developers.

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) trim down the sizeof(AVCodec) q

[FFmpeg-devel] [PATCH] avformat/lc3: Add file format for LC3/LC3plus transport

2024-04-08 Thread Antoine Soulier via ffmpeg-devel
From: Antoine SOULIER A file format is described in Bluetooth SIG LC3 and ETSI TS 103 634, for test purpose. This is the format implemented here. --- Changelog| 1 + doc/muxers.texi | 6 ++ libavformat/Makefile | 2 + libavformat/allformats.c | 2 + libavform

Re: [FFmpeg-devel] [PATCH v2 02/27] avcodec/decode: Add new ProgressFrame API

2024-04-08 Thread Michael Niedermayer
On Mon, Apr 08, 2024 at 10:13:40PM +0200, Andreas Rheinhardt wrote: > Frame-threaded decoders with inter-frame dependencies > use the ThreadFrame API for syncing. It works as follows: > > During init each thread allocates an AVFrame for every > ThreadFrame. > > Thread A reads the header of its pa

Re: [FFmpeg-devel] Query from Reuters on XZ, open source, and Microsoft

2024-04-08 Thread Rémi Denis-Courmont
Hi, Le 9 avril 2024 01:13:31 GMT+07:00, Romain Beauxis a écrit : >I would like to offer a constructive feedback really not intended as >trolling. I believe that supporting a more modern development workflow such >as the GitHub PR or gitlab MR would go very long way in helping onboarding >new dev

[FFmpeg-devel] [PATCH v3 01/27] avcodec/threadprogress: Add new API for frame-threaded progress

2024-04-08 Thread Andreas Rheinhardt
The API is similar to the ThreadFrame API, with the exception that it no longer has an included AVFrame and that it has its own mutexes and condition variables which makes it more independent of pthread_frame.c. One can wait on anything via a ThreadProgress. One just has to ensure that the lifetime

Re: [FFmpeg-devel] [PATCH v2 02/27] avcodec/decode: Add new ProgressFrame API

2024-04-08 Thread Andreas Rheinhardt
Michael Niedermayer: > On Mon, Apr 08, 2024 at 10:13:40PM +0200, Andreas Rheinhardt wrote: >> Frame-threaded decoders with inter-frame dependencies >> use the ThreadFrame API for syncing. It works as follows: >> >> During init each thread allocates an AVFrame for every >> ThreadFrame. >> >> Thread