Commit Graph

10005 Commits

Author SHA1 Message Date
Paul B Mahol 30c7f37d80 avfilter/vf_mix: add planes option 2022-02-15 20:07:40 +01:00
Paul B Mahol 0da255dd10 avfilter/vf_mix: improve speed of processing 2022-02-14 23:57:58 +01:00
Paul B Mahol e235c76487 avfilter/vf_tmix: increase max allowed number of frames 2022-02-14 23:57:58 +01:00
Paul B Mahol 81df787b53 avfilter/avf_showspectrum: stop using AVAudioFifo to keep samples
Fixes limitation of input duration that showspectrumpic can process.
2022-02-14 23:32:22 +01:00
pascal massimino 9f4dff61f7 avfilter/vf_fftfilt: Add missing cpu.h inclusion
Error was: implicit declaration of function 'av_cpu_max_align'
is invalid in C99

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-14 19:17:48 +01:00
Paul B Mahol 8e825ec3ab avfilter/vf_fftfilt: switch to rdft from lavu/tx 2022-02-14 17:52:09 +01:00
Paul B Mahol e26a0afabd avfilter/vf_fftdnoiz: switch to fft from lavu/tx 2022-02-14 17:52:09 +01:00
Paul B Mahol f1daa3b120 avfilter/blend_modes: unbreak interpolate mode for float format 2022-02-14 17:51:45 +01:00
Paul B Mahol 9e11a7e193 avfilter/af_aderivative: add timeline support 2022-02-14 17:51:28 +01:00
Paul B Mahol 66f8f9ed29 avfilter/f_perms: add commands support 2022-02-14 17:51:20 +01:00
Paul B Mahol fcee53619a avfilter/af_surround: change x/y spread defaults
Previous default value of 1.0 is producing lesser quality channels.
2022-02-12 12:48:42 +01:00
Paul B Mahol 619519ee0a avfilter/af_surround: avoid implicit conversion to float 2022-02-12 12:48:28 +01:00
Paul B Mahol b015c101ab avfilter/af_surround: switch to rdft from avutil/tx 2022-02-12 12:48:18 +01:00
Paul B Mahol f05c52985c avfilter: add dialogue enhance audio filter 2022-02-12 12:47:36 +01:00
Paul B Mahol 800dfd2eac avfilter/af_atempo: switch to rdft from lavu/tx 2022-02-12 12:45:43 +01:00
Paul B Mahol 1ca19cf371 avfilter/af_compensationdelay: add commands support 2022-02-11 21:19:27 +01:00
David Lacko 4b40e20ce9 avfilter/af_adelay: add command support
Add command 'delays' to the adelay filter.
This command accepts same values as the option with one difference, to apply
delay to all channels prefix 'all:' to the argument.

Signed-off-by: David Lacko <deiwo101@gmail.com>
2022-02-11 20:30:17 +01:00
Paul B Mahol 9bdb476c40 avfilter/vf_avgblur: fix memory leaks if config_input() is called again 2022-02-10 09:22:36 +01:00
Paul B Mahol 9809f318ea avfilter/vf_dblur: fix memory leaks if config_input() is called again 2022-02-10 09:22:36 +01:00
Paul B Mahol f89cd457ca avfilter/vf_gblur: fix memory leaks if config_input() is called again 2022-02-10 09:22:36 +01:00
Paul B Mahol a0ede3cb56 avfilter/vf_gblur: use av_freep() 2022-02-10 09:22:36 +01:00
Anton Khirnov aeaefc3728 lavfi/qsvpp: fix after 85c938fa28 2022-02-09 09:40:33 +01:00
Anton Khirnov c65c2ed01d lavfi/vf_deshake_opencl: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 85c938fa28 lavfi/qsvvpp: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Paul B Mahol e597ea4c0e avfilter/asrc_sinc: switch to rdft from lavu/tx 2022-02-06 12:45:47 +01:00
Paul B Mahol bedb4bac1c avfilter/vf_cas: unbreak >8 depth support 2022-02-05 20:56:33 +01:00
Jason Jang 306994b887 avfilter/af_apsyclip: increase protection for high frequencies
This reduces sibilance distortion when sibilance and bass are
present at the same time. Bringing the protection of high
frequencies up to about the same level as for low frequencies
should also make the quality less dependent on the frequency
balance of the playback system.

Signed-off-by: Jason Jang <jcj83429@gmail.com>
2022-02-05 14:52:16 +01:00
Jason Jang 18fceb9926 avfilter/af_apsyclip: fix peak overestimation
Ignore more samples that are near the edge of the block. The reason
is that the filtering tends to cause these samples to go above the
window more than the samples near the middle. If these samples are
included in the unwindowed peak estimation, the peak can be
overestimated. Because the block is windowed again before
overlapping, overshoots near the edge of the block are not very
important.

