summaryrefslogtreecommitdiffstats
path: root/libavcodec/vaapi_encode.c
Commit message (Collapse)AuthorAgeFilesLines
* vaapi_encode: Destroy output buffer pool before VA contextMark Thompson2018-02-201-2/+2
| | | | | The buffers are created associated with the context, so they should be destroyed before the context is. This is enforced by the iHD driver.
* vaapi_encode: Allocate slice structures and parameter buffers dynamicallyJun Zhao2018-02-201-10/+30
| | | | | | | | | This removes the arbitrary limit on the allowed number of slices and parameter buffers. From ffmpeg commit e4a6eb70f471eda36592078e8fa1bad87fc9df73. Signed-off-by: Mark Thompson <sw@jkqxz.net>
* vaapi: Always free parameter buffers after vaEndPicture() with libva2Mark Thompson2017-10-251-2/+2
| | | | | | This is an ABI change in libva2: previously the Intel driver had this behaviour and it was implemented as a driver quirk, but now it is part of the specification so all drivers must do it.
* vaapi_encode: Move quality option to common codeMark Thompson2017-08-061-0/+35
| | | | | | | | | 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.
* vaapi_encode: Use gop_size consistently in RC parametersMark Thompson2017-04-261-2/+1
| | | | | | | | The non-H.26[45] codecs already use this form. Since we don't currently generate I frames for codecs which support them separately to IDR, the p_per_i variable is set to infinity by default so that it doesn't interfere with any other calculation. (All the code for I frames still exists, and it works for H.264 if set manually.)
* vaapi_encode: Discard output buffer if picture submission failsMark Thompson2017-02-161-0/+2
| | | | | Previously this was leaking, though it actually hit an assert making sure that the buffer had already been cleared when freeing the picture.
* Mark some arrays that never change as const.Anton Khirnov2017-02-011-1/+1
|
* vaapi_encode: Pass framerate parameters to driverMark Thompson2017-01-301-0/+18
| | | | | | | 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.
* vaapi_encode: Support VBR modeMark Thompson2017-01-301-5/+37
| | | | | | This includes a backward-compatibility hack to choose CBR anyway on old drivers which have no CBR support, so that existing programs will continue to work their options now map to VBR.
* vaapi_encode: Add MPEG-2 supportMark Thompson2017-01-291-0/+1
|
* vaapi_encode: Support forcing IDR frames via AVFrame.pict_typeMark Thompson2017-01-111-4/+23
|
* vaapi_encode: Fix GOP sizingMark Thompson2017-01-111-43/+35
| | | | | | 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.
* vaapi_encode: Write sequence header as extradataMark Thompson2016-10-171-0/+22
| | | | | Only works if packed headers are supported, where we can know the output before generating the first frame.
* vaapi_encode: Decide on GOP setup before initialising sequence parametersMark Thompson2016-10-021-6/+6
| | | | | This was always too late; several fields related to it have been incorrectly zero since the encoder was added.
* vaapi_encode: Sync to input surface rather than outputMark Thompson2016-09-281-3/+3
| | | | | | | | | While outwardly bizarre, this change makes the behaviour consistent with other VAAPI encoders which sync to the encode /input/ picture in order to wait for /output/ from the encoder. It is not harmful on i965 (because synchronisation already happens in vaRenderPicture(), so it has no effect there), and it allows the encoder to work on mesa/gallium which assumes this behaviour.
* vaapi_encode: Check packed header capabilitiesMark Thompson2016-09-281-7/+29
| | | | | This improves behaviour with drivers which do not support packed headers, such as AMD VCE on mesa/gallium.
* vaapi_encode: Refactor initialisationMark Thompson2016-09-281-85/+168
| | | | | | | | 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.
* vaapi_encode: Respect driver quirks around buffer destructionMark Thompson2016-07-021-1/+21
| | | | | No longer leaks memory when used with a driver with the "render does not destroy param buffers" quirk (i.e. Intel i965).
* vaapi_encode: Maintain a pool of bitstream output buffersMark Thompson2016-06-261-18/+72
| | | | | | | | | 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.
* vaapi_encode: Fix fallback when input does not match any formatMark Thompson2016-06-211-2/+5
| | | | Just a typo. Add a comment to make it clearer what it's doing.
* vaapi_encode: Add support for writing arbitrary additional packed headersMark Thompson2016-06-091-0/+21
|
* vaapi_encode: Check config attributes before creating configMark Thompson2016-05-271-2/+130
| | | | | | This prevents attempts to use unsupported modes, such as low-power H.264 mode on non-Skylake targets. Also fixes a crash on invalid configuration, when trying to destroy an invalid VA config/context.
* cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-2/+2
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* vaapi_encode: Add support for codec-local optionsMark Thompson2016-04-151-0/+1
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* vaapi_encode: Refactor slightly to allow easier setting of global optionsMark Thompson2016-04-151-0/+13
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: VAAPI encode common infrastructureMark Thompson2016-03-301-0/+1096
Signed-off-by: Anton Khirnov <anton@khirnov.net>
OpenPOWER on IntegriCloud