Re: [FFmpeg-devel] [FFmpeg-cvslog] avfilter/video: don't zero allocated buffers if memory poisoning is used

2024-08-13 Thread Martin Storsjö
On Tue, 13 Aug 2024, James Almer wrote: ffmpeg | branch: master | James Almer | Sat Aug 10 21:31:16 2024 -0300| [41307ff3e9384c51d646bff7e3dcf0d554098a8f] | committer: James Almer avfilter/video: don't zero allocated buffers if memory poisoning is used Same as in avcodec/get_buffer.c Should

[FFmpeg-devel] [FEATURE] Cut a video (-ss) with timings non-aligned on keyframes, with minimal re-encoding

2024-08-13 Thread basj
A little bump, does anyone have an idea about this? Do you think it would be worth developing a command-line option so that exact cutting with minimal re-encoding would be easier? Linked: https://superuser.com/questions/1850814/cut-a-video-with-ffmpeg-with-no-or-minimal-reencoding ___

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/mpegvideoencdsp: add aarch64 pix_sum and pix_norm1

2024-08-13 Thread Rémi Denis-Courmont
Le 9 août 2024 14:27:27 GMT+03:00, Ramiro Polla a écrit : >checkasm --bench for Raspberry Pi 5 Model B Rev 1.0: >pix_norm1_c: 235.7 >pix_norm1_neon: 40.7 >pix_sum_c: 249.0 >pix_sum_neon: 22.0 >--- > libavcodec/aarch64/Makefile | 2 + > libavcodec/aarch64/mpegvideoencdsp_init.c |

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/mpegvideoencdsp: add aarch64 pix_sum and pix_norm1

2024-08-13 Thread Rémi Denis-Courmont
Le 13 août 2024 10:45:15 GMT+03:00, "Rémi Denis-Courmont" a écrit : > > >Le 9 août 2024 14:27:27 GMT+03:00, Ramiro Polla a >écrit : >>checkasm --bench for Raspberry Pi 5 Model B Rev 1.0: >>pix_norm1_c: 235.7 >>pix_norm1_neon: 40.7 >>pix_sum_c: 249.0 >>pix_sum_neon: 22.0 >>--- >> libavcodec/aa

[FFmpeg-devel] [PATCH] lavc/qsvdec: Add vvc_mp4toannexb bsf for QSV VVC decoder

2024-08-13 Thread fei . w . wang-at-intel . com
From: Fei Wang Fix error: $ ffmpeg -hwaccel qsv -i input.mp4 -f null - .. [vvc_qsv @ 026890D966C0] Error decoding stream header: unknown error (-1) [vvc_qsv @ 026890D966C0] Error decoding header Signed-off-by: Fei Wang --- libavcodec/qsvdec.c | 2 +- 1 file changed, 1 insertion(+), 1 d

Re: [FFmpeg-devel] [PATCH 08/10] lavfi: move AVFilterLink.{frame, sample}_count_{in, out} to FilterLink

2024-08-13 Thread Anton Khirnov
Quoting Michael Niedermayer (2024-08-12 22:19:30) > On Sun, Aug 11, 2024 at 04:42:09PM +0200, Anton Khirnov wrote: > > --- > > libavfilter/af_adrc.c | 3 ++- > > libavfilter/af_afftdn.c | 3 ++- > > libavfilter/af_ashowinfo.c| 4 +++- > > libavfilter/af_dynaudnorm.c | 3 ++-

Re: [FFmpeg-devel] [FEATURE] Cut a video (-ss) with timings non-aligned on keyframes, with minimal re-encoding

2024-08-13 Thread Timo Rothenpieler
On 13.08.2024 09:35, b...@gget.it wrote: A little bump, does anyone have an idea about this? Do you think it would be worth developing a command-line option so that exact cutting with minimal re-encoding would be easier? How do you plan to figure out the options needed to be passed to each

Re: [FFmpeg-devel] [FFmpeg-cvslog] avfilter/video: don't zero allocated buffers if memory poisoning is used

2024-08-13 Thread James Almer
On 8/13/2024 4:22 AM, Martin Storsjö wrote: On Tue, 13 Aug 2024, James Almer wrote: ffmpeg | branch: master | James Almer | Sat Aug 10 21:31:16 2024 -0300| [41307ff3e9384c51d646bff7e3dcf0d554098a8f] | committer: James Almer avfilter/video: don't zero allocated buffers if memory poisoning is

