ffmpeg.git
3 months agolibswscale/utils.c: Fix bug #8255
Gautam Ramakrishnan [Sun, 9 Feb 2020 18:33:09 +0000 (00:03 +0530)]
libswscale/utils.c: Fix bug #8255

Bug #8255 points out a double free error in libwscale/utils.c file.
The double free is because the pointer to cascaded_context of an
sw_context is not set to NULL after freeing it. When the sw_context
is later freed, sws_freeContext is called on the cascaded_context,
causing a double free.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavcodec/agm: Test remaining data in decode_raw_intra_rgb()
Michael Niedermayer [Sat, 8 Feb 2020 20:17:01 +0000 (21:17 +0100)]
avcodec/agm: Test remaining data in decode_raw_intra_rgb()

Fixes: Timeout (270sec -> 25ms)
Fixes: 20485/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5636954207289344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavformat/tty: Fix division by 0 in probe
Michael Niedermayer [Wed, 5 Feb 2020 21:22:30 +0000 (22:22 +0100)]
avformat/tty: Fix division by 0 in probe

Fixes: division by zero
Fixes: 20436/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5763229752229888
Fixes: 20503/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4841641154445312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agolibavcodec/mvha: Check height before applying median predictor
Michael Niedermayer [Sun, 9 Feb 2020 14:02:45 +0000 (15:02 +0100)]
libavcodec/mvha: Check height before applying median predictor

Fixes: out of array read
Fixes: 20495/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVHA_fuzzer-5711179129552896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavcodec/midivid: Check vector index
Michael Niedermayer [Sun, 9 Feb 2020 13:53:15 +0000 (14:53 +0100)]
avcodec/midivid: Check vector index

Fixes: out of array read
Fixes: 20494/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVDV_fuzzer-5681452423577600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavcodec/cbs: Fix potential double-free when adding unit fails
Andreas Rheinhardt [Mon, 18 Nov 2019 07:47:58 +0000 (08:47 +0100)]
avcodec/cbs: Fix potential double-free when adding unit fails

ff_cbs_insert_unit_data() has two modes of operation: It can insert a
unit with a newly created reference to an already existing AVBuffer; or
it can take a buffer and create an AVBuffer for it. Said buffer will
then become owned by the unit lateron.

A potential memleak/double-free exists in the second case, because if
creating the AVBuffer fails, the function immediately returns, but when
it fails lateron, the supplied buffer will be freed. The caller has no
way to distinguish between these two outcomes. The only such caller
(cbs_jpeg_split_fragment() in cbs_jpeg.c) opted for a potential
double-free.

This commit changes this by explicitly stating that a non-refcounted
buffer will be freed on error. The aforementioned caller has been
brought in line with this.

Fixes CID 1452623.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 months agoavfilter/vf_fade: fix color fading for planar rgb
Paul B Mahol [Sun, 9 Feb 2020 21:50:07 +0000 (22:50 +0100)]
avfilter/vf_fade: fix color fading for planar rgb

3 months agoavfilter/vf_fade: add >8 bit support for black and alpha fade
Paul B Mahol [Sat, 8 Feb 2020 12:16:44 +0000 (13:16 +0100)]
avfilter/vf_fade: add >8 bit support for black and alpha fade

3 months agodoc/ffmpeg: Document device selection for Vulkan
Mark Thompson [Sun, 9 Feb 2020 19:15:53 +0000 (19:15 +0000)]
doc/ffmpeg: Document device selection for Vulkan

3 months agolavfi/vf_*_vaapi: Fix error case
Mark Thompson [Sun, 29 Sep 2019 16:46:04 +0000 (17:46 +0100)]
lavfi/vf_*_vaapi: Fix error case

Fixes CID 1452400, 1452416, 1452550, 1452590, 1452760.

3 months agolavfi/vf_deshake_opencl: Avoid propagating uninitialised data
Mark Thompson [Sun, 29 Sep 2019 16:46:03 +0000 (17:46 +0100)]
lavfi/vf_deshake_opencl: Avoid propagating uninitialised data

