[FFmpeg-devel] [PATCH V2 1/4] dnn: add DCO_RGB color order to enum DNNColorOrder

2021-05-06 Thread Ting Fu
Adding DCO_RGB color order to DNNColorOrder, since tensorflow model needs this kind of color oder as input. Signed-off-by: Ting Fu --- V2: Rebase patch to latest code libavfilter/dnn/dnn_backend_tf.c | 1 + libavfilter/dnn/dnn_io_proc.c| 14 +++--- libavfilter/dnn_interface.h

[FFmpeg-devel] [PATCH V2 2/4] lavfi/dnn_backend_tensorflow: add multiple outputs support

2021-05-06 Thread Ting Fu
Signed-off-by: Ting Fu --- libavfilter/dnn/dnn_backend_tf.c | 49 ++--- libavfilter/dnn_filter_common.c | 53 ++-- libavfilter/dnn_filter_common.h | 6 ++-- libavfilter/vf_derain.c | 2 +- libavfilter/vf_sr.c | 2 +- 5

[FFmpeg-devel] [PATCH V2 3/4] lavfi/dnn_backend_tensorflow: support detect model

2021-05-06 Thread Ting Fu
Signed-off-by: Ting Fu --- libavfilter/dnn/dnn_backend_tf.c | 39 ++-- libavfilter/vf_dnn_detect.c | 32 +- 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/libavfilter/dnn/dnn_backend_tf.c b/libavfilter/dnn/dnn_backend_tf.c

[FFmpeg-devel] [PATCH V2 4/4] dnn/vf_dnn_detect: add tensorflow output parse support

2021-05-06 Thread Ting Fu
Testing model is tensorflow offical model in github repo, please refer https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf1_detection_zoo.md to download the detect model as you need. For example, local testing was carried on with 'ssd_mobilenet_v2_coco_2018_03_29.ta

Re: [FFmpeg-devel] [PATCH V4] [mips] Optimize H264 decoding for MIPS platform.

2021-05-06 Thread 殷时友
> 2021年4月12日 下午11:37,Shiyou Yin 写道: > > v2: Fixed a build error in [PATCH 2/5]. > v3: add patch 4/5. > v4: Fix bug in 2/5 caused by instruction 'lhu' on BIGENDIAN environment. > > [PATCH v4 1/5] avcodec/mips: Restore the initialization sequence of > [PATCH v4 2/5] avcodec/mips: Refine get_cabac

Re: [FFmpeg-devel] [PATCH] avformat/utils: constrain the guaranteed lifetime of the pointer returned by avformat_index_get_entry()

2021-05-06 Thread James Almer
On 4/8/2021 2:21 PM, James Almer wrote: This will give us more room to improve the implementation later. Suggested-by: Anton Khirnov Signed-off-by: James Almer --- libavformat/avformat.h | 12 ++-- libavformat/utils.c| 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-)

Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: fix -t inaccurate recording time

2021-05-06 Thread Shiwang Xie
Have tested several cases, will push after tomorrow if without objection, thanks. On Thu, 29 Apr 2021, Shiwang.Xie wrote: if input start time is not 0 -t is inaccurate doing stream copy, will record extra duration according to input start time. it should base on following cases: input video s

Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: fix -t inaccurate recording time

2021-05-06 Thread Gyan Doshi
On 2021-05-06 20:00, Shiwang Xie wrote: Have tested several cases, will push after tomorrow if without objection, thanks. Resend the patch inlined or attached with text/x-diff or text/x-patch mime type so that patchwork picks it up and runs fate on it. Regards, Gyan On Thu, 29 Apr 2021,

[FFmpeg-devel] [PATCH 2/2] GSoC: Add guided filter

2021-05-06 Thread Xuewei Meng
This version can be executed by thread in slice level. To-Do-List: 1. Fast guided filter 2. Improve the derain/dehaze/denoise performance of guided filter Signed-off-by: Xuewei Meng <928826...@qq.com> --- doc/filters.texi | 21 +++ libavfilter/Makefile | 1 + libavfilter/allfilt

[FFmpeg-devel] [PATCH] fftools/ffmpeg: fix -t inaccurate recording time

2021-05-06 Thread Shiwang.Xie
if input start time is not 0 -t is inaccurate doing stream copy, will record extra duration according to input start time. it should base on following cases: input video start time from 60s, duration is 300s, 1. stream copy: ffmpeg -ss 40 -t 60 -i in.mp4 -c copy -y out.mp4 open_input_fi

