Re: [FFmpeg-devel] [PATCH v2 1/1] lavc/qsvdec: fix dead loop of qsv decoding

2023-09-14 Thread sirius hu
Ok, I will file a bug ASAP. Best regards Sirius 发件人: ffmpeg-devel 代表 Xiang, Haihao 发送时间: Thursday, September 14, 2023 2:11:52 PM 收件人: an...@khirnov.net ; ffmpeg-devel@ffmpeg.org 主题: Re: [FFmpeg-devel] [PATCH v2 1/1] lavc/qsvdec: fix dead loop of qsv decoding

Re: [FFmpeg-devel] [PATCH] vulkan_hevc: switch from a buffer pool to a simple malloc

2023-09-14 Thread Lynne
Sep 15, 2023, 03:00 by andreas.rheinha...@outlook.com: > Lynne: > >> -static int get_data_set_buf(FFVulkanDecodeContext *s, AVBufferRef >> **data_buf, >> -int nb_vps, AVBufferRef * const >> vps_list[HEVC_MAX_VPS_COUNT]) >> +static int alloc_hevc_header_structs(FFVulka

Re: [FFmpeg-devel] [PATCH] vulkan_hevc: switch from a buffer pool to a simple malloc

2023-09-14 Thread Andreas Rheinhardt
Lynne: > -static int get_data_set_buf(FFVulkanDecodeContext *s, AVBufferRef **data_buf, > -int nb_vps, AVBufferRef * const > vps_list[HEVC_MAX_VPS_COUNT]) > +static int alloc_hevc_header_structs(FFVulkanDecodeContext *s, > + int nb_vp

[FFmpeg-devel] [PATCH] vulkan_decode: don't call get_proc_addr on every frame's destruction

2023-09-14 Thread Lynne
The issue is that we cannot rely on any context existing when we free frames, due to threading. The Vulkan functions are loaded in each context separately, so until now, we've just been loading them on every frame's destruction. Rather than do this, just save the function pointers we need in each

Re: [FFmpeg-devel] [PATCH 5/5] avcodec/vulkan_decode: Factor creating session params out, fix leak

2023-09-14 Thread Lynne
Sep 15, 2023, 01:45 by andreas.rheinha...@outlook.com: > All Vulkan HWAccels share the same boilerplate code for creating > session params and this includes a common bug: In case actually > creating the video session parameters fails, the buffer destined > to hold them leaks; in case of HEVC this

[FFmpeg-devel] [PATCH] vulkan_hevc: switch from a buffer pool to a simple malloc

2023-09-14 Thread Lynne
Simpler and more robust now that contexts are not shared between threads. Patch attached. >From f476162c2b0b165f5cb23398bf6b989b4503daee Mon Sep 17 00:00:00 2001 From: Lynne Date: Fri, 15 Sep 2023 01:51:49 +0200 Subject: [PATCH] vulkan_hevc: switch from a buffer pool to a simple malloc Simpler

[FFmpeg-devel] [PATCH 5/5] avcodec/vulkan_decode: Factor creating session params out, fix leak

2023-09-14 Thread Andreas Rheinhardt
All Vulkan HWAccels share the same boilerplate code for creating session params and this includes a common bug: In case actually creating the video session parameters fails, the buffer destined to hold them leaks; in case of HEVC this is also true if get_data_set_buf() fails. This commit factors t

[FFmpeg-devel] [PATCH 4/5] avutil/hwcontext_vulkan: Cosmetics

2023-09-14 Thread Andreas Rheinhardt
The alignment in vulkan_unmap_from_drm() (formerly the clone of vulkan_frame_free()) is nicer than the in vulkan_frame_free(), let's preserve it. Signed-off-by: Andreas Rheinhardt --- libavutil/hwcontext_vulkan.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavuti

[FFmpeg-devel] [PATCH 3/5] avutil/hwcontext_vulkan: Deduplicate code

2023-09-14 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavutil/hwcontext_vulkan.c | 26 +- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index d1c2d69b7b..0c846fde38 100644 --- a/libavutil/hwcontext_vulkan.c +++

[FFmpeg-devel] [PATCH 2/5] avutil/hwcontext_vulkan: Improve type-safety

2023-09-14 Thread Andreas Rheinhardt
The AVBuffer API uses uint8_t as base type for buffers and therefore its free callbacks need to abide by this. Therefore vulkan_frame_free() used an inappropriate signature which caused casts whenever this function has been called manually. This commit changes this by making vulkan_frame_free() us

[FFmpeg-devel] [PATCH 1/5] avutil/hwcontext_vulkan: Remove redundant resetting

2023-09-14 Thread Andreas Rheinhardt
vulkan_free_internal() already resets the AVVkFrame.internal pointer. Signed-off-by: Andreas Rheinhardt --- 1. I find it odd that the frame's internal is freed without the frame itself being freed; vulkan_frame_free() expects the internal to be present and seems to NPD if not. (Actually, I was a

Re: [FFmpeg-devel] [FFmpeg-cvslog] avcodec/utvideodec: add vlc multi support

2023-09-14 Thread Paul B Mahol
On Fri, Sep 15, 2023 at 12:19 AM Michael Niedermayer wrote: > On Wed, Sep 06, 2023 at 10:19:29PM +, Christophe Gisquet wrote: > > ffmpeg | branch: master | Christophe Gisquet < > christophe.gisq...@gmail.com> | Sun Jul 9 12:56:35 2017 +| > [da888b790af779a7489068c25f9e7ab8ac653d41] | com

Re: [FFmpeg-devel] [FFmpeg-cvslog] avcodec/utvideodec: add vlc multi support

2023-09-14 Thread Michael Niedermayer
On Wed, Sep 06, 2023 at 10:19:29PM +, Christophe Gisquet wrote: > ffmpeg | branch: master | Christophe Gisquet | > Sun Jul 9 12:56:35 2017 +| [da888b790af779a7489068c25f9e7ab8ac653d41] | > committer: Paul B Mahol > > avcodec/utvideodec: add vlc multi support > > Faster decoding, by av

Re: [FFmpeg-devel] [PATCH] MULTI VLC decoding boost

2023-09-14 Thread Paul B Mahol
On Fri, Sep 15, 2023 at 12:01 AM Michael Niedermayer wrote: > On Mon, Aug 28, 2023 at 07:36:17PM +0200, Paul B Mahol wrote: > > Patches attached. > > > > Thanks for kurosu for pointing unmerged branches. > > > > The UNCACHED_PATH for x86_32 is broken with this for 2 codecs it touches. > > Fix is

Re: [FFmpeg-devel] [PATCH] MULTI VLC decoding boost

2023-09-14 Thread Michael Niedermayer
On Mon, Aug 28, 2023 at 07:36:17PM +0200, Paul B Mahol wrote: > Patches attached. > > Thanks for kurosu for pointing unmerged branches. > > The UNCACHED_PATH for x86_32 is broken with this for 2 codecs it touches. > Fix is trivial, to be fixed later. [...] > +int ff_init_vlc_multi_from_lengths(V

Re: [FFmpeg-devel] [PATCH] avcodec/bonk: Fix integer overflow in predictor_calc_error()

2023-09-14 Thread Michael Niedermayer
On Mon, Sep 04, 2023 at 09:06:35PM +0200, Michael Niedermayer wrote: > Fixes: signed integer overflow: -2147483300 - 12285 cannot be represented in > type 'int' > Fixes: > 59462/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-5714298807386112 > > Found-by: continuous fuzzing proces

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/huffyuvdec: avoid undefined behavior with get_vlc2() failure

2023-09-14 Thread Michael Niedermayer
On Tue, Jun 20, 2023 at 01:36:40AM +0200, Michael Niedermayer wrote: > On Tue, Jun 20, 2023 at 01:05:45AM +0200, Paul B Mahol wrote: > > Shouldnt it error out instead? > > yes but that would make it slower. Also i think real files (not fuzzeed files) > would use vlc tables that have no "holes" th

Re: [FFmpeg-devel] [PATCH 2/3] avformat/jpegxl_anim_dec: Check that size fits within argument

2023-09-14 Thread Michael Niedermayer
On Sun, Sep 10, 2023 at 03:09:51AM +0200, Michael Niedermayer wrote: > Fixes: out of array access > Fixes: > 61991/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-5524679648215040 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmp

Re: [FFmpeg-devel] [PATCH] avfilter: add libvmaf_cuda

2023-09-14 Thread Timo Rothenpieler
On 14.09.2023 20:59, Kyle Swanson wrote: Problem was slightly different, there is no `libvmaf_cuda`, just `libvmaf` built with the cuda apis optionally enabled. `./configure` is fixed now and I've tested all the possible combinations, updated patch attached. This looks more complicated than nec

Re: [FFmpeg-devel] [PATCH] avfilter: add libvmaf_cuda

2023-09-14 Thread Kyle Swanson
Hi, On Mon, Sep 11, 2023 at 11:51 AM Timo Rothenpieler wrote: > > On 11.09.2023 19:53, Kyle Swanson wrote: > > Hi, > > > > On Tue, Sep 5, 2023 at 10:16 AM Kyle Swanson wrote: > >> I'll merge this in a few days. > > > > Not merged yet because I noticed a bug in the configure script. > > Setting o

Re: [FFmpeg-devel] VDD conference invitation - Dublin 22-24 Sept 2023

2023-09-14 Thread Michael Niedermayer
On Sat, Sep 09, 2023 at 09:23:35PM +0200, Tomas Härdin wrote: > lör 2023-09-09 klockan 15:53 +0200 skrev Michael Niedermayer: > > On Sat, Sep 09, 2023 at 09:04:25AM +0200, Tomas Härdin wrote: > > > fre 2023-09-08 klockan 15:09 +0200 skrev Michael Niedermayer: > > [...] > > > > > > AI based filters

[FFmpeg-devel] [PATCH 5/5] avcodec/pthread_frame: Only set PerThreadContext* when frame-threading

2023-09-14 Thread Andreas Rheinhardt
Otherwise the thread_ctx pointer might be NULL or point to a SliceThreadContext. Signed-off-by: Andreas Rheinhardt --- libavcodec/pthread_frame.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index 4973d6

[FFmpeg-devel] [PATCH 4/5] avcodec/threadframe: Move ff_thread_can_start_frame() to thread.h

2023-09-14 Thread Andreas Rheinhardt
It does not use ThreadFrames at all, so thread.h is the correct place. bcb0faeaba60b5d329fafee2e55f28d3c709e7b1 was wrong. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_dec.c | 1 + libavcodec/thread.h| 2 ++ libavcodec/threadframe.h | 2 -- 3 files changed, 3 insertions(+

[FFmpeg-devel] [PATCH 3/5] avcodec/pthread_frame: Fix doxygen comments

2023-09-14 Thread Andreas Rheinhardt
The '<' in ///< says that the comment pertains to the previous item on the same line as the ///<. Signed-off-by: Andreas Rheinhardt --- libavcodec/pthread_frame.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c ind

[FFmpeg-devel] [PATCH 2/5] avcodec/pthread_frame: Remove unused enum values

2023-09-14 Thread Andreas Rheinhardt
No longer used since the removal of FF_API_THREAD_SAFE_CALLBACKS in e0786a8eeb9e7c8feb057e83f284491f0a87e463. Signed-off-by: Andreas Rheinhardt --- libavcodec/pthread_frame.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c in

Re: [FFmpeg-devel] [PATCH 2/2] libavutil/hwcontect_cuda: add option to use current CUDA context

2023-09-14 Thread Timo Rothenpieler
On 14.09.2023 18:52, Roman Arzumanyan wrote: Got it, thanks. Please find the patches in attachment. Just for my own understanding - could you please explain how this magic works in the configure script? I mean this section: if ! disabled ffnvcodec; then ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h

Re: [FFmpeg-devel] [PATCH 2/2] libavutil/hwcontect_cuda: add option to use current CUDA context

2023-09-14 Thread Roman Arzumanyan
Got it, thanks. Please find the patches in attachment. Just for my own understanding - could you please explain how this magic works in the configure script? I mean this section: if ! disabled ffnvcodec; then ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_c

[FFmpeg-devel] [PATCH 1/5] avcodec/thread: Remove outdated documentation

2023-09-14 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/thread.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libavcodec/thread.h b/libavcodec/thread.h index 2c8c0cdb16..180e1137ae 100644 --- a/libavcodec/thread.h +++ b/libavcodec/thread.h @@ -73,12 +73,7 @@ void ff_thread_f

Re: [FFmpeg-devel] [PATCH 00/10 v4][RFC] AVCodecContext and AVCodecParameters side data

2023-09-14 Thread James Almer
On 9/14/2023 12:43 PM, Anton Khirnov wrote: Quoting James Almer (2023-09-06 19:44:20) Changes since the previous version: - Removed the AVPacketSideDataSet from AVCodecContext, using instead the existing coded_side_data field, at Anton's request. I still prefer using a new field of type AVPa

Re: [FFmpeg-devel] [PATCH 00/10 v4][RFC] AVCodecContext and AVCodecParameters side data

2023-09-14 Thread Anton Khirnov
Quoting James Almer (2023-09-06 19:44:20) > Changes since the previous version: > - Removed the AVPacketSideDataSet from AVCodecContext, using instead the > existing coded_side_data field, at Anton's request. > > I still prefer using a new field of type AVPacketSideDataSet, given that the > user

[FFmpeg-devel] [PATCH 3/3] fftools/ffmpeg: deprecate the -top option

2023-09-14 Thread Anton Khirnov
It is badly named (should have been -top_field_first, or at least -tff), underdocumented and underspecified, and (most importantly) entirely redundant with the setfield filter. --- Changelog | 1 + doc/ffmpeg.texi | 2 -- fftools/ffmpeg.h | 9 +

[FFmpeg-devel] [PATCH 2/3] fftools/ffmpeg_enc: apply -top to individual encoded frames

2023-09-14 Thread Anton Khirnov
Fixes #9339. --- fftools/ffmpeg_enc.c| 5 + tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 | 2 +- tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10 | 2 +- tests/ref/lavf/mxf_d10 | 2 +- 4 files changed, 8 insertions(+), 3 de

[FFmpeg-devel] [PATCH 1/3] fftools/ffmpeg_enc: refactor setting encoding field_order

2023-09-14 Thread Anton Khirnov
Merge three blocks with slightly inconsistent checks into one, treating encoder input as interlaced when either: * at least one of ilme/ildct flags is set * the first frame in the stream is marked as interlaced * the user specified the -top option Stop modifying the frame passed to enc_open(). ---

Re: [FFmpeg-devel] [PATCH 2/2] libavutil/hwcontect_cuda: add option to use current CUDA context

2023-09-14 Thread Anton Khirnov
Quoting Roman Arzumanyan (2023-09-14 09:26:52) > Hello, > > This is the second patch of the group which adds the option to use CUDA > context current to calling thread. It simplifies the usage of ffmpeg > libraries in applications which rely on CUDA runtime API. > > Example: > > AVDictionary *op

Re: [FFmpeg-devel] [PATCH] avcodec/lagarith: use VLC for probe code length

2023-09-14 Thread Paul B Mahol
On Thu, Sep 14, 2023 at 3:34 PM Andreas Rheinhardt < andreas.rheinha...@outlook.com> wrote: > Paul B Mahol: > > +unsigned val, bits; > > + > > +bits = get_vlc2(gb, lag_tab.table, VLC_BITS, 3); > > +if (bits > 31) { > > *value = 0; > > return AVERROR_INVALIDDATA; > > U

Re: [FFmpeg-devel] [PATCH] avcodec/lagarith: use VLC for probe code length

2023-09-14 Thread Andreas Rheinhardt
Paul B Mahol: > +unsigned val, bits; > + > +bits = get_vlc2(gb, lag_tab.table, VLC_BITS, 3); > +if (bits > 31) { > *value = 0; > return AVERROR_INVALIDDATA; Using a signed int and checking for zero is simpler. And the depth of this VLC is 1, not 3. - Andreas ___

Re: [FFmpeg-devel] [PATCH 2/2] libavutil/hwcontect_cuda: add option to use current CUDA context

2023-09-14 Thread Timo Rothenpieler
On 14/09/2023 15:29, Roman Arzumanyan wrote: Thanks for the swift reply Timo, you're right about versioning. However, I didn't find any existing CUDA API versioning macro unlike that for Video Codec SDK API. So I basically did the same thing as that in previous commit to nvcodec-headers which b

Re: [FFmpeg-devel] [PATCH 2/2] libavutil/hwcontect_cuda: add option to use current CUDA context

2023-09-14 Thread Roman Arzumanyan
Thanks for the swift reply Timo, you're right about versioning. However, I didn't find any existing CUDA API versioning macro unlike that for Video Codec SDK API. So I basically did the same thing as that in previous commit to nvcodec-headers which barely adds new function pointer... Anyway, I too

[FFmpeg-devel] framequeue: Remove redundant logic code

2023-09-14 Thread 杨亚磊 via ffmpeg-devel
Hello everyone. I submitted a patch, the details are as follows: framequeue: Remove redundant logic code In this logical branch, fq->queued and fq->allocated must be equal. Deleting this code will make it easier to understand the logic ( copy the data before tail to the ne

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/error_resilience: Make applying decode_error_flags optional

2023-09-14 Thread Andreas Rheinhardt
Andreas Rheinhardt: > Add a pointer parameter that if supplied will be used to return > the updated decode_error_flags. This will allow to fix several > races when using frame-threading; these resulted from AVFrame > that the earlier code updated concurrently being used as source > in an av_frame_r

Re: [FFmpeg-devel] [PATCH] avcodec/x86/mpegvideoenc_template: Disable dead code

2023-09-14 Thread Andreas Rheinhardt
Andreas Rheinhardt: > Since bfb28b5ce89f3e950214b67ea95b45e3355c2caf the permutation > type FF_IDCT_PERM_SIMPLE is ARCH_X86_32-only. So use this > knowledge to disable code for it when not on ARCH_X86_32. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/x86/idctdsp_init.c | 2 ++

Re: [FFmpeg-devel] [PATCH 2/2] libavutil/hwcontect_cuda: add option to use current CUDA context

2023-09-14 Thread Timo Rothenpieler
This will either need updates to the ffnvcodec version checks in configure, to ensure the new symbol always exists, or some kind of more selective check to only build those parts of the code if the new function is present. As it is now, this would fail all current builds. _

[FFmpeg-devel] [PATCH 2/2] libavutil/hwcontect_cuda: add option to use current CUDA context

2023-09-14 Thread Roman Arzumanyan
Hello, This is the second patch of the group which adds the option to use CUDA context current to calling thread. It simplifies the usage of ffmpeg libraries in applications which rely on CUDA runtime API. Example: AVDictionary *opts = NULL; AVBufferRef *hwDeviceCtx; av_dict_set(&opts, "curre

[FFmpeg-devel] [PATCH 1/2] nvcodec-headers: add cuCtxGetCurrent function

2023-09-14 Thread Roman Arzumanyan
Hello, This patch adds cuCtxGetCurrent function to nvcodec-headers repo. Second patch of the group which adds FFmpeg option to use current CUDA context depends on this. 0001-Add-cuCtxGetCurrent-function.patch Description: Binary data ___ ffmpeg-devel m

Re: [FFmpeg-devel] [PATCH v2 1/1] lavc/qsvdec: fix dead loop of qsv decoding

2023-09-14 Thread zhilizhao(赵志立)
> On Sep 14, 2023, at 14:11, Xiang, Haihao > wrote: > > >> This seems like a bug in libmfx/libvpl. > > I agree there should be a bug in libmfx/libvpl, but we have to avoid this dead > loop in FFmpeg. Is it possible that a normal case which do take more than 500ms now break out early and ret