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

10849 Commits

Author SHA1 Message Date
James Almer
b37795688a avfilter/vf_showinfo: use av_frame_side_data_name() to print side data names
This ensures all defined types are supported, even if only to report
their presence and print their size if a custom implementation is
not added.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-01-13 18:30:51 -03:00
Anton Khirnov
54c0e72b42 lavfi/graphparser: drop a redundant label 2023-01-10 11:52:02 +01:00
Anton Khirnov
ca67a783ab lavfi/graphparser: improve applying graph-level sws options
The current code will apply them if the options string does not contain
a 'flags' substring, and will do so by appending the graph-level option
string to the filter option string (with the standard ':' separator).
This is flawed in at least the following ways:
- naive substring matching without actually parsing the options string
  may lead to false positives (e.g. flags are specified by shorthand)
  and false negatives (e.g. the 'flags' substring is not actually the
  option name)
- graph-level sws options are not limited to flags, but may set
  arbitrary sws options

This commit simply applies the graph-level options with
av_set_options_string() and lets them be overridden as desired by the
user-specified filter options (if any). This is also shorter and avoids
extra string handling.
2023-01-10 11:52:02 +01:00
Anton Khirnov
1c18530e93 lavfi/avfilter: process options for filters without a private class
It still makes sense to apply AVFilterContext-level options to such
filters.
2023-01-10 11:52:02 +01:00
Anton Khirnov
d234b4b193 lavfi/avfilter: simplify process_options()
This function currently treats AVFilterContext options and
filter-private options differently: the former are immediately applied,
while the latter are stored in a dictionary to be applied later.

There is no good reason for having two branches - storing all options in
the dictionary is simpler and achieves the same effect (since it is
later applied with av_opt_set_dict()).

This will also be useful in future commits.
2023-01-10 11:52:02 +01:00
Anton Khirnov
b6ba764552 lavfi/avfilter: export a multikey dict from process_options()
This way the function does not need to be able to match keys to
AVOptions, which will be useful in future commits.
2023-01-10 11:52:02 +01:00
Anton Khirnov
bd7c07c26a lavfi/avfilter: avoid a redundant av_opt_set_dict2() call
Current code first sets AVFilterContext-level options, then aplies the
leftover on the filter's private data. This is unnecessary, applying the
options to AVFilterContext with the AV_OPT_SEARCH_CHILDREN flag
accomplishes the same effect.
2023-01-10 11:52:02 +01:00
Anton Khirnov
a7b1b4bc23 lavfi: remove AVFilter.init_dict()
Nothing uses it anymore.

All options on all filters can now be set with normal AVOptions
mechanisms, such as av_opt_set*().
2023-01-10 11:52:02 +01:00
Anton Khirnov
018a8b9dc3 lavfi/vf_scale: allow passing options to swscale directly
Avoid using the dictionary mechanism, which is non-introspectable. As
this is the only user of AVFilter.init_dict(), this callback can now be
removed.
2023-01-10 11:52:02 +01:00
Paul B Mahol
5d3f0226ad avfilter/avf_avectorscope: add anti-aliased line drawing mode 2023-01-09 18:07:05 +01:00
Clément Bœsch
6e05622216 avfilter/paletteuse: use explicit key indexes in set_frame_lut 2023-01-03 17:29:13 +01:00
Clément Bœsch
68275043a0 avfilter/paletteuse: add atkinson dithering
Atkinson according to
https://bisqwit.iki.fi/jutut/kuvat/ordered_dither/error_diffusion.txt:

        *   1   1    / 8
    1   1   1
        1
2023-01-03 17:29:13 +01:00
Clément Bœsch
c973e8ae79 avfilter/paletteuse: add burkes dithering
Burkes according to
https://bisqwit.iki.fi/jutut/kuvat/ordered_dither/error_diffusion.txt:

          *  8  4
    2  4  8  4  2   / 32
2023-01-03 17:29:13 +01:00
Clément Bœsch
9973343bf9 avfilter/paletteuse: add sierra3 dithering
Sierra3 according to
https://bisqwit.iki.fi/jutut/kuvat/ordered_dither/error_diffusion.txt:

          *  5  3
    2  4  5  4  2
       2  3  2      / 32