0.1 is the value from the version originally contributed to calf.

Signed-off-by: Jason Jang <jcj83429@gmail.com>
2022-02-05 14:52:16 +01:00
Jason Jang b4ad13420f avfilter/af_apsyclip: fix FFT bin indexing
With a complex FFT instead of real FFT, the negative frequencies
are not dropped from the spectrum output, so they need to be scaled
when the positive frequencies are scaled. The location of the top
bin is also different.

Signed-off-by: Jason Jang <jcj83429@gmail.com>
2022-02-05 14:52:16 +01:00
Paul B Mahol e13f0b9456 avfilter/vf_v360: improve xyz_to_fisheye() 2022-01-29 17:36:37 +01:00
Paul B Mahol 3981dbd192 avfilter/vf_v360: improve xyz_to_dfisheye() even more 2022-01-29 17:36:37 +01:00
Paul B Mahol d388dc20b9 avfilter/af_afir: switch to lavu/tx 2022-01-29 11:46:55 +01:00
Kyle Swanson 3d29724c00 avfilter/vf_libvmaf: update filter for libvmaf v2.0.0 2022-01-23 11:41:30 -08:00
Paul B Mahol 06a54a4ec7 avfilter/vf_v360: improve xyz_to_dfisheye() 2022-01-22 18:32:58 +01:00
Fei Wang a17c990265 avfilter/tonemap_vaapi: set va parameters filters and numbers
This can fill VAProcPipelineParameterBuffer correctly and make the
pipeline works.

Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-17 16:32:17 +08:00
Xinpeng Sun 516496069d avfilter: add overlay vaapi filter
Overlay one video on the top of another.

It takes two inputs and has one output. The first input is the "main" video on
which the second input is overlaid. This filter requires same memory layout for
all the inputs.

An example command to use this filter to overlay overlay.mp4 at the top-left
corner of the main.mp4:

ffmpeg -init_hw_device vaapi=foo:/dev/dri/renderD128 \
-hwaccel vaapi -hwaccel_device foo -hwaccel_output_format vaapi -c:v h264 -i main.mp4 \
-hwaccel vaapi -hwaccel_device foo -hwaccel_output_format vaapi -c:v h264 -i overlay.mp4 \
-filter_complex "[0:v][1:v]overlay_vaapi=0:0:100💯0.5[t1]" \
-map "[t1]" -an -c:v h264_vaapi -y out_vaapi.mp4

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Signed-off-by: Xinpeng Sun <xinpeng.sun@intel.com>
Signed-off-by: Zachary Zhou <zachary.zhou@intel.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-17 16:32:17 +08:00
Rudolf Polzer dcc9454ab9 vf_paletteuse: fix color cache lookup for Bayer dithering mode.
To trigger this bug, use `paletteuse=dither=bayer:bayer_scale=0`; you will see
that adjacent pixel lines will use the same dither pattern, instead of being
shifted from each other by 32 units (0x20).

One way to demostrate the bug is:

$ convert -size 64x256 gradient:black-white -rotate 270 grad.png
$ echo 'P2 2 1 255 0 255' > bw.pnm
$ ffmpeg -i grad.png -filter_complex 'movie=bw.pnm,scale=256x1[bw]; [0:v][bw]paletteuse=dither=bayer:bayer_scale=0' gradbw.png

Previously: https://www.rm.cloudns.org/img/uploaded/0bd152c11b9cd99e5945115534b1bdde.png
Now:        https://www.rm.cloudns.org/img/uploaded/89caaa5e36c38bc2c01755b30811f969.png

This was caused by passing inconsistent color vs (a,r,g,b) parameters to
color_get(), and NBITS being 5 meaning actually hitting the same cache node
does happen in this case, but ONLY if bayer_scale is zero.

The fix is passing the correct color value to color_get().

Also added a previous-failing FATE test; image comparison of the first frame:

Previously: https://www.rm.cloudns.org/img/uploaded/d0ff9db8d8a7d8a3b8b88bbe92bf5fed.png
Now:        https://www.rm.cloudns.org/img/uploaded/a72389707e719b5cd1c58916a9e79ca8.png

(on this less synthetic test image, the bug basically causes noise from cache
 hits vs misses)

Tested: FATE passes, which exercises this filter but at the default bayer_scale.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
2022-01-17 01:31:06 +05:30
Vittorio Giovara 7d377558a6 vf_tonemap: Fix order of planes
This resulted in a dimmed tonemapping due to bad resulting luma
calculation.

Found by: Derek Buitenhuis

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2022-01-14 15:48:36 +01:00
Linjie Fu 9c58fd2226 lavf/vf_deinterlace_vaapi: flush queued frame for field in DeinterlacingBob
For DeinterlacingBob mode with rate=field, the frame number of output
should equal 2x input total since only intra deinterlace is used.