[FFmpeg-devel] [PATCH 1/7] checkasm: add csv/tsv bench output

2024-08-13 Thread J. Dekker
When collecting performance information from checkasm it is common to parse the output for use in graphs to compare vs different architectures. Signed-off-by: J. Dekker --- tests/checkasm/checkasm.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests

[FFmpeg-devel] [PATCH 2/7] checkasm: improve print format

2024-08-13 Thread J. Dekker
Port dav1d's checkasm output format to FFmpeg's checkasm, includes relative speedups and aligns results. Signed-off-by: J. Dekker --- tests/checkasm/checkasm.c | 53 +++ 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/tests/checkasm/checkasm.c b

[FFmpeg-devel] [PATCH 3/7] checkasm: add wildcompares for test & functions

2024-08-13 Thread J. Dekker
Added: --test=Filter tests by glob style pattern. --bench[=] Run benchmark and optionally filter functions by glob style pattern. Example: $ ./tests/checkasm/checkasm --bench=yuva* [...] yuva420p_bgr24_8_c: 34.5 ( 1.00x) yuva420p_

[FFmpeg-devel] [PATCH 4/7] avutil/riscv/asm: add stack pushing helpers

2024-08-13 Thread J. Dekker
From: Niklas Haas Instead of duplicating these common macros in every file, add them to the shared utility file. Also add a base case for sanity. --- libavcodec/riscv/h264addpx_rvv.S | 10 -- libavcodec/riscv/h264idct_rvv.S | 10 -- libavcodec/riscv/startcode_rvb.S | 10

[FFmpeg-devel] [PATCH 5/7] avutil/riscv/asm: add helper macro to count varargs

2024-08-13 Thread J. Dekker
From: Niklas Haas (Ab)using nested macros to get the number of arguments passed to a variadic macro. Useful for stack manipulation. --- libavutil/riscv/asm.S | 17 + 1 file changed, 17 insertions(+) diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S index 175f2a8672..db1

[FFmpeg-devel] [PATCH 7/7] avcodec/riscv: add h264 qpel

2024-08-13 Thread J. Dekker
From: Niklas Haas checkasm: bench runs 131072 (1 << 17) avg_h264_qpel_4_mc00_8_c: 37.6 ( 1.00x) avg_h264_qpel_4_mc00_8_rvv_i32: 27.4 ( 1.37x) avg_h264_qpel_4_mc01_8_c: 214.6 ( 1.00x) avg_h264_qpel_4_mc01_8_rvv_i32:

[FFmpeg-devel] [PATCH 6/7] avutil/riscv/asm: add generic push/pop helpers

2024-08-13 Thread J. Dekker
From: Niklas Haas Generic helper macros to push/pop multiple registers at once. Expands to a single `addi` plus a sequence of XLEN-sized stores/loads. --- libavutil/riscv/asm.S | 37 + 1 file changed, 37 insertions(+) diff --git a/libavutil/riscv/asm.S b/liba

[FFmpeg-devel] [PATCH] avcodec/rpzaenc: don't use buffer data beyond the end of a row

2024-08-13 Thread James Almer
Fixes use of uninitized data (masked by the default zeroing of image buffers). Signed-off-by: James Almer --- libavcodec/rpzaenc.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/rpzaenc.c b/libavcodec/rpzaenc.c index d84555d6c6..3a1924d385 100644 --- a/lib

[FFmpeg-devel] [PATCH] swscale/output: don't leave the alpha channel undefined in vuyx and xv36le

2024-08-13 Thread James Almer
It's non-determistic, as shown by poisoning avfilter buffers instead of zeroing them. Signed-off-by: James Almer --- libswscale/output.c | 6 +++--- tests/ref/fate/filter-pixfmts-copy | 4 ++-- tests/ref/fate/filter-pixfmts-crop | 4 ++-- tests/ref/fate/filter-p

Re: [FFmpeg-devel] [PATCH] swscale/output: don't leave the alpha channel undefined in vuyx and xv36le

2024-08-13 Thread Timo Rothenpieler
On 13/08/2024 16:25, James Almer wrote: It's non-determistic, as shown by poisoning avfilter buffers instead of zeroing them. Signed-off-by: James Almer --- libswscale/output.c | 6 +++--- tests/ref/fate/filter-pixfmts-copy | 4 ++-- tests/ref/fate/filter-pixfmts