Fixes CID 1452753.

3 months agolavc/vp9_raw_reorder_bsf: Fix operator ordering
Mark Thompson [Sun, 29 Sep 2019 16:46:01 +0000 (17:46 +0100)]
lavc/vp9_raw_reorder_bsf: Fix operator ordering

Fixes CID 1413024.

3 months agolavc/vaapi_encode: Fix leak in error case
Mark Thompson [Sun, 29 Sep 2019 16:46:00 +0000 (17:46 +0100)]
lavc/vaapi_encode: Fix leak in error case

Fixes CID 1442564.

3 months agolavc/h265_metadata_bsf: Fix parameter ordering
Mark Thompson [Sun, 29 Sep 2019 16:45:59 +0000 (17:45 +0100)]
lavc/h265_metadata_bsf: Fix parameter ordering

Fixes CID 1452433.

3 months agolavc/cbs_h2645: Add missing newlines in log messages
Mark Thompson [Sun, 29 Sep 2019 16:45:58 +0000 (17:45 +0100)]
lavc/cbs_h2645: Add missing newlines in log messages

3 months agoavutil/log: add support for multibyte console log for win32
Marton Balint [Wed, 29 Jan 2020 00:10:38 +0000 (01:10 +0100)]
avutil/log: add support for multibyte console log for win32

Fixes ticket #5398.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 months agoavutil/log: add support for forced ANSI colors on win32
Marton Balint [Tue, 28 Jan 2020 23:30:06 +0000 (00:30 +0100)]
avutil/log: add support for forced ANSI colors on win32

To make behavior the same as non-win32 code when the standard error is
redirected. Also restructure the code a bit.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 months agoavutil/log: fix detecting console mode on Win32
Marton Balint [Tue, 28 Jan 2020 23:46:01 +0000 (00:46 +0100)]
avutil/log: fix detecting console mode on Win32

A redirected stderr can still have a valid handle.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 months agoavutil/log: factorize ansi_fputs
Marton Balint [Tue, 28 Jan 2020 23:32:27 +0000 (00:32 +0100)]
avutil/log: factorize ansi_fputs

Signed-off-by: Marton Balint <cus@passwd.hu>
3 months agoavutil/log: drop support for NO_COLOR environment variable
Marton Balint [Tue, 28 Jan 2020 22:55:18 +0000 (23:55 +0100)]
avutil/log: drop support for NO_COLOR environment variable

Deprecated for more than 9 years now.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 months agolibavcodec/amfenc_hevc.c: Fix Maximum Reference Frames option on AMF HEVC.
Sitan Liu [Mon, 3 Feb 2020 21:54:15 +0000 (00:54 +0300)]
libavcodec/amfenc_hevc.c: Fix Maximum Reference Frames option on AMF HEVC.

3 months agolibavcodec/amfenc_hevc.c: Fix Profile level option on AMF HEVC.
Sitan Liu [Mon, 3 Feb 2020 21:54:14 +0000 (00:54 +0300)]
libavcodec/amfenc_hevc.c: Fix Profile level option on AMF HEVC.

3 months agoavfilter/af_afftfilt: fix memory leaks on error
Paul B Mahol [Sun, 9 Feb 2020 14:49:09 +0000 (15:49 +0100)]
avfilter/af_afftfilt: fix memory leaks on error

3 months agoavfilter/af_afffilt: fix crash on error
Paul B Mahol [Sun, 9 Feb 2020 14:42:48 +0000 (15:42 +0100)]
avfilter/af_afffilt: fix crash on error

3 months agoavfilter/vf_xfade: add diagonal smooth transitions
Paul B Mahol [Sun, 9 Feb 2020 11:59:56 +0000 (12:59 +0100)]
avfilter/vf_xfade: add diagonal smooth transitions

3 months agoavfilter/af_asoftclip: add support for commands
Paul B Mahol [Sun, 9 Feb 2020 09:59:20 +0000 (10:59 +0100)]
avfilter/af_asoftclip: add support for commands

