Commit Graph

97760 Commits

Author SHA1 Message Date
Linjie Fu
d3a7bdd4ac lavc/libopenh264enc: Rewrite profile handling
Support the profiles "constrained_baseline" and "high" for libopenh264
version >= 1.8, support "constrained_baseline" and "main" for earlier
version.

If option not supported with current version, convert to constrained
baseline with a warning for users.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
2020-05-13 09:55:29 +08:00
Lynne
4b7e13931f
hwcontext_vulkan: don't add the optional VK_KHR_surface extension by default
Both API and CLI users can enable any extension they'd like using the options.
2020-05-12 21:32:34 +01:00
Lynne
251e4ad0ad
hwcontext_vulkan: don't error on unavailable user-specified extensions
Only warn instead. API users can find out which extensions were unavailable
by using the enabled_inst_extensions and enabled_dev_extensions fields.
This eliminates having to trial-and-error to find which extensions were missing.
2020-05-12 21:32:32 +01:00
Lynne
6025e66f98
hwcontext_vulkan: use the maximum amount of queues for each family
Due to our AVHWDevice infrastructure, where API users are offered a way
to derive contexts rather than always create new one, our filterchains,
being supported by a single hardware device context, can grow to considerable
size.
Hence, in such situations, using the maximum amount of queues the device offers
can be benefitial to eliminating bottlenecks where queue submissions on the
same family have to wait for the previous one to finish.
2020-05-12 21:32:30 +01:00
Lynne
0e39fce1e1
hwcontext_vulkan: update prepare_frame() for multiple semaphores when exporting 2020-05-12 21:32:24 +01:00
Michael Niedermayer
f0c0471075 avcodec/ralf: Check num_blocks before use
Fixes: out of array access
Fixes: 20659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5739471895265280

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 21:39:13 +02:00
Michael Niedermayer
a035fd88ae avcodec/iff: Test video_size being non zero
Fixes: Out of array access
Fixes: 20659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5658548592967680
Fixes: 20659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5723561177382912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 21:39:13 +02:00
Michael Niedermayer
4d701e9222 avcodec/cdtoons: Check sprite_offset is within the packet
Fixes: out of array read
Fixes: 20659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDTOONS_fuzzer-5754518731227136

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>
2020-05-12 21:39:13 +02:00
Michael Niedermayer
19738b1bc2 libavcodec/decode: Mark decode_simple_internal() as inline
This was suggested in
https://github.com/google/oss-fuzz/issues/3787
to reduce the grouping errors by oss-fuzz

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 21:39:13 +02:00
Steven Liu
ba436c1586 avformat/hlsenc: free options fix memleak in hls_write_trailer
Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
2020-05-12 22:32:08 +08:00
Steven Liu
76eaca43be avformat/hlsenc: fix filename memleak in hls_write_packet
Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
2020-05-12 22:32:04 +08:00
Steven Liu
e684d07ac6 avformat/hlsenc: move number out of hls_start
Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
2020-05-12 22:31:57 +08:00
Anton Khirnov
ffae62d96c vp9dec: support exporting QP tables through the AVVideoEncParams API 2020-05-12 09:37:47 +02:00
Anton Khirnov
c90f57c673 vp9dec: factorise freeing per-tile allocated data 2020-05-12 09:37:47 +02:00
Anton Khirnov
c584409643 lavc: add a flag for exporting AVVideoEncParams from decoders 2020-05-12 09:37:47 +02:00
Anton Khirnov
b84a2b91fd vf_showinfo: support AV_FRAME_DATA_VIDEO_ENC_PARAMS 2020-05-12 09:37:47 +02:00
Juan De León
991d417692 libavutil: add API for exporting video frame quantizers
This is intended to replace the deprecated the AV_FRAME_DATA_QP_TABLE*
API and extend it to a wider range of codecs.

In the future, it may also be extended to support other encoding
parameters such as motion vectors.

Additional changes by Anton Khirnov <anton@khirnov.net> with suggestions
by Lynne <dev@lynne.ee>.

Signed-off-by: Juan De León <juandl@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-05-12 09:37:47 +02:00
Anton Khirnov
d8de9d46f2 doc/examples/muxing: convert to new encoding API 2020-05-12 09:37:47 +02:00
Anton Khirnov
3bfe20389d doc/examples/demuxing_decoding: convert to new decoding API 2020-05-12 09:37:47 +02:00
Anton Khirnov
e4edf220e5 doc/examples/demuxing_decoding: drop -refcount
Non-refcounted frames are deprecated and there is no good reason to use
them.
2020-05-12 09:37:47 +02:00
Michael Niedermayer
876cfa67f3 avcodec/utvideodec: Fix integer overflow in decode_plane()
Fixes: signed integer overflow: 2147483594 + 142 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_fuzzer-5658568101724160

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 01:00:28 +02:00
Michael Niedermayer
8627885172 avcodec/ttadsp: Fix several integer overflows in tta_filter_process_c()
Fixes: signed integer overflow: 1931744255 + 252497024 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5763348114440192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 01:00:28 +02:00
Michael Niedermayer
0c4330847c avcodec/ralf: Fix integer overflow in decode_block()
Fixes: signed integer overflow: 289082077 - -2003141111 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5196077752123392

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 01:00:28 +02:00
Michael Niedermayer
1ac106bf56 avcodec/nuv: widen buf_size type
Fixes: signed integer overflow: 65312 * 65312 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-5740176118906880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 01:00:28 +02:00
Mark Reid
fabeef22d9 libswscale: fix for floating point formats, require full chroma
upon more floating point testing, looks like I missed adding this bit.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 01:00:28 +02:00
Michael Niedermayer
5f359f2b67 test: Add codecview test 2020-05-12 01:00:28 +02:00
Michael Niedermayer
b1e9764c5e tests: Add pp7, spp tests based on pp test 2020-05-12 01:00:28 +02:00
Michael Niedermayer
52cc86cae1 avfilter/vf_spp: Fix endian-dependance in add_block()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 01:00:28 +02:00
Michael Niedermayer
dde86d0ddf avfilter/vf_spp: Remove unused AVCodecContext
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 01:00:28 +02:00
Lynne
70d396c8af Revert "hwcontext_vulkan: only use one semaphore per image"
This reverts commit 97b526c192.
It broke the API, and assumed no other APIs used multiple semaphores.
This also disallowed certain optimizations to happen.

