James Almer [Mon, 24 Sep 2018 00:54:24 +0000 (21:54 -0300)]
avformat/ivfenc: fix writing codec tag
The value in AVCodecParameters->codec_tag may not be correct for IVF,
as it's the case when remuxing AV1 streams from mp4, so ignore it and
write the correct value based on codec ID instead.
Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
avcodec/prosumer: Check remaining space in put byte context
Fixes: Timeout Fixes: 10053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5636993883570176 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>
avdevice/decklink: add support for selecting devices based on their unique ID
Also bump the API version requirement to 10.9.5, because on olders versions
there were some reports of crashes using the undocumented, yet available
BMDDeckLinkDeviceHandle.
Mark Thompson [Tue, 18 Sep 2018 22:31:05 +0000 (23:31 +0100)]
vaapi_encode_h265: Set level based on stream if not set by user
Sets the level based on the stream properties if it is not explicitly
set by the user. Also add a tier option to set general_tier_flag, since
that affects the level choice.
Mark Thompson [Tue, 18 Sep 2018 22:31:03 +0000 (23:31 +0100)]
vaapi_encode_h265: Improve profile support
Set profile compatibility/constraint flags properly (including the
constraint flags used for RExt profiles, as all streams we can currently
generate are RExt-compatible), and use that to add support for the "Main
Intra" and "Main 10 Intra" RExt subprofiles (for which we can re-use the
existing Main and Main10 VAAPI profiles).
Mark Thompson [Tue, 18 Sep 2018 22:31:00 +0000 (23:31 +0100)]
cbs_h264: Fix default value for max mv lengths
A recent version of the standard changed the max and default to 15, from
16 in older versions. This updates the default to 15 to match, but the
max stays as 16 so that we don't reject older streams.
Mark Thompson [Tue, 18 Sep 2018 22:30:56 +0000 (23:30 +0100)]
hwcontext_vaapi: Improve format mapping
Give the entries in the VAAPI format map table an explicit type and add
functions to do the necessary lookups. Add another field to this table
indicating whether the chroma planes are swapped (as in YV12), and use
that rather than explicit comparisons where swapping is needed.
Mark Thompson [Tue, 18 Sep 2018 22:30:52 +0000 (23:30 +0100)]
hwcontext_vaapi: Improve logging around quirk detection
Clarify that the list is the naughty list, and therefore being on it is
not desirable. The i965 driver does not need to be on the list after
version 2.0 (when the standard parameter buffer rendering behaviour was
changed).
Mark Thompson [Tue, 18 Sep 2018 22:30:49 +0000 (23:30 +0100)]
vaapi_encode_h264: Properly set constraint flags
constraint_set1_flag should be set for constrained baseline and main
profiles, because the stream conforms to main profile.
constraint_set3_flag should be set for high profile when the stream
is intra-only.
constraint_set4_flag should always be set for main and high profiles
because interlaced encoding is not supported.
constraint_set5_flag should be set for main and high profiles when
B-frames are not used.
Also fix the setting of max_num_ref_frames - use the gop_size value
to check for intra-only rather than the constraint flag (which is not
necessarily set).
Mark Thompson [Tue, 18 Sep 2018 22:30:48 +0000 (23:30 +0100)]
vaapi_encode: Clean up the packed header configuration
Add a larger warning more clearly explaining the consequences of missing
packed header support in the driver. Also only write the extradata if the
user actually requests it via the GLOBAL_HEADER flag.
Mark Thompson [Tue, 18 Sep 2018 22:30:47 +0000 (23:30 +0100)]
vaapi_encode: Clean up the GOP structure configuration
Choose what types of reference frames will be used based on what types
are available, and make the intra-only mode explicit (GOP size one,
which must be used for MJPEG).
Mark Thompson [Tue, 18 Sep 2018 22:30:46 +0000 (23:30 +0100)]
vaapi_encode: Add support for max QP in rate control
This was added in libva 2.1.0 (VAAPI 1.1.0). Use AVCodecContext.qmax,
matching the existing behaviour for qmin, and clean up the defaults so
that we only pass min/max when explicitly set.
Mark Thompson [Tue, 18 Sep 2018 22:30:45 +0000 (23:30 +0100)]
vaapi_encode: Clean up rate control configuration
Query which modes are supported and select between VBR and CBR based
on that - this removes all of the codec-specific rate control mode
selection code.
Mark Thompson [Tue, 18 Sep 2018 22:30:44 +0000 (23:30 +0100)]
vaapi_encode: Always reapply global parameters after the sequence header
The codec sequence headers may contain fields which can overwrite the
fine parameters given in the specific settings (e.g. a crude bitrate
value vs. the max-rate / target-percentage / etc. values in
VAEncMiscParameterRateControl). Always reapply all global parameters
after a sequence header to avoid this causing problems.
Mark Thompson [Tue, 18 Sep 2018 22:30:40 +0000 (23:30 +0100)]
vaapi_encode: Choose profiles dynamically
Previously there was one fixed choice for each codec (e.g. H.265 -> Main
profile), and using anything else then required an explicit option from
the user. This changes to selecting the profile based on the input format
and the set of profiles actually supported by the driver (e.g. P010 input
will choose Main 10 profile for H.265 if the driver supports it).
The entrypoint and render target format are also chosen dynamically in the
same way, removing those explicit selections from the per-codec code.
Mark Thompson [Tue, 18 Sep 2018 22:30:39 +0000 (23:30 +0100)]
configure: Use pkgconfig for VAAPI
Set the minimum version to 0.35.0 (libva 1.3.0) and remove redundant
configure tests. This also allows the proprietary libmfx fork of libva,
which always shows the version number 0.99.0 (independent of the actual
version).
avcodec/ac3dec: Fix shift signedness in mask creation
Fixes: 9924/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5473421772193792 Fixes: left shift of 1 by 63 places cannot be represented in type 'long long' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
avformat/dashenc: Reduce Muxing overhead for chunked CMAF format
SIDX atom being inserted for every MOOF atom increases the muxing overhead.
This behaviour can be disabled for chunked CMAF format by enabling Global SIDX option of mov muxer.
Fixes: out of array read Fixes: 10064/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5766801384800256 Fixes: 10225/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5071833448054784 Fixes: 10261/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5115048024866816 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
avcodec/zmbv: Check that the decompressed data size is correct
This checks the value exactly for intra frames and checks it against a
minimum for inter frames as they can be variable.
Fixes: Timeout Fixes: 10182/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZMBV_fuzzer-6245951174344704 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>
Combined 1st and 2nd loop into one inline asm in function ff_vc1_inv_trans_8x8_mmi to
reduce memory operation, and made some small optimization in ff_vc1_inv_trans_4x8_mmi.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>