3 months agoavfilter/af_asoftclip: add slice threading support
Paul B Mahol [Sun, 9 Feb 2020 09:47:43 +0000 (10:47 +0100)]
avfilter/af_asoftclip: add slice threading support

3 months agodoc/APIchanges: fix vulkan hwcontext date
Lynne [Sat, 8 Feb 2020 23:32:46 +0000 (23:32 +0000)]
doc/APIchanges: fix vulkan hwcontext date

3 months agolavu/tx: mention FFT output is not normalized
Lynne [Sat, 8 Feb 2020 23:06:09 +0000 (23:06 +0000)]
lavu/tx: mention FFT output is not normalized

Not even FFTW's output is normalized.
This should prevent at least some users from complaining that doing a forward
transform followed by an inverse transform has a mismatching output to the
original input.

3 months agocheckasm: sbrdsp: Fix a spurious test failure by calculating a better epsilon for...
Martin Storsjö [Wed, 5 Feb 2020 20:18:19 +0000 (22:18 +0200)]
checkasm: sbrdsp: Fix a spurious test failure by calculating a better epsilon for sum_square

Signed-off-by: Martin Storsjö <martin@martin.st>
3 months agoavfilter/vf_alphamerge: add AVClass to private context
Paul B Mahol [Sat, 8 Feb 2020 20:54:09 +0000 (21:54 +0100)]
avfilter/vf_alphamerge: add AVClass to private context

3 months agoavfilter/vf_paletteuse: Fix potential double-free of AVFrame
Andreas Rheinhardt [Mon, 27 Jan 2020 08:28:20 +0000 (09:28 +0100)]
avfilter/vf_paletteuse: Fix potential double-free of AVFrame

apply_palette() would free an AVFrame given to it only via an AVFrame *
(and not via AVFrame **) in three of its four exists (namely in the
normal path and in two error paths). So upon error the caller has no way
to know whether the frame has already been freed or not;
load_apply_palette(), the only caller, opted to free the frame in this
scenario.

This commit changes this by making apply_palette not freeing the frame
at all, which is left to load_apply_palette().

Fixes Coverity issue #1452434.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavcodec/mlpdec: use get_bits_long for huff lsbs
Jai Luthra [Fri, 7 Feb 2020 20:16:12 +0000 (01:46 +0530)]
avcodec/mlpdec: use get_bits_long for huff lsbs

lsb bits may go beyond 25 bits, so to be safe use get_bits_long

Signed-off-by: Jai Luthra <me@jailuthra.in>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavfilter/vf_alphamerge: add timeline support
Paul B Mahol [Sat, 8 Feb 2020 13:28:01 +0000 (14:28 +0100)]
avfilter/vf_alphamerge: add timeline support

3 months agoavfilter/vf_fade: improve type option description
Paul B Mahol [Sat, 8 Feb 2020 11:40:23 +0000 (12:40 +0100)]
avfilter/vf_fade: improve type option description

3 months agoavfilter/vf_fade: add missing .flags for type option
Paul B Mahol [Sat, 8 Feb 2020 11:36:59 +0000 (12:36 +0100)]
avfilter/vf_fade: add missing .flags for type option

3 months agoavfilter/vf_maskedclamp: make C version consistent with ASM one
Paul B Mahol [Sat, 8 Feb 2020 09:44:38 +0000 (10:44 +0100)]
avfilter/vf_maskedclamp: make C version consistent with ASM one

In case of undefined behaviour.

3 months agofate/adpcm: add adpcm_ima_ssi tests
Zane van Iperen [Fri, 7 Feb 2020 11:38:25 +0000 (11:38 +0000)]
fate/adpcm: add adpcm_ima_ssi tests

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoaviflter/vf_xfade: add pixelize transition
Paul B Mahol [Fri, 7 Feb 2020 21:35:16 +0000 (22:35 +0100)]
aviflter/vf_xfade: add pixelize transition

3 months agoavfilter/vf_xfade: add dissolve transition
Paul B Mahol [Fri, 7 Feb 2020 21:00:14 +0000 (22:00 +0100)]
avfilter/vf_xfade: add dissolve transition

