1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

10606 Commits

Author SHA1 Message Date
Anton Khirnov
984c751b12 lavfi/vf_decimate: use inverse of output framerate as timebase
This filter currently keeps the input timebase, but produces CFR output.
It is thus simpler to use 1/output fps as the output timebase.

Also, set output frame durations.
2022-10-13 10:19:13 +02:00
Anton Khirnov
0ce7a86e31 lavfi/vf_coreimage: set frame durations
This filter is supposed to produce CFR output.
2022-10-13 10:19:13 +02:00
Anton Khirnov
19c701fac8 lavfi/vf_tinterlace: set frame durations
This filter is supposed to produce CFR output.
2022-10-13 10:19:13 +02:00
Anton Khirnov
7c299c1178 lavfi/settb: rescale input frame durations 2022-10-13 10:19:13 +02:00
Anton Khirnov
476c90c207 lavfi/f_drawgraph: forward input frame durations 2022-10-13 10:19:13 +02:00
Paul B Mahol
504fbc2149 avfilter/af_aspectralstats: allow to select subset of measurements 2022-10-11 18:14:06 +02:00
Carl Eugen Hoyos
82479ef6bd lavfi/rotate: Avoid undefined behaviour.
Fixes the following integer overflows:
libavfilter/vf_rotate.c:273:13: runtime error: signed integer overflow: 92951468 + 2058533568 cannot be represented in type 'int'
libavfilter/vf_rotate.c:273:37: runtime error: signed integer overflow: 39684 * 54149 cannot be represented in type 'int'
libavfilter/vf_rotate.c:272:13: runtime error: signed integer overflow: 247587320 + 1900985032 cannot be represented in type 'int'
libavfilter/vf_rotate.c:272:37: runtime error: signed integer overflow: 42584 * 50430 cannot be represented in type 'int'
libavfilter/vf_rotate.c:272:50: runtime error: signed integer overflow: 65083 * 52912 cannot be represented in type 'int'
libavfilter/vf_rotate.c:273:50: runtime error: signed integer overflow: 65286 * 38044 cannot be represented in type 'int'

Fixes ticket #9799, different output with different compilers.
2022-10-10 02:58:39 +02:00
Paul B Mahol
5676b7cdcf avfilter/af_adynamicequalizer: rework processing 2022-10-09 09:16:24 +02:00
Paul B Mahol
3d6d127cd0 avfilter/af_biquads: fix bandpass for zdf 2022-10-07 14:05:31 +02:00
Anton Khirnov
a6bf4d47a9 lavfi/avf_showspatial: add framerate option
Apparently this option was intended (the context contains a
currently-unused frame_rate field), but was never added. This results in
the output timebase being unset after config_output(), so the input
audio timebase ends up being used for video output, which is clearly
wrong.

Add an option for setting output video framerate. Also set output frame
durations.
2022-10-04 11:55:03 +02:00
Anton Khirnov
06758370aa lavfi/avf_showfreqs: set frame durations
The filter is supposed to produce CFR output.
2022-10-04 11:55:03 +02:00
Anton Khirnov
dc686a0c22 lavfi/avf_showcqt: set frame durations
The filter is supposed to produce CFR output.
2022-10-04 11:55:03 +02:00
Anton Khirnov
7d13c5dff0 lavfi/avf_avectorscope: set frame durations
The filter is supposed to produce CFR output.
2022-10-04 11:55:03 +02:00
Anton Khirnov
ae84484c78 lavfi/avf_aphasemeter: set frame durations
The filter is supposed to produce CFR output.
2022-10-04 11:55:03 +02:00
Anton Khirnov
ed48d00861 lavfi/avf_ahistogram: set frame durations
The filter is supposed to produce CFR output.
2022-10-04 11:55:03 +02:00
Anton Khirnov
502892d706 lavfi/vf_fps: set frame duration 2022-10-04 11:55:03 +02:00
Timo Rothenpieler
59cb0bd23d avfilter/vf_extractplanes: add missing break; statement 2022-09-27 19:35:49 +02:00
Tristan Schmelcher
179830108d
avfilter/scale_eval: Reduce rounding error.
When force_original_aspect_ratio and force_divisible_by are both
used, dimensions are now rounded to the nearest allowed multiple of
force_divisible_by rather than first rounding to the nearest integer and
then rounding in a static direction. This results in less distortion of
the aspect ratio.

