Commit Graph

836 Commits

Author SHA1 Message Date
Paul B Mahol fc9a686688 avfilter: add audio dynamic smooth filter 2021-12-02 09:39:27 +01:00
Paul B Mahol 11b11577fe avfilter: add audio spectral stats filter 2021-12-02 09:35:36 +01:00
Wu Jianhua 3188b606d7 avfilter: add a vflip_vulkan filter
The following command is on how to apply vflip_vulkan filter:

ffmpeg -init_hw_device vulkan -i input.264 -vf hwupload=extra_hw_frames=16,vflip_vulkan,hwdownload,format=yuv420p output.264

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:48 +01:00
Wu Jianhua d313cb5a2f avfilter: add a hflip_vulkan filter
The following command is on how to apply hflip_vulkan filter:

ffmpeg -init_hw_device vulkan -i input.264 -vf hwupload=extra_hw_frames=16,hflip_vulkan,hwdownload,format=yuv420p output.264

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:48 +01:00
Lynne 1d06084171
vulkan: fix checkheaders 2021-11-19 16:47:28 +01:00
Lynne f6dd30df24
lavfi/vulkan: split off lavfi-specific code into vulkan_filter.c
The issue is that libavfilter depends on libavcodec, and when doing a
static build, if libavcodec also includes "libavfilter/vulkan.c", then
during link-time, compiling programs will fail as there would be multiple
definitions of the same symbols in both libavfilter and libavcodec's
object files.
Linkers are, however, more permitting if both files that include
a common file that's used as a template are one-to-one identical.
Hence, to make both files the same in the future, export all avfilter
specific functions to a separate file.
There is some work in progress to make templated files like this be
compiled only once, so this is not a long-term solution.

This also removes a macro that could be used to toggle SPIRV compilation
capability on #include-time, as this could cause the files to be different.
2021-11-19 16:47:26 +01:00
Lynne b2aec70bd6
lavu/vulkan: add option to switch between shader compilers and cleanup glslang 2021-11-19 13:44:47 +01:00
Paul B Mahol d401b1ccec avfilter: add colorspectrum source video filter 2021-11-16 20:41:39 +01:00
Wu Jianhua 5fc935c7fa libavfilter: add a gblur_vulkan filter
This commit adds a powerful and customizable gblur Vulkan filter,
which provides a maximum 127x127 kernel size of Gaussian Filter.
The size could be adjusted by requirements on quality or performance.

The following command is on how to apply gblur_vulkan filter:

ffmpeg -init_hw_device vulkan -i input.264 -vf hwupload=extra_hw_frames=16,gblur_vulkan,hwdownload,format=yuv420p output.264

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-16 10:32:21 +01:00
Niklas Haas 51e03409d7 lavfi: add a libplacebo filter
This filter conceptually maps the libplacebo `pl_renderer` API into
libavfilter, which is a high-level image rendering API designed to work
with an RGB pipeline internally. As such, there's no way to avoid e.g.
chroma interpolation with this filter, although new versions of
libplacebo support outputting back to subsampled YCbCr after processing
is done.

That being said, `pl_renderer` supports automatic integration of the
majority of libplacebo's shaders, ranging from debanding to tone
mapping, and also supports loading custom mpv-style user shaders, making
this API a natural candidate for getting a lot of functionality out of
relatively little code.

In the future, I may approach this problem either by rewriting this
filter to also support a non-renderer codepath, or by upgrading
libplacebo's renderer to support a full YCbCr pipeline.

This unfortunately requires a very new version of libplacebo (unreleased
at time of writing) for timeline semaphore support. But the amount of
boilerplate needed to hack in backwards compatibility would have been
very unreasonable.
2021-11-12 14:45:36 +01:00
Roman Arzumanyan 08a501946f avfilter/scale_npp: add scale2ref_npp filter
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-11-03 19:06:14 +01:00
Paul B Mahol 8164fe1139 avfilter: add huesaturation filter 2021-10-29 23:18:27 +02:00
Paul B Mahol 97b5b9dbea avfilter: split negate filter from lut filter
Using luts for negating is suboptimal.