Currently for "backward_ref = 0, rate = field", extra_delay is
introduced. Due to the async without flush, frame number of output is
[expected_number - 2].

Specifically, if the input only has 1 frame, the output will be empty.

Add deint_vaapi_request_frame for deinterlace_vaapi, send NULL frame
to flush the queued frame.

For 1 frame input in Bob mode with rate=field,
before patch: 0 frame;
after  patch: 2 frames;

ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128
        -hwaccel_output_format vaapi -i input.h264 -an -vf
        deinterlace_vaapi=mode=bob:rate=field -f null -

Tested-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-12 10:02:24 +08:00
Niklas Haas ecf09764dc lavfi/vf_libplacebo: fix side data stripping logic
This was accidentally comparing s->colorspace against out->colorspace,
which is wrong - the intent was to compare in->colorspace against
out->colorspace.

We also forgot to strip mastering metadata. Finally, the order is sort
of wrong - we should strip this side data *before* process_frames,
because otherwise it may end up being seen and used by libplacebo.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-01-10 09:11:02 +01:00
softworkz 479f3c6598 avfilter/vpp_qsv: fix regression on older api versions (e.g. 1.11)
Commit 8b83dad825 introduced a
regression in a way that scaling via vpp_qsv doesn't work any longer
for devices with an MSDK runtime version lower than 1.19. This is true
for older CPUs which are stuck at 1.11.
The commit added checks for the compile-sdk version but it didn't test
for the runtime version.

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-10 14:54:36 +08:00
Wu Jianhua 9a194252c7 avfilter: add a blend_vulkan filter
This commit adds a blend_vulkan filter and a normal blend mode, and
reserves support for introducing the blend modes in the future.

Use the commands below to test: (href: https://trac.ffmpeg.org/wiki/Blend)
I. make an image for test
ffmpeg -f lavfi -i color=s=256x256,geq=r='H-1-Y':g='H-1-Y':b='H-1-Y' -frames 1 \
-y -pix_fmt yuv420p test.jpg

II. blend in sw
ffmpeg -i test.jpg -vf "split[a][b];[b]transpose[b];[a][b]blend=all_mode=normal,\
pseudocolor=preset=turbo" -y normal_sw.jpg

III. blend in vulkan
ffmpeg -init_hw_device vulkan -i test.jpg -vf "split[a][b];[b]transpose[b];\
[a]hwupload[a];[b]hwupload[b];[a][b]blend_vulkan=all_mode=normal,hwdownload,\
format=yuv420p,pseudocolor=preset=turbo" -y normal_vulkan.jpg

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-01-05 15:16:22 +01:00
Wu Jianhua 49250b582a avfilter/vf_blend: fix un-checked potential memory allocation failure
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-01-05 15:16:22 +01:00
Niklas Haas db28bb8fb4 lavfi/libplacebo: support dovi metadata application
libplacebo supports automatic dolby vision application, but it requires
us to switch to a new API. Also add some logic to strip the dolby vision
metadata from the output frames in any case where we end up changing the
colorimetry.

The libplacebo dependency bump is justified because neither 184 nor 192
are part of any stable libplacebo release, so users have to build from
git anyways for this filter to exist.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-01-05 03:13:12 +01:00
rcombs da92865b27 lavfi/drawutils: re-enable P010 and P016 support
These formats now work as expected.
2022-01-04 19:39:22 -06:00
rcombs 66343e46cf lavfi/drawutils: overhaul to improve pixel format support
- No longer mixes u8 and u16 component accesses (this was UB)
- De-duplicated 8->16 conversion
- De-duplicated component -> plane+offset conversion
- De-duplicated planar + packed RGB
- No longer calls ff_fill_rgba_map
- Removed redundant comp_mask data member
- RGB0 and related formats no longer write an alpha value to the 0 byte
- Non-planar YA formats now work correctly
- High-bit-depth semi-planar YUV now works correctly
2022-01-04 19:39:22 -06:00
rcombs f67bd3a825 lavfi/drawutils: ensure we don't support formats with non-pixel-sized offsets 2022-01-04 19:39:22 -06:00
rcombs f320722eb5 lavfi/drawutils: ensure we can't overflow a component 2022-01-04 19:39:22 -06:00
rcombs f00079b25c lavfi/drawutils: ensure we don't allow mixed-byte-depth formats
These could be hazardous because of FFDrawColor's union
2022-01-04 19:39:22 -06:00
rcombs e24b71add5 lavfi/drawutils: reimplement ff_fill_rgba_map without hardcoding the list
Same outputs, but computed instead of statically known, so new formats will be
supported more easily. Asserts in place to ensure we update this if we add
anything incompatible with its logic.
2022-01-04 19:39:22 -06:00