[FFmpeg-devel] [PATCH 2/2] libavformat: Enable jpeg streams in HEIF MOVContext

2025-07-16 Thread Eric Joyner
Nikon HEIFs from a camera or NX studio include a small jpeg thumbnail in addition to the expected HEVC thumbnails; allowing jpegs allows all thumbnails to have an associated stream for Nikon HEIF files. With this, Nikon HEIFs can finally be decoded without failing and the thumbnails can be extrac

[FFmpeg-devel] [PATCH 0/2] Fix Nikon HEIF decoding error

2025-07-16 Thread Eric Joyner
This patch set was motivated by ffmpeg being unable to open .HIF files from a Nikon Z6 III camera because it would always fail with an error involving thumbnails; probably due to them including three. With these changes, ffprobe/ffmpeg will no longer error out on those types of files. I ran "make

[FFmpeg-devel] [PATCH 1/2] libavformat: Support multiple thumbnails in HEIF

2025-07-16 Thread Eric Joyner
Prevents ffmpeg/ffprobe from erroring out when reading an HEIF that contains multiple hvcC thumbnails (e.g. from a Nikon Z6III camera). Before, move_read_iref_thmb() would always override the stored thmb_item_id in the MOVContext with each new read thumbnail, causing a stream and item_id mismatch

[FFmpeg-devel] [PATCH v2 5/5] configure: remove ossfuzz sanitizer flags

2025-07-16 Thread Kacper Michajłow
In OSS-Fuzz build environment flags are handled by CFLAGS and LDFLAGS. In local build use --toolchain=clang-fuzz-asan-ubsan or similar combination depending on requested sanitizers. Signed-off-by: Kacper Michajłow --- configure | 5 - 1 file changed, 5 deletions(-) diff --git a/configure b/

[FFmpeg-devel] [PATCH v2 4/5] configure: add -fuzz support to --toolchain

