Commit Graph

17 Commits

Author SHA1 Message Date
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
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
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
c5b4ad247b vaapi_encode: Remove common priv_data and options fields
The codec-specific context now contains both the common context and the
codec-specific options directly.
2018-08-27 16:21:38 +01:00
Mark Thompson
2c3ad16d3e vaapi_encode_mjpeg: Move common structure into context 2018-08-27 16:21:37 +01:00
wm4
b945fed629 avcodec: add metadata to identify wrappers and hardware decoders
Explicitly identify decoder/encoder wrappers with a common name. This
saves API users from guessing by the name suffix. For example, they
don't have to guess that "h264_qsv" is the h264 QSV implementation, and
instead they can just check the AVCodec .codec and .wrapper_name fields.

Explicitly mark AVCodec entries that are hardware decoders or most
likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing
API users listing hardware decoders in a more generic way. The proposed
AVCodecHWConfig does not provide this information fully, because it's
concerned with decoder configuration, not information about the fact
whether the hardware is used or not.

AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software
implementations in case the hardware is not capable.

Based on a patch by Philip Langdale <philipl@overt.org>.

Merges Libav commit 47687a2f8a.
2017-12-14 19:37:56 +01:00
James Almer
318778de9e Merge commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3'
* commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3':
  Mark some arrays that never change as const.

Merged-by: James Almer <jamrial@gmail.com>
2017-09-26 16:02:40 -03:00
Anton Khirnov
fd9212f2ed Mark some arrays that never change as const. 2017-02-01 10:42:59 +01:00
Mark Thompson
478a4b7e6d vaapi_encode: Check packed header capabilities
This improves behaviour with drivers which do not support packed
headers, such as AMD VCE on mesa/gallium.

(cherry picked from commit 892bbbcdc1)
2016-11-21 22:13:41 +00:00
Mark Thompson
c8241e730f vaapi_encode: Refactor initialisation
This allows better checking of capabilities and will make it easier
to add more functionality later.

It also commonises some duplicated code around rate control setup
and adds more comments explaining the internals.

(cherry picked from commit 80a5d05108)
2016-11-21 22:13:41 +00:00
Mark Thompson
892bbbcdc1 vaapi_encode: Check packed header capabilities
This improves behaviour with drivers which do not support packed
headers, such as AMD VCE on mesa/gallium.
2016-09-28 22:54:11 +01:00
Mark Thompson
80a5d05108 vaapi_encode: Refactor initialisation
This allows better checking of capabilities and will make it easier
to add more functionality later.

It also commonises some duplicated code around rate control setup
and adds more comments explaining the internals.
2016-09-28 22:54:10 +01:00
Derek Buitenhuis
8ed427f9f9 Merge commit '92fdea37477b5a2d1329e5ef0773e24473fa8f12'
These are all trivial to merge.

* commit '92fdea37477b5a2d1329e5ef0773e24473fa8f12':
  vaapi_h265: Add -qp option, use it to replace use of -global_quality
  vaapi_h265: Add constant-bitrate encode support
  vaapi_h264: Add encode quality option (for quality-speed tradeoff)
  vaapi_h264: Add -qp option, use it to replace use of -global_quality
  vaapi_encode: Add support for codec-local options
  vaapi_h264: Add constant-bitrate encode support
  vaapi_encode: Refactor slightly to allow easier setting of global options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-11 19:40:39 +01:00
Derek Buitenhuis
939345854a Merge commit '83f230c2445a94fdd94c66504482217fcece5909'
* commit '83f230c2445a94fdd94c66504482217fcece5909':
  lavc: VAAPI MJPEG encoder

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-08 22:46:52 +01:00
Mark Thompson
f6b8552369 vaapi_encode: Refactor slightly to allow easier setting of global options
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-04-15 10:07:04 +02:00
Mark Thompson
83f230c244 lavc: VAAPI MJPEG encoder
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-30 09:11:44 +02:00