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

8 weeks 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.

8 weeks 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>
8 weeks 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

8 weeks 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>
8 weeks 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>
8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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.

8 weeks 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>
8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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>
8 weeks 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

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

8 weeks 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>
8 weeks 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

8 weeks 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

8 weeks 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.

8 weeks 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>
8 weeks 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>
8 weeks 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.

8 weeks 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.

8 weeks 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>
8 weeks 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>
8 weeks 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>
8 weeks 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>
8 weeks 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>
8 weeks 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

8 weeks 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

8 weeks 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>
8 weeks 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>
8 weeks 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>
2 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>
2 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

2 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

2 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

2 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.

2 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.

2 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).

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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>
2 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>
2 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>
2 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

2 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.

2 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

2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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

2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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

2 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

2 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

2 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>
2 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>
2 months agoavcodec/8svx: Use av_assert1(0) instead of error message in unreachable code
Michael Niedermayer [Sun, 29 Dec 2019 14:11:33 +0000 (15:11 +0100)]
avcodec/8svx: Use av_assert1(0) instead of error message in unreachable code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/wmavoice: Fix rounding and integer anomalies in calc_input_response()
Michael Niedermayer [Sat, 14 Dec 2019 14:27:44 +0000 (15:27 +0100)]
avcodec/wmavoice: Fix rounding and integer anomalies in calc_input_response()

Fixes: out of array access
Fixes: inf is outside the range of representable values of type 'int'
Fixes: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long'
Fixes: 19316/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5677369365102592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/wmavoice: sanity check block_align
Michael Niedermayer [Sat, 21 Dec 2019 21:27:37 +0000 (22:27 +0100)]
avcodec/wmavoice: sanity check block_align

This limit is roughly based on the bitreader limit, its likely a much tighter limit
could be used

Fixes: left shift of 1965039647 by 1 places cannot be represented in type 'int'
Fixes: 19545/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5695391899320320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/pcm: Fix invalid shift in pcm_decode_frame for LXF
Michael Niedermayer [Tue, 17 Dec 2019 23:07:50 +0000 (00:07 +0100)]
avcodec/pcm: Fix invalid shift in pcm_decode_frame for LXF

Fixes: left shift of 32 by 28 places cannot be represented in type 'int'
Fixes: 19472/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PCM_LXF_fuzzer-5704364320096256

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/snappy: Sanity check bytestream2_get_levarint()
Michael Niedermayer [Sun, 19 Jan 2020 20:51:11 +0000 (21:51 +0100)]
avcodec/snappy: Sanity check bytestream2_get_levarint()

Fixes: left shift of 79 by 28 places cannot be represented in type 'int'
Fixes: 20202/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5719004081815552
Fixes: 20219/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5641738677125120
Fixes: 20389/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5680721517871104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavformat/udp: cancel pending IO on win32 manually
Marton Balint [Sun, 26 Jan 2020 21:13:50 +0000 (22:13 +0100)]
avformat/udp: cancel pending IO on win32 manually

recvfrom() is not a cancellation point in pthreads-win32, see
https://sourceware.org/pthreads-win32/manual/pthread_cancel.html

In order to be able to cancel the reader thread on Win32 properly we first
shutdown the socket then call CancelIoEx to abort pending IO. Subsequent
recvfrom() calls will fail with WSAESHUTDOWN causing the thread to exit.

Fixes ticket #5717.

Signed-off-by: Marton Balint <cus@passwd.hu>
2 months agoavformat/udp: remove setting cancel state from the TX thread
Marton Balint [Sun, 26 Jan 2020 20:11:53 +0000 (21:11 +0100)]
avformat/udp: remove setting cancel state from the TX thread

Write mode does not use cancellation.

Signed-off-by: Marton Balint <cus@passwd.hu>
2 months agoavcodec/mlpdsp: Fix a invalid shift in ff_mlp_rematrix_channel()
Michael Niedermayer [Sat, 1 Feb 2020 22:25:42 +0000 (23:25 +0100)]
avcodec/mlpdsp: Fix a invalid shift in ff_mlp_rematrix_channel()

Fixes: left shift of negative value -2
Fixes: 20305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-5677196618498048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Jai Luthra <me@jailuthra.in>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/adpcm_argo: simplify and move duplicated logic into a function
Zane van Iperen [Sat, 1 Feb 2020 06:59:59 +0000 (06:59 +0000)]
avcodec/adpcm_argo: simplify and move duplicated logic into a function

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavfilter: add xfade opencl filter
Paul B Mahol [Thu, 23 Jan 2020 15:29:34 +0000 (16:29 +0100)]
avfilter: add xfade opencl filter

2 months agodoc/filters: fix tonemap_vaapi filter name in documentation
Paul B Mahol [Sun, 2 Feb 2020 09:06:19 +0000 (10:06 +0100)]
doc/filters: fix tonemap_vaapi filter name in documentation

2 months agodoc/filters: make filters order more consistent
Paul B Mahol [Sun, 2 Feb 2020 09:04:35 +0000 (10:04 +0100)]
doc/filters: make filters order more consistent

