[FFmpeg-devel] [PATCH] avutil/intreadwrite: Always provide AV_[RW]N(24|48)

2022-09-12 Thread Andreas Rheinhardt
Currently, only the AVR32-arch provides some of these (namely the 24 bit variants), but this should not depend on the arch. Signed-off-by: Andreas Rheinhardt --- When I started writing this patch, I believed that whether intreadwrite.h provided AV_[RW]N24 depended upon the arch, namely AVR32; but

[FFmpeg-devel] multithreading hwaccel is broken on 5.1 and master branch

2022-09-12 Thread Wang Bin
cc867f2c09d2b69cee8a0eccd62aff002cbbfe11 this change breaks hwaccel. The assertion av_assert0(!p->parent->stash_hwaccel) fails when seeking. So this makes video players unusable. videotoolbox has another crash when starting to decode. The crash can be reproduce easily in ffmpeg: ./ffmpeg -stream_lo

[FFmpeg-devel] [PATCH] doc/examples/extract_mvs: add motion information

2022-09-12 Thread Chema Gonzalez
Note that the motion information includes subpel motion information This was likely forgotten in 56bdf61baa04c4fd8d165f34499115ce0aa97c43. Tested: ``` $ make examples -j ... $ doc/examples/extract_mvs in.264 | head -40 | \ csvcut -C framenum,source,flags |csvlook | blockw | blockh | srcx | s

Re: [FFmpeg-devel] [PATCH 1/1] avcodec/mpegutils: add motion_vec debug mode

2022-09-12 Thread Chema Gonzalez
Hi Paul, I tried to understand the per-frame side-data (and metadata) mechanism. Adding my notes here in case they help a future reader. Metadata and side-data seem like similar mechanisms to add auxiliary information to each frame. Main difference seems to be that metadata is simpler (a key/valu

Re: [FFmpeg-devel] [PATCH] fate/spdif: Add spdif tests

2022-09-12 Thread Andreas Rheinhardt
Andreas Rheinhardt: > These tests test both the demuxer as well as the muxer > wherever possible. It is not always possible due to the fact > that the muxer supports more codecs than the demuxer. > > The spdif demuxer does currently not set the need_parsing flag. > If one were to set this to AVSTR

Re: [FFmpeg-devel] [PATCH] avformat: add Limitless Audio Format demuxer

2022-09-12 Thread Paul B Mahol
On 9/13/22, Andreas Rheinhardt wrote: > Paul B Mahol: >> +case 3: >> +for (int n = 0; n < st->codecpar->sample_rate; n++) >> +AV_WL24(pkt->data + n * 3, AV_RL24(s->data + n * s->nb_stored >> * 3 + s->stored_index * 3)); >> +break; > > Looking at intreadwrite.h shows

Re: [FFmpeg-devel] [PATCH] avformat: add Limitless Audio Format demuxer

2022-09-12 Thread Andreas Rheinhardt
Paul B Mahol: > +case 3: > +for (int n = 0; n < st->codecpar->sample_rate; n++) > +AV_WL24(pkt->data + n * 3, AV_RL24(s->data + n * s->nb_stored * > 3 + s->stored_index * 3)); > +break; Looking at intreadwrite.h shows that we actually have AV_RN24 and AV_WN24. - A

Re: [FFmpeg-devel] [PATCH] swsresample/swresample: abort on invalid layouts

2022-09-12 Thread James Almer
On 9/8/2022 8:00 PM, James Almer wrote: On 9/8/2022 7:47 PM, Andreas Rheinhardt wrote: James Almer: If it's unsupported or invalid, then there's no point trying to rebuild it using a value that may have been derived from the same layout to begin with. Move the checks before the attempts at c

[FFmpeg-devel] FFmpeg 5.1.2

2022-09-12 Thread Michael Niedermayer
Hi all due to more bugfixes i intend to make 5.1.2 soon (within the next days) I do plan to make releases from older still maintained/used branches following 5.1.2 thx -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Breaking DRM is a little like attempting to break t

Re: [FFmpeg-devel] [PATCH] avcodec/bonk: Actually clip when using av_clip()

2022-09-12 Thread Paul B Mahol
On 9/12/22, Andreas Rheinhardt wrote: > Also fixes a "statement with no effect [-Wunused-value]" > warning from GCC. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/bonk.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c > in

Re: [FFmpeg-devel] [PATCH] avformat: add Limitless Audio Format demuxer

2022-09-12 Thread Paul B Mahol
On 9/12/22, Paul B Mahol wrote: > Patch attached. > Updated patch attached. From 33efa252db96d9eac7f162f17b22c1cd8b3b1c14 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 11 Sep 2022 20:10:27 +0200 Subject: [PATCH] avformat: add LAF demuxer Signed-off-by: Paul B Mahol --- libavformat/Ma

Re: [FFmpeg-devel] [PATCH] avcodec/x86/audiodsp: add scalarproduct avx2

2022-09-12 Thread James Almer
On 9/12/2022 3:39 PM, James Almer wrote: From 55eb5a18b4bf029f52f9d9108a750c576ba780ee Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Mon, 12 Sep 2022 18:53:31 +0200 Subject: [PATCH] avcodec/x86/audiodsp: add scalarproduct avx2 Signed-off-by: Paul B Mahol ---  libavcodec/x86/audiodsp.asm 

Re: [FFmpeg-devel] [PATCH] avcodec/x86/audiodsp: add scalarproduct avx2

2022-09-12 Thread James Almer
From 55eb5a18b4bf029f52f9d9108a750c576ba780ee Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Mon, 12 Sep 2022 18:53:31 +0200 Subject: [PATCH] avcodec/x86/audiodsp: add scalarproduct avx2 Signed-off-by: Paul B Mahol --- libavcodec/x86/audiodsp.asm| 24 libavcodec

[FFmpeg-devel] [PATCH] avcodec/x86/audiodsp: add scalarproduct avx2

2022-09-12 Thread Paul B Mahol
Patch attached. How to get more speed? From 55eb5a18b4bf029f52f9d9108a750c576ba780ee Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Mon, 12 Sep 2022 18:53:31 +0200 Subject: [PATCH] avcodec/x86/audiodsp: add scalarproduct avx2 Signed-off-by: Paul B Mahol --- libavcodec/x86/audiodsp.asm|

[FFmpeg-devel] [PATCH] avcodec/tiff: Fix loop detection

2022-09-12 Thread Michael Niedermayer
Fixes regression with tickets/4364/L1004220.DNG Signed-off-by: Michael Niedermayer --- libavcodec/tiff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index beb427e0074..226050744fc 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/ti

[FFmpeg-devel] [PATCH 3/3] avfilter/video: Fix newline in trace output

2022-09-12 Thread Andreas Rheinhardt
Forgotten in 7e350379f87e7f74420b4813170fe808e2313911. Signed-off-by: Andreas Rheinhardt --- Does anyone actually use this? The fact that this went unnoticed for so long suggest "no". libavfilter/video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/video.c b/l

[FFmpeg-devel] [PATCH 2/3] avfilter/avfilter: #if ff_tlog_link() away when empty

2022-09-12 Thread Andreas Rheinhardt
It is currently calling av_channel_layout_describe() unnecessarily. Signed-off-by: Andreas Rheinhardt --- libavfilter/avfilter.c | 2 ++ libavfilter/internal.h | 4 2 files changed, 6 insertions(+) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index bde41637dd..f34204e650 10

[FFmpeg-devel] [PATCH v2 1/3] avfilter/avfilter: Don't use AVFrame.channel_layout

2022-09-12 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavfilter/avfilter.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 965f5d0f63..bde41637dd 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -21,6 +21

[FFmpeg-devel] [PATCHv5 0/18] RISC-V cycle counters, Zbb & initial V extension support

2022-09-12 Thread Rémi Denis-Courmont
The following changes since commit 3ce6fa6b6d099dcad43bb0178334441ab72df4cc: avformat: add bonk demuxer (2022-09-12 11:35:43 +0200) are available in the Git repository at: git.remlab.net:git/ffmpeg.git rvv for you to fetch changes up to ceb5ead12aba107292a09a342570f6fd12c9951d: lavu/risc

[FFmpeg-devel] [PATCH 15/18] lavu/riscv: float reversed vector multiplication with RVV

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- libavutil/riscv/float_dsp_init.c | 3 +++ libavutil/riscv/float_dsp_rvv.S | 22 ++ 2 files changed, 25 insertions(+) diff --git a/libavutil/riscv/float_dsp_init.c b/libavutil/riscv/float_dsp_init.c index c2b72c3b25..ae089d2fdb 100644 --- a/lib

[FFmpeg-devel] [PATCH 14/18] lavu/riscv: float vector sum-and-difference with RVV

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- libavutil/riscv/float_dsp_init.c | 2 ++ libavutil/riscv/float_dsp_rvv.S | 18 ++ 2 files changed, 20 insertions(+) diff --git a/libavutil/riscv/float_dsp_init.c b/libavutil/riscv/float_dsp_init.c index 9bc1976d04..c2b72c3b25 100644 --- a/libavuti

[FFmpeg-devel] [PATCH 16/18] lavu/riscv: float vector windowed overlap/add with RVV

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- libavutil/riscv/float_dsp_init.c | 3 +++ libavutil/riscv/float_dsp_rvv.S | 35 2 files changed, 38 insertions(+) diff --git a/libavutil/riscv/float_dsp_init.c b/libavutil/riscv/float_dsp_init.c index ae089d2fdb..cf8c995d7c 100644

[FFmpeg-devel] [PATCH 13/18] lavu/riscv: float vector multiplication-addition with RVV

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- libavutil/riscv/float_dsp_init.c | 3 +++ libavutil/riscv/float_dsp_rvv.S | 19 +++ 2 files changed, 22 insertions(+) diff --git a/libavutil/riscv/float_dsp_init.c b/libavutil/riscv/float_dsp_init.c index 1381eadab6..9bc1976d04 100644 --- a/libavu

[FFmpeg-devel] [PATCH 17/18] lavu/riscv: float vector dot product with RVV

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- libavutil/riscv/float_dsp_init.c | 2 ++ libavutil/riscv/float_dsp_rvv.S | 21 + 2 files changed, 23 insertions(+) diff --git a/libavutil/riscv/float_dsp_init.c b/libavutil/riscv/float_dsp_init.c index cf8c995d7c..055cdc7520 100644 --- a/libav

[FFmpeg-devel] [PATCH 18/18] lavu/riscv: fixed vector sum-and-difference with RVV

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- libavutil/fixed_dsp.c| 4 +++- libavutil/fixed_dsp.h| 1 + libavutil/riscv/Makefile | 4 +++- libavutil/riscv/fixed_dsp_init.c | 36 ++ libavutil/riscv/fixed_dsp_rvv.S | 38 +

[FFmpeg-devel] [PATCH 12/18] lavu/riscv: float vector multiply-accumulate with RVV

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- libavutil/riscv/float_dsp_init.c | 6 + libavutil/riscv/float_dsp_rvv.S | 38 2 files changed, 44 insertions(+) diff --git a/libavutil/riscv/float_dsp_init.c b/libavutil/riscv/float_dsp_init.c index 903da4eeda..1381eadab6 1006

[FFmpeg-devel] [PATCH 10/18] lavu/riscv: float vector-scalar multiplication with RVV

2022-09-12 Thread remi
From: Rémi Denis-Courmont This is based on existing code from the VLC git tree with two minor changes to account for the different function prototypes. --- libavutil/float_dsp.c| 2 ++ libavutil/float_dsp.h| 1 + libavutil/riscv/Makefile | 4 ++- libavutil/risc

[FFmpeg-devel] [PATCH 11/18] lavu/riscv: float vector-vector multiplication with RVV

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- libavutil/riscv/float_dsp_init.c | 9 - libavutil/riscv/float_dsp_rvv.S | 34 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/libavutil/riscv/float_dsp_init.c b/libavutil/riscv/float_dsp_init.c index f1d3d528

[FFmpeg-devel] [PATCH 08/18] lavu/riscv: add CPU flags for the RISC-V Vector extension

2022-09-12 Thread remi
From: Rémi Denis-Courmont RVV defines a total of 12 different extensions, including: - 5 different instruction subsets: - Zve32x: 8-, 16- and 32-bit integers, - Zve32f: Zve32x plus single precision floats, - Zve64x: Zve32x plus 64-bit integers, - Zve64f: Zve32f plus Zve64x, - Zve64d: Z

[FFmpeg-devel] [PATCH 09/18] checkasm: register the RISC-V V subsets

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- tests/checkasm/checkasm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index e56fd3850e..a5d0503811 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -226,6 +226,11 @@ static c

[FFmpeg-devel] [PATCH 06/18] configure: probe RISC-V Vector extension

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- Makefile | 2 +- configure| 15 +++ ffbuild/arch.mak | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 61f79e27ae..1fb742f390 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ ffbuild/

[FFmpeg-devel] [PATCH 07/18] lavu/riscv: initial common header for assembler macros

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- libavutil/riscv/asm.S | 74 +++ 1 file changed, 74 insertions(+) create mode 100644 libavutil/riscv/asm.S diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S new file mode 100644 index 00..7623c161cf --- /dev/

[FFmpeg-devel] [PATCH 05/18] lavu/riscv: add optimisations

2022-09-12 Thread remi
From: Rémi Denis-Courmont This provides some micro-optimisations for signed integer clipping, and support for bit weight with the Zbb extension. --- libavutil/intmath.h | 5 +- libavutil/riscv/intmath.h | 103 ++ 2 files changed, 106 insertions(+), 2 d

[FFmpeg-devel] [PATCH 04/18] lavu/riscv: byte-swap operations

2022-09-12 Thread remi
From: Rémi Denis-Courmont If the target supports the Basic bit-manipulation (Zbb) extension, then the REV8 instruction is available to reverse byte order. Note that this instruction only exists at the "XLEN" register size, so we need to right shift the result down to the data width. If Zbb is n

[FFmpeg-devel] [PATCH 03/18] configure/riscv: detect fast CLZ

2022-09-12 Thread remi
From: Rémi Denis-Courmont RISC-V defines the CLZ instruction as part of the ratified Zbb subset of the (not yet ratified) bit mapulation extension (B). We can detect it from the __riscv_zbb predefined constant. At least GCC 12 already supports this correctly. Note that the macro will be non-zero

[FFmpeg-devel] [PATCH 02/18] lavu/riscv: AV_READ_TIME cycle counter

2022-09-12 Thread remi
From: Rémi Denis-Courmont This uses the architected RISC-V 64-bit cycle counter from the RISC-V unprivileged instruction set. In 64-bit and 128-bit, this is a straightforward CSR read. In 32-bit mode, the 64-bit value is exposed as two CSRs, which cannot be read atomically, so a loop is necessar

[FFmpeg-devel] [PATCH 01/18] doc: reference the RISC-V specification

2022-09-12 Thread remi
From: Rémi Denis-Courmont --- doc/optimization.txt | 5 + 1 file changed, 5 insertions(+) diff --git a/doc/optimization.txt b/doc/optimization.txt index 974e2f9af2..3ed29fe38c 100644 --- a/doc/optimization.txt +++ b/doc/optimization.txt @@ -267,6 +267,11 @@ CELL/SPU: http://www-01.ibm.com

[FFmpeg-devel] [PATCH] avutil/x86/float_dsp: add fma3 for scalarproduct

2022-09-12 Thread Paul B Mahol
Patch attached. From f7c47b8eefa1c06a74d17f13b4e9010785dc6430 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 20 Jan 2021 16:58:31 +0100 Subject: [PATCH] avutil/x86/float_dsp: add fma3 for scalarproduct Signed-off-by: Paul B Mahol --- libavutil/x86/float_dsp.asm| 127

[FFmpeg-devel] [PATCH] avcodec/x86/Makefile: Don't build empty files

2022-09-12 Thread Andreas Rheinhardt
Should fix ticket #9909, fixing a regression since bfb28b5ce89f3e950214b67ea95b45e3355c2caf. Thanks to Carl Eugen Hoyos for analyzing the issue. Signed-off-by: Andreas Rheinhardt --- This would be my solution. What do you think of it? libavcodec/x86/Makefile | 7 +-- 1 file changed, 5 inse

[FFmpeg-devel] [PATCH] avformat/bonk: Don't set data_offset to what it would be set to anyway

2022-09-12 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavformat/bonk.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/bonk.c b/libavformat/bonk.c index fc400979b3..0fff0b5bda 100644 --- a/libavformat/bonk.c +++ b/libavformat/bonk.c @@ -79,7 +79,6 @@ static int bonk_read_header(AVFormatContext *

Re: [FFmpeg-devel] [PATCH 1/2] fate/id3v2: Add test for reading and writing UTF-16 BOM tags

2022-09-12 Thread Andreas Rheinhardt
Andreas Rheinhardt: > Signed-off-by: Andreas Rheinhardt > --- > tests/fate/id3v2.mak | 5 > tests/ref/fate/id3v2-utf16-bom | 42 ++ > 2 files changed, 47 insertions(+) > create mode 100644 tests/ref/fate/id3v2-utf16-bom > > diff --git a/tests/fate

Re: [FFmpeg-devel] [PATCH] Bonk, Bonk

2022-09-12 Thread Martijn van Beurden
Op wo 7 sep. 2022 om 19:59 schreef Paul B Mahol : > Patches attached. > > Could decoder be made faster? > > Haven't reviewed, but great to have another codec added. Concerning the speed, as far as I know Bonk is slow to decode. Its website states that it is slow: http://www.logarithmic.net/pfh/bon

[FFmpeg-devel] [PATCH] fftools/opt_common: check the return value of av_hwdevice_get_type_name before printing it

2022-09-12 Thread James Almer
It may be NULL, as is the case for D3D11VA_VLD. Running "ffmpeg -h decoder=h264" on a Windows build Before: Decoder h264 [H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10]: Supported hardware devices: dxva2 (null) d3d11va cuda After: Decoder h264 [H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10]: Sup

Re: [FFmpeg-devel] [PATCH] avcodec/bonk: Actually clip when using av_clip()

2022-09-12 Thread James Almer
On 9/12/2022 9:20 AM, Andreas Rheinhardt wrote: Also fixes a "statement with no effect [-Wunused-value]" warning from GCC. Signed-off-by: Andreas Rheinhardt --- libavcodec/bonk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c index f

[FFmpeg-devel] [PATCH] avcodec/bonk: Actually clip when using av_clip()

2022-09-12 Thread Andreas Rheinhardt
Also fixes a "statement with no effect [-Wunused-value]" warning from GCC. Signed-off-by: Andreas Rheinhardt --- libavcodec/bonk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c index f3d797d588..409694f710 100644 --- a/libavcodec/bonk.c

Re: [FFmpeg-devel] [PATCH v2] avcodec/arm/sbcenc: avoid callee preserved vfp registers

2022-09-12 Thread Martin Storsjö
On Sun, 25 Aug 2019, James Cowgill wrote: When compiling FFmpeg with GCC-9, some very random segfaults were observed in code which had previously called down into the SBC encoder NEON assembly routines. This was caused by these functions clobbering some of the vfp callee saved registers (d8 - d1

Re: [FFmpeg-devel] [PATCH] avformat: add Limitless Audio Format demuxer

2022-09-12 Thread Andreas Rheinhardt
Paul B Mahol: > +static int laf_read_header(AVFormatContext *ctx) > +{ > +LAFContext *s = ctx->priv_data; > +AVIOContext *pb = ctx->pb; > +unsigned st_count, mode; > +unsigned sample_rate; > +int64_t duration; > +int codec_id; > +int quality; > +int bpp; > + > +a

[FFmpeg-devel] [PATCH] avformat: add Limitless Audio Format demuxer

2022-09-12 Thread Paul B Mahol
Patch attached. From d867b825507b5f38a051dd0ccf4612b7570a2088 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 11 Sep 2022 20:10:27 +0200 Subject: [PATCH] avformat: add LAF demuxer Signed-off-by: Paul B Mahol --- libavformat/Makefile | 1 + libavformat/allformats.c | 1 + libavfor