History

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.

Mark Thompson committed 8 years ago

Commit 2923ed21 parent 40ac6223 files · +172 −0Browse files

Showing the changes to libavcodec/vaapi_encode.h (1 of 3 files). Show all

Unified · Split

libavcodec/vaapi_encode.h+22−0
@@ -52,6 +52,10 @@ enum { · 51 unmodified lines
5252
5353 typedef struct VAAPIEncodeSlice {
5454 int index;
55+ int row_start;
56+ int row_size;
57+ int block_start;
58+ int block_size;
5559 void *priv_data;
5660 void *codec_slice_params;
5761 } VAAPIEncodeSlice;
@@ -125,6 +129,10 @@ typedef struct VAAPIEncodeContext { · 67 unmodified lines
125129 int surface_width;
126130 int surface_height;
127131
132+ // The block size for slice calculations.
133+ int slice_block_width;
134+ int slice_block_height;
135+
128136 // Everything above this point must be set before calling
129137 // ff_vaapi_encode_init().
130138
@@ -224,6 +232,12 @@ typedef struct VAAPIEncodeContext { · 93 unmodified lines
224232 int64_t dts_pts_diff;
225233 int64_t ts_ring[MAX_REORDER_DELAY * 3];
226234
235+ // Slice structure.
236+ int slice_block_rows;
237+ int slice_block_cols;
238+ int nb_slices;
239+ int slice_size;
240+
227241 // Frame type decision.
228242 int gop_size;
229243 int p_per_i;
@@ -234,11 +248,19 @@ typedef struct VAAPIEncodeContext { · 4 unmodified lines
234248 int end_of_stream;
235249 } VAAPIEncodeContext;
236250
251+enum {
252+ // Codec supports controlling the subdivision of pictures into slices.
253+ FLAG_SLICE_CONTROL = 1 << 0,
254+};
255+
237256 typedef struct VAAPIEncodeType {
238257 // List of supported profiles and corresponding VAAPI profiles.
239258 // (Must end with FF_PROFILE_UNKNOWN.)
240259 const VAAPIEncodeProfile *profiles;
241260
261+ // Codec feature flags.
262+ int flags;
263+
242264 // Perform any extra codec-specific configuration after the
243265 // codec context is initialised (set up the private data and
244266 // add any necessary global parameters).

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t