FATE test changes because filter no longer clips values into limited color range.
2021-10-27 11:29:29 +02:00
Paul B Mahol 407acc0747 avfilter: add varblur video filter 2021-10-19 08:53:56 +02:00
Paul B Mahol 933765aa0e avfilter: add xcorrelate video filter 2021-10-13 19:09:21 +02:00
Paul B Mahol 32eaf4069e avfilter: add limitdiff video filter 2021-10-13 19:02:34 +02:00
Paul B Mahol 8f26ebde14 avfilter: add audio signal to distortion ratio filter 2021-10-09 14:10:09 +02:00
Roman Arzumanyan ed084161ba avfilter/sharpen_npp: add sharpening video filter with borders control
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-10-07 18:07:53 +02:00
Paul B Mahol ba63078b0f avfilter: add (a)latency filters 2021-10-02 18:49:40 +02:00
Paul B Mahol b2ec4edef7 avfilter: add morpho filter 2021-09-28 22:57:33 +02:00
Paul B Mahol eeab62ad2d avfilter: add audio psychoacoustic clipper 2021-09-11 16:19:40 +02:00
Paul B Mahol 463c71b3b3 avfilter/vf_convolution: add scharr operator 2021-09-10 18:43:51 +02:00
Paul Buxton e07ada3dac avfilter: add grayworld video filter
Implements a gray world color correction algorithm
using a log scale LAB colorspace.

Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2021-08-29 13:31:37 +02:00
Paul B Mahol 1da2dd5c77 avfilter: add atilt filter 2021-08-28 18:51:04 +02:00
Paul B Mahol b53a7d2d4d avfilter: add adecorrelate filter 2021-08-28 18:46:39 +02:00
Paul B Mahol 02aa7dc423 avfilter: add hsvkey and hsvhold video filters 2021-08-25 20:43:18 +02:00
Paul B Mahol 8567f1c392 avfilter: add (a)segment filters 2021-08-16 20:26:04 +02:00
Paul B Mahol 6846d48fa6 avfilter: add afwtdn filter 2021-07-24 12:24:40 +02:00
Timo Rothenpieler b0e2e938c3 avfilter/scale_cuda: combine separate CUDA sources 2021-06-24 20:58:47 +02:00
Timo Rothenpieler 072788c46e avfilter: compress CUDA PTX code if possible 2021-06-22 14:05:44 +02:00
Xuewei Meng f8d910e90f GSoC: Add guided filter
Add examples on how to use this filter, and improve the code style.
Implement the slice-level parallelism for guided filter.
Add the basic version of guided filter.

Signed-off-by: Xuewei Meng <xwmeng96@gmail.com>
Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
2021-05-10 13:34:29 +08:00
Guo, Yejun 41ef57fdb2 lavfi/dnn_classify: add filter dnn_classify for classification based on detection bounding boxes
classification is done on every detection bounding box in frame's side data,
which are the results of object detection (filter dnn_detect).

Please refer to commit log of dnn_detect for the material for detection,
and see below for classification.

- download material for classifcation:
wget https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.1/emotions-recognition-retail-0003.bin
wget https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.1/emotions-recognition-retail-0003.xml
wget https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.1/emotions-recognition-retail-0003.label

- run command as:
./ffmpeg -i cici.jpg -vf dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml:input=data:output=detection_out:confidence=0.6:labels=face-detection-adas-0001.label,dnn_classify=dnn_backend=openvino:model=emotions-recognition-retail-0003.xml:input=data:output=prob_emotion:confidence=0.3:labels=emotions-recognition-retail-0003.label:target=face,showinfo -f null -

