History

lavc/vaapi_encode: add tile slice encoding support

Add functions to initialize tile slice structure and make tile slice: - vaapi_encode_init_tile_slice_structure - vaapi_encode_make_tile_slice Tile slice is not allowed to cross the boundary of a tile due to the constraints of media-driver. Currently adding support for one slice per tile. N x N tile encoding is supposed to be supported with the the capability of ARBITRARY_MACROBLOCKS slice structures. N X 1 tile encoding should also work in ARBITRARY_ROWS slice structure.

Linjie Fu committed 6 years ago

Commit a7c2cdf1 parent 65f4d562 files · +136 −8Browse files

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

Unified · Split

libavcodec/vaapi_encode.h+16−0
@@ -43,6 +43,10 @@ enum { · 42 unmodified lines
4343 MAX_PICTURE_REFERENCES = 2,
4444 MAX_REORDER_DELAY = 16,
4545 MAX_PARAM_BUFFER_SIZE = 1024,
46+ // A.4.1: table A.6 allows at most 22 tile rows for any level.
47+ MAX_TILE_ROWS = 22,
48+ // A.4.1: table A.6 allows at most 20 tile columns for any level.
49+ MAX_TILE_COLS = 20,
4650 };
4751
4852 extern const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[];
@@ -302,6 +306,18 @@ typedef struct VAAPIEncodeContext { · 253 unmodified lines
302306 int nb_slices;
303307 int slice_size;
304308
309+ // Tile encoding.
310+ int tile_rows;
311+ int tile_cols;
312+ // Tile width of the i-th column.
313+ int col_width[MAX_TILE_COLS];
314+ // Tile height of i-th row.
315+ int row_height[MAX_TILE_ROWS];
316+ // Location of the i-th tile column boundary.
317+ int col_bd[MAX_TILE_COLS + 1];
318+ // Location of the i-th tile row boundary.
319+ int row_bd[MAX_TILE_ROWS + 1];
320+
305321 // Frame type decision.
306322 int gop_size;
307323 int closed_gop;

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