Commit Graph

13 Commits

Author SHA1 Message Date
Mark Thompson
19388a7200 vaapi_encode: Move quality option to common code
Use AVCodecContext.compression_level rather than a private option,
replacing the H.264-specific quality option (which stays only for
compatibility).

This now works with the H.265 encoder in the i965 driver, as well as
the existing cases with the H.264 encoder.
2017-08-06 14:42:04 +01:00
Mark Thompson
ff35aa8ca4 vaapi_encode: Pass framerate parameters to driver
Only do this when building for a recent VAAPI version - initial
driver implementations were confused about the interpretation of the
framerate field, but hopefully this will be consistent everywhere
once 0.40.0 is released.
2017-01-30 22:52:54 +00:00
Mark Thompson
ca6ae3b77a vaapi_encode: Add MPEG-2 support 2017-01-29 13:28:31 +00:00
Mark Thompson
a3c3a5eac2 vaapi_encode: Support forcing IDR frames via AVFrame.pict_type 2017-01-11 23:03:58 +00:00
Mark Thompson
37fab0661a vaapi_encode: Fix GOP sizing
This change makes the configured GOP size be respected exactly -
previously the value could be exceeded slightly due to flaws in the
frame type selection logic.
2017-01-11 23:03:58 +00:00
Mark Thompson
0cf86fabfa vaapi_encode: Write sequence header as extradata
Only works if packed headers are supported, where we can know the
output before generating the first frame.
2016-10-17 21:07:25 +01: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
Mark Thompson
8a62d2c28f vaapi_encode: Maintain a pool of bitstream output buffers
Previously we would allocate a new one for every frame.  This instead
maintains an AVBufferPool of them to use as-needed.

Also makes the maximum size of an output buffer adapt to the frame
size - the fixed upper bound was a bit too easy to hit when encoding
large pictures at high quality.
2016-06-26 19:40:56 +01:00
Mark Thompson
19d7667a81 vaapi_encode: Add support for writing arbitrary additional packed headers 2016-06-09 21:15:39 +01:00
Mark Thompson
69b06ed428 vaapi_encode: Add support for codec-local options
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-04-15 10:07:05 +02: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
104c804bca lavc: VAAPI encode common infrastructure
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-30 09:05:28 +02:00