Re: [FFmpeg-devel] [PATCH] swscale/output: don't leave the alpha channel undefined in vuyx and xv36le

2024-08-13 Thread James Almer
On 8/13/2024 12:08 PM, Timo Rothenpieler wrote: On 13/08/2024 16:25, James Almer wrote: It's non-determistic, as shown by poisoning avfilter buffers instead of zeroing them. Signed-off-by: James Almer ---   libswscale/output.c  | 6 +++---   tests/ref/fate/filter-pixfmts-co

Re: [FFmpeg-devel] [PATCH 4/7] avutil/riscv/asm: add stack pushing helpers

2024-08-13 Thread Rémi Denis-Courmont
Le 13 août 2024 17:03:33 GMT+03:00, "J. Dekker" a écrit : >From: Niklas Haas > >Instead of duplicating these common macros in every file, add them to >the shared utility file. Also add a base case for sanity. Is `#error` a standard directive of C11? >--- > libavcodec/riscv/h264addpx_rvv.S | 1

Re: [FFmpeg-devel] [PATCH 6/7] avutil/riscv/asm: add generic push/pop helpers

2024-08-13 Thread Rémi Denis-Courmont
Le 13 août 2024 17:03:35 GMT+03:00, "J. Dekker" a écrit : >From: Niklas Haas > >Generic helper macros to push/pop multiple registers at once. Expands to >a single `addi` plus a sequence of XLEN-sized stores/loads. >--- > libavutil/riscv/asm.S | 37 + > 1 file

Re: [FFmpeg-devel] [PATCH 4/7] avutil/riscv/asm: add stack pushing helpers

2024-08-13 Thread epirat07
On 13 Aug 2024, at 17:51, Rémi Denis-Courmont wrote: > Le 13 août 2024 17:03:33 GMT+03:00, "J. Dekker" a écrit : >> From: Niklas Haas >> >> Instead of duplicating these common macros in every file, add them to >> the shared utility file. Also add a base case for sanity. > > Is `#error` a standar

Re: [FFmpeg-devel] [PATCH 4/7] avutil/riscv/asm: add stack pushing helpers

2024-08-13 Thread Rémi Denis-Courmont
Le 13 août 2024 19:10:48 GMT+03:00, epira...@gmail.com a écrit : >On 13 Aug 2024, at 17:51, Rémi Denis-Courmont wrote: > >> Le 13 août 2024 17:03:33 GMT+03:00, "J. Dekker" a écrit : >>> From: Niklas Haas >>> >>> Instead of duplicating these common macros in every file, add them to >>> the share

Re: [FFmpeg-devel] [PATCH 2/7] checkasm: improve print format

2024-08-13 Thread Lynne via ffmpeg-devel
On 13/08/2024 16:03, J. Dekker wrote: Port dav1d's checkasm output format to FFmpeg's checkasm, includes relative speedups and aligns results. Signed-off-by: J. Dekker --- tests/checkasm/checkasm.c | 53 +++ 1 file changed, 48 insertions(+), 5 deletions(-)

Re: [FFmpeg-devel] [PATCH] avcodec/h264_mp4toannexb: Prepend SPS/PPS to buffering period SEI

2024-08-13 Thread Josh Allmann
On Wed, 7 Aug 2024 at 09:13, Josh Allmann wrote: > > On Thu, 1 Aug 2024 at 14:37, Josh Allmann wrote: > > > > Encoders may emit a buffering period SEI without a corresponding > > SPS/PPS if the SPS/PPS is carried out-of-band, eg with avcc. > > > > During Annex B conversion, this may result in the

Re: [FFmpeg-devel] [PATCH] avcodec/rpzaenc: don't use buffer data beyond the end of a row

2024-08-13 Thread James Almer
On 8/13/2024 11:05 AM, James Almer wrote: Fixes use of uninitized data (masked by the default zeroing of image buffers). Signed-off-by: James Almer --- libavcodec/rpzaenc.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/rpzaenc.c b/libavcodec/rpzaenc.c

Re: [FFmpeg-devel] [PATCH] swscale/output: don't leave the alpha channel undefined in vuyx and xv36le

