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

10740 Commits

Author SHA1 Message Date
mail@nodoa.me
38b837e0e1 avfilter/vf_decimate: add mixed option to process input only partially to be decimated
Enabling the option will only decimate frames below dupthresh and output at
variable frame rate.
2022-12-19 16:24:25 +01:00
Paul B Mahol
a350e68c83 avfilter/af_afir: fix some misc low priority issues
Remove double ;; and dead store.
2022-12-18 23:53:19 +01:00
Paul B Mahol
8c75e5fdd3 avfilter/af_afir: improve output when IR switching at runtime
Also improve normalization and add more gtype modes
2022-12-18 19:58:12 +01:00
Saliev, Rafik F
8ad988ac37 libavfilter/dnn: fix openvino async mode
Bugfix: The OpenVino DNN backend in the 'async' mode sets
'task->inference_done' to 'complete' prior to data copy from
OpenVino output buffer to task's output frame.
This order causes task destroy in ff_dnn_get_result_common()
prior to model output processing.

Signed-off-by: Rafik Saliev <rafik.f.saliev@intel.com>
2022-12-17 09:55:14 +08:00
Paul B Mahol
69ac78da9b avfilter/afir_template: avoid indirect accessing nb_partitions value 2022-12-12 20:29:07 +01:00
Paul B Mahol
a73f4ca49b avfilter/afir_template: skip wet gain if its 1 2022-12-12 20:29:07 +01:00
Paul B Mahol
91abbb9d02 avfilter/af_afir: reduce output gain with default parameters
It was unreasonably high. Also change scaling to reduce
rare quantization errors.
2022-12-12 20:29:07 +01:00
Paul B Mahol
8556006984 avfilter/af_afir: improve output quality with small minp
Remove direct convolution implementation as its give worse
results. Simplifies code too.
2022-12-11 18:33:24 +01:00
Paul B Mahol
442bbdb3c5 avfilter/drawutils: rgb48/bgr48 is supported 2022-12-10 14:57:05 +01:00
Paul B Mahol
f0f19f3d3d avfilter: add corr video filter 2022-12-08 13:03:42 +01:00
Haihao Xiang
4061c22428 lavfi/vf_scale_qsv: remove PI, PHI and E
PI, PHI and E are defined in libavutil/eval.c, and user may use these
constants for scale_qsv filter, so we needn't re-define these variables
in vf_scale_qsv.c

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-08 14:29:23 +08:00
Haihao Xiang
3552dba0e1 lavfi/vf_vpp_qsv: accept P010 input in system memory
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-08 14:25:52 +08:00
Haihao Xiang
e5faa1d50c lavfi/vf_vpp_qsv: allow user to set scale_mode with constants
$ ffmpeg -f lavfi -i testsrc -vf "format=nv12,vpp_qsv=scale_mode=hq" -f
null -

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-08 14:24:21 +08:00
Haihao Xiang
d51edd225d lavfi/vf_vpp_qsv: use macros for extra mfx parameter
Make it easy to add new extra mfx parameter buffer. No functional
change.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-08 14:22:12 +08:00
Wenbin Chen
20f2941191 libavfilter/qsvvpp: Change the alignment to meet the requirement of YUV420P format
When process yuv420 frames, FFmpeg uses same alignment on Y/U/V
planes. VPL and MSDK use Y plane's pitch / 2 as U/V planes's
pitch, which makes U/V planes 16-bytes aligned. We need to set
a separate alignment to meet runtime's behaviour.

Now alignment is changed to 16 so that the linesizes of U/V planes
meet the requirment of VPL/MSDK. Add get_buffer.video callback to
qsv filters to change the default get_buffer behaviour.