3 months agoavfilter/af_crystalizer: add slice threading support
Paul B Mahol [Fri, 7 Feb 2020 18:26:39 +0000 (19:26 +0100)]
avfilter/af_crystalizer: add slice threading support

3 months agoac3enc: drop a global variable
Anton Khirnov [Wed, 29 Jan 2020 15:34:48 +0000 (16:34 +0100)]
ac3enc: drop a global variable

Log the warning message once per encoder instance instead.

Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
3 months agoconfigure: fix order of linking for libglslang
Paul B Mahol [Fri, 7 Feb 2020 09:32:18 +0000 (10:32 +0100)]
configure: fix order of linking for libglslang

3 months agoavfilter: add afirsrc filter
Paul B Mahol [Fri, 31 Jan 2020 17:07:35 +0000 (18:07 +0100)]
avfilter: add afirsrc filter

3 months agoavcodec/cavsdsp: Fix undefined left shifts of negative numbers
Andreas Rheinhardt [Sat, 28 Sep 2019 02:26:00 +0000 (04:26 +0200)]
avcodec/cavsdsp: Fix undefined left shifts of negative numbers

Affected the ffmpeg-filter_colorkey FATE-test (but only if the C version
of idct8_add is used and not e.g. the x86 SSE2 version).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fixes: left shift of negative value -107
Fixes: 20398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5725389278412800

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavfilter/af_acrossover: free all output frames on error
Paul B Mahol [Fri, 7 Feb 2020 11:09:24 +0000 (12:09 +0100)]
avfilter/af_acrossover: free all output frames on error

3 months agoavfilter/af_acrossover: add slice threading support
Paul B Mahol [Fri, 7 Feb 2020 11:06:06 +0000 (12:06 +0100)]
avfilter/af_acrossover: add slice threading support

3 months agolavd/avfoundation.m: Add an option to drop late frames.
Thilo Borgmann [Sun, 19 Jan 2020 16:36:21 +0000 (17:36 +0100)]
lavd/avfoundation.m: Add an option to drop late frames.

Retains current behaviour by the default value.

3 months agoavformat: add demuxer for Simon & Schuster Interactive's VAG format
Zane van Iperen [Thu, 6 Feb 2020 06:58:14 +0000 (06:58 +0000)]
avformat: add demuxer for Simon & Schuster Interactive's VAG format

Adds support for the custom VAG container used by some Simon & Schuster
Interactive games such as Real War, and Real War: Rogue States.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavcodec: add decoder for Simon & Schuster Interactive's ADPCM variant
Zane van Iperen [Thu, 6 Feb 2020 06:58:10 +0000 (06:58 +0000)]
avcodec: add decoder for Simon & Schuster Interactive's ADPCM variant

Adds support for the ADPCM variant used by some Simon & Schuster
Interactive games such as Real War, and Real War: Rogue States.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavcodec/hevc: add support for Frame Duplication (Doubling/Tripling)
Praveen Karadugattu [Thu, 23 Jan 2020 13:24:17 +0000 (18:54 +0530)]
avcodec/hevc: add support for Frame Duplication (Doubling/Tripling)

Parse picture_struct SEI value.

3 months agoavfilter/af_acrossover: improve filter output
Paul B Mahol [Sun, 14 Apr 2019 17:03:39 +0000 (19:03 +0200)]
avfilter/af_acrossover: improve filter output

Makes sum always flat. Also faster.

3 months agoavfilter/Makefile: add vulkan.h to the list of skipped headers
James Almer [Thu, 6 Feb 2020 13:26:31 +0000 (10:26 -0300)]
avfilter/Makefile: add vulkan.h to the list of skipped headers

Should fix make checkheaders

Signed-off-by: James Almer <jamrial@gmail.com>
3 months agoavcodec/aptx: split decoder and encoder into separate files
James Almer [Sun, 8 Dec 2019 14:58:18 +0000 (11:58 -0300)]
avcodec/aptx: split decoder and encoder into separate files

