Commit Graph

8660 Commits

Author SHA1 Message Date
Paul B Mahol 0df0e12d02 avfilter/af_aiir: implement parallel processing 2020-10-16 23:07:27 +02:00
Chris Miceli 6bdfea8d4b libavfilter/dnn/dnn_backend{openvino, tf}: check memory alloc non-NULL
These previously would not check that the return value was non-null
meaning it was susceptible to a sigsegv. This checks those values.
2020-10-14 11:08:09 +08:00
Chris Miceli ad95e5e45d libavfilter/dnn_backend_native: check mem allocation
check that frame allocations return non-null.
2020-10-14 10:19:05 +08:00
leozhang b9727870ae avfilter/vf_scale_cuda: unload cuModule on uninit
Signed-off-by: leozhang <nowerzt@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-10-12 21:09:21 +02:00
Paul B Mahol f7fd205f11 avfilter/af_sofalizer: allow up to 64 channels 2020-10-12 12:21:35 +02:00
Paul B Mahol aa125fd06a avfilter/af_sofalizer: allow to specify virtual speakers indetifier as number 2020-10-12 12:21:35 +02:00
James Almer 0c73c2909e avfilter/avfilter.h: add missing FF_API_NEXT wrapper
Signed-off-by: James Almer <jamrial@gmail.com>
2020-10-10 23:58:40 -03:00
Andreas Rheinhardt 358c0bb168 avfilter/vf_minterpolate: Remove redundant code for freeing
ad73b32d29 added some code for freeing in
the input's config_props function, yet this is unnecessary as uninit is
called anyway if config_props fails.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-09 16:38:28 +02:00
Andreas Rheinhardt aa262dcce8 avfilter/vf_minterpolate: Fix left shift of negative value
This has happened when initializing the motion estimation context if
width or height of the video was smaller than the block size used
for motion estimation and if the motion interpolation mode indicates
not to use motion estimation.

The solution is of course to only initialize the motion estimation
context if the interpolation mode uses motion estimation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-09 16:38:28 +02:00
Andreas Rheinhardt bb13cdbe27 avfilter/vf_minterpolate: Reject too small dimensions
The latter code relies upon the dimensions to be not too small;
otherwise one will call av_clip() with min > max lateron which aborts
in case ASSERT_LEVEL is >= 2 or one will get a nonsense result that may
lead to a heap-buffer-overflow/underflow. The latter has happened in
ticket #8248 which this commit fixes.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-09 16:38:28 +02:00
Paul B Mahol a086b73e1f avfilter/vf_v360: use quaternions for rotation
Fixes gimbal lock issues, and round-off errors.
2020-10-07 01:54:05 +02:00
Paul B Mahol 3a035a8cd2 avfilter/vf_v360: fix possible out of range values 2020-10-04 19:23:52 +02:00
Paul B Mahol eaba6cecfb avfilter/vf_v360: add mitchell interpolation 2020-10-04 19:23:52 +02:00
Paul B Mahol 23d0754165 avfilter/vf_v360: stop using floats variables in xyz_to_octahedron
Use proper integer variables.
2020-09-30 00:09:22 +02:00
Mark Thompson 4fceb2634e Revert "avfilter/setparams: add FF_FILTER_FLAG_HWFRAME_AWARE"
This reverts commit 5bbf58ab87.

The setparams filters are not hwframe aware, so the default context
passthrough behaviour is needed to allow using them with hardware frames.
2020-09-29 17:07:43 +01:00
Paul B Mahol 12585c87e6 avfilter/vf_v360: simplify input flipping 2020-09-29 14:21:22 +02:00
Paul B Mahol 86b29c0cd0 avfilter/vf_v360: split maps into slices 2020-09-29 14:21:20 +02:00
Mingyu Yin ad2546e3b3 dnn/native: add native support for dense
Signed-off-by: Mingyu Yin <mingyu.yin@intel.com>
2020-09-29 14:19:55 +08:00
Pavel Koshevoy 5bbf58ab87 avfilter/setparams: add FF_FILTER_FLAG_HWFRAME_AWARE
Allow setparams to be used with hw backed frames and
avoid an assertion failure in avfilter_config_links.
2020-09-27 19:15:44 -06:00
Paul B Mahol 6db1b1af4c avfilter/vf_v360: add octahedron format 2020-09-27 22:40:26 +02:00
Andrew Klaassen a6e72fb46d vf_colorspace: Added linear trc.
This patch adds the coefficients for the linear gamma function (1,0,1,0)
to the colorspace filter.