2 months agoavcodec/v4l2_m2m: Cosmetics
Andriy Gelman [Mon, 13 Jan 2020 04:11:30 +0000 (23:11 -0500)]
avcodec/v4l2_m2m: Cosmetics

Change pointer symbol position.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2 months agoavcodec/v4l2_m2m: Use consistent logging context
Andriy Gelman [Mon, 13 Jan 2020 04:11:29 +0000 (23:11 -0500)]
avcodec/v4l2_m2m: Use consistent logging context

Before this commit v4l2_m2m used two different logging contexts (from
V4L2m2mPriv and AVCodecContext). For consistency always use AVCodecContext.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2 months agoavcodec/v4l2_m2m: Simplify capture buffer init check
Andriy Gelman [Mon, 13 Jan 2020 04:11:27 +0000 (23:11 -0500)]
avcodec/v4l2_m2m: Simplify capture buffer init check

Before this commit s->avctx == NULL was used to infer that an encoder is
being initialzed. Code readability has been improved by directly using
!av_codec_is_decoder() instead.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2 months agoavcodec:v4l2_context: Remove NULL initialization
Andriy Gelman [Mon, 13 Jan 2020 04:11:26 +0000 (23:11 -0500)]
avcodec:v4l2_context: Remove NULL initialization

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2 months agoavfilter/vf_xfade: remove unused header
Paul B Mahol [Sat, 1 Feb 2020 21:06:11 +0000 (22:06 +0100)]
avfilter/vf_xfade: remove unused header

2 months agoavfilter/vf_psnr: fix logic failure when comparing time bases
Paul B Mahol [Sat, 1 Feb 2020 20:10:25 +0000 (21:10 +0100)]
avfilter/vf_psnr: fix logic failure when comparing time bases

2 months agoavfilter/vf_ssim: fix logic failure when comparing time bases
Paul B Mahol [Sat, 1 Feb 2020 20:09:32 +0000 (21:09 +0100)]
avfilter/vf_ssim: fix logic failure when comparing time bases

2 months agoavcodec/utils: remove extra brackets
leozhang [Sat, 1 Feb 2020 09:12:13 +0000 (17:12 +0800)]
avcodec/utils: remove extra brackets

Signed-off-by: leozhang <leozhang@qiyi.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agolibavcodec/amfenc_hevc.c: Fix constant QP settings for I, P
OvchinnikovDmitrii [Tue, 28 Jan 2020 16:23:43 +0000 (19:23 +0300)]
libavcodec/amfenc_hevc.c: Fix constant QP settings for I, P

2 months agolavc/h265_profile_level: Fix the default profile in ff_h265_guess_level
Linjie Fu [Wed, 15 Jan 2020 06:54:43 +0000 (14:54 +0800)]
lavc/h265_profile_level: Fix the default profile in ff_h265_guess_level

Default to using multiplication factors for Main profile.

Introduced since cd3578a8e4e11e0ba021e621367a7974d6de5da0.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
2 months agoavformat/hlsenc: fix hls_ts_options with mpegts
Marton Balint [Mon, 23 Dec 2019 00:27:38 +0000 (01:27 +0100)]
avformat/hlsenc: fix hls_ts_options with mpegts

Was broken since cdbf8847ea97a985dfd55432e1384bb7fe5d2d3b.

Signed-off-by: Marton Balint <cus@passwd.hu>
2 months agoavfilter/vf_geq: use per-thread AVExpr for expression evaluation
Marton Balint [Sat, 28 Dec 2019 13:50:12 +0000 (14:50 +0100)]
avfilter/vf_geq: use per-thread AVExpr for expression evaluation

There was no consensus about separating AVExprState from AVExpr so here is a
minimal patch using the existing AVExpr to fix ticket #7528.

Signed-off-by: Marton Balint <cus@passwd.hu>
2 months agoavcodec/avdct: Clear IDCTDSPContext context
Michael Niedermayer [Mon, 27 Jan 2020 20:54:22 +0000 (21:54 +0100)]
avcodec/avdct: Clear IDCTDSPContext context

Fixes use of uninitialized variable and segfault

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoMAINTAINERS: Add patchwork maintainer
Michael Niedermayer [Mon, 27 Jan 2020 20:54:21 +0000 (21:54 +0100)]
MAINTAINERS: Add patchwork maintainer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agodashenc: check pts to prevent division by zero error
Alfred E. Heggestad [Thu, 30 Jan 2020 09:58:01 +0000 (10:58 +0100)]
dashenc: check pts to prevent division by zero error

this usecase will cause a division by zero trap:

1. dashenc has received one frame
2. os->max_pts and os->start_pts have same value
3. delta between max_pts and start_pts is 0
4. av_rescale_q(0, x, y) returns 0
5. this value is used as denominator in division
6. Bang! -> segfault

this fix checks that max_pts > start_pts.
the fix has been tested and works.

Signed-off-by: Alfred E. Heggestad <alfred.heggestad@gmail.com>
Reviewed-by: Jeyapal, Karthick <kjeyapal@akamai.com>
Signed-off-by: James Almer <jamrial@gmail.com>