Reviewed-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Tristan Schmelcher <tschmelcher@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-09-27 00:07:43 +02:00
Paul B Mahol
9995a76f7c avfilter/vf_extractplanes: add support for packed rgb float formats 2022-09-25 18:34:49 +02:00
Andreas Rheinhardt
5a7978a694 avfilter/avfilter: Make ff_command_queue_pop() static
Only used here.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-21 13:01:20 +02:00
Andreas Rheinhardt
55c35d84eb avfilter/internal: Remove declaration of inexistent function
ff_get_ref_perms_string() has been removed in
7e350379f8.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-21 13:00:52 +02:00
Paul B Mahol
1f9f0dc6ee avfilter/af_afftdn: add double sample format support 2022-09-18 22:43:58 +02:00
Paul B Mahol
9ac777234e avfilter/af_dynaudnorm: fix parameter for copy samples function 2022-09-18 19:43:41 +02:00
Yondon Fu
b11813708d avfilter/vf_libvmaf: Update ssim, ms_ssim options description
Update description for ssim and ms_ssim libvmaf options to specify
feature=float_ssim and feature=float_ms_ssim which are used to request
ssim and ms_ssim values in the latest versions of libvmaf.

Signed-off-by: Yondon Fu <yondon.fu@gmail.com>
2022-09-16 13:07:43 -07:00
Timo Rothenpieler
c9bd6ee5cb avfilter/vf_colorspace_cuda: mark fall-through 2022-09-15 19:35:30 +02:00
James Almer
0e0f74b632 avfilter/vf_drawbox: use the correct macro to fill rgb plane pointers
Fixes ticket #9924

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-15 09:13:29 -03:00
Andreas Rheinhardt
859b31de50 avfilter/video: Fix newline in trace output
Forgotten in 7e350379f8.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-14 21:49:00 +02:00
Andreas Rheinhardt
e10774a8cc avfilter/avfilter: #if ff_tlog_link() away when empty
It is currently calling av_channel_layout_describe()
unnecessarily.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-14 21:48:48 +02:00
Andreas Rheinhardt
f4af504a1f avfilter/avfilter: Don't use AVFrame.channel_layout
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-14 21:48:11 +02:00
Christian Feldmann
8357d4790f avfilter/vf_libvmaf: copy all values also for 10 bit input 2022-09-14 19:42:59 +02:00
Roman Arzumanyan
cc81ab283c libavfilter: add vf_colorrange_cuda, CUDA-accelerated color conversion filter
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2022-09-13 22:59:30 +02:00
Paul B Mahol
09cce81245 avfilter/vf_gblur: allow filtering with zero horizontal sigma 2022-09-10 22:11:38 +02:00
Michael Niedermayer
31581ae7ee
avfilter/vf_showinfo: remove backspaces
They mess with storing editing and comparing the results

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-09-08 21:29:41 +02:00
James Almer
d9e3cb7e73 avfilter/vf_scale: overwrite the width and height expressions with the original values
Instead of the potentially adjusted ones. Otherwise, if config_props() is
called again and if using force_original_aspect_ratio, the already adjusted
values could be altered again.

Example command line
scale=size=1920x1000:force_original_aspect_ratio=decrease:force_divisible_by=2

user value 1920x1000 -> 1920x798 on init_dict() -> 1918x798 on frame
change when eval_mode == EVAL_MODE_INIT, which after e645a1ddb9 could be at the
very first frame.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-06 10:10:42 -03:00
Paul B Mahol
49a1de26ec avfilter/vf_gblur: handle cases when parameters become invalid 2022-09-04 16:41:44 +02:00
Timo Rothenpieler
6512dd6cb5 avfilter/vf_bilateral_cuda: refactor use of pow to simple multiplication 2022-09-03 20:27:34 +02:00
Timo Rothenpieler
416923346a compat/cuda: switch from powf to __powf intrinsic
The powf builtin causes crashes on older clang, so manually implement
the (faster) intrinsic.
The code it spawns is identical to that of nvcc.
2022-09-03 20:27:34 +02:00
Andreas Rheinhardt
72c601e0f7 avutil/internal: Move avpriv-file API to a header of its own
It is not used by the large majority of files that include
lavu/internal.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-03 15:41:44 +02:00
Mohamed Khaled Mohamed
1a5cd79f51 avfilter: add bilateral_cuda filter
GSoC 2022