2024-08-13 Thread James Almer
On 8/13/2024 11:25 AM, James Almer wrote: It's non-determistic, as shown by poisoning avfilter buffers instead of zeroing them. Signed-off-by: James Almer --- libswscale/output.c | 6 +++--- tests/ref/fate/filter-pixfmts-copy | 4 ++-- tests/ref/fate/filter-pixfm

[FFmpeg-devel] [PATCH] fftools/ffmpeg: remove useless error check

2024-08-13 Thread Marvin Scholz
When ret is checked here, it was never assigned anything, making this check useless, as highlighted by Coverity. It seems to be a copy paste mistake given that opt_match_per_stream_str does not return an error code that could be checked and the previous value assigned to ret is already checked abo

Re: [FFmpeg-devel] [PATCH 1/2 v2] avformat/avisynth: remove atexit() handler

2024-08-13 Thread Stephen Hutchinson
On 7/19/24 12:56 PM, Stephen Hutchinson wrote: The atexit() handler in the avisynth demuxer was added because there was a conflict in AvxSynth that arose due to their use of C++ global objects, particularly in relation to having added a logging function relying on log4cpp. This conflict was resp

Re: [FFmpeg-devel] [PATCH 2/2 v2] avformat/avisynth: remove mutex lock from avisynth_read_close

2024-08-13 Thread Stephen Hutchinson
On 7/19/24 12:56 PM, Stephen Hutchinson wrote: Signed-off-by: Stephen Hutchinson --- Changes compared to v1: * Adjusted for patch #1's inclusion of dlclose libavformat/avisynth.c | 4 1 file changed, 4 deletions(-) diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index 2674

Re: [FFmpeg-devel] [PATCH 3/4] avformat/avisynth: remove library allocation from global state

2024-08-13 Thread Stephen Hutchinson
On 7/29/24 12:43 AM, Stephen Hutchinson wrote: As part of this, the mutexes are no longer necessary, and avisynth_read_close needs to check that avs->avs_library.library still exists before it attempts to call avisynth_context_destroy and dlclose. Signed-off-by: Stephen Hutchinson --- libavfo

Re: [FFmpeg-devel] [PATCH 4/4] avformat/avisynth: move avs_planes* consts into relevant function

2024-08-13 Thread Stephen Hutchinson
On 7/29/24 12:43 AM, Stephen Hutchinson wrote: These consts are only used in the switch(planar) case located in avisynth_create_stream_video and nowhere else in the demuxer, so move them into that function directly. Signed-off-by: Stephen Hutchinson --- libavformat/avisynth.c | 22 +++

[FFmpeg-devel] PATCH] Make H.274 film grain support optional for H.264. Saves ~779kb.

2024-08-13 Thread Dale Curtis
Film grain support adds a huge amount of overhead to the H264Context structure for a feature that is rarely used. On low end devices or pages that have lots of media this bloats memory usage rapidly. This introduces a --disable-h264-film-grain option which makes these fields optional and reduces t

Re: [FFmpeg-devel] PATCH] Make H.274 film grain support optional for H.264. Saves ~779kb.

2024-08-13 Thread James Almer
On 8/13/2024 4:31 PM, Dale Curtis wrote: Film grain support adds a huge amount of overhead to the H264Context structure for a feature that is rarely used. On low end devices or pages that have lots of media this bloats memory usage rapidly. This introduces a --disable-h264-film-grain option whic

Re: [FFmpeg-devel] PATCH] Make H.274 film grain support optional for H.264. Saves ~779kb.

2024-08-13 Thread Dale Curtis
Thanks, disable-h274-film-grain and applying it to hevc too sgtm. I'll wait to see what Niklas says before updating though. - dale On Tue, Aug 13, 2024 at 12:47 PM James Almer wrote: > On 8/13/2024 4:31 PM, Dale Curtis wrote: > > Film grain support adds a huge amount of overhead to the H264Cont

Re: [FFmpeg-devel] PATCH] Make H.274 film grain support optional for H.264. Saves ~779kb.

2024-08-13 Thread Hendrik Leppkes
On Tue, Aug 13, 2024 at 9:32 PM Dale Curtis wrote: > > Film grain support adds a huge amount of overhead to the H264Context > structure for a feature that is rarely used. On low end devices or > pages that have lots of media this bloats memory usage rapidly. > > This introduces a --disable-h264-fi