Dealing with APIs that give or expect single semaphores is easier when
we use per-image semaphores.
2020-05-11 23:48:26 +01:00
James Almer
2932905255 avformat/ivfenc: move bsf insertion to the init function
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-05-11 19:41:59 -03:00
James Almer
8e12f09a25 avformat/ivfenc: add an AVOutputFormat.init() function
Signed-off-by: James Almer <jamrial@gmail.com>
2020-05-11 19:40:40 -03:00
Michael Niedermayer
7a92147f87 avcodec/iff: Fix several integer overflows
Fixes: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself
Fixes: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int32_t' (aka 'int')
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5764066459254784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-11 00:45:09 +02:00
Michael Niedermayer
82d4c7b95e avcodec/g729postfilter: Clip gain before scaling with AGC_FAC1
The fixed point integer reference specifies the multiplication used
to have 16bit input and clips so we need to clip the input
The floating point implementation does not seem to do that.

Fixes: signed integer overflow: 6317568 * 410 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G729_fuzzer-5700189272932352

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-11 00:45:09 +02:00
Michael Niedermayer
22e51e95ac avcodec/alac: Fix integer overflow with 24/20bps samples
Fixes: signed integer overflow: 1020048 * 4096 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5753877751660544

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-11 00:45:09 +02:00
Michael Niedermayer
8ee264e684 avcodec/adpcm: Clip predictor for IMA_APM
Fixes: signed integer overflow: -2147483647 - 61436 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_APM_fuzzer-5092176004644864

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-11 00:45:09 +02:00
Lynne
fc99a24782
hwcontext_vulkan: convert to general layout and transfer queue when exporting
The specs note that images should be in the GENERAL layout when exporting
for maximum compatibility.
CUDA exported images are handled differently, and the queue is the same,
so we don't need to do that there.
2020-05-10 23:20:49 +01:00
Lynne
875c1707e5
hwcontext_vulkan: create all images with concurrent sharing mode
As it turns out, we were already assuming and treating all images as if they had
concurrent access mode. This just changes the flag to CONCURRENT, which has less
restrictions than EXCLUSIVE, and fixed validation messages on machines with
multiple queues.
The validation layer didn't pick this up because the machine I was testing on
had only a single queue.
2020-05-10 23:20:49 +01:00
Lynne
7c080dc190
hwcontext_vulkan: fix inverted condition when exporting images to drm_prime
Calling vkGetImageSubresourceLayout is only legal for linear and drm images.
2020-05-10 23:20:49 +01:00
Lynne
acfef378b7
hwcontext_vulkan: update debugging layer name 2020-05-10 23:20:48 +01:00
Lynne
030a565baf
hwcontext_vulkan: remove unused internal REQUIRED extension flag
This is a leftover from an old version which used the 1.0 Vulkan API
with the maintenance extensions being required.
2020-05-10 23:20:48 +01:00
Lynne
dccd07f66d
hwcontext_vulkan: expose enabled device and instance extensions
This solves a huge oversight - it lets users reliably use their own
AVVulkanDeviceContext. Otherwise, the extensions supplied and enabled
are not discoverable by anything outside of hwcontext_vulkan.
Also clarifies that any user-supplied VkInstance must be at least 1.1.
2020-05-10 23:20:48 +01:00
Lynne
3c5e5a5095
hwcontext_vulkan: let users enable device and instance extensions using options
Also documents all options supported by the hwdevice.
This lets users enable all extensions they need without writing their own
instance initialization code.
2020-05-10 23:20:47 +01:00
Andreas Rheinhardt
6db81e93a9 avformat/hlsenc: Simplify setting base_output_dirname
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-05-10 22:30:43 +02:00
Andreas Rheinhardt
21553d2082 avformat/hlsenc: Simplify setting basename with av_asprintf()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-05-10 22:23:28 +02:00
Andreas Rheinhardt
6b44f6839d avformat/hlsenc: Simplify setting subtitle basename with av_asprintf
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-05-10 21:41:22 +02:00
Andreas Rheinhardt
940601616e avformat/hlsenc: Don't cast const away
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-05-10 21:40:56 +02:00
Andreas Rheinhardt
d41c93d155 avformat/hlsenc: Remove redundant initializations
For every variantstream vs, vs->packets_written is set to one, only to be
set to zero a few lines below. Given that the relevant structure has
been zeroed during the allocation, this commit removes both assignments.
A redundant initialization for vs->init_range_length has been removed as
well a few lines below. Given that the relevant structure has been
zeroed during the allocation, this commit removes both assignments. A
redundant initialization for vs->init_range_length has been removed as
well.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-05-10 21:40:41 +02:00
Andreas Rheinhardt
a90f2265fa avformat/hlsenc: Don't reset AVIOContext pointer manually a second time
ff_format_io_close() already does it for us.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-05-10 21:40:13 +02:00
Limin Wang
a058d81570 avfilter/vf_signalstats: reindent after last commit
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-10 22:32:34 +08:00