Signed-off-by: Mohamed Khaled <mohamed.elbassiony00@eng-st.cu.edu.eg>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2022-09-03 15:18:56 +02:00
Paul B Mahol
d1513e7f9c avfilter: add 3D scope multimedia filter 2022-09-03 14:44:59 +02:00
Paul B Mahol
0dff278e5b avfilter/af_silenceremove: do not trim non-silence from start 2022-08-23 22:18:02 +02:00
David Flater
d2b6ec1e27 avfilter/af_alimiter: fix misbehavior when nb_channels != 2
Some code in alimiter assumes that there are 2 channels, resulting in
clipping if the loudest channel is 3 or above and an out-of-bounds read if
the input is monophonic.  Fix that in 2 places.

Signed-off-by: David Flater <dave@flaterco.com>
2022-08-23 12:20:05 +02:00
Timo Rothenpieler
c469c3c3b1 avfilter/vsrc_ddagrab: add options for more control over output format fallback 2022-08-13 15:22:14 +02:00
Timo Rothenpieler
6a574e3901 avfilter/vsrc_ddagrab: add rgbaf16 output support 2022-08-13 15:21:59 +02:00
Timo Rothenpieler
b77fff47d0 configure: always enable gnu_windres if available
Use the appropiate Makefile variable to ensure the resource file is
only built into shared libraries instead.
2022-08-13 14:42:36 +02:00
Haihao Xiang
54c4196d56 lavfi/qsv: create mfx session using oneVPL for qsv filters
Use the mfxLoader handle in qsv hwdevice to create mfx session for qsv
filters.

This is in preparation for oneVPL support
2022-08-12 10:43:39 +08:00
Haihao Xiang
c77149bc37 qsv: restrict OPAQUE memory to MFX_VERSION < 2.0
OPAQUE memory isn't supported for MFX_VERSION >= 2.0[1][2]. This is in
preparation for oneVPL support

