Commit Graph

10405 Commits

Author SHA1 Message Date
rcombs c6364b711b lavfi/vf_tonemap_opencl: fix build
This was broken in d42b410e05.
2022-06-01 20:09:17 -05:00
rcombs 3e580351bc lavfi/vf_scale_vulkan: fix build
This was broken in d42b410e05.
2022-06-01 20:07:47 -05:00
Thilo Borgmann e9107d16f3 lavfi/blockdetect: Remove nop init() function 2022-06-01 21:31:20 +02:00
Leo Izen d42b410e05 avutil/csp: create public API for colorspace structs
This commit moves some of the functionality from avfilter/colorspace
into avutil/csp and exposes it as a public API so it can be used by
libavcodec and/or libavformat. It also converts those structs from
double values to AVRational to make regression testing easier and
more consistent.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2022-06-01 13:52:38 -04:00
Paul B Mahol a7e0997324 avfilter/af_biquads: refactor some options 2022-05-29 12:38:37 +02:00
Paul B Mahol 525f83becd avfilter: add tiltshelf audio filter 2022-05-29 12:37:46 +02:00
Paul B Mahol 93b31dae1d avfilter/af_biquads: fix low/highshelf 'k' calculation 2022-05-27 09:39:53 +02:00
Fei Wang 6ec127b223 avfilter/vf_vpp_qsv: set outlink to EOF correctly
1. Return error if filter frame fail before set outlink to EOF in none
pass through mode.
2. Set outlink to EOF before return success in pass through mode.

Fix endless cmd:

ffmpeg -hwaccel qsv -qsv_device /dev/dri/renderD128 -hwaccel_output_format     \
qsv -v debug -c:v hevc_qsv -i 4k.h265                                          \
-filter_complex "vpp_qsv=w=3840:h=2160:async_depth=4[o1];[o1]split=2[s1][s2];
[s2]vpp_qsv=w=1920:h=1080:async_depth=4[o2];[o2]split=2[s3][s4];
[s4]vpp_qsv=w=1920:h=1080:async_depth=4[o3]" \
-map [s1] -c:v hevc_qsv -async 3 -async_depth 3 -b:v 9000k -preset 7 -g 33 -y -f null - \
-map [s3] -c:v hevc_qsv -async 3 -async_depth 3 -b:v 4000k -preset 7 -g 33 -y -f null - \
-map [o3] -c:v hevc_qsv -async 3 -async_depth 3 -b:v 3100k -preset 7 -g 33 -y -f null -
2022-05-26 23:21:26 +08:00
Haihao Xiang 478e1a98a2 qsv: add requirement for the mininal version of libmfx
libmfx 1.28 was released 3 years ago, it is easy to get a greater
version than 1.28. We may remove lots of compile-time checks if adding
the requirement for the minimal version in the configure script.

Reviewed-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-05-25 15:17:35 +08:00
Anton Khirnov fa26e17747 lavfi/vf_v360: implement output mask for barrelsplit
The top/bottom of the barrel are each coded as two semicircles inside a
square block in the frame. Mask out the parts of the square that lie
outside of these semicircles, so they are made transparent when
alpha_mask=1.