Signed-off-by: James Almer <jamrial@gmail.com>
3 months agoavformat/hlsenc: allow a custom SDT and PAT period
Marton Balint [Mon, 23 Dec 2019 00:36:41 +0000 (01:36 +0100)]
avformat/hlsenc: allow a custom SDT and PAT period

The default is not to write SDT and PAT periodically, only in the beginning of
every segment. After this patch the user might override this if needed.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 months agoavformat/matroskaenc: Check functions that can fail
Andreas Rheinhardt [Wed, 1 Jan 2020 00:58:23 +0000 (01:58 +0100)]
avformat/matroskaenc: Check functions that can fail

Sometimes it has not been checked whether opening the dynamic buffer for
writing Tags fails; this might have led to segfaults.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agolibswscale/x86/yuv2rgb: Change inline assembly into nasm code
Ting Fu [Sun, 19 Jan 2020 03:51:03 +0000 (11:51 +0800)]
libswscale/x86/yuv2rgb: Change inline assembly into nasm code

The original inline assembly and nasm code have the same fps when called by command.
NASM code almost has no impact on the perfromance.

Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavfilter/vf_xfade: add horzopen/close transition
Paul B Mahol [Wed, 5 Feb 2020 15:52:30 +0000 (16:52 +0100)]
avfilter/vf_xfade: add horzopen/close transition

3 months agoavfilter/vf_xfade: add vertopen/close transition
Paul B Mahol [Wed, 5 Feb 2020 15:44:50 +0000 (16:44 +0100)]
avfilter/vf_xfade: add vertopen/close transition

3 months agoavcodec/av1_parse: don't look for trailing bits in Tile List OBUs
James Almer [Wed, 5 Feb 2020 14:50:20 +0000 (11:50 -0300)]
avcodec/av1_parse: don't look for trailing bits in Tile List OBUs

The spec states there aren't any.

Signed-off-by: James Almer <jamrial@gmail.com>
3 months agovf_ssim: Fix loading doubles to float registers on i386
Martin Storsjö [Wed, 5 Feb 2020 11:29:32 +0000 (13:29 +0200)]
vf_ssim: Fix loading doubles to float registers on i386

This fixes the tests filter-refcmp-ssim-yuv and filter-refcmp-ssim-rgb
on i386 after breaking in fcc0424c933742c8fc852371e985d16b6eb4bfe9.

Signed-off-by: Martin Storsjö <martin@martin.st>
3 months agoavcodec/Makefile: combine dvdsub dependencies into one entry per module
James Almer [Wed, 5 Feb 2020 03:01:59 +0000 (00:01 -0300)]
avcodec/Makefile: combine dvdsub dependencies into one entry per module

Signed-off-by: James Almer <jamrial@gmail.com>
3 months agoconfigure: don't enable $ARCH_external if $ARCH is disabled
James Almer [Sun, 26 Jan 2020 15:08:26 +0000 (12:08 -0300)]
configure: don't enable $ARCH_external if $ARCH is disabled

The check_x86asm() checks would force enable these variables on success,
bypassing any --disable-* command line option.
This is important in the case of AVX512, where the relevant define is used
to choose between different values for memory alignment and strides in
some allocations.

Signed-off-by: James Almer <jamrial@gmail.com>
3 months agolavfi: bump minor version for the Vulkan filters
Lynne [Tue, 4 Feb 2020 23:52:29 +0000 (23:52 +0000)]
lavfi: bump minor version for the Vulkan filters

3 months agodoc/APIchanges: update with Vulkan commit info
Lynne [Tue, 4 Feb 2020 23:51:55 +0000 (23:51 +0000)]
doc/APIchanges: update with Vulkan commit info

3 months agolavu: bump minor version for the Vulkan patchset
Lynne [Tue, 4 Feb 2020 23:49:56 +0000 (23:49 +0000)]
lavu: bump minor version for the Vulkan patchset

3 months agolavu/hwcontext_cuda: refactor context initialisation
Philip Langdale [Tue, 31 Dec 2019 17:41:57 +0000 (09:41 -0800)]
lavu/hwcontext_cuda: refactor context initialisation