Signed-off-by: Andrew Klaassen <clawsoon@yahoo.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2020-09-27 09:14:46 -04:00
Paul B Mahol 85195f6ae9 avfilter/vf_histogram: add slide modes for thistogram 2020-09-26 22:04:27 +02:00
Guo, Yejun e71d73b096 dnn: add a new interface DNNModel.get_output
for some cases (for example, super resolution), the DNN model changes
the frame size which impacts the filter behavior, so the filter needs
to know the out frame size at very beginning.

Currently, the filter reuses DNNModule.execute_model to query the
out frame size, it is not clear from interface perspective, so add
a new explict interface DNNModel.get_output for such query.
2020-09-21 21:26:56 +08:00
Guo, Yejun fce3e3e137 dnn: put DNNModel.set_input and DNNModule.execute_model together
suppose we have a detect and classify filter in the future, the
detect filter generates some bounding boxes (BBox) as AVFrame sidedata,
and the classify filter executes DNN model for each BBox. For each
BBox, we need to crop the AVFrame, copy data to DNN model input and do
the model execution. So we have to save the in_frame at DNNModel.set_input
and use it at DNNModule.execute_model, such saving is not feasible
when we support async execute_model.

This patch sets the in_frame as execution_model parameter, and so
all the information are put together within the same function for
each inference. It also makes easy to support BBox async inference.
2020-09-21 21:26:56 +08:00
Guo, Yejun 2003e32f62 dnn: change dnn interface to replace DNNData* with AVFrame*
Currently, every filter needs to provide code to transfer data from
AVFrame* to model input (DNNData*), and also from model output
(DNNData*) to AVFrame*. Actually, such transfer can be implemented
within DNN module, and so filter can focus on its own business logic.

DNN module also exports the function pointer pre_proc and post_proc
in struct DNNModel, just in case that a filter has its special logic
to transfer data between AVFrame* and DNNData*. The default implementation
within DNN module is used if the filter does not set pre/post_proc.
2020-09-21 21:26:56 +08:00
Guo, Yejun 6918e240d7 dnn: add userdata for load model parameter
the userdata will be used for the interaction between AVFrame and DNNData
2020-09-21 21:26:56 +08:00
Xu Jun a39fcbdffb dnn_backend_native_layer_conv2d.c: fix bug of loop boundary in single thread mode.
Before patch, fate test for dnn may fail in some Windows environment
while succeed in my Linux. The bug was caused by a wrong loop boundary.
After patch, fate test succeed in my windows mingw 64-bit.

Signed-off-by: Xu Jun <xujunzz@sjtu.edu.cn>
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2020-09-20 12:30:47 +08:00
Paul B Mahol cdc4c268e2 avfilter/vf_datascope: fix oscilloscope with gray>8 depth 2020-09-19 16:38:21 +02:00
Limin Wang 0ea2bda099 avfilter/vf_showinfo: add const to the AVFrameSideData instance
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-09-17 18:52:11 +08:00
Xu Jun 7d3cd9f956 dnn_backend_native_layer_conv2d.c: refine code.
Move thread area allocate out of thread function into
main thread.

Signed-off-by: Xu Jun <xujunzz@sjtu.edu.cn>
2020-09-17 08:45:23 +08:00
Xu Jun 8e67ae2cb4 dnn_backend_native_layer_conv2d.c: fix memory allocation bug in multithread function.
Before patch, memory was allocated in each thread functions,
which may cause more than one time of memory allocation and
cause crash.

After patch, memory is allocated in the main thread once,
an index was parsed into thread functions. Bug fixed.

Signed-off-by: Xu Jun <xujunzz@sjtu.edu.cn>
2020-09-17 08:45:23 +08:00
Paul B Mahol 2524e64dbe avfilter/f_interleave: fix some issues with interleaving 2020-09-15 17:21:38 +02:00
Paul B Mahol fda5363c80 avfilter/x86/vf_convolution_init: there is asm only for 8bit depth 2020-09-15 08:13:04 +02:00
Paul B Mahol 05c8d0bce6 avfilter/avf_concat: check for possible integer overflow
Also check that segment delta pts is always bigger than input pts.

