diff options
author | Mark Thompson <sw@jkqxz.net> | 2018-09-23 22:52:56 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-10-27 19:35:35 +0100 |
commit | 2923ed247ee2f507f32b34aeddd6785bab173a71 (patch) | |
tree | 84779b4ab0f7825ad647da5c4bbde3ccf8f33168 /libavcodec/vaapi_encode.h | |
parent | 40ac622460284f4aad10a13b786d03d6c2cfa868 (diff) | |
download | ffmpeg-2923ed247ee2f507f32b34aeddd6785bab173a71.tar.gz |
vaapi_encode: Support configurable slices
This adds common code to query driver support and set appropriate
address/size information for each slice. It only supports rectangular
slices for now, since that is the most common use-case.
Diffstat (limited to 'libavcodec/vaapi_encode.h')
-rw-r--r-- | libavcodec/vaapi_encode.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h index 091889f9ae..271d4ef518 100644 --- a/libavcodec/vaapi_encode.h +++ b/libavcodec/vaapi_encode.h @@ -52,6 +52,10 @@ enum { typedef struct VAAPIEncodeSlice { int index; + int row_start; + int row_size; + int block_start; + int block_size; void *priv_data; void *codec_slice_params; } VAAPIEncodeSlice; @@ -125,6 +129,10 @@ typedef struct VAAPIEncodeContext { int surface_width; int surface_height; + // The block size for slice calculations. + int slice_block_width; + int slice_block_height; + // Everything above this point must be set before calling // ff_vaapi_encode_init(). @@ -224,6 +232,12 @@ typedef struct VAAPIEncodeContext { int64_t dts_pts_diff; int64_t ts_ring[MAX_REORDER_DELAY * 3]; + // Slice structure. + int slice_block_rows; + int slice_block_cols; + int nb_slices; + int slice_size; + // Frame type decision. int gop_size; int p_per_i; @@ -234,11 +248,19 @@ typedef struct VAAPIEncodeContext { int end_of_stream; } VAAPIEncodeContext; +enum { + // Codec supports controlling the subdivision of pictures into slices. + FLAG_SLICE_CONTROL = 1 << 0, +}; + typedef struct VAAPIEncodeType { // List of supported profiles and corresponding VAAPI profiles. // (Must end with FF_PROFILE_UNKNOWN.) const VAAPIEncodeProfile *profiles; + // Codec feature flags. + int flags; + // Perform any extra codec-specific configuration after the // codec context is initialised (set up the private data and // add any necessary global parameters). |