There's enough going on here now that it should not be duplicated
between cuda_device_create and cuda_device_derive.

3 months agolavfi: add an chromaber_vulkan filter
Lynne [Sun, 27 Oct 2019 14:48:16 +0000 (14:48 +0000)]
lavfi: add an chromaber_vulkan filter

This commit adds a chromatic aberration filter for Vulkan that attempts to
emulate a lens chromatic aberration effect.
For a YUV frame it will instead shift the chroma channels, providing a
simple approximation.

3 months agolavfi: add an avgblur_vulkan filter
Lynne [Sun, 27 Oct 2019 14:47:18 +0000 (14:47 +0000)]
lavfi: add an avgblur_vulkan filter

This commit adds a fast avgblur Vulkan filter.
This will reset Intel GPUs on Linux due to a known, two-year-old driver bug
(!834 on mesa's gitlab).

3 months agolavfi: add an overlay_vulkan filter
Lynne [Sun, 27 Oct 2019 14:46:16 +0000 (14:46 +0000)]
lavfi: add an overlay_vulkan filter

This commit adds a basic, non-converting overlay filter for Vulkan.

3 months agolavfi: add an scale_vulkan filter
Lynne [Sun, 27 Oct 2019 14:45:36 +0000 (14:45 +0000)]
lavfi: add an scale_vulkan filter

This commit adds a basic, non-converting Vulkan scaling filter.

3 months agolavfi: add Vulkan filtering framework
Lynne [Sun, 27 Oct 2019 14:44:00 +0000 (14:44 +0000)]
lavfi: add Vulkan filtering framework

This commit adds a Vulkan filtering infrastructure for libavfilter.
It attempts to abstract as much as possible of the Vulkan API from filters.

The way the hwcontext and the framework are designed permits for parallel,
non-CPU-blocking filtering throughout, with the exception of up/downloading
and mapping.

3 months agolavfi/vf_hwupload: Add support for HW -> HW transfers
Philip Langdale [Thu, 24 Oct 2019 01:11:37 +0000 (18:11 -0700)]
lavfi/vf_hwupload: Add support for HW -> HW transfers

As we find ourselves wanting a way to transfer frames between
HW devices (or more realistically, between APIs on the same device),
it's desirable to have a way to describe the relationship. While
we could imagine introducing a `hwtransfer` filter, there is
almost no difference from `hwupload`. The main new feature we need
is a way to specify the target device. Having a single device
for the filter chain is obviously insufficient if we're dealing
with two devices.

So let's add a way to specify the upload target device, and if none
is specified, continue with the existing behaviour.

We must also correctly preserve the sw_format on such a transfer.

3 months agolavu: add Vulkan hwcontext code
Lynne [Wed, 28 Aug 2019 20:58:10 +0000 (21:58 +0100)]
lavu: add Vulkan hwcontext code

This commit adds the necessary code to initialize and use a Vulkan device
within the hwcontext libavutil framework.
Currently direct mapping to VAAPI and DRM frames is functional, and
transfers to CUDA and native frames are supported.

Lets hope the future Vulkan video decode extension fits well within this
framework.

3 months agolavu/hwcontext: Add support for HW -> HW transfers
Philip Langdale [Thu, 24 Oct 2019 01:01:52 +0000 (18:01 -0700)]
lavu/hwcontext: Add support for HW -> HW transfers

We are beginning to consider scenarios where a given HW Context
may be able to transfer frames to another HW Context without
passing via system memory - this would usually be when two
contexts represent different APIs on the same device (eg: Vulkan
and CUDA).

This is modelled as a transfer, as we have today, but where both
the src and the dst are hardware frames with hw contexts. We need
to be careful to ensure the contexts are compatible - particularly,
we cannot do transfers where one of the frames has been mapped via
a derived frames context - we can only do transfers for frames that
were directly allocated by the specified context.

Additionally, as we have two hardware contexts, the transfer function
could be implemented by either (or indeed both). To handle this
uncertainty, we explicitly look for ENOSYS as an indicator to try
the transfer in the other direction before giving up.

3 months agofate/adpcm: add adpcm_argo tests
Zane van Iperen [Tue, 4 Feb 2020 02:01:23 +0000 (02:01 +0000)]
fate/adpcm: add adpcm_argo tests

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agolavc/dvdsubenc: accept palette from options
Michael Kuron [Mon, 3 Feb 2020 19:42:31 +0000 (20:42 +0100)]
lavc/dvdsubenc: accept palette from options

Previously, the default palette would always be used.
Now, we can accept a custom palette, just like dvdsubdec does.

Signed-off-by: Michael Kuron <michael.kuron@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agolavc/dvdsubdec: Move palette parsing to new function
Michael Kuron [Mon, 3 Feb 2020 19:42:30 +0000 (20:42 +0100)]
lavc/dvdsubdec: Move palette parsing to new function

Signed-off-by: Michael Kuron <michael.kuron@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavformat/sccdec: use av_sscanf() instead
Paul B Mahol [Tue, 4 Feb 2020 19:37:26 +0000 (20:37 +0100)]
avformat/sccdec: use av_sscanf() instead

3 months agoavfilter/vf_ssim: improve precision
Paul B Mahol [Thu, 30 Jan 2020 21:01:23 +0000 (22:01 +0100)]
avfilter/vf_ssim: improve precision

Use doubles for accumulating floats.

3 months agoavcodec/mlpenc: fix small memory leak
Paul B Mahol [Tue, 4 Feb 2020 10:35:02 +0000 (11:35 +0100)]
avcodec/mlpenc: fix small memory leak

3 months agomlp: check huff_lsbs only when codebook is used
Jai Luthra [Sun, 2 Feb 2020 19:03:00 +0000 (00:33 +0530)]
mlp: check huff_lsbs only when codebook is used

When no codebook is used, huff_lsbs can be more than 24 and still decode to
original values once filters are applied.

Signed-off-by: Jai Luthra <me@jailuthra.in>
3 months agomlpenc: fix some -fsanitize=integer errors
Jai Luthra [Sun, 2 Feb 2020 19:02:59 +0000 (00:32 +0530)]
mlpenc: fix some -fsanitize=integer errors

Signed-off-by: Jai Luthra <me@jailuthra.in>
3 months agomlpenc: clean up
Jai Luthra [Fri, 24 Jan 2020 10:33:34 +0000 (16:03 +0530)]
mlpenc: clean up

Signed-off-by: Jai Luthra <me@jailuthra.in>
3 months agomlpenc: improve lpc filtering
Jai Luthra [Fri, 24 Jan 2020 10:33:33 +0000 (16:03 +0530)]
mlpenc: improve lpc filtering

* fix a possible memory leak (apply_filter returned before freeing)
* use apply_filters in process_major_frame
* revert back to checking bounds with 24 bitdepth, as huff offset takes
care of it

Signed-off-by: Jai Luthra <me@jailuthra.in>
3 months agomlpenc: prevent negative lsb_bits lshift
Jai Luthra [Fri, 24 Jan 2020 10:33:32 +0000 (16:03 +0530)]
mlpenc: prevent negative lsb_bits lshift

Fixes Coverity CID 1396239.

Signed-off-by: Jai Luthra <me@jailuthra.in>
3 months agomlpenc: fix huff offset calculation
Jai Luthra [Fri, 24 Jan 2020 10:33:31 +0000 (16:03 +0530)]
mlpenc: fix huff offset calculation

huff offset wasn't always within the bounds before, which lead to
corrupt encoding that didn't always trigger lossless check failures

Signed-off-by: Jai Luthra <me@jailuthra.in>
3 months agomlpenc: fix lossless check error in number_sbits
Jai Luthra [Fri, 24 Jan 2020 10:33:30 +0000 (16:03 +0530)]
mlpenc: fix lossless check error in number_sbits

we need two bits instead of one bit to represent -1 in bitstream

Signed-off-by: Jai Luthra <me@jailuthra.in>
3 months agoavfilter/vf_xfade: add circleopen & circleclose transition
Paul B Mahol [Tue, 4 Feb 2020 09:27:57 +0000 (10:27 +0100)]
avfilter/vf_xfade: add circleopen & circleclose transition

3 months agoavcodec/lagarith: Sanity check scale
Michael Niedermayer [Tue, 28 Jan 2020 19:12:25 +0000 (20:12 +0100)]
avcodec/lagarith: Sanity check scale

A value of 24 and above can collaps the range to 0 which would not work.

Fixes: Timeout (75sec -> 21sec)
Fixes: 18707/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LAGARITH_fuzzer-5708950892969984

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavcodec/pngdec: Check amount decoded
Michael Niedermayer [Sat, 17 Aug 2019 21:55:34 +0000 (23:55 +0200)]
avcodec/pngdec: Check amount decoded

Fixes: Timeout (70sec -> 243ms)
Fixes: 16097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5664690889293824
Fixes: 16927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5170612070252544
Fixes: 16927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5706325622784000
Fixes: 18705/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5650989302677504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavcodec/apedec: Fix integer overflows in predictor_decode_mono_3950()
Michael Niedermayer [Tue, 28 Jan 2020 17:35:43 +0000 (18:35 +0100)]
avcodec/apedec: Fix integer overflows in predictor_decode_mono_3950()

Fixes: signed integer overflow: -2147407150 + -1871606 cannot be represented in type 'int'
Fixes: 18702/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5679095417667584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agodoc: Fix typo for dvdsubdec
Michael Kuron [Mon, 3 Feb 2020 19:42:29 +0000 (20:42 +0100)]
doc: Fix typo for dvdsubdec

Signed-off-by: Michael Kuron <michael.kuron@gmail.com>
3 months agoavformat/dashenc: use AV_OPT_TYPE_DICT for http_opts
Marton Balint [Sun, 2 Feb 2020 21:58:08 +0000 (22:58 +0100)]
avformat/dashenc: use AV_OPT_TYPE_DICT for http_opts

This changes the separator character from comma to colon, but since this option
was only added recently I think it should be done for consistency with other
similar options.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 months agoavcodec/libvpxenc: add VP9 temporal scalability encoding option
Wonkap Jang [Mon, 3 Feb 2020 18:02:01 +0000 (10:02 -0800)]
avcodec/libvpxenc: add VP9 temporal scalability encoding option

This commit reuses the configuration options for VP8 that enables
temporal scalability for VP9. It also adds a way to enable three
preset temporal structures (refer to the documentation for more
detail) that can be used in offline encoding.

Signed-off-by: James Zern <jzern@google.com>
3 months agoavfilter/vf_xfade_opencl: move passthrough code before eof check
Paul B Mahol [Mon, 3 Feb 2020 08:40:46 +0000 (09:40 +0100)]
avfilter/vf_xfade_opencl: move passthrough code before eof check

3 months agoavfilter/vf_xfade: move passthrough code before eof check
Paul B Mahol [Mon, 3 Feb 2020 08:36:52 +0000 (09:36 +0100)]
avfilter/vf_xfade: move passthrough code before eof check

3 months agoMAINTAINERS: Add myself as mxf* maintainer
Tomas Härdin [Sat, 1 Feb 2020 15:15:53 +0000 (16:15 +0100)]
MAINTAINERS: Add myself as mxf* maintainer

I have more time for this these days

3 months agoavcodec/ralf: Fix integer overflow in apply_lpc()
Michael Niedermayer [Sun, 8 Dec 2019 12:48:45 +0000 (13:48 +0100)]
avcodec/ralf: Fix integer overflow in apply_lpc()

Fixes: signed integer overflow: 2147482897 + 2048 cannot be represented in type 'int'
Fixes: 19240/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5743240326414336
Fixes: 19869/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5150136636538880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavcodec/dca_lbr: Fix some error codes and error passing
Michael Niedermayer [Sat, 4 Jan 2020 22:01:12 +0000 (23:01 +0100)]
avcodec/dca_lbr: Fix some error codes and error passing

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>