2023-01-03 17:29:13 +01:00
Clément Bœsch
11926c4bd4 avfilter/palette{gen,use}: misc for-loop cosmetics 2023-01-03 17:18:56 +01:00
Clément Bœsch
1340fe7caf avfilter/paletteuse: move r,g,b computation in a more local scope 2023-01-03 17:18:55 +01:00
Clément Bœsch
1ae1b707e2 avfilter/paletteuse: remove mean error tool
This belongs in another filter.
2023-01-03 17:18:55 +01:00
Clément Bœsch
8789a9e05b avfilter/paletteuse: remove alternative search methods
This is a maintenance pain more than anything. It appears to make the
code slightly faster as a side effect.
2023-01-03 17:18:55 +01:00
Clément Bœsch
0f7942afa6 avfilter/paletteuse: switch to recursive method
It appears faster than the iterative method on my machine (1.06x
faster), so I'm guessing compilers improved over time (the iterative
version was slightly faster in the past).
2023-01-03 17:18:55 +01:00
Clément Bœsch
6c7b54e962 avfilter/paletteuse: use lowbias32 for color hashing
Impact is more negligible than previous commit but still faster (1.02x).
2023-01-03 17:18:55 +01:00
Clément Bœsch
c9084cd0e2 avfilter/palettegen: use lowbias32 for color hashing
1.12x faster overall in palettegen on my machine.
2023-01-03 17:18:55 +01:00
Clément Bœsch
3cafbdc083 avfilter/palette: add lowbias32 hashing 2023-01-03 17:18:55 +01:00
Clément Bœsch
051926868c avfilter/palette{gen,use}: update Copyright after recent changes 2023-01-03 17:18:55 +01:00
Clément Bœsch
3a4a6c7815 avfilter/palettegen: use libc qsort
Now that the sort function is deterministic, we can rely on the libc
sorting function.
2023-01-03 17:18:55 +01:00
Clément Bœsch
8057e1a618 avfilter/palettegen: make refs order deterministic
Currently, in case of equality on the first color channel, the order of
the ref colors is defined by the hashing function. This commit makes the
sorting deterministic and improve the hierarchical ordering.
2023-01-03 17:18:55 +01:00
Clément Bœsch
2441e53c0a avfilter/palettegen: add a warning about supporting only sRGB 2023-01-03 17:18:55 +01:00
Clément Bœsch
9026d92c13 avfilter/palettegen: base box split decision on a perceptual model
Similar to the change in paletteuse, we rely on a perceptual model to
decide how and where to split the box.
2023-01-03 17:18:55 +01:00
Clément Bœsch
724f52b906 avfilter/palettegen: switch to signed arithmetic
This prevents mixed sign arithmetic (typically because we have signed
color channel differences), which has nasty side effects in C.
2023-01-03 17:18:55 +01:00
Clément Bœsch
67ce6ad9a2 avfilter/palettegen: rename local variable box_weight to weight
This variable is used only for the running weight (used to reach the
target median). The places where we actually need the box weight are
changed to use box->weight.
2023-01-03 17:18:55 +01:00
Clément Bœsch
61d334d8c3 avfilter/palettegen: misc cosmetics 2023-01-03 17:18:55 +01:00
Clément Bœsch
efb0a6f6ce avfilter/palettegen: compute average color within compute_box_stats() 2023-01-03 17:18:55 +01:00
Clément Bœsch
dafd43b78d avfilter/palettegen: change cut score from ∑e² to max e²
This is following the results from personal research¹.

¹: https://github.com/ubitux/research/tree/main/color-quantization#results
2023-01-03 17:18:55 +01:00
Clément Bœsch
187f5e7f90 avfilter/palettegen: rename variance to cut_score
"Variance" wasn't exactly the correct word; "cut score" is more
agnostic, which will be useful when changing the algorithm in the next
commit.
2023-01-03 17:18:55 +01:00
Clément Bœsch
e49fc1a6ef avfilter/palettegen: always compute the box variance
The variance computation is simple enough now (since we can use the axis
squared errors) that it doesn't need to have a complex lazy computation
logic.
2023-01-03 17:18:55 +01:00
Clément Bœsch
9e5f494d26 avfilter/palettegen: use box->major_axis without intermediate variable 2023-01-03 17:18:55 +01:00
Clément Bœsch
86bced7c65 avfilter/palettegen: define the best axis to cut using the squared error
This is following the results from personal research¹.

¹: https://github.com/ubitux/research/tree/main/color-quantization#results
2023-01-03 17:18:55 +01:00
Clément Bœsch
21f7814238 avfilter/palettegen: move box stats computation to a dedicated function 2023-01-03 17:18:55 +01:00
Clément Bœsch
a0587c0219 avfilter/paletteuse: switch to a perceptual model
Now the selection of the color is based on a distance built around human
perception of color instead of the unreliable sRGB triplet one.
2023-01-03 17:18:55 +01:00
Clément Bœsch
1159c36d6d avfilter/paletteuse: remove redundant alpha condition
This is redundant with a != 0xff below.
2023-01-03 17:18:55 +01:00
Clément Bœsch
4c061bc837 avfilter/paletteuse: remove unused alpha split dimension
The equalities in the w{r,g,b} range checks make sure longest is never
0. Even if the alpha ended up being selected in get_next_color() it
would cause underread memory accesses in its caller (colormap_insert).
2023-01-03 17:18:55 +01:00
Clément Bœsch
71ed92e9c4 avfilter/paletteuse: name target color arg consistently in colormap functions 2023-01-03 17:18:55 +01:00
Clément Bœsch
755c427f7a avfilter/paletteuse: switch from u8[4] to u32 for color code
This change simplifies the code quite a bit and make it consistent with
how it's done in palettegen.
2023-01-03 17:18:55 +01:00
Clément Bœsch
31c5f26a46 avfilter/palette{gen,use}: add palette utils
These color management helpers will be shared by palettegen and
paletteuse in the following commits.