[1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals
[2] https://github.com/oneapi-src/oneVPL
2022-08-12 10:43:39 +08:00
Haihao Xiang
40684899e8 qsv: restrict audio related code to MFX_VERSION < 2.0
Audio isn't supported for MFX_VERSION >= 2.0[1][2]. This is in
preparation for oneVPL support

[1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals
[2] https://github.com/oneapi-src/oneVPL
2022-08-12 10:43:39 +08:00
Haihao Xiang
3e61b7dd7f qsv: remove mfx/ prefix from mfx headers
The following Cflags has been added to libmfx.pc, so mfx/ prefix is no
longer needed when including mfx headers in FFmpeg.
   Cflags: -I${includedir} -I${includedir}/mfx

Some old versions of libmfx have the following Cflags in libmfx.pc
   Cflags: -I${includedir}

We may add -I${includedir}/mfx to CFLAGS when running 'configure
--enable-libmfx' for old versions of libmfx, if so, mfx headers without
mfx/ prefix can be included too.

If libmfx comes without pkg-config support, we may do a small change to
the settings of the environment(e.g. set -I/opt/intel/mediasdk/include/mfx
instead of -I/opt/intel/mediasdk/include to CFLAGS), then the build can
find the mfx headers without mfx/ prefix

After applying this change, we won't need to change #include for mfx
headers when mfx headers are installed under a new directory.

This is in preparation for oneVPL support (mfx headers in oneVPL are
installed under vpl directory)
2022-08-12 10:43:39 +08:00
James Almer
0c3e3fd1b4 avfilter/framesync: add a new option to set how to sync streams based on secondary input timestamps
Include two values for it, a default one that sets/keeps the current behavior,
where the frame event generated by the primary input will have a timestamp
equal or higher than frames in secondary input, plus a new one where the
secondary input frame will be that with the absolute closest timestamp to that
of the frame event one.

Addresses ticket #9689, where the new optional behavior produces better frame
syncronization.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-10 09:15:37 -03:00
Fei Wang
26890b6b67 lavfi/overlay_vaapi: set defalut alpha value as 1.0
The present default value of 0 will render the overlay video invisible.
A default of 1.0 is consistent with most common use cases.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-08-09 14:02:25 +08:00
James Almer
d93e29154f avfilter/avfiltergraph: remove unnecessary channel layout copy
It's not modified, so we can simply use a const pointer to it.
Also check the return value of the other copy in the function while at it.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-06 20:32:46 -03:00
Timo Rothenpieler
611f843534 avfilter/vsrc_ddagrab: set sRGB color information on output frames
According to MSDN, all integer pixel formats contains sRGB compliant
pixel data, so set the color information on our output frames
accordingly.
2022-08-06 22:23:07 +02:00
Timo Rothenpieler
38595ebe3b avfilter/vsrc_ddagrab: make output format user configurable 2022-08-06 15:50:15 +02:00
Timo Rothenpieler
cbb53bfbd8 avfilter/vsrc_ddagrab: move most of init to config_props
Most notably, the input hw_device_ctx is not set at init time, so using it was impossible.
2022-08-05 14:27:55 +02:00
Timo Rothenpieler
fbf87a46ab avfilter/vsrc_ddagrab: fix mouse cursor render init 2022-08-05 14:07:47 +02:00
Andreas Rheinhardt
f0dd4ab055 avfilter/vf_cropdetect: Remove set-but-unused variable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-30 22:14:26 +02:00
Thilo Borgmann
665349c4c0 lavfi/vf_cropdetect: Reindent after last commit 2022-07-30 13:20:56 +02:00
Thilo Borgmann
9d66417cc5 lavfi/cropdetect: Add new mode to detect crop-area based on motion vectors and edges
This filter allows crop detection even if the video is embedded in non-black areas.
2022-07-30 13:17:28 +02:00
Thilo Borgmann
cf1f574431 lavfi/edge_common: Templatify ff_gaussian_blur and ff_sobel 2022-07-30 13:17:28 +02:00
Niklas Haas
1cbd4552fe fflcms2: move to libavcodec
We will need this helper inside libavcodec in the future, so move it
there, leaving behind an #include to the raw source file in its old
location in libvfilter. This approach is inspired by the handling of
vulkan.c, and avoids us needing to expose any of it publicly (or
semi-publicly) in e.g. libavutil, thus avoiding any ABI headaches.

It's debatable whether the actual code belongs in libavcodec or
libavfilter, but I decided to put it into libavcodec because it
conceptually deals with encoding and decoding ICC profiles, and will be
used to decode embedded ICC profiles in image files.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-07-30 11:42:06 +02:00
Dmitry Rogozhkin
e0691eab22 qsv: Update ffmpeg qsv_errors to recognize GPU hang and other statuses
GPU hang is one of the most typical errors on Intel GPUs in
case something goes wrong. It's important to recognize it
explicitly for easier bugs triage. Also, this error code
can be used to trigger GPU recovery path in self-written
applications.

There were 2 other statuses which MediaSDK can ppotentially return,
MFX_ERR_NONE_PARTIAL_OUTPUT and MFX_ERR_REALLOC_SURFACE. Adding
them as well.

v2: move MFX_ERR_NONE_PARTIAL_OUTPUT next to MFX_WRN_* (Haihao)

Signed-off-by: Hon Wai Chow <hon.wai.chow@intel.com>
Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-07-29 12:30:34 +08:00
Mattias Wadman
1ec1a48458 avfilter/vf_zscale: Add smpte240m transfer option and fix matrix option typo
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-07-28 16:17:23 +02:00
Ting Fu
23953b9eb7 lavf/dnn: dump OpenVINO model input/output names to OVMdel struct.
Dump all input/output names to OVModel struct. In case other funcs use
them for reporting errors or locating issues.

Signed-off-by: Ting Fu <ting.fu@intel.com>
2022-07-24 08:38:50 +08:00
Ting Fu
130d19bf20 lavf/sr: fix the segmentation fault caused by incorrect input frame free.
This issue would cause segmetaion fault when running srcnn model with
sr filter by TensorFlow backend. This filter would free the frame incorectly.

Signed-off-by: Ting Fu <ting.fu@intel.com>
2022-07-22 08:15:04 +08:00
Wenbin Chen
636a629ff6 libavfilter/vf_overlay_qsv: Use format of first input to set output format for overlay_qsv
overlay_qsv hard coded to use nv12 as output format. Now use the format
of the first input to set output format.

For detailed information of supported format on different platform,
please see the "composition" rows in "Video Processing Features" at
below link:
https://www.intel.com/content/www/us/en/develop/documentation/media-capabilities-of-intel-hardware/top.html

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-07-20 12:35:23 +08:00
Timo Rothenpieler
926f355aff avfilter/vsrc_ddagrab: check for existence of DPI_AWARENESS_CONTEXT
Apparently some (broken?) Windows SDK versions define IDXGIOutput5
but not DPI_AWARENESS_CONTEXT. So we need to explicitly check for its
existence.
2022-07-19 13:57:38 +02:00
Anton Khirnov
ecd0a7c5bd lavfi/vf_showinfo: print frame durations 2022-07-19 12:27:18 +02:00
Anton Khirnov
357ba45a5c lavfi: use AVFrame.duration instead of AVFrame.pkt_duration 2022-07-19 12:27:17 +02:00
Timo Rothenpieler
61c151a098 avfilter/vsrc_ddagrab: dynamically load SetThreadDpiAwarenessContext
It's a Windows 10 only function, and its presence alone prevents the
binary from loading on older Windows versions.
2022-07-19 01:29:00 +02:00
Timo Rothenpieler
cb22d5ea3c avfilter/vsrc_ddagrab: fix checkheaders error 2022-07-18 13:08:39 +02:00
Timo Rothenpieler
f611255480 avfilter: add vsrc_ddagrab 2022-07-18 02:08:27 +02:00
Michael Niedermayer
fd26b07e8b Bump versions after 5.1 branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-13 00:29:05 +02:00
Michael Niedermayer
6f1b144358 Bump Versions for 5.1 branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-13 00:27:37 +02:00
Michael Niedermayer
dd6040675e avfilter/vf_signature: Fix integer overflow in filter_frame()
Fixes: CID1403233

The second of the 2 changes may be unneeded but will help coverity

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-12 21:55:22 +02:00
George Floarea
9222965fdd avfilter/vf_xfade: fix zx and zy comparison for slide*
This resulted in the wrong column/row being chosen.
This can be seen best when using xfade on streams with transparency.

For example: in case of a slideleft transition, the first column from
the first input will overwrite the first column of the second stream
throught the transition.
2022-07-12 16:32:30 +02:00
Marton Balint
846488cca8 avfilter/vf_zscale: enable AVX512 zimg functions
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-10 22:35:20 +02:00
Marton Balint
a6f0e641bc avfilter/vf_zscale: simplify and fix slice_params calculations
Do not insist on a fixed slice height, because that can still cause overflows
in corner cases as described in this comment:

https://github.com/sekrit-twc/zimg/issues/177#issuecomment-1157734233

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-10 22:35:20 +02:00
Marton Balint
68fdc9de84 avfilter/vf_zscale: remove some unneeded initializations
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-10 22:35:20 +02:00
Mohamed Khaled Mohamed
b1648150b2 avfilter: add chromakey_cuda filter
GSoC'22

libavfilter/vf_chromakey_cuda.cu:the CUDA kernel for the filter
libavfilter/vf_chromakey_cuda.c: the C side that calls the kernel and gets user input
libavfilter/allfilters.c: added the filter to it
libavfilter/Makefile: added the filter to it
cuda/cuda_runtime.h: added two math CUDA functions that are used in the filter

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2022-07-10 17:20:15 +02:00
Paul B Mahol
fc1ca18fcf avfilter/vf_xfade: add two more transitions 2022-07-09 16:55:50 +02:00
Paul B Mahol
6ed9eaf664 avfilter: add remap opencl filter 2022-07-07 17:52:32 +02:00
Vignesh Venkatasubramanian
aa8905a1b1 avfilter/xstack: Add support for fixed size grid
Add a short hand parameter for making a fixed size grid. The existing
xstack layout parameter syntax gets tedious if all one wants is a
matrix like grid of the input streams. Add a grid option to the xstack
filter that simplifies this use case by simply specifying the number of
rows and columns instead of specific x/y co-ordinate for each stream.

Also updating the filter documentation to explain the new option.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
2022-07-04 19:49:31 +02:00
Andreas Rheinhardt
624d0cf428 avfilter/vf_atadenoise: Remove unused-but-set variables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-03 11:41:23 +02:00
Gyan Doshi
0744c84792 avfilter/Makefile: always make colorspace.o
Unbreaks libavfilter builds when configured with a subset of filters.

drawutils added ff_draw_init2 in 6c3a82f043 which calls functions defined in
colorspace.c. So the latter needs to be built alongside the former.
2022-06-25 17:55:53 +05:30
Paul B Mahol
5a4ffb4f5e avfilter/vf_gblur: properly round output 2022-06-23 18:50:54 +02:00
Andreas Rheinhardt
ed42a51930 avfilter/x86/vf_bwdif: Remove obsolete MMXEXT functions
The only system which benefit from these are truely ancient
32bit x86s as all other systems use at least the SSE2 versions
(this includes all x64 cpus (which is why this code is restricted
to x86-32)).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-22 13:38:14 +02:00
Andreas Rheinhardt
7c3c1d938f avfilter/x86/vf_idet: Remove obsolete MMX(EXT) functions
The only system which benefit from these are truely ancient
32bit x86s as all other systems use at least the SSE2 versions
(this includes all x64 cpus (which is why this code is restricted
to x86-32)).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-22 13:38:01 +02:00
Andreas Rheinhardt
4d7128be9a avfilter/x86/vf_yadif: Remove obsolete MMXEXT functions
The only system which benefit from these are truely ancient
32bit x86s as all other systems use at least the SSE2 versions
(this includes all x64 cpus (which is why this code is restricted
to x86-32)).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-22 13:37:48 +02:00
Andreas Rheinhardt
77b2a422a0 avfilter/x86/vf_eq_init: Remove obsolete MMXEXT function
x64 always has MMX, MMXEXT, SSE and SSE2 and this means
that some functions for MMX, MMXEXT and 3dnow are always
overridden by other functions (unless one e.g. explicitly
disables SSE2) for x64. So given that the only systems that
benefit from process_mmxext are truely ancient 32bit x86s
it is removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-22 13:36:31 +02:00
Andreas Rheinhardt
c5dd2fdc09 avfilter/x86/vf_noise: Remove obsolete MMX function
x64 always has MMX, MMXEXT, SSE and SSE2 and this means
that some functions for MMX, MMXEXT and 3dnow are always
overridden by other functions (unless one e.g. explicitly
disables SSE2) for x64. So given that the only systems that
benefit from line_noise_mmx are truely ancient 32bit x86s
it is removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-22 13:32:08 +02:00
Paul B Mahol
aa1babc59a avfilter/vf_estdif: tweak ecost option 2022-06-21 18:10:39 +02:00
Nil Admirari
69364a06c6 libavfilter/vf_frei0r.c: Use UTF-8 version of getenv()
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-06-21 13:27:46 +03:00
rcombs
6c3a82f043 lavfi/drawutils: improve colorspace support
- Introduce ff_draw_init2, which takes explicit colorspace and range
  args
- Use lavu/csp and lavfi/colorspace for conversion, rather than the
  lavu/colorspace.h macros
- Use the passed-in colorspace when performing RGB->YUV conversions

The upshot of this is:
- Support for YUV spaces other than BT601
- Better rounding for all conversions
- Particular rounding improvements in >8-bit formats, which previously
  used simple left-shifts
- Support for limited-range RGB
- Support for full-range YUV in non-J pixfmts

Due to the rounding improvements, this results in a large number of
minor changes to FATE tests.

Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-19 19:18:34 -05:00
rcombs
a5b3b65dc0 lavfi/colorspace: add ff_matrix_mul_3x3_vec
Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-19 19:18:34 -05:00
Paul B Mahol
42289d5eaf avfilter/vf_zscale: dissallow too small slices
Also change rounding type when calculating slices size.
2022-06-16 10:23:30 +02:00
Paul B Mahol
d39f9feddc avfilter: add virtualbass filter 2022-06-16 10:23:30 +02:00
Andreas Rheinhardt
40e6575aa3 all: Replace if (ARCH_FOO) checks by #if ARCH_FOO
This is more spec-compliant because it does not rely
on dead-code elimination by the compiler. Especially
MSVC has problems with this, as can be seen in
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html
or
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html

This commit does not eliminate every instance where we rely
on dead code elimination: It only tackles branching to
the initialization of arch-specific dsp code, not e.g. all
uses of CONFIG_ and HAVE_ checks. But maybe it is already
enough to compile FFmpeg with MSVC with whole-programm-optimizations
enabled (if one does not disable too many components).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-15 04:56:37 +02:00
Pierre-Anthony Lemieux
4d45f5acbd
avfilter/showinfo: refactor to use avutil/uuid 2022-06-12 18:34:38 +10:00
Thilo Borgmann
72106d6cc3 lavfi/blockdetect: Reindent after last commit 2022-06-06 09:09:34 +02:00
Thilo Borgmann
b7cea55730 lavfi/blockdetect: Fix possible div by 0
Found-by Covererity, CID 1504568, 1504569
2022-06-06 09:09:25 +02:00
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