Now the commandline works fine:
ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 3082x1884 \
-i ./3082x1884.yuv -vf 'vpp_qsv=w=2466:h=1508' -f rawvideo \
-pix_fmt yuv420p 2466_1508.yuv

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-12-08 14:21:07 +08:00
Paul B Mahol
f2e0351b77 avfilter/vf_vif: add missing framesync options 2022-12-07 12:23:16 +01:00
Paul B Mahol
cb9ab38c52 avfilter/vf_chromanr: split inner loops
Makes overall faster processing in default case.
2022-12-07 00:57:25 +01:00
Paul B Mahol
cc11afe502 avfilter/avf_showvolume: make rms meter actually get rms of whole frame 2022-12-06 17:31:56 +01:00
Paul B Mahol
520111c610 avfilter/vf_thumbnail: allow to change stats log level 2022-12-05 21:08:02 +01:00
Paul B Mahol
46642ceeaf avfilter/vf_thumbnail: optimize planar processing path 2022-12-05 21:07:11 +01:00
Paul B Mahol
6c814093d8 avfilter/vf_bm3d: switch to TX from lavu 2022-12-04 23:02:07 +01:00
Timo Rothenpieler
ee650398ec avfilter/vf_libplacebo: ensure filter hwdevice is a vulkan one
Before this, the filter blindly casts to AVVulkanDeviceContext and
passes invalid values to libplacebo if it's not.
2022-12-04 15:22:13 +01:00
Paul B Mahol
fc016fd665 avfilter/vf_exposure: ensure that scale is always > 0 2022-12-04 13:22:36 +01:00
Paul B Mahol
ec32c62cad avfilter/avf_showcwt: write also to alpha plane if available 2022-12-04 11:18:48 +01:00
Paul B Mahol
7bf74f909d avfilter/af_afftdn: fix invalid duplicated use of sizeof() 2022-12-03 21:28:54 +01:00
Paul B Mahol
754fa305fa avfilter/af_astats: accessing outlink in uninit is not valid 2022-12-03 17:32:07 +01:00
Paul B Mahol
e69909342e avfilter/avf_showcwt: fix logic mistake 2022-12-03 12:47:02 +01:00
Paul B Mahol
6b368bcb85 avfilter/af_apsyclip: add copy_props() call 2022-12-01 19:50:54 +01:00
Paul B Mahol
4d38d4607c avfilter/af_astats: print stats in case nb_samples is 0
Happens with special function only.
2022-12-01 19:21:11 +01:00
Marvin Scholz
fcbdd145cd avfilter/f_metadata: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz
492b45cb19 avfilter/vf_libvmaf: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz
d5d6e5ccec avfilter/vf_coreimage: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz
1cf526c37a avfilter/vf_scale: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Haihao Xiang
0ae459176b lavfi/vf_vpp_qsv: scale_mode can be applied to color conversion
Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-01 09:40:40 +08:00
Haihao Xiang
7a856588dc lavfi/qsvvpp: provide a default framerate if needed
VPP in the SDK requires the frame rate to be set to a valid value,
otherwise init will fail, so always set a default framerate when the
input link doesn't have a valid framerate.

Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-01 09:40:31 +08:00
Haihao Xiang
51bad2e6a7 lavfi/qsvvpp: avoid overriding the returned value
It means more than one output is ready when
MFXVideoVPP_RunFrameVPPAsync() returns MFX_ERR_MORE_SURFACE [1].
Currently the returned value from MFXVideoVPP_RunFrameVPPAsync() might
be overridden, so the check of 'ret == MFX_ERR_MORE_SURFACE' is always
false when MFX_ERR_MORE_SURFACE is returned from
MFXVideoVPP_RunFrameVPPAsync()

