1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

92102 Commits

Author SHA1 Message Date
Mark Thompson
feb1cf08ab lavc/h265_profile_level: Avoid integer overflow in bitrate
Fixes CIDs #1439659 and #1439660.
2018-09-24 23:09:45 +01:00
Mark Thompson
321294adb7 h264_metadata: Avoid integer overflow in bitrate
Fixes CID #1439664.
2018-09-24 23:09:32 +01:00
Mark Thompson
581b4125aa lavc/h264_levels: Avoid integer overflow in bitrate
Fixes CID #1439656.
2018-09-24 23:08:45 +01:00
Baptiste Coudurier
dc58e33dd3 avformat/utils: set AV_PKT_FLAG_KEY for data packets 2018-09-24 13:51:13 -07:00
James Almer
e50cb8b2f4 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>
2018-09-24 16:15:30 -03:00
Paul B Mahol
54ca198e23 avfilter/vf_threshold: add slice threading 2018-09-24 20:21:17 +02:00
Steven Liu
4b00332203 avfilter/sr: process and output message when load_model is NULL
fix ticket: 7455

Reviewed-by: Pedro Arthur <bygrandao@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-09-24 22:02:54 +08:00
Paul B Mahol
8d29930767 avcodec/ilbcdec: fix typo, fixes CID 1439653 2018-09-24 09:20:31 +02:00
Michael Niedermayer
0f36ad514c 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>
2018-09-24 00:49:30 +02:00
Michael Niedermayer
3b5945b146 avcodec/prosumer: Remove unused table element
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-24 00:49:30 +02:00
Michael Niedermayer
52b909b5c1 avcodec/prosumer: remove unneeded variable from vertical_predict
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-24 00:49:30 +02:00
Michael Niedermayer
093607f0cd avcodec/prosumer: Rename do_shift() to vertical_predict()
It seems what this function does is a vertical prediction filter, thus
the new name should improve understanding.

rename the related table_b too

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-24 00:49:30 +02:00
Michael Niedermayer
0cd22fd752 avcodec/prosumer: mark src as const
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-24 00:49:30 +02:00
Michael Niedermayer
3c9ebcbc4d avcodec/prosumer: Only scan as many elements as matter in fill_elements()
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-24 00:49:30 +02:00
Michael Niedermayer
fa1d3caef0 avcodec/prosumer: factorize e0 setting out
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-24 00:49:30 +02:00
Michael Niedermayer
e97951f458 avcodec/prosumer: Use 16bit instead of 32 for table
Simplifies code and reduces needed memory

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-24 00:49:30 +02:00
Michael Niedermayer
d3a9cb6bc8 avcodec/prosumer: Factorize the 2 loops in fill_elements()
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-24 00:49:30 +02:00
Michael Niedermayer
f24701b073 avcodec/prosumer: clean up loop end code in fill_elements()
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-24 00:49:30 +02:00
Michael Niedermayer
674727291b avcodec/prosumer: Remove dead code
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-24 00:49:30 +02:00
Paul B Mahol
a9485d7318 avfilter: document mono option of silencedetect filter
Also provide shorter option, and reorder options in documentation.
2018-09-23 23:10:51 +02:00
Marton Balint
db6b4b56b3 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.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-09-23 18:55:29 +02:00
Linjie Fu
0f9b298242 avcodec/vaapi: free slice_buffers when decoding failed
If vaEndPicture() failed in ff_vaapi_decode_issue(), free
the pic->slice_buffers.

Fixes the memory leak issue in ticket #7385

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-09-23 17:46:37 +01:00
Mark Thompson
d5451a9b07 doc/encoders: Document -sei option to hevc_vaapi 2018-09-23 14:42:34 +01:00
Mark Thompson
bfc4d0f6e4 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.
2018-09-23 14:42:34 +01:00
Mark Thompson
59dd91c768 lavc/h265: Add some common code for profile/tier/level handling
Adds support for determining for level limits, including mapping PTL
blocks to profiles to check profile-dependent level limits.
2018-09-23 14:42:34 +01:00
Mark Thompson
61aea24662 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).
2018-09-23 14:42:34 +01:00
Mark Thompson
1156b507f7 cbs_h264: Infer default VUI values if VUI parameters are not present 2018-09-23 14:42:34 +01:00
Mark Thompson
574dafe7b8 cbs_h264: Fix profile typo 2018-09-23 14:42:34 +01:00
Mark Thompson
4b2e3de8c0 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.
2018-09-23 14:42:34 +01:00
Mark Thompson
6522ba30e9 h264_metadata: Add option to set the level of the stream 2018-09-23 14:42:34 +01:00
Mark Thompson
bb3503164e vaapi_encode_h264: Set level based on stream if not set by user 2018-09-23 14:42:34 +01:00
Mark Thompson
cc549149d3 lavc/h264: Add common code for level handling
Including a unit test.
2018-09-23 14:42:34 +01:00
Mark Thompson
40724026b7 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.
2018-09-23 14:42:34 +01:00
Mark Thompson
930aad6a36 vaapi_encode_mjpeg: Mark as intra-only 2018-09-23 14:42:34 +01:00
Mark Thompson
ff0eb2bce3 vaapi_encode_mjpeg: Use CBS to store parameters and write headers
Also adds greyscale, 4:2:2, 4:4:4 and RGB support.
2018-09-23 14:42:34 +01:00
Mark Thompson
525de2000b lavc/cbs: Add JPEG support 2018-09-23 14:42:34 +01:00
Mark Thompson
852c7ba3f8 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).
2018-09-23 14:42:34 +01:00
Mark Thompson
c2e2b04df3 doc/encoders: Add missing options to VAAPI encoders 2018-09-23 14:42:34 +01:00
Mark Thompson
91534786fa vaapi_encode_h26[45]: Make the AUD option a boolean 2018-09-23 14:42:34 +01:00
Mark Thompson
4cc367bf9d 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).
2018-09-23 14:42:34 +01:00
Mark Thompson
851a63c22a 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.
2018-09-23 14:42:34 +01:00
Mark Thompson
bf726c26fd 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).
2018-09-23 14:42:33 +01:00
Mark Thompson
8479f99c7d 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.
2018-09-23 14:42:33 +01:00
Mark Thompson
af532c9215 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.
2018-09-23 14:42:33 +01:00
Mark Thompson
2562dd9e78 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.
2018-09-23 14:42:33 +01:00
Mark Thompson
ac31d84506 vaapi_encode: Clean up the encode quality configuration 2018-09-23 14:42:33 +01:00
Mark Thompson
95f6f7b704 vaapi_encode_mpeg2: Add options
Include the common options, and also named options for setting the profile
and level.
2018-09-23 14:42:33 +01:00
Mark Thompson
aa2563aecc vaapi_encode: Add common options between all encoders
The only common option here is low_power - it was previously supported
for H.264 only, that specific option is removed.
2018-09-23 14:42:33 +01:00
Mark Thompson
3b188666f1 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.
2018-09-23 14:42:33 +01:00
Mark Thompson
a00763be88 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).
2018-09-23 14:42:33 +01:00