2025-07-16 Thread Kacper Michajłow
libFuzzer is linked only for fuzzing targets. Signed-off-by: Kacper Michajłow --- configure | 5 + 1 file changed, 5 insertions(+) diff --git a/configure b/configure index bff0fe285b..4773a507d3 100755 --- a/configure +++ b/configure @@ -4616,6 +4616,11 @@ add_sanitizer_flags(){

[FFmpeg-devel] [PATCH v2 3/5] configure: allow -ubsan in toolchain

2025-07-16 Thread Kacper Michajłow
It's is commonly called UBSAN after all. Signed-off-by: Kacper Michajłow --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 11b2a93038..bff0fe285b 100755 --- a/configure +++ b/configure @@ -4628,7 +4628,7 @@ add_sanitizer_flags(){

[FFmpeg-devel] [PATCH v2 2/5] configure: add -fno-omit-frame-pointer when sanitizers are used

2025-07-16 Thread Kacper Michajłow
All sanitizers give better reports with frame pointers. And skip adding -fomit-frame-pointer. Signed-off-by: Kacper Michajłow --- configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 17a83dd873..11b2a93038 100755 --- a/configure +++ b/config

[FFmpeg-devel] [PATCH v2 1/5] configure: allow multiple sanitizers in --toolchain

2025-07-16 Thread Kacper Michajłow
For example this allows --toolchain=clang-asan-usan. Signed-off-by: Kacper Michajłow --- configure | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 10dafae8e2..17a83dd873 100755 --- a/configure +++ b/configure @@ -4638,14 +4638,23 @@

Re: [FFmpeg-devel] [PATCH] configure: Update ossfuzz stuff to clang-12+

2025-07-16 Thread Kacper Michajlow
On Wed, 16 Jul 2025 at 15:26, Michael Niedermayer wrote: > > On Wed, Jul 16, 2025 at 11:58:14AM +0200, Kacper Michajlow wrote: > > On Tue, 15 Jul 2025 at 00:24, Michael Niedermayer > > wrote: > > > > > > --- > > > configure | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > >

[FFmpeg-devel] [PATCH 5/5] configure: remove ossfuzz sanitizer flags

2025-07-16 Thread Kacper Michajłow
In OSS-Fuzz build environment flags are handled by CFLAGS and LDFLAGS. In local build use --toolchain=clang-fuzz-asan-ubsan or similar combination depending on requested sanitizers. Signed-off-by: Kacper Michajłow --- configure | 5 - 1 file changed, 5 deletions(-) diff --git a/configure b/

[FFmpeg-devel] [PATCH 4/5] configure: add -fuzz support to --toolchain

2025-07-16 Thread Kacper Michajłow
libFuzzer is linked only for fuzzing targets. Signed-off-by: Kacper Michajłow --- configure | 5 + 1 file changed, 5 insertions(+) diff --git a/configure b/configure index fd4a52fc5f..36f7ab8c7c 100755 --- a/configure +++ b/configure @@ -4616,6 +4616,11 @@ add_sanitizer_flags(){

[FFmpeg-devel] [PATCH 3/5] configure: allow -ubsan in toolchain

2025-07-16 Thread Kacper Michajłow
It's is commonly called UBSAN after all. Signed-off-by: Kacper Michajłow --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 3fe33b72ed..fd4a52fc5f 100755 --- a/configure +++ b/configure @@ -4628,7 +4628,7 @@ add_sanitizer_flags(){

[FFmpeg-devel] [PATCH 2/5] configure: add -fno-omit-frame-pointer when sanitizers are used

2025-07-16 Thread Kacper Michajłow
All sanitizers give better reports with frame pointers. Signed-off-by: Kacper Michajłow --- configure | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure b/configure index 85712380c0..3fe33b72ed 100755 --- a/configure +++ b/configure @@ -4643,6 +4643,9 @@ add_sanitizers(){ for

[FFmpeg-devel] [PATCH 1/5] configure: allow multiple sanitizers in --toolchain

2025-07-16 Thread Kacper Michajłow
For example this allows --toolchain=clang-asan-usan. Signed-off-by: Kacper Michajłow --- configure | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 10dafae8e2..85712380c0 100755 --- a/configure +++ b/configure @@ -4638,14 +4638,21 @@ add

[FFmpeg-devel] [PATCH 5/5] avfilter/vaf_spectrumsynth: don't use uninitialized variable as scale

2025-07-16 Thread Kacper Michajłow
scale was never initialized. av_tx_init() will use default scale if we pass NULL. Fixes: b3117f376d1c50b3c39befe27cbba12d5c0f80da Signed-off-by: Kacper Michajłow --- libavfilter/vaf_spectrumsynth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vaf_spectrumsy

[FFmpeg-devel] [PATCH 4/5] swscale/lut3d: remove unused function

2025-07-16 Thread Kacper Michajłow
Signed-off-by: Kacper Michajłow --- libswscale/lut3d.c | 13 - 1 file changed, 13 deletions(-) diff --git a/libswscale/lut3d.c b/libswscale/lut3d.c index f42958cd92..535694e61c 100644 --- a/libswscale/lut3d.c +++ b/libswscale/lut3d.c @@ -131,19 +131,6 @@ static av_always_inline v3u16

[FFmpeg-devel] [PATCH 3/5] avcodec/sonic: move code closer to use to avoid unused warnings

2025-07-16 Thread Kacper Michajłow
Put decoding and encoding code into thier respective #if blocks. Signed-off-by: Kacper Michajłow --- libavcodec/sonic.c | 257 +++-- 1 file changed, 129 insertions(+), 128 deletions(-) diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index acefbbdbfb.

[FFmpeg-devel] [PATCH 2/5] avcodec/sonic: remove dead code

2025-07-16 Thread Kacper Michajłow
This was in else branch of `#if 1` since ever. No need to keep dead code like that, if anyone needs it they can get it from git history. Signed-off-by: Kacper Michajłow --- libavcodec/sonic.c | 299 - 1 file changed, 299 deletions(-) diff --git a/liba

[FFmpeg-devel] [PATCH 1/5] avformat/udp: avoid warning about always false comparision

2025-07-16 Thread Kacper Michajłow
socklen_t underlying type can be signed or unsigned depending on platform. This is fine, just cast it to size_t before comparision. Fixes: warning: result of comparison of unsigned expression < 0 is always false [-Wtautological-unsigned-zero-compare] Signed-off-by: Kacper Michajłow --- l

Re: [FFmpeg-devel] [PATCH v2 2/3] tests/checkasm: add check for vf_colordetect

2025-07-16 Thread James Almer
On 7/16/2025 1:24 PM, Niklas Haas wrote: From: Niklas Haas --- tests/checkasm/Makefile | 1 + tests/checkasm/checkasm.c | 3 + tests/checkasm/checkasm.h | 1 + tests/checkasm/vf_colordetect.c | 137 4 files changed, 142 insertions

Re: [FFmpeg-devel] [PATCH v2 3/3] avfilter/vf_colordetect: add x86 SIMD implementation

2025-07-16 Thread James Almer
On 7/16/2025 6:49 PM, Niklas Haas wrote: On Wed, 16 Jul 2025 17:25:12 -0300 James Almer wrote: On 7/16/2025 1:24 PM, Niklas Haas wrote: +cglobal detect_alpha%1_%3, 6, 7, 6, color, color_stride, alpha, alpha_stride, width, height, x +pxor m0, m0 +add colorq, widthq +add alphaq, wid

Re: [FFmpeg-devel] [PATCH v2 3/3] avfilter/vf_colordetect: add x86 SIMD implementation

2025-07-16 Thread Niklas Haas
On Wed, 16 Jul 2025 17:25:12 -0300 James Almer wrote: > On 7/16/2025 1:24 PM, Niklas Haas wrote: > > +cglobal detect_alpha%1_%3, 6, 7, 6, color, color_stride, alpha, > > alpha_stride, width, height, x > > +pxor m0, m0 > > +add colorq, widthq > > +add alphaq, widthq > > +neg widthq

Re: [FFmpeg-devel] [PATCH v2 3/3] avfilter/vf_colordetect: add x86 SIMD implementation

2025-07-16 Thread James Almer
On 7/16/2025 1:24 PM, Niklas Haas wrote: +cglobal detect_alpha%1_%3, 6, 7, 6, color, color_stride, alpha, alpha_stride, width, height, x +pxor m0, m0 +add colorq, widthq +add alphaq, widthq +neg widthq +%ifidn %3, limited +%if ARCH_X86_64 +movq xm3, r6mp ; p +movq xm4, r7

Re: [FFmpeg-devel] [PATCH v2 3/3] avfilter/vf_colordetect: add x86 SIMD implementation

2025-07-16 Thread Henrik Gramner via ffmpeg-devel
On Wed, Jul 16, 2025 at 6:26 PM Niklas Haas wrote: > +cglobal detect_range%1, 6, 7, 5, data, stride, width, height, mpeg_min, > mpeg_max, x > +movd xm0, mpeg_mind > +movd xm1, mpeg_maxd > +vpbroadcast%1 m0, xm0 > +vpbroadcast%1 m1, xm1 You could perhaps also do something like the

Re: [FFmpeg-devel] [PATCH] avcodec/jpegxl_parser: add sanity check for frame size

2025-07-16 Thread Leo Izen
On 7/16/25 06:34, Kacper Michajlow wrote: On Tue, 15 Jul 2025 at 20:02, Leo Izen wrote: If a frame size is absolutely massive, this can spin the parser as it attempts to decode a permuted TOC. We add a sanity check here for eight times the size of the image for an internal frame to prevent mal

[FFmpeg-devel] [PATCH v2 3/3] avfilter/vf_colordetect: add x86 SIMD implementation

2025-07-16 Thread Niklas Haas
From: Niklas Haas alphadetect8_full_c: 5658.2 ( 1.00x) alphadetect8_full_avx2:215.1 (26.31x) alphadetect8_full_avx512: 133.5 (42.40x) alphadetect8_limited_c: 7391.5 ( 1.00x)

[FFmpeg-devel] [PATCH v2 1/3] avfilter/vf_colordetect: add new color range detection filter

2025-07-16 Thread Niklas Haas
From: Niklas Haas This filter can detect various properties about the image, including whether or not there are out-of-range values, or whether the input appears to use straight or premultiplied alpha. Of course, these can only be heuristics, with "undetermined" as the base case. While we can de

[FFmpeg-devel] [PATCH v2 2/3] tests/checkasm: add check for vf_colordetect

2025-07-16 Thread Niklas Haas
From: Niklas Haas --- tests/checkasm/Makefile | 1 + tests/checkasm/checkasm.c | 3 + tests/checkasm/checkasm.h | 1 + tests/checkasm/vf_colordetect.c | 137 4 files changed, 142 insertions(+) create mode 100644 tests/checkasm/vf_colord

[FFmpeg-devel] [PATCH v2 0/3] avfilter: add vf_colordetect filter

2025-07-16 Thread Niklas Haas
Changes since v1: - Fix overflow in both C and x86 code for 16-bit depth - Fix SIMD overflow for 8-bit depth - Improve checkasm test to try and force overflow conditions ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/lis

Re: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_colordetect: add new color range detection filter

2025-07-16 Thread Niklas Haas
On Wed, 16 Jul 2025 17:25:49 +0200 Niklas Haas wrote: > From: Niklas Haas > > This filter can detect various properties about the image, including > whether or not there are out-of-range values, or whether the input appears > to use straight or premultiplied alpha. > > Of course, these can only b

[FFmpeg-devel] [PATCH 3/3] avfilter/vf_colordetect: add x86 SIMD implementation

2025-07-16 Thread Niklas Haas
From: Niklas Haas alphadetect8_full_c: 6334.7 ( 1.00x) alphadetect8_full_avx2:208.1 (30.44x) alphadetect8_full_avx512: 123.3 (51.39x) alphadetect8_limited_c:645.3 ( 1.00x)

[FFmpeg-devel] [PATCH 1/3] avfilter/vf_colordetect: add new color range detection filter

2025-07-16 Thread Niklas Haas
From: Niklas Haas This filter can detect various properties about the image, including whether or not there are out-of-range values, or whether the input appears to use straight or premultiplied alpha. Of course, these can only be heuristics, with "undetermined" as the base case. While we can de

[FFmpeg-devel] [PATCH 2/3] tests/checkasm: add check for vf_colordetect

2025-07-16 Thread Niklas Haas
From: Niklas Haas --- tests/checkasm/Makefile | 1 + tests/checkasm/checkasm.c | 3 + tests/checkasm/checkasm.h | 1 + tests/checkasm/vf_colordetect.c | 129 4 files changed, 134 insertions(+) create mode 100644 tests/checkasm/vf_colord

Re: [FFmpeg-devel] Feature Request

2025-07-16 Thread Timo Rothenpieler
On 16/07/2025 15:36, Glen Edwards wrote: Add Support for Muxing VP8, VP9, and AV1 Video Codecs in the mov muxer, than Add Support for Muxing TTA, FLAC and Opus audio Codecs in the mov muxer, plus improvements in the mov muxer plus modern audio/video codec support , Plus Modern Audio and Video Cod

Re: [FFmpeg-devel] [PATCH v2 0/3] Add OpenHarmony hardware codec wrapper

2025-07-16 Thread Zhao Zhili
> On Jul 16, 2025, at 22:11, Kieran Kunhya via ffmpeg-devel > wrote: > > On Wed, Jul 16, 2025 at 3:08 PM Zhao Zhili wrote: >> >> >> >>> On Jul 6, 2025, at 16:05, Zhao Zhili >>> wrote: >>> >>> From: Zhao Zhili >>> >>> v2: >>> 1. Add encoder. >>> 2. Trial refactor of decoder. >>> >>> Z

Re: [FFmpeg-devel] [PATCH v2 0/3] Add OpenHarmony hardware codec wrapper

2025-07-16 Thread Kieran Kunhya via ffmpeg-devel
On Wed, Jul 16, 2025 at 3:08 PM Zhao Zhili wrote: > > > > > On Jul 6, 2025, at 16:05, Zhao Zhili > > wrote: > > > > From: Zhao Zhili > > > > v2: > > 1. Add encoder. > > 2. Trial refactor of decoder. > > > > Zhao Zhili (3): > > avutil/hwcontext: Add ohcodec device and pixel format > > avcodec/

Re: [FFmpeg-devel] [PATCH v2 0/3] Add OpenHarmony hardware codec wrapper

2025-07-16 Thread Zhao Zhili
> On Jul 6, 2025, at 16:05, Zhao Zhili > wrote: > > From: Zhao Zhili > > v2: > 1. Add encoder. > 2. Trial refactor of decoder. > > Zhao Zhili (3): > avutil/hwcontext: Add ohcodec device and pixel format > avcodec/ohdec: Add h264/hevc OpenHarmony decoders > avcodec/ohenc: Add h264/hevc O

[FFmpeg-devel] Feature Request

2025-07-16 Thread Glen Edwards
Add Support for Muxing VP8, VP9, and AV1 Video Codecs in the mov muxer, than Add Support for Muxing TTA, FLAC and Opus audio Codecs in the mov muxer, plus improvements in the mov muxer plus modern audio/video codec support , Plus Modern Audio and Video Codecs in the mov muxer and Add Support for Mu

Re: [FFmpeg-devel] [PATCH] configure: Update ossfuzz stuff to clang-12+

2025-07-16 Thread Michael Niedermayer
On Wed, Jul 16, 2025 at 11:58:14AM +0200, Kacper Michajlow wrote: > On Tue, 15 Jul 2025 at 00:24, Michael Niedermayer > wrote: > > > > --- > > configure | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/configure b/configure > > index fc082d5467e..e568eed55d3 1007

Re: [FFmpeg-devel] [PATCH] configure: Update ossfuzz stuff to clang-12+

2025-07-16 Thread Michael Niedermayer
Hi On Wed, Jul 16, 2025 at 11:11:13AM +0100, Frank Plowman wrote: > > > On 16/07/2025 18:58, Kacper Michajlow wrote: > > On Tue, 15 Jul 2025 at 00:24, Michael Niedermayer > > wrote: > >> > >> --- > >> configure | 4 ++-- > >> 1 file changed, 2 insertions(+), 2 deletions(-) > >> > >> diff --git

Re: [FFmpeg-devel] [PATCH] configure: Update ossfuzz stuff to clang-12+

2025-07-16 Thread Frank Plowman
On 16/07/2025 19:11, Frank Plowman wrote: > > > On 16/07/2025 18:58, Kacper Michajlow wrote: >> On Tue, 15 Jul 2025 at 00:24, Michael Niedermayer >> wrote: >>> >>> --- >>> configure | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/configure b/configure >>> inde

Re: [FFmpeg-devel] [PATCH v2] configure: add -Wl when linker is called indirectly

2025-07-16 Thread Kacper Michajlow
On Fri, 20 Jun 2025 at 01:52, Kacper Michajłow wrote: > > It's possible to call linker indirectly through driver like Clang. In > which cases linker args has to be prefixed with -Wl. > > Signed-off-by: Kacper Michajłow > --- > configure | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-

Re: [FFmpeg-devel] [PATCH] checkasm/swscale: fix function prototypes

2025-07-16 Thread Kacper Michajlow
On Thu, 3 Jul 2025 at 23:08, Kacper Michajłow wrote: > > This aligns declared function types in checkasm with real definition. > > Fixes FATE: checkasm-{sw_rgb,sw_scale,sw_yuv2rgb,sw_yuv2yuv} > > Fixes: runtime error: call to function through pointer to incorrect > function type > Fixes: c1a0e65

Re: [FFmpeg-devel] [PATCH] avfilter/vf_blackdetect: add AVX2 SIMD version

2025-07-16 Thread Niklas Haas
On Thu, 10 Jul 2025 17:10:42 +0200 Niklas Haas wrote: > From: Niklas Haas > > Requested by a user. Even with autovectorization enabled, the compiler > performs a quite poor job of optimizing this function, due to not being > able to take advantage of the pmaxub + pcmpeqb trick for counting the nu

Re: [FFmpeg-devel] [PATCH] avcodec/jpegxl_parser: add sanity check for frame size

2025-07-16 Thread Kacper Michajlow
On Tue, 15 Jul 2025 at 20:02, Leo Izen wrote: > > If a frame size is absolutely massive, this can spin the parser as it > attempts to decode a permuted TOC. We add a sanity check here for eight > times the size of the image for an internal frame to prevent malicious > bitstreams from slowing the p

Re: [FFmpeg-devel] [POLL] [VOTE] code.ffmpeg.org

2025-07-16 Thread Kacper Michajlow
On Sun, 13 Jul 2025 at 13:44, Michael Niedermayer wrote: > > Hi all > > Do people want Forgejo or Gitlab on code.ffmpeg.org for testing? > > F. code.ffmpeg.org should run Forgejo > G. code.ffmpeg.org should run Gitlab I cannot tell. While Forgejo looks fine on the surface, the devil is in the det

Re: [FFmpeg-devel] [PATCH] configure: Update ossfuzz stuff to clang-12+

2025-07-16 Thread Frank Plowman
On 16/07/2025 18:58, Kacper Michajlow wrote: > On Tue, 15 Jul 2025 at 00:24, Michael Niedermayer > wrote: >> >> --- >> configure | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/configure b/configure >> index fc082d5467e..e568eed55d3 100755 >> --- a/configure >> +

Re: [FFmpeg-devel] [PATCH v2 2/2] lavc/vvc: Add max parameter to kth_order_egk_decode

2025-07-16 Thread Frank Plowman
On 15/07/2025 03:48, Frank Plowman wrote: > Prior to this patch, kth_order_egk_decode could read arbitrarily > large values which then overflowed and caused various issues. > Patch fixes this by making kth_order_egk_decode falliable, > requiring the caller to specify an upper bound and returning an

Re: [FFmpeg-devel] [PATCH] configure: Update ossfuzz stuff to clang-12+

2025-07-16 Thread Kacper Michajlow
On Tue, 15 Jul 2025 at 00:24, Michael Niedermayer wrote: > > --- > configure | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/configure b/configure > index fc082d5467e..e568eed55d3 100755 > --- a/configure > +++ b/configure > @@ -4606,8 +4606,8 @@ set >> $logfile > te

Re: [FFmpeg-devel] [PATCH] avfilter/vf_blackdetect: add AVX2 SIMD version

2025-07-16 Thread Niklas Haas
On Thu, 10 Jul 2025 17:10:42 +0200 Niklas Haas wrote: > From: Niklas Haas > > Requested by a user. Even with autovectorization enabled, the compiler > performs a quite poor job of optimizing this function, due to not being > able to take advantage of the pmaxub + pcmpeqb trick for counting the nu

Re: [FFmpeg-devel] [PATCH] avfilter/vf_thumbnail: unroll and use multiple histograms

2025-07-16 Thread Niklas Haas
On Sat, 12 Jul 2025 13:38:37 +0200 Niklas Haas wrote: > From: Niklas Haas > > This naive hist[p[x]]++ loop suffers badly when there are large regions of > identical values in the image, because of store-to-load forwarding delay. > > Splitting up the histogram into four "parallel" histograms and p

Re: [FFmpeg-devel] [PATCH 1/4] avfilter/scene_sad: pass true depth to ff_scene_sad_get_fn()

2025-07-16 Thread Niklas Haas
On Sat, 12 Jul 2025 11:22:40 +0200 Niklas Haas wrote: > From: Niklas Haas > > I need to be able to distinguish between 10/12/14 and 16 bit depths, for > overflow reasons. Merging this series soon. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org h