summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_encode.h
diff options
context:
space:
mode:
authorLinjie Fu <linjie.fu@intel.com>2020-05-12 21:47:12 +0800
committerLinjie Fu <linjie.fu@intel.com>2020-07-20 15:26:50 +0800
commita7c2cdf0f6bc53d2bdf05fc92f20415a3de7045f (patch)
tree61cec168a8e76c63fded2be732a7f5e60aaf17ee /libavcodec/vaapi_encode.h
parent65f4d561c9dbd0a20ed9ed8c229dbbf3b89262ce (diff)
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. Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
Diffstat (limited to 'libavcodec/vaapi_encode.h')
-rw-r--r--libavcodec/vaapi_encode.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h
index 85d2a8f616..6487a99604 100644
--- a/libavcodec/vaapi_encode.h
+++ b/libavcodec/vaapi_encode.h
@@ -43,6 +43,10 @@ enum {
MAX_PICTURE_REFERENCES = 2,
MAX_REORDER_DELAY = 16,
MAX_PARAM_BUFFER_SIZE = 1024,
+ // A.4.1: table A.6 allows at most 22 tile rows for any level.
+ MAX_TILE_ROWS = 22,
+ // A.4.1: table A.6 allows at most 20 tile columns for any level.
+ MAX_TILE_COLS = 20,
};
extern const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[];
@@ -302,6 +306,18 @@ typedef struct VAAPIEncodeContext {
int nb_slices;
int slice_size;
+ // Tile encoding.
+ int tile_rows;
+ int tile_cols;
+ // Tile width of the i-th column.
+ int col_width[MAX_TILE_COLS];
+ // Tile height of i-th row.
+ int row_height[MAX_TILE_ROWS];
+ // Location of the i-th tile column boundary.
+ int col_bd[MAX_TILE_COLS + 1];
+ // Location of the i-th tile row boundary.
+ int row_bd[MAX_TILE_ROWS + 1];
+
// Frame type decision.
int gop_size;
int closed_gop;