[1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#video-processing-procedures

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-01 09:39:32 +08:00
Chen,Wenbin
50575e24be lavfi/qsvvpp: change the output frame's width and height
Make sure the size of the output frame always matches the agreed upon
image size.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-12-01 09:39:32 +08:00
Paul B Mahol
14e6ca17e1 avfilter/af_astats: do not give output for 0 samples 2022-11-30 21:19:49 +01:00
Paul B Mahol
569b1a24cd avfilter/avf_showcwt: add yet another mode variant 2022-11-30 20:08:18 +01:00
Paul B Mahol
7d20635aeb avfilter/avf_showcwt: add frame slide mode 2022-11-30 18:06:42 +01:00
Paul B Mahol
bcb5ef667d avfilter/avf_showcwt: add some small optimizations 2022-11-30 18:06:42 +01:00
Paul B Mahol
d7a5f068c2 avfilter/avf_showcwt: add thread jobs for forward fft per channel 2022-11-29 22:26:56 +01:00
Paul B Mahol
9d717cb846 avfilter/avf_showcwt: flush frames at EOF 2022-11-29 22:26:55 +01:00
Paul B Mahol
a08a508105 avfilter/avf_showcwt: refactor code into function 2022-11-29 22:26:55 +01:00
Paul B Mahol
634e29f3c0 avfilter/avf_showcwt: always consume some available samples
Stop waiting for big cache of samples.
2022-11-29 22:26:55 +01:00
Paul B Mahol
d34c1b389e avfilter: add showcwt multimedia filter 2022-11-28 23:18:03 +01:00
Niklas Haas
48c385fb4c avfilter/vf_libplacebo: support more output formats
Rather than hard-coding AV_PIX_FMT_VULKAN, expand this to the full list
of formats supported by <libplacebo/utils/libav.h>. We re-use the
existing `format` option to allow selecting specific software formats in
addition to specific vulkan hwframe formats.

Some minor changes are necessary to account for the fact that
`ff_vk_filter_config_output` is now only called optionally, the fact
that the output format must now be parsed before `query_format` gets
called, and the fact that we need to call a different function to
retrieve data from the `pl_frame` in the non-hwaccel case.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-11-28 16:05:36 +01:00
Paul B Mahol
2324b917fc avfilter/avf_avectorscope: simplify code a little 2022-11-27 19:53:16 +01:00
Paul B Mahol
e0bc798ce5 avfilter/f_ebur128: fix crash when using vflip filter 2022-11-25 19:50:17 +01:00
Paul B Mahol
4c1a79eb80 avfilter/avf_showcqt: fix crash when using vflip filter 2022-11-25 19:40:11 +01:00
Paul B Mahol
9d2b5762d3 avfilter/avf_a3dscope: fix crash when using vflip filter 2022-11-25 19:40:11 +01:00
Paul B Mahol
9c8b977c1e avfilter/avf_avectorscope: fix crash when using vflip filter 2022-11-25 19:40:11 +01:00
Paul B Mahol
f2ea508e16 avfilter/avf_showcqt: remove invalid line 2022-11-25 19:40:11 +01:00
Paul B Mahol
3e288dbf56 avfilter/avf_showspectrum: set hop_size for showspectrumpic
Fixes invalid spikes in video output.
2022-11-21 15:47:02 +01:00
Wang, Bin
459527108a libavfilter/x86/vf_convolution: fix sobel swap issue on WIN64
Reviewed by: James Almer <jamrial@gmail.com>
Signed-off-by: Wang, Bin <bin.wang@intel.com>
2022-11-21 12:28:25 +08:00
Paul B Mahol
34eeb466fb avfilter/af_surround: fix possible out of array access 2022-11-19 19:35:23 +01:00
Paul B Mahol
66afa361e8 avfilter/af_surround: refactor code
So support for new i/o layouts are more easily added.
2022-11-19 15:20:23 +01:00
Niklas Haas
46a4cc460e avfilter/vf_libplacebo: fix normalize_sar calculation
This previous expression multiplied a constant (outlink->h) that was
guaranteed to be 0 at this point, thus making it always a no-op.

Fix the calculation, and also properly reset the SAR to 1:1 as is now
necessary (the failure to do so previously hid this bug's existence).
2022-11-19 14:15:47 +01:00
Niklas Haas
05d390890a avfilter/vf_libplacebo: default to normalize_sar=0
As a result of a typo in the source code, this option was completely
non-functional. In order to fix it, without breaking the current default
behavior, explicitly change this default to 0.

This behavior is also consistent with how other scale filters behave by
default, so it's probably best to enshrine it anyways.
2022-11-19 14:15:19 +01:00
Paul B Mahol
3bcec58535 avfilter: fix av_tx_fn stride usage for complex inputs 2022-11-19 00:25:47 +01:00
Paul B Mahol
fced45fd95 avfilter/af_surround: improve LFE loudness 2022-11-18 21:51:10 +01:00
Paul B Mahol
52291d2ac8 avfilter/af_surround: implement smooth option/support 2022-11-18 21:51:10 +01:00
Paul B Mahol
3d33003d59 avfilter/af_surround: split factors calculations
From multiplication with magnitude.
2022-11-18 21:51:10 +01:00
Paul B Mahol
08b4c3d6d6 avfilter/af_surround: improve front center channel
Stops producing too loud output of front center channel in stereo upmix
by using average magnitude instead of square root of squared magnitudes.
2022-11-18 21:51:10 +01:00
Niklas Haas
12b4ab5d4d avfilter/vf_libplacebo: fix output format selection
After commit c0b93, it's possible that `ff_vk_filter_config_input` never
gets called, leading to `s->vkctx.input_format` being left unset. This
broke the format auto-selection logic in `libplacebo_config_output`,
resulting in a default to yuv420p, instead of defaulting to the input
format as intended.

Fixes: c0b93c4f8b
2022-11-18 16:14:23 +01:00
Niklas Haas
d1b14b4f0b avfilter/vf_libplacebo: suppress warning on older libplacebo
Move the declaration before the code.
2022-11-18 16:11:01 +01:00
Paul B Mahol
3e6816514c avfilter/af_surround: fix regression with channel i/o gain 2022-11-18 12:58:09 +01:00
Paul B Mahol
193270ee87 avfilter/avf_showspectrum: fix stride and set scale 2022-11-18 12:58:09 +01:00
Paul B Mahol
00409d81d9 avfilter/af_surround: simplify some code more 2022-11-18 00:53:51 +01:00
Paul B Mahol
2e53376a9b avfilter/af_surround: add more layouts for stereo upmix 2022-11-17 20:27:31 +01:00
Paul B Mahol
4f6c06e8ff avfilter/af_firequalizer: switch to TX from lavu 2022-11-17 13:28:58 +01:00
Paul B Mahol
59b16355ec avfilter/avf_showspatial: switch to lavu TX
Also try harder to make output constant frame rate.
2022-11-17 12:37:22 +01:00
Paul B Mahol
24cd4c9661 avfilter/af_loudnorm: simplify query_formats() 2022-11-17 12:37:22 +01:00
Paul B Mahol
07357e56a6 avfilter/avf_showspectrum: fix possible hang at EOF
May happen when using filter fps option.
2022-11-17 01:15:05 +01:00
Paul B Mahol
a640b2874a avfilter/af_surround: allow non-power of 2 win_size 2022-11-17 00:01:40 +01:00
Paul B Mahol
404c2955b1 avfilter/af_surround: move upmix before irdft 2022-11-16 20:40:04 +01:00
Paul B Mahol
d770403cac avfilter/af_surround: refactor some code 2022-11-16 20:40:04 +01:00
Paul B Mahol
752039a9eb avfilter/af_surround: add support for commands 2022-11-15 19:52:38 +01:00
Paul B Mahol
64031c5e65 avfilter/af_surround: add focus option
And improve angle option handling.
2022-11-15 19:52:38 +01:00
Niklas Haas
c0b93c4f8b avfilter/vf_libplacebo: support all supported pixfmts
This is done only to the inputs, not the outputs, because we always
output vulkan hwframes.

Doing so also requires keeping track of backing textures for non-hwdec
formats, but is otherwise a mostly straightforward change to the format
query function. Special care needs to be taken to avoid crashing on
older libplacebo due to AV_PIX_FMT_RGBF32LE et al.
2022-11-15 16:47:55 +01:00
Niklas Haas
be13812a23 avfilter/vf_libplacebo: init vulkan device in query_format
Instead of doing it ad-hoc in `filter_frame`. This is not a huge change
on its own, but paves the way for adding support for more formats in the
future, in particular formats other than AV_PIX_FMT_VULKAN.
2022-11-15 16:47:55 +01:00
Cosmin Stejerean
3b375a0c5c lavfi/vf_dnn_processing.c: Fix missing AV_PIX_FMT_GRAY8
Has been removed by mistake in 2003e32f62, readd it to the switch cases.

Signed-off-by: Thilo Borgmann <thilo.borgmann@mail.de>
2022-11-15 13:42:58 +01:00
Paul B Mahol
52f7adfbde avfilter/af_surround: add forgotten null pointer check 2022-11-15 10:42:30 +01:00
Paul B Mahol
11d744343f avfilter/af_surround: avoid using doubles 2022-11-15 10:42:30 +01:00
Paul B Mahol
9bbd3b3b17 avfilter/af_surround: check that upmix func ptr is valid 2022-11-14 22:20:44 +01:00
Paul B Mahol
e0fbf89939 avfilter/af_surround: speed up slice threading for stereo upmixing
And add stereo->octagonal/8.0 upmix.
2022-11-14 22:04:14 +01:00
bwang30
3ab11dc5bb libavfilter/x86/vf_convolution: add sobel filter optimization and unit test with intel AVX512 VNNI
This commit enabled assembly code with intel AVX512 VNNI and added unit test for sobel filter

sobel_c: 4537
sobel_avx512icl 2136

Signed-off-by: bwang30 <bin.wang@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-11-14 10:04:16 +08:00
Andreas Rheinhardt
bfab87a61d avfilter/vf_fftdnoiz: Check return value of av_tx_init()
Should fix Coverity issue #1500329.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-12 13:36:31 +01:00
Andreas Rheinhardt
c787eab395 avfilter/af_afir: Check return value of av_tx_init()
Should fix Coverity issue #1516762.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-12 13:35:45 +01:00
Andreas Rheinhardt
36d0550bc9 avfilter/vf_fftfilt: Check return value of av_tx_init()
Should fix Coverity issue #1516765.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-12 13:33:58 +01:00
Andreas Rheinhardt
b6fcf3a617 avfilter/af_surround: Check return value of av_tx_init()
Should fix Coverity issue #1516766.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-12 13:24:35 +01:00
Paul B Mahol
8e96319674 avfilter/af_dynaudnorm: add curve option 2022-11-10 19:16:05 +01:00
Paul B Mahol
a0c7c9d636 avfilter/f_ebur128: add quiet framelog mode 2022-11-10 19:15:53 +01:00
Paul B Mahol
05721c5df8 avfilter/vf_thumbnail: add slice threading support 2022-11-10 14:52:48 +01:00
Andreas Rheinhardt
a7ccfdc0d7 avfilter/vf_hqdn3d: Fix left-shift of negative numbers
Affected filter-hqdn3d and filter-hqdn3d-sample FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-09 17:39:00 +01:00
Andreas Rheinhardt
cf57147da1 avfilter/phase_template: Fix left-shift of negative numbers
Affected the filter-phase FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-09 17:39:00 +01:00
Andreas Rheinhardt
e72e8ec515 avfilter/vf_qp: Don't store NAN in int
Affected the filter-pp2 FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-09 17:39:00 +01:00
Paul B Mahol
10ddbaf514 avfilter/af_loudnorm: stop rewritting pts 2022-11-09 11:56:01 +01:00
Paul B Mahol
40d0cb93ab avfilter/af_loudnorm: switch to activate 2022-11-09 11:56:01 +01:00
Rui Zhu
36572a0c1d avfilter/af_loudnorm: fix incorrect gain when audio is shorter than 3s
The input data is multiplied by `s->offset` to get normalized output.
`s->target_tp` and `true_peak` is not in dB,
so `s->offset` should be calculated by division instead of subtraction.

Signed-off-by: Rui Zhu <real.zhurui@gmail.com>
2022-11-09 11:56:01 +01:00
Paul B Mahol
e17628b720 avfilter/af_speechnorm: change initial gain state
Stops doing unwanted fade-in at start.
2022-11-07 08:32:48 +01:00
Paul B Mahol
7f4c5f6525 avfilter/af_speechnorm: remove long search range for min gain
Effective only for linked channels processing.
2022-11-07 08:32:48 +01:00
Paul B Mahol
7027101904 avfilter/af_speechnorm: implement rms option 2022-11-07 08:32:48 +01:00
softworkz
c8050d82a9 avfilter/overlay_vaapi: enable expressions for overlay parameters
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz
ff075f5abb avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz
916447bf4c avfilter/overlay_vaapi: add framesync options
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz
db6b376db9 avfilter/overlay_vaapi: remove redundant .get_buffer assignments
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz
7ebd6189a2 avfilter/overlay_vaapi: reformat options
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz
50aeaadad0 avfilter/overlay_vaapi: handle secondary null input
Currently segfaults in this case.

Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz
55cc8312cc avfilter/overlay_vaapi: remove double framesync init
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz
e154d8931e avfilter/overlay_vaapi: build filter params just once
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz
a847c82289 avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
mail@nodoa.me
e8850bc2a8 lavfi/vf_fieldmatch: keep fields as-is if not matched properly
Makes it possible to use deinterlacers which output one frame for each field as fallback if field
matching fails (combmatch=full).

Currently, the documented example with fallback on a post-deinterlacer will only work in case the
deinterlacer outputs one frame per first field (as yadif=mode=0). The reason for that is that
fieldmatch will attempt to match the second field regardless of whether it recognizes the end
result is still interlaced. This produces garbled output with for example mixed telecined 24fps and
60i content combined with a field-based deinterlaced such as yadif=mode=1.
This patch orders fieldmatch to revert to using the second field of the current frame in case the
end result is still interlaced and a post-deinterlacer is assumed to be used.

Signed-off-by: lovesyk <lovesyk@users.noreply.github.com>
2022-11-05 11:50:36 +01:00
Paul B Mahol
5c2a29cf72 avfilter: add backgroundkey video filter 2022-11-05 10:52:39 +01:00
Paul B Mahol
369b7f2654 avfilter/af_dynaudnorm: add slice threading support 2022-11-04 18:32:13 +01:00
Paul B Mahol
4a672f1c0e avfilter/af_dynaudnorm: process also short durations 2022-11-04 18:32:13 +01:00
Paul B Mahol
4dda3b1653 avfilter/vf_pseudocolor: add spectral preset 2022-11-04 08:50:04 +01:00
Paul B Mahol
5661c8715c avfilter/src_movie: support unknown channel layouts 2022-11-02 10:53:44 +01:00
Brendan Hack
01b9abd771 avfilter/vf_frei0r: set align to 1 for frei0r frames
The frei0r API requires linesize to be width * 4.
Since the align property of ff_default_get_video_buffer2
specifies line alignment, not buffer alignment, the
previous value of 16 breaks this requirement for frames
whose width is a multiple of 8, but not a multiple of 16
as it adds extra padding to ensure line aligment.

Fix Trac ticket #9873
2022-10-29 17:11:14 +02:00
Paul B Mahol
00b03331a0 avfilter/vf_threshold: fix handling of zero threshold 2022-10-27 10:23:24 +02:00
Paul B Mahol
0e5e3b37c0 avfilter/vf_[color/chroma]key: lower lower limit for similarity option 2022-10-27 10:23:09 +02:00
Takeshi (Kesh) Ikuma
65f96a965a avfilter/vf_curves: add PCHIP interpolator and interp option
summary: This patch modifies the `curves` filter with new `interp` option
         to let user pick the existing natural cubic spline interpolation
         and the new PCHIP interapolation.

reason:  The natural cubic spline does not impose monotonicity between
         the keypoints. As such, the fitted curve may vary wildly against
         user's intension. The PCHIP interpolation is not as smooth as
         the natural spline but guarantees the monotonicity. Providing
         both options enhances users experience (e.g., reduces the number
         of keypoints to realize the desired curve). See the related bug
         report for the example of an ill-interpolated curve.

alternate solution:
         Both Photoshop and GIMP appear to use monotonic interpolation in
         their curve tools, which were the models for this filter. As
         such, an alternate solution is to drop the natural spline and
         go without the `interp` option.

related bug report: https://trac.ffmpeg.org/ticket/9947 (filed by myself)

Signed-off-by: Takeshi (Kesh) Ikuma <tikuma@hotmail.com>
2022-10-22 19:35:44 +02:00
Paul B Mahol
ff3c708686 avfilter/vf_fftdnoiz: improve filtering at edges 2022-10-22 12:04:43 +02:00
Paul B Mahol
da4ff1d536 avfilter/vf_maskedthreshold: implement diff mode
To be useful for adaptive thresholding with threshold filter.
2022-10-21 20:11:14 +02:00
Paul B Mahol
754d52cf42 avfilter/window_func: add kaiser window 2022-10-20 12:13:37 +02:00
Marvin Scholz
60224f203f avfilter: Fix doxy references
Doxygen does not properly form references that span multiple levels,
so instead reword it a bit and manually add the references to what
they should point to.
2022-10-17 09:56:44 +02:00
Anton Khirnov
9e8a327e68 lavfi/src_avsynctest: set video frame durations
This filter produces CFR video output.
2022-10-13 10:19:13 +02:00
Anton Khirnov
cdc4d99089 lavfi/vf_minterpolate: set output frame durations
This filter produces CFR output.
2022-10-13 10:19:13 +02:00
Anton Khirnov
c9508a019d lavfi/vf_frei0r: set frame durations for frei0r_src
This source produces CFR output.
2022-10-13 10:19:13 +02:00
Anton Khirnov
d1526f4dac lavfi/vf_deinterlace_qsv: set output frame durations 2022-10-13 10:19:13 +02:00
Anton Khirnov
4b2f380e0a lavfi/vf_framepack: properly set output duration for framesequence output
Output has to be CFR in this case.
2022-10-13 10:19:13 +02:00
Anton Khirnov
fa5730d84a lavfi/vf_estdif: set frame durations 2022-10-13 10:19:13 +02:00
Anton Khirnov
62bfcc340f lavfi/vf_estdif: drop a redundant context variable
It is only used in filter() and always set immediately before filter()
is called, so it can be passed as a parameter instead.
2022-10-13 10:19:13 +02:00
Anton Khirnov
2feeb6d103 lavfi/vf_estdif: drop an unused function parameter 2022-10-13 10:19:13 +02:00
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