diff options
author | Mark Thompson <sw@jkqxz.net> | 2016-06-05 17:18:04 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2016-06-26 19:40:56 +0100 |
commit | 8a62d2c28fbacd1ae20c35887a1eecba2be14371 (patch) | |
tree | 1465cd0ae306bafae84b617f0bb908ec4be74184 /libavcodec/vaapi_encode.h | |
parent | bd31c61cf94d01dbe1051cf65874e7b2c0ac5454 (diff) | |
download | ffmpeg-streaming-8a62d2c28fbacd1ae20c35887a1eecba2be14371.zip ffmpeg-streaming-8a62d2c28fbacd1ae20c35887a1eecba2be14371.tar.gz |
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.
Diffstat (limited to 'libavcodec/vaapi_encode.h')
-rw-r--r-- | libavcodec/vaapi_encode.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h index 85f3a0c..eede73c 100644 --- a/libavcodec/vaapi_encode.h +++ b/libavcodec/vaapi_encode.h @@ -39,7 +39,6 @@ enum { MAX_PARAM_BUFFERS = 16, MAX_REORDER_DELAY = 16, MAX_PARAM_BUFFER_SIZE = 1024, - MAX_OUTPUT_BUFFER_SIZE = 1024 * 1024, }; enum { @@ -84,6 +83,7 @@ typedef struct VAAPIEncodePicture { int nb_param_buffers; VABufferID param_buffers[MAX_PARAM_BUFFERS]; + AVBufferRef *output_buffer_ref; VABufferID output_buffer; void *priv_data; @@ -130,6 +130,8 @@ typedef struct VAAPIEncodeContext { AVBufferRef *recon_frames_ref; AVHWFramesContext *recon_frames; + AVBufferPool *output_buffer_pool; + VAConfigAttrib config_attributes[MAX_CONFIG_ATTRIBUTES]; int nb_config_attributes; |