Fixes the other part of #9725.
2022-05-24 13:41:24 +02:00
Anton Khirnov 83a5ef5113 lavfi/vf_v360: fix barrelsplit transform with padding
Make it match Facebook's transform360
(https://github.com/facebook/transform360)

Fixes one part of #9725.
2022-05-24 13:41:22 +02:00
Anton Khirnov 82784ddf33 lavfi/vf_v360: factorize vector computation for barrelsplit 2022-05-24 13:39:48 +02:00
Anton Khirnov 58bb83c7ed lavfi/vf_v360: drop nonsense inline specifier
This function is always called indirectly, it cannot be inlined.
2022-05-24 13:39:48 +02:00
Thilo Borgmann 9cb9da62a3 avfilter: Add blockdetect filter 2022-05-24 11:21:36 +02:00
softworkz f579a1d08b avfilter: use avpriv_fopen_utf8() instead of plain fopen()
Unify file access operations by replacing usages of direct calls
to posix fopen() to prepare for long filename support on Windows.

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-05-24 11:50:24 +03:00
Paul B Mahol d2ef44fbb1 avfilter/af_afftfilt: add threads support 2022-05-24 08:58:42 +02:00
Martin Storsjö 6076dbcb55 Switch uses of av_fopen_utf8 to avpriv_fopen_utf8
The former has been deprecated.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-05-23 13:52:45 +03:00
Martin Storsjö 4cdc14aa95 libavutil: Deprecate av_fopen_utf8, provide an avpriv version
Since every DLL can use an individual CRT on Windows, having
an exported function that opens a FILE* won't work if that
FILE* is going to be used from a different DLL (or from user
application code).

Internally within the libraries, the issue can be worked around
by duplicating the function in all libraries (this already happened
implicitly because the function resided in file_open.c) and renaming
the function to ff_fopen_utf8 (so that it doesn't end up exported from
the DLLs) and duplicating it in all libraries that use it.

This makes the avpriv_fopen_utf8 / ff_fopen_utf8 function work in
the exact same way as the existing avpriv_open / ff_open, with the
same setup as introduced in e743e7ae6e.

That mechanism doesn't work for external users, thus deprecate the
existing function.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-05-23 13:52:26 +03:00
Steven Liu 90007e0b4e avfilter/avf_showfreqs: fix memleak in plot_freqs
plot_freqs should free colors before return error when
ff_get_video_buffer failed

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2022-05-23 15:07:50 +08:00
Andreas Rheinhardt 41a558fea0 avfilter/formats: Constify channel_layout in ff_add_channel_layout()
It copies, not moves the channel layout.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-19 20:20:38 +02:00
Paul B Mahol 163e737c17 avfilter/af_afir: add support for double sample format 2022-05-15 13:34:50 +02:00
Paul B Mahol e6f0cec880 avfilter/af_acrossover: add precision option 2022-05-14 14:11:52 +02:00
Paul B Mahol b90341d1d5 avfilter/af_asubboost: add channels option 2022-05-13 22:09:08 +02:00
Paul B Mahol 710dce131f avfilter/vf_zscale: active region use doubles so use that type here too 2022-05-13 15:18:43 +02:00
Paul B Mahol 075c2308e3 avfilter/af_asubboost: add boost option 2022-05-13 15:18:42 +02:00
Paul B Mahol 2c77d9150d avfilter/af_crossfeed: always return same number of samples with block processing 2022-05-13 15:18:42 +02:00
Paul B Mahol 52a14b8505 avfilter/vf_zscale: improve slice processing 2022-05-13 10:22:51 +02:00
Paul B Mahol b5aa514bbb avfilter/af_biquads: always return same number of samples with block processing 2022-05-12 18:23:37 +02:00
Paul B Mahol ee9345e905 avfilter/af_ladspa: remove not wanted line
This fixes output when trimming output samples.
2022-05-12 10:52:52 +02:00
Wang Cao d82481ef41 avfilter/af_alimiter: add latency compensation option
Signed-off-by: Wang Cao <wangcao@google.com>
2022-05-12 10:52:52 +02:00
Paul B Mahol cbc1b8adad avfilter/af_biquads: add zdf transform type 2022-05-11 22:14:58 +02:00
Andreas Rheinhardt 260d7d5a6c avfilter/avfilter: Fix compilation with TRACE defined
av_get_pix_fmt_name() is used in an ff_tlog(), which is only
compiled if TRACE is defined. Fixes a regression caused by
f2b79c5b85.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-10 18:22:20 +02:00
Paul B Mahol 38238b604f avfilter/af_biquads: use correct variables when reversing samples
Also silence initial block frames.
2022-05-10 09:27:10 +02:00
Andreas Rheinhardt f2b79c5b85 lib*/version: Move library version functions into files of their own
This avoids having to rebuild big files every time FFMPEG_VERSION
changes (which it does with every commit).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-10 06:49:32 +02:00
Paul B Mahol 5ccd8f492b avfilter/af_crossfeed: add option for linear phase filtering
But at expense of additional delay.
2022-05-09 22:21:40 +02:00
Paul B Mahol 1309867022 avfilter/af_biquads: add option for block based linear phase processing 2022-05-09 22:21:40 +02:00
Paul B Mahol fe57904a71 avfilter/af_afftdn: request new frames only when needed 2022-05-09 22:21:39 +02:00
Paul B Mahol 36c274057a avfilter/avf_ahistogram: request new frames only when needed 2022-05-09 22:21:39 +02:00
Paul B Mahol d166317cdd avfilter/af_biquads: add tdi transform type 2022-05-08 18:27:11 +02:00
Gyan Doshi b980d9e8ec avfilter/geq: unbreak alpha processing
d607af50fd broke alpha processing by always overwriting any supplied
alpha expression.
2022-05-08 10:05:19 +05:30
Paul B Mahol 30a49a5230 avfilter/vf_fftdnoiz: add window type support 2022-05-07 13:23:33 +02:00
Michael Niedermayer 0a3e121798 avfilter/vf_libplacebo: Match AV_OPT_TYPE_FLOAT to dbl
Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-05-06 15:57:45 +02:00
Andreas Rheinhardt 3cdf0f9424 avfilter/vf_fftdnoiz: Remove redundant ';'
These are actually null statements here and therefore lead
to -Wdeclaration-after-statement warnings.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-06 05:51:59 +02:00
Andreas Rheinhardt 11e37539ee avfilter/vf_threshold: Move ff_threshold_init into a header
This removes a dependency of checkasm on lavfi/vf_threshold.o
and also allows to inline ff_threshold_init() irrespectively of
interposing.
With this patch checkasm no longer pulls all of lavfi and lavf in.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-06 05:19:50 +02:00
Andreas Rheinhardt c499f9bc38 avfilter/vf_nlmeans: Move ff_nlmeans_init into a header
This removes a dependency of checkasm on lavfi/vf_nlmeans.o
and also allows to inline ff_nlmeans_init() irrespectively of
interposing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-06 05:19:50 +02:00
Andreas Rheinhardt fbe4e825d8 avfilter/vf_hflip: Move ff_hflip_init into a header
This removes a dependency of checkasm on lavfi/vf_hflip.o
and also allows to inline ff_hflip_init() irrespectively of
interposing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-06 05:19:50 +02:00
Andreas Rheinhardt 24936a9fbb avfilter/vf_gblur: Move ff_gblur_init into a header
This removes a dependency of checkasm on lavfi/vf_gblur.o
and also allows to inline ff_gblur_init() irrespectively of
interposing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-06 05:19:49 +02:00
Andreas Rheinhardt 8cd57648d1 avfilter/vf_eq: Move ff_nlmeans_init into a header
This removes a dependency of checkasm on lavfi/vf_eq.o
and also allows to inline ff_eq_init() irrespectively of
interposing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-06 05:19:49 +02:00
Andreas Rheinhardt 364fab1fdc avfilter/vf_blend: Move ff_blend_init into a header
This removes a dependency of checkasm on lavfi/vf_blend.o
and also allows to inline ff_blend_init() irrespectively of
interposing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-06 05:19:49 +02:00
Andreas Rheinhardt ea398201f9 avfilter/af_afir: Move ff_afir_init() to header
This allows to inline it in af_afir.c (regardless of interposing);
moreover it removes a dependency of the checkasm test on
lavfi/af_afir.o.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-06 05:19:49 +02:00
Andreas Rheinhardt 0df18f29ae avfilter/af_afir: Only keep DSP stuff in header
Only the AudioFIRDSPContext and the functions for its initialization
are needed outside of lavfi/af_afir.c.
Also rename the header to af_afirdsp.h to reflect the change.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-06 05:19:49 +02:00
Paul B Mahol 767f66ea5d avfilter: add multiply video filter 2022-05-05 19:07:10 +02:00
Paul B Mahol a6f136aef1 avfilter/vf_fftdnoiz: refactor code and improve 3d filtering 2022-05-05 19:06:09 +02:00
Paul B Mahol 003f9a9b41 avfilter/vf_fftdnoiz: add alternative denoising method 2022-05-05 19:06:08 +02:00
Paul B Mahol 0914e3a14a avfilter/vf_maskfun: properly handle read-only frames 2022-05-04 20:51:45 +02:00
Paul B Mahol 7aa69300b1 avfilter/vf_maskfun: rename too generic variables 2022-05-04 20:51:45 +02:00
Paul B Mahol 810c508956 avfilter/vf_guided: fix reallocation of memory per every frame's plane processing 2022-05-02 23:47:24 +02:00
Paul B Mahol 17a4237a05 avfilter/vf_guided: make use of link variables 2022-05-02 23:47:24 +02:00
Paul B Mahol 3e4d68f2b6 avfilter/vf_guided: remove excessive parentheses 2022-05-02 23:47:24 +02:00
Paul B Mahol ccd29bf881 avfilter/vf_guided: fix timeline support 2022-05-02 23:47:24 +02:00
Paul B Mahol e40cec0609 avfilter/vf_guided: clean up commands support
Some options can not be changed at runtime.
Remove pointless wrapper.
2022-05-02 23:47:24 +02:00
Paul B Mahol bdf01a9609 avfilter/vf_overlay: improve premultiplied alpha overlay for YUV 2022-05-01 20:02:24 +02:00
Paul B Mahol eef652ca9c avfilter/avf_showvolume: request new frames only when needed 2022-04-30 16:20:38 +02:00
Paul B Mahol 3ce4e08089 avfilter/avf_avectorscope: request new frames only when needed 2022-04-30 16:20:38 +02:00
Paul B Mahol 9aa20d28cd avfilter/af_aspectralstats: request new frames only when needed 2022-04-30 15:41:46 +02:00
Paul B Mahol a9e9020ff6 avfilter/af_surround: request new frames only when needed 2022-04-30 15:41:46 +02:00
Paul B Mahol d8e8aa944a avfilter/avf_showfreqs: add rate option
Fix possible buffer overflow.
2022-04-30 15:41:45 +02:00
Paul B Mahol fe06e70c30 avfilter/vf_estdif: set frame_rate only when needed 2022-04-30 10:09:45 +02:00
Paul B Mahol f09712d686 avfilter/vf_w3fdif: set frame_rate only when needed 2022-04-30 10:09:45 +02:00
Paul B Mahol 6018fa899f avfilter/vf_nnedi: set frame_rate only when needed 2022-04-30 10:09:45 +02:00
Paul B Mahol 55e0b041b3 avfilter/vf_mix: output same number of frames from input for tmix 2022-04-29 22:27:39 +02:00
Paul B Mahol 1148e5f1cc avfilter/vf_xmedian: fix multiple threads usage 2022-04-29 22:27:39 +02:00
Paul B Mahol 3415028d13 avfilter/vf_mix: fix multiple threads usage 2022-04-29 20:50:33 +02:00
Paul B Mahol 126d5d3b5f avfilter/vf_fftdnoiz: small improvements
Stop using log() for block size.
Fix possible buffer overflow in export path.
2022-04-29 20:22:55 +02:00
Paul B Mahol 31c714bf0b avfilter/af_adynamicequalizer: remove unused header 2022-04-29 20:22:55 +02:00
Andreas Rheinhardt 8449fbdf8e avfilter/vf_colormap: Avoid allocation of small array
The number of elements is always two or three.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-29 13:38:20 +02:00
Andreas Rheinhardt 9d2f427958 avfilter/vf_colormap: Remove unnecessary headers
In particular remove config_components.h in order to avoid unnecessary
rebuilds.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-29 13:38:14 +02:00
Andreas Rheinhardt fdc16fbb7a avfilter/vf_colormap: Fix declaration-after-statement
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-29 13:38:07 +02:00
Andreas Rheinhardt f4ace6d82d avfilter/vf_colormap: Properly uninit FFFrameSync, fix leak
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-29 13:37:51 +02:00
Andreas Rheinhardt 5f8c83e95e avfilter/Makefile: Add fflcms2.h to SKIPHEADERS- if necessary
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-29 01:30:14 +02:00
Paul B Mahol c27123606a avfilter/af_adynamicequalizer: set target filter type 2022-04-28 22:12:32 +02:00
Paul B Mahol 4e284837e4 avfilter/af_adynamicequalizer: improve threshold usage 2022-04-28 22:12:32 +02:00
Paul B Mahol 14b74610d7 avfilter/af_anlms: add timeline support 2022-04-27 21:30:43 +02:00
Thilo Borgmann 79286d3eb6 avfilter/vf_blurdetect: fix uninitialized variables and possible div by zero
Found-by: Coverity
2022-04-27 11:41:41 +02:00
Paul B Mahol 39f22df6cd avfilter/vsrc_testsrc: fix typo for yellow patch 2022-04-26 22:04:30 +02:00
Paul B Mahol 944e60f4ae avfilter/vf_blurdetect: remove set but not used variables 2022-04-26 20:15:26 +02:00
Paul B Mahol 452d611fc7 avfilter/vf_lut3d: allow to control when to upload CLUT for haldclut 2022-04-26 20:07:04 +02:00
Thilo Borgmann 1da3394adb avfilter/vf_blurdetect: cleanup headers, remove unused variables, fix type of variable 2022-04-26 12:39:17 +02:00
Paul B Mahol 08ac8bda38 avfilter/vf_colormap: avoid reallocating memory to build map 2022-04-26 09:21:56 +02:00
Paul B Mahol f908f365f9 avfilter/vf_colormap: change default nb_patches 2022-04-26 09:21:55 +02:00
Thilo Borgmann b23208826b lavfi: Add blurdetect filter 2022-04-25 20:52:15 +02:00
Thilo Borgmann 22df52c444 lafi/vf_edgedetect: Move some common functions into seperate file 2022-04-25 20:52:15 +02:00
Paul B Mahol fe85afbf8c avfilter/af_afftdn: use better approach for gain smoothing 2022-04-23 23:05:51 +02:00
Jan Ekström eae3b84189 libavfilter/version: bump minor version for icc{gen,detect}
Missed during that patch set's life time.
2022-04-23 23:07:26 +03:00
Niklas Haas 2cb0cebd11 lavfi: add vf_iccdetect for parsing ICC profiles
This filter is designed to parse embedded ICC profiles and attempt
extracting colorspace tags from them, updating the AVFrame metadata
accordingly.

This is intentionally made a separate filter, rather than being part of
libavcodec itself, so that it's an opt-in behavior for the time being.
This also gives the user more flexibility to e.g. first attach an ICC
profile and then also set the colorspace tags from it.

This makes #9673 possible, though not automatic.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Niklas Haas 5cfeaeef0c lavfi: add vf_iccgen for generating ICC profiles
This filter is designed to specifically cover the task of generating ICC
profiles (and attaching them to output frames) on demand. Other tasks,
such as ICC profile loading/stripping, or ICC profile application, are
better left to separate filters (or included into e.g. vf_setparams).

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Niklas Haas b9a25963f7 lavfi: add ICC profile support via lcms2
This introduces an optional dependency on lcms2 into FFmpeg. lcms2 is a
widely used library for ICC profile handling, which apart from being
used in almost all major image processing programs and video players,
has also been deployed in browsers. As such, it's both widely available
and well-tested.

Add a few helpers to cover our major use cases. This commit merely
introduces the helpers (and configure check), even though nothing uses
them yet.

It's worth pointing out that the reason the cmsToneCurves for each
AVCOL_TRC are cached inside the context, is because constructing a
cmsToneCurve requires evaluating the curve at 4096 (by default) grid
points and constructing a LUT. So, we ideally only want to do this once
per curve. This matters for e.g. ff_icc_profile_detect_transfer, which
essentially compares a profile against all of these generated LUTs.
Re-generating the LUTs for every iteration would be unnecessarily
wasteful.

The same consideration does not apply to e.g. cmsCreate*Profile, which
is a very lightweight operation just involving struct allocation and
setting a few pointers.

The cutoff value of 0.01 was determined by experimentation. The lowest
"false positive" delta I saw in practice was 0.13, and the largest
"false negative" delta was 0.0008. So a value of 0.01 sits comfortaby
almost exactly in the middle.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Niklas Haas 072dd047f0 lavfi: add ff_detect_color_primaries helper
Related to #9673, this helper exists to facilitate "guessing" the right
primary tags from a given set of raw primary coefficients.

The cutoff value of 0.001 was chosen by experimentation. The smallest
"false positive" delta observed in practice was 0.023329, while the
largest "false negative" delta was 0.00016. So, a value of 0.001 sits
comfortably in the middle.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Niklas Haas 6d83036662 lavfi: generalize colorspace coefficent helpers
These are needed beyond just vf_colorspace, so give them a new home in
colorspace.h.

In addition to moving code around, also merge the white point and
primary coefficients into a single struct to slightly increase the
convenience and shrink the size of the new API by avoiding the need
to introduce an extra function just to look up the white point as well.
The only place the distinction matters is in a single enum comparison,
which can just as well be a single memcpy - the difference is
negligible.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Paul B Mahol ce23794b91 avfilter/avf_showspectrum: filter support all channel counts 2022-04-23 19:24:43 +02:00