There is nothing much currently that can be done to recover from
this situation so just return AVERROR_INVALIDDATA error code.
2020-09-14 18:16:42 +02:00
Paul B Mahol 17b44f759e avfilter/af_amix: do not leave unset PTS for frames after first stream is over
First stream is used only to get number of samples to put into each output frame.
2020-09-14 18:16:42 +02:00
Mark Reid 60e7021064 avfilter/vf_premultiply: add missing AV_PIX_FMT_YUVA444P12
query_formats says its supported, but is missing from switch statement leading to segfault
2020-09-14 10:31:46 +02:00
Marton Balint 172af0ee51 avfilter/vf_showinfo: use av_timecode_make_smpte_tc_string2
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-09-13 17:51:57 +02:00
Paul B Mahol 55af1807f7 avfilter/asrc_anullsrc: actually return correct EOF pts 2020-09-13 13:26:11 +02:00
Paul B Mahol c28b14eb98 avfilter/asrc_anullsrc: give better limits to number of samples per frame 2020-09-13 13:18:18 +02:00
Paul B Mahol 0a17a4891d avfilter/asrc_anullsrc: make number of output samples match duration 2020-09-13 13:18:18 +02:00
Ting Fu dc16aeb390 dnn/openvino: add input/output name info
show all input/output names when the input or output name not correct

Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2020-09-12 16:15:30 +08:00
Ting Fu 87cb24a1ca dnn/openvino: support run inference via GPU
for enabling OpenVINO GPU please:
1. install required OpenCL drivers, see: https://github.com/intel/compute-runtime/releases/tag/19.41.14441
2. build OpenVINO c lib with GPU enabled: use cmake config with: -DENABLE_CLDNN=ON
3. then make, and include the OpenVINO c lib in environment variables
detailed steps please refer: https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md

inference model with GPU please add: optioins=device=GPU

Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2020-09-12 16:15:30 +08:00
Andreas Rheinhardt 0963be71ec avfilter/formats: Remove pointless checks
ff_formats_ref() takes a pointer to an AVFilterFormats and a pointer to
a pointer to an AVFilterFormats as arguments and adds the latter as an
owner to the list pointed to by the former; the latter is hereby always
the address of a list contained in an AVFilterFormatsConfig and can
therefore not be NULL. So remove the check for whether it is NULL; also
do the same for ff_channel_layouts_ref().

Also do the same for the unref functions where argument is never NULL
because it is always the address of an existing lvalue.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:53:06 +02:00
Andreas Rheinhardt 5616942220 avfilter/formats: Don't typedef structure a second time
Before commit 2f76476549, avfilter.h
contained no typedef for AVFilterChannelLayouts; all references to it
were done using its struct tag. formats.h meanwhile contained the
definition of the struct and a typedef for it. Said commit now added a
typedef in avfilter.h, too, bringing it in line with AVFilterFormats;
yet this means that there are two typedefs for AVFilterChannelLayouts
(in contrast to AVFilterFormats which is only typedef'ed in avfilter.h).

The problem is that older versions of GCC don't like this and error out:
http://fate.ffmpeg.org/history.cgi?slot=x86_64-openbsd5.6-gcc4.2-conf2
is one of the FATE boxes that now fail to compile. So just remove the
typedef in formats.h.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:51:03 +02:00
Andreas Rheinhardt 0086432fc7 fftools, libavcodec, libavfilter: Add const to some AVCodec *
The user has no business modifying the underlying AVCodec.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:42:36 +02:00
Andreas Rheinhardt b091df7210 avfilter/vf_subtitles: Remove obsolete LIBAVCODEC_VERSION_INT checks
libavcodec major version is already 58.

Reviewed-by: Nicolas George <george@nsup.org>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:42:02 +02:00
Andreas Rheinhardt e65897f3ee avfilter/vf_subtitles: Remove unnecessary initialization of AVPacket
av_read_frame() can handle uninitialized packets.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:41:36 +02:00
Andreas Rheinhardt 77ace1ffea avfilter/vf_subtitles: Fix leaks on failure
init_subtitles() sometimes returned directly upon error without cleaning
up after itself. The easiest way to trigger this is by using
picture-based subtitles; it is also possible to run into this in case of
missing decoders or allocation failures.

Furthermore, return the proper error code in case of missing decoder.

Reviewed-by: Nicolas George <george@nsup.org>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:41:18 +02:00
Andreas Rheinhardt 8443848dfc avfilter/vf_uspp: Fix potential leak of dict on error
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:41:08 +02:00
Andreas Rheinhardt 98171d14c5 avfilter/lavfutils: Avoid initializing packet
av_read_frame() can handle uninitialized packets.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:40:58 +02:00