Note that it probably makes sense to share at least the sRGB/linear
functions with other filters at some point.

More information on OkLab can be found here: https://bottosson.github.io/posts/oklab/

For the arithmetic integer version, see:
http://blog.pkh.me/p/38-porting-oklab-colorspace-to-integer-arithmetic.html
and https://github.com/ubitux/oklab-int
2023-01-03 17:18:55 +01:00
Clément Bœsch
7bc054e63c avfilter/palette{gen,use}: simplify a few alpha masks 2023-01-03 17:18:55 +01:00
Clément Bœsch
320fbf5f24 avfilter/palette{gen,use}: revert support palettes with alpha
This reverts commit dea673d0d5.

This change cannot work for several reasons, the most obvious ones are:

- the alpha is being part of the scoring of the color difference, even
  though we can not interpret the alpha as part of the perception of the
  color (we don't even know if it's premultiplied or postmultiplied)
- the colors are averaged with their alpha value which simply cannot
  work

The command proposed in the original thread of the patch actually
produces a completely broken file:

    ffmpeg -y -loglevel verbose -i fate-suite/apng/o_sample.png -filter_complex "split[split1][split2];[split1]palettegen=max_colors=254:use_alpha=1[pal1];[split2][pal1]paletteuse=use_alpha=1" -frames:v 1 out.png

We can see that many color pixels are off, but more importantly some
colors have a random alpha value: https://imgur.com/eFQ2UK7

I don't see any easy fix for this unfortunately, the approach appears to
be flawed by design.
2023-01-03 17:18:55 +01:00
Clément Bœsch
cad9d7fc85 avfilter/palettegen: allow a minimum of 2 colors 2023-01-03 17:18:55 +01:00
Paul B Mahol
c94988a781 avfilter/af_afade: add options to control unity/silence gains 2023-01-03 10:25:06 +01:00
Paul B Mahol
3879555cd5 avfilter/afir_template: make IR transitions artifacts free 2023-01-02 15:33:57 +01:00
Paul B Mahol
eeb280f351 avfilter/af_afir: fix prev_selir variable change in private filter context 2022-12-25 20:39:54 +01:00
Paul B Mahol
eaba6bfc51 avfilter/afir_template: reduce memset overhead a little 2022-12-25 20:39:54 +01:00
Paul B Mahol
8906145cdf avfilter/af_afir: increase max partition size 2022-12-25 20:39:54 +01:00
Paul B Mahol
64ddf04460 avfilter/af_afir: reduce memory usage 2022-12-25 20:39:54 +01:00
Paul B Mahol
9498bc7c32 avfilter/af_afir: make dry/wet runtime options 2022-12-22 17:09:15 +01:00
Paul B Mahol
54ebe1e8dc avfilter/afir_template: skip useless moving of samples 2022-12-22 17:09:15 +01:00
Paul B Mahol
bc1fc1be99 avfilter/afir_template: stop using hack to zero out data 2022-12-22 17:09:15 +01:00
Niklas Haas
a69b08790b avfilter/vf_tinterlace: support full-range YUV
This filter, when used in the "pad" mode, currently makes the
distinction between limited and full range solely by testing for YUVJ
pixel formats at link setup time. This is deprecated and should be
improved to perform the detection based on the per-frame metadata.

In order to make this distinction based on color range metadata, which
is only known at the time of filtering frames, for simplicity, we simply
allocate two copies of the "black" frame - one for limited range and the
other for full range metadata. This could be done more dynamically (e.g.
as-needed or simply by blitting the appropriate pixel value directly),
but this change is relatively simple and preserves the structure of the
existing code.

This commit actually fixes a bug in FATE - the new output is correct for
the first time. The previous md5 ref was of a frame that incorrectly
combined full-range pixel data with limited-range black fields. The
corresponding result has been updated.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-12-20 14:02:37 +01:00
Niklas Haas
8e2f61ef04 avfilter/vf_blackdetect: support full-range YUV
This filter currently makes the distinction between limited and full
range by testing for the deprecated YUVJ pixel formats at link setup
time. This is deprecated and should be improved to perform the detection
based on the per-frame metadata.

Rewrite it to calculate the black pixel threshold at the time of
filtering a frame, when metadata about the frame's color range is known.
Doing it this way has the small side benefit of being able to handle
streams with variable metadata, and is not a meaningful performance
cost.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-12-20 14:02:37 +01:00
Paul B Mahol
3b66757d7d avfilter: add adrc filter 2022-12-19 20:43:58 +01:00
Paul B Mahol
744100af62 avfilter/af_headphone: properly initialize scale 2022-12-19 18:45:56 +01:00
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