We'll see the detect&classify result as below:
[Parsed_showinfo_2 @ 0x55b7d25e77c0]   side data - detection bounding boxes:
[Parsed_showinfo_2 @ 0x55b7d25e77c0] source: face-detection-adas-0001.xml, emotions-recognition-retail-0003.xml
[Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 0,  region: (1005, 813) -> (1086, 905), label: face, confidence: 10000/10000.
[Parsed_showinfo_2 @ 0x55b7d25e77c0]            classify:  label: happy, confidence: 6757/10000.
[Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 1,  region: (888, 839) -> (967, 926), label: face, confidence: 6917/10000.
[Parsed_showinfo_2 @ 0x55b7d25e77c0]            classify:  label: anger, confidence: 4320/10000.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2021-05-06 10:50:44 +08:00
Andreas Rheinhardt 420cedd497 libavresample: Remove deprecated library
Deprecated in c29038f304.
The resample filter based upon this library has been removed as well.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt 0c820b1525 avfilter/Makefile: Don't compile transform.c unconditionally
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:11 -03:00
Guo, Yejun aa9ffdaa1e lavfi: add filter dnn_detect for object detection
Below are the example steps to do object detection:

1. download and install l_openvino_toolkit_p_2021.1.110.tgz from
https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit/download.html
  or, we can get source code (tag 2021.1), build and install.
2. export LD_LIBRARY_PATH with openvino settings, for example:
.../deployment_tools/inference_engine/lib/intel64/:.../deployment_tools/inference_engine/external/tbb/lib/
3. rebuild ffmpeg from source code with configure option:
--enable-libopenvino
--extra-cflags='-I.../deployment_tools/inference_engine/include/'
--extra-ldflags='-L.../deployment_tools/inference_engine/lib/intel64'
4. download model files and test image
wget https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.1/face-detection-adas-0001.bin
wget https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.1/face-detection-adas-0001.xml
wget
https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.1/face-detection-adas-0001.label
wget https://github.com/guoyejun/ffmpeg_dnn/raw/main/images/cici.jpg
5. run ffmpeg with:
./ffmpeg -i cici.jpg -vf dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml:input=data:output=detection_out:confidence=0.6:labels=face-detection-adas-0001.label,showinfo -f null -

We'll see the detect result as below:
[Parsed_showinfo_1 @ 0x560c21ecbe40]   side data - detection bounding boxes:
[Parsed_showinfo_1 @ 0x560c21ecbe40] source: face-detection-adas-0001.xml
[Parsed_showinfo_1 @ 0x560c21ecbe40] index: 0,  region: (1005, 813) -> (1086, 905), label: face, confidence: 10000/10000.
[Parsed_showinfo_1 @ 0x560c21ecbe40] index: 1,  region: (888, 839) -> (967, 926), label: face, confidence: 6917/10000.

There are two faces detected with confidence 100% and 69.17%.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2021-04-17 17:27:02 +08:00
Paul B Mahol 4a69cd4e4e avfilter: add identity video filter 2021-03-06 12:41:30 +01:00
Guo, Yejun bdce636100 dnn: extract common functions used by different filters
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2021-02-18 09:59:37 +08:00
Ashish Singh 38aea9b041 avfilter: add vif filter
This is Visual Information Fidelity (VIF) filter and one of the component
filters of VMAF. It outputs the average VIF score over all frames.

Signed-off-by: Ashish Singh <ashk43712@gmail.com>
2021-02-16 15:00:50 +01:00
Paul B Mahol edc45d1bd5 avfilter: add monochrome video filter 2021-02-12 00:08:39 +01:00
Paul B Mahol 4390573c44 avfilter: add exposure video filter 2021-02-10 19:23:48 +01:00
Paul B Mahol 579e4e57a2 avfilter: add aexciter audio filter 2021-02-10 19:21:01 +01:00
Paul B Mahol bd5226704a avfilter: add colorize filter 2021-02-07 11:48:28 +01:00
Paul B Mahol f6621a8e72 avfilter: add colorcorrect filter 2021-02-03 15:49:13 +01:00
Paul B Mahol 090f31f813 avfilter: add colorcontrast filter 2021-02-02 14:27:06 +01:00
Paul B Mahol a9d23d33a1 avfilter: add colortemperature filter 2021-01-27 11:48:00 +01:00
Paul B Mahol 35f8628047 avfilter: add kirsch video filter 2021-01-27 11:46:26 +01:00
Paul B Mahol 37f76c81d6 avfilter: add shear video filter 2021-01-26 12:19:09 +01:00
Paul B Mahol b897b52618 avfilter: add epx pixel art scaler 2021-01-25 00:48:35 +01:00
Paul B Mahol e722b443e4 avfilter: add estdif video filter 2021-01-16 14:08:59 +01:00
Anton Khirnov c6357311f3 lavfi/vf_uspp: convert to the video_enc_params API 2021-01-01 14:26:09 +01:00