Re: [FFmpeg-devel] [PATCH] libavcodec/arm/mlpdsp_armv5te: fix label format to work with binutils 2.43

2024-08-13 Thread Martin Storsjö
On Fri, 9 Aug 2024, Ross Burton wrote: binutils 2.43 has stricter validation for labels[1] and results in errors when building ffmpeg for armv5: src/libavcodec/arm/mlpdsp_armv5te.S:232: Error: junk at end of line, first unrecognized character is `0' Remove the leading zero in the "01" label t

Re: [FFmpeg-devel] [PATCH] swscale/output: don't leave the alpha channel undefined in vuyx and xv36le

2024-08-13 Thread Michael Niedermayer
On Tue, Aug 13, 2024 at 11:25:17AM -0300, James Almer wrote: > It's non-determistic, as shown by poisoning avfilter buffers instead of > zeroing them. > > Signed-off-by: James Almer > --- > libswscale/output.c | 6 +++--- > tests/ref/fate/filter-pixfmts-copy | 4 ++--

Re: [FFmpeg-devel] PATCH] Make H.274 film grain support optional for H.264. Saves ~779kb.

2024-08-13 Thread Dale Curtis
On Tue, Aug 13, 2024 at 1:11 PM Hendrik Leppkes wrote: > Disabling random codec features seems like an anti-feature to me, in > the future it'll make every feature be questioned and compile-time > conditional, and make everything terrible. > If the context size is the major concern, maybe large s

[FFmpeg-devel] [PATCH] avcodec/snowenc: sign extend a variable before shifting

2024-08-13 Thread James Almer
Fixes "libavcodec/snowenc.c:718:27: runtime error: left shift of 8509032 by 8 places cannot be represented in type 'int'" as seen in fate-vsynth2-snow-hpel under ubsan. Signed-off-by: James Almer --- libavcodec/snowenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavc

[FFmpeg-devel] [PATCH] vulkan: remove AVClass * from the context, use a logging pointer

2024-08-13 Thread Lynne via ffmpeg-devel
The issue is that VulkanContext mostly always used the AVClass * from its structure, which we don't set in decode. --- libavcodec/vulkan_decode.c| 2 ++ libavfilter/vf_avgblur_vulkan.c | 2 ++ libavfilter/vf_blend_vulkan.c | 2 ++ libavfilter/vf_bwdif_vulkan.c | 4 +-- libavf

[FFmpeg-devel] [PATCH] lavfi/vf_libplacebo: move deprecated field inside PL_API_VER check

2024-08-13 Thread llyyr
Set equivalent new option instead. Deprecated upstream in libplacebo v7.346. --- libavfilter/vf_libplacebo.c | 8 1 file changed, 8 insertions(+) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index be9000aa8ea7..e4e750d4edfa 100644 --- a/libavfilter/vf_libplaceb

Re: [FFmpeg-devel] [PATCH] lavc/libx265: unbreak build for X265_BUILD >= 210

2024-08-13 Thread Gyan Doshi
On 2024-08-11 04:03 pm, Gyan Doshi wrote: x265 added support for alpha starting with build 210. While doing so, x265_encoder_encode() changed its fifth arg to an array of pointers to x265_picture. This broke building lavc/libx265.c This patch simply unbreaks the build and maintains existing s

Re: [FFmpeg-devel] PATCH] Make H.274 film grain support optional for H.264. Saves ~779kb.

2024-08-13 Thread Christophe Gisquet
Hi, Le mar. 13 août 2024 à 23:39, Dale Curtis a écrit : > > On Tue, Aug 13, 2024 at 1:11 PM Hendrik Leppkes wrote: > > > Disabling random codec features seems like an anti-feature to me, in > > the future it'll make every feature be questioned and compile-time > > conditional, and make everythin

Re: [FFmpeg-devel] [PATCH] lavc/qsvdec: Add vvc_mp4toannexb bsf for QSV VVC decoder

2024-08-13 Thread Xiang, Haihao
On Di, 2024-08-13 at 16:01 +0800, fei.w.wang-at-intel@ffmpeg.org wrote: > From: Fei Wang > > Fix error: > $ ffmpeg -hwaccel qsv -i input.mp4 -f null - > .. > [vvc_qsv @ 026890D966C0] Error decoding stream header: unknown error (-1) > [vvc_qsv @ 026890D966C0] Error decoding header > >