[FFmpeg-devel] [PATCHv2] fate/integer.c: Connect test to fuzzer

2021-05-06 Thread Vedaa
Hi, I have made the requisite changes. --- Makefile | 2 ++ libavutil/tests/integer.c | 21 ++- libavutil/tests/integer.h | 43 +++ tools/Makefile| 3 +++ tools/target_int_fuzzer.c | 35 +++

Re: [FFmpeg-devel] [PATCH 1/5] avformat: move AVStream.last-IP_{pts, duration} to AVStreamInternal

2021-05-06 Thread James Almer
On 5/3/2021 10:31 AM, James Almer wrote: Those are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer --- libavformat/avformat.h | 2 -- libavformat/internal.h | 3 +++ libavformat/nutdec.c | 2 +- libavformat/utils.c| 20 ++--

Re: [FFmpeg-devel] [PATCH 3/5 v2] avformat: move AVStream.{parser, need_parsing} to AVStreamInternal

2021-05-06 Thread Andreas Rheinhardt
James Almer: > Those are private fields, no reason to have them exposed in a public > header. > > Signed-off-by: James Almer > --- > Now also porting the v4l2 outdev, which unfortunately requires an accessor. > If anyone with a v4l2 capable machine wants to check if not setting > need_parsing at

Re: [FFmpeg-devel] [PATCH 3/5 v2] avformat: move AVStream.{parser, need_parsing} to AVStreamInternal

2021-05-06 Thread James Almer
On 5/6/2021 3:31 PM, Andreas Rheinhardt wrote: James Almer: Those are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer --- Now also porting the v4l2 outdev, which unfortunately requires an accessor. If anyone with a v4l2 capable machine wants to che

Re: [FFmpeg-devel] [PATCH] ffmpeg: return no chosen output if an uninitialized stream is unavailable

2021-05-06 Thread Jan Ekström
On Fri, May 7, 2021 at 12:22 AM Jan Ekström wrote: > > Otherwise the rate emulation logic in `transcode_step` never gets > hit, and the unavailability flag never gets reset, leading to an > eternal loop. > > Fixes #9160 Sent this out as one way of dealing with this and to receive comments. Altern

[FFmpeg-devel] [PATCH] ffmpeg: return no chosen output if an uninitialized stream is unavailable

2021-05-06 Thread Jan Ekström
Otherwise the rate emulation logic in `transcode_step` never gets hit, and the unavailability flag never gets reset, leading to an eternal loop. Fixes #9160 --- fftools/ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 3ad11452d

[FFmpeg-devel] [PATCH 1/2] avformat: add data_size for ff_hex_to_data()

2021-05-06 Thread lance . lmwang
From: Limin Wang This prevents OOM in case of data buffer size is insufficient. Signed-off-by: Limin Wang --- libavfilter/dnn/dnn_backend_tf.c | 4 ++-- libavformat/hls.c| 2 +- libavformat/internal.h | 6 -- libavformat/rtpdec_latm.c| 4 ++-- libavformat/

Re: [FFmpeg-devel] [PATCH 1/2] avformat: add data_size for ff_hex_to_data()

2021-05-06 Thread James Almer
On 5/6/2021 10:23 PM, lance.lmw...@gmail.com wrote: From: Limin Wang This prevents OOM in case of data buffer size is insufficient. Signed-off-by: Limin Wang --- libavfilter/dnn/dnn_backend_tf.c | 4 ++-- libavformat/hls.c| 2 +- libavformat/internal.h | 6 --

Re: [FFmpeg-devel] [PATCH 5/6] avfilter/dnn/dnn_backend_tf: simplify the code with ff_hex_to_data

2021-05-06 Thread James Almer
On 4/26/2021 7:48 AM, lance.lmw...@gmail.com wrote: From: Limin Wang please use tools/python/tf_sess_config.py to get the sess_config after that. note the byte order of session config is the normal order. Signed-off-by: Limin Wang --- libavfilter/dnn/dnn_backend_tf.c | 34 ++

[FFmpeg-devel] [PATCH 2/2] avformat/hls: use av_strncasecmp()

2021-05-06 Thread lance . lmwang
From: Limin Wang Signed-off-by: Limin Wang --- libavformat/hls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index c7f9f06..9610b83 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -799,7 +799,7 @@ static int parse_playlist(

Re: [FFmpeg-devel] [PATCH 1/2] avformat: add data_size for ff_hex_to_data()

2021-05-06 Thread lance . lmwang
On Thu, May 06, 2021 at 10:25:47PM -0300, James Almer wrote: > On 5/6/2021 10:23 PM, lance.lmw...@gmail.com wrote: > > From: Limin Wang > > > > This prevents OOM in case of data buffer size is insufficient. > > > > Signed-off-by: Limin Wang > > --- > > libavfilter/dnn/dnn_backend_tf.c | 4 ++-

[FFmpeg-devel] [PATCH 1/2] avcodec/ttmlenc: Don't confuse capabilities and caps_internal

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/ttmlenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ttmlenc.c b/libavcodec/ttmlenc.c index 09f2657cd6..e274a92e04 100644 --- a/libavcodec/ttmlenc.c +++ b/libavcodec/ttmlenc.c @@ -392,5 +392,5 @@ const AVCodec ff

[FFmpeg-devel] [PATCH 2/2] avcodec/ttmlenc: Mark encoder as init-threadsafe

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- This of course supersedes https://ffmpeg.org/pipermail/ffmpeg-devel/2021-May/279974.html libavcodec/ttmlenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ttmlenc.c b/libavcodec/ttmlenc.c index e274a92e04..5cab33cc60 100644

Re: [FFmpeg-devel] [PATCH 2/2] avformat/hls: use av_strncasecmp()

2021-05-06 Thread Steven Liu
> 2021年5月7日 上午9:23,lance.lmw...@gmail.com 写道: > > From: Limin Wang > > Signed-off-by: Limin Wang > --- > libavformat/hls.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/hls.c b/libavformat/hls.c > index c7f9f06..9610b83 100644 > --- a/libavformat/hls.c >

[FFmpeg-devel] [PATCH 01/20] avcodec/wma: Remove nonsense volatile

2021-05-06 Thread Andreas Rheinhardt
The address of this variable never leaks, so it cannot be modified by anyone else at all. Signed-off-by: Andreas Rheinhardt --- libavcodec/wma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/wma.c b/libavcodec/wma.c index cfa5fa3355..ee04ef725f 100644 --- a/libav

[FFmpeg-devel] [PATCH] avfilter/vf_dnn_classify: add result check for av_frame_get_side_data

2021-05-06 Thread Steven Liu
CID: 1482090 there can return null from av_frame_get_side_data, and will use sd->data after av_frame_get_side_data, so should check null return value. Signed-off-by: Steven Liu --- libavfilter/vf_dnn_classify.c | 4 1 file changed, 4 insertions(+) diff --git a/libavfilter/vf_dnn_classify.c

[FFmpeg-devel] [PATCH 02/20] avcodec/wma(dec|enc): Fix memleaks upon allocation error

2021-05-06 Thread Andreas Rheinhardt
ff_wma_init() can fail without freeing everything it has allocated; so add the FF_CODEC_CAP_INIT_CLEANUP to the codecs using it. Signed-off-by: Andreas Rheinhardt --- libavcodec/wmadec.c | 2 ++ libavcodec/wmaenc.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libavcodec/wmadec.c b/liba

[FFmpeg-devel] [PATCH 03/20] avcodec/wma: Check initializing VLC

2021-05-06 Thread Andreas Rheinhardt
Initializing a VLC entails implicit allocations which may fail. Signed-off-by: Andreas Rheinhardt --- libavcodec/wma.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/wma.c b/libavcodec/wma.c index ee04ef725f..004ffb5515 100644 --- a/libavcodec/wma.c +++ b/li

[FFmpeg-devel] [PATCH 04/20] avcodec/wmadec: Forward error instead of return -1

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/wmadec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index b63ce66b23..6eec85e59a 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -70,7 +70,7 @@ static void dump_

[FFmpeg-devel] [PATCH 05/20] avcodec/wmadec: Check operations that can fail

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/wmadec.c | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 6eec85e59a..47abcecc9c 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -106

[FFmpeg-devel] [PATCH 11/20] avcodec/vorbisenc: Combine codebooks, avoid relocations

2021-05-06 Thread Andreas Rheinhardt
The Vorbis encoder has an array of a structure containing all the ingredients for a codebook; this includes a pointer to the actual codebook and some even have a pointer to an array containing quant values. Each of these real codebooks is an array of its own. These pointers lead to relocations and

[FFmpeg-devel] [PATCH 12/20] avcodec/mqc: Hardcode tables to save space

2021-05-06 Thread Andreas Rheinhardt
mqc currently initializes three arrays at runtime; each of them has 2 * 47 elements, one is uint16_t, two are uint8_t, so that their combined size is 8 * 47. The source data for these initializations is contained in an array of 47 elements of size six. Said array is only used in order to initialize

[FFmpeg-devel] [PATCH 08/20] avcodec/wmaenc: Mark encoders as init-threadsafe

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/wmaenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c index 3035668487..cf42aeaca0 100644 --- a/libavcodec/wmaenc.c +++ b/libavcodec/wmaenc.c @@ -439,7 +439,7 @@ const AVCodec ff_

[FFmpeg-devel] [PATCH 07/20] avcodec/wmaenc: Check operations that can fail

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/wmaenc.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c index 2a78325298..3035668487 100644 --- a/libavcodec/wmaenc.c +++ b/libavcodec/wmaenc.c @@ -88,8 +88,11 @@ static av_cold

[FFmpeg-devel] [PATCH 09/20] avcodec/vorbisenc: Don't free uninitialized pointers

2021-05-06 Thread Andreas Rheinhardt
The Vorbis encoder allocates several arrays destined to contain pointers to separately allocated arrays; yet these arrays are allocated without initializing them: They are only uninitialized until their final values are stored in them; so if allocating one of the earlier subarrays fails, all of the

[FFmpeg-devel] [PATCH 13/20] avcodec/jpeg2000dec: Make decoder init-threadsafe

2021-05-06 Thread Andreas Rheinhardt
The JPEG-2000 decoder and encoder share common luts; the decoder initializes them once, guarded by a dedicated AVOnce, whereas the encoder initializes them always during init. This means that the decoder is not init-threadsafe; in fact there is a potential data race because these luts can be initia

[FFmpeg-devel] [PATCH 14/20] avcodec/j2kenc: Make encoder init-threadsafe

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/j2kenc.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c index 17eb959d73..82ad3284b5 100644 --- a/libavcodec/j2kenc.c +++ b/libavcodec/j2kenc.c @@ -74,6 +74,7 @@ #include "liba

[FFmpeg-devel] [PATCH 06/20] avcodec/wmadec: Mark decoders as init-threadsafe

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/wmadec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 47abcecc9c..d627bbe50e 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -988,7 +988,7 @@ const AVCodec ff_

[FFmpeg-devel] [PATCH 10/20] avcodec/vorbisenc: Mark encoder as init-threadsafe

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/vorbisenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c index dc54919f64..5c10e49b3f 100644 --- a/libavcodec/vorbisenc.c +++ b/libavcodec/vorbisenc.c @@ -1303,4 +1303,5 @@ const AVCodec ff_vor

[FFmpeg-devel] [PATCH 15/20] avcodec/webp: Mark decoder as init-threadsafe

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/webp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/webp.c b/libavcodec/webp.c index 23558309c6..83371ef6fd 100644 --- a/libavcodec/webp.c +++ b/libavcodec/webp.c @@ -1560,4 +1560,5 @@ const AVCodec ff_webp_decoder = { .decod

[FFmpeg-devel] [PATCH 16/20] avcodec/nuv: Mark decoder as init-threadsafe

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/nuv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 3ba12fd8e6..089ce68338 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -372,5 +372,5 @@ const AVCodec ff_nuv_decoder = {

[FFmpeg-devel] [PATCH 17/20] avcodec/twinvqdec: Mark decoder as init-threadsafe

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/twinvqdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/twinvqdec.c b/libavcodec/twinvqdec.c index b972facfdd..1fbe0bc32e 100644 --- a/libavcodec/twinvqdec.c +++ b/libavcodec/twinvqdec.c @@ -426,4 +426,5 @@ const AVCodec ff_twinv

[FFmpeg-devel] [PATCH 18/20] avcodec/metasound: Mark decoder as init-threadsafe

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/metasound.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/metasound.c b/libavcodec/metasound.c index be47510d7a..57851a43c5 100644 --- a/libavcodec/metasound.c +++ b/libavcodec/metasound.c @@ -382,4 +382,5 @@ const AVCodec ff_metas

[FFmpeg-devel] [PATCH 19/20] avcodec/dvdsubdec: Remove unnecessary close function

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/dvdsubdec.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index b0127951c5..e164745561 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -739,12 +739,6 @@ static void dvd

[FFmpeg-devel] [PATCH 20/20] avcodec/dvdsubdec: Mark decoder as init-threadsafe

2021-05-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/dvdsubdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index e164745561..52259f0730 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -764,4 +764,5 @@ const AVCodec ff_dvdsu