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.
Showing the changes to libavcodec/vaapi_encode.h (1 of 2 files). Show all
Unified · Split
| @@ -43,6 +43,10 @@ enum { · 42 unmodified lines | |||
| 43 | MAX_PICTURE_REFERENCES = 2, | 43 | MAX_PICTURE_REFERENCES = 2, |
| 44 | MAX_REORDER_DELAY = 16, | 44 | MAX_REORDER_DELAY = 16, |
| 45 | MAX_PARAM_BUFFER_SIZE = 1024, | 45 | 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, | ||
| 46 | }; | 50 | }; |
| 47 | 51 | ||
| 48 | extern const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[]; | 52 | extern const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[]; |
| @@ -302,6 +306,18 @@ typedef struct VAAPIEncodeContext { · 253 unmodified lines | |||
| 302 | int nb_slices; | 306 | int nb_slices; |
| 303 | int slice_size; | 307 | int slice_size; |
| 304 | 308 | ||
| 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 | |||
| 305 | // Frame type decision. | 321 | // Frame type decision. |
| 306 | int gop_size; | 322 | int gop_size; |
| 307 | int closed_gop; | 323 | int closed_gop; |