1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

cbs_av1: expose tile col/row starts in SBs

This commit is contained in:
Lynne 2023-02-23 02:46:13 +01:00
parent e49b8b48cd
commit 6ec58ff820
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464
2 changed files with 12 additions and 0 deletions

View File

@ -215,6 +215,8 @@ typedef struct AV1RawFrameHeader {
uint8_t uniform_tile_spacing_flag;
uint8_t tile_cols_log2;
uint8_t tile_rows_log2;
uint8_t tile_start_col_sb[AV1_MAX_TILE_COLS];
uint8_t tile_start_row_sb[AV1_MAX_TILE_COLS];
uint8_t width_in_sbs_minus_1[AV1_MAX_TILE_COLS];
uint8_t height_in_sbs_minus_1[AV1_MAX_TILE_ROWS];
uint16_t context_update_tile_id;

View File

@ -626,6 +626,10 @@ static int FUNC(tile_info)(CodedBitstreamContext *ctx, RWContext *rw,
tile_width_sb = (sb_cols + (1 << current->tile_cols_log2) - 1) >>
current->tile_cols_log2;
for (int off = 0, i = 0; off < sb_cols; off += tile_width_sb)
current->tile_start_col_sb[i++] = off;
current->tile_cols = (sb_cols + tile_width_sb - 1) / tile_width_sb;
min_log2_tile_rows = FFMAX(min_log2_tiles - current->tile_cols_log2, 0);
@ -634,6 +638,10 @@ static int FUNC(tile_info)(CodedBitstreamContext *ctx, RWContext *rw,
tile_height_sb = (sb_rows + (1 << current->tile_rows_log2) - 1) >>
current->tile_rows_log2;
for (int off = 0, i = 0; off < sb_rows; off += tile_height_sb)
current->tile_start_row_sb[i++] = off;
current->tile_rows = (sb_rows + tile_height_sb - 1) / tile_height_sb;
for (i = 0; i < current->tile_cols - 1; i++)
@ -652,6 +660,7 @@ static int FUNC(tile_info)(CodedBitstreamContext *ctx, RWContext *rw,
start_sb = 0;
for (i = 0; start_sb < sb_cols && i < AV1_MAX_TILE_COLS; i++) {
current->tile_start_col_sb[i] = start_sb;
max_width = FFMIN(sb_cols - start_sb, max_tile_width_sb);
ns(max_width, width_in_sbs_minus_1[i], 1, i);
size_sb = current->width_in_sbs_minus_1[i] + 1;
@ -669,6 +678,7 @@ static int FUNC(tile_info)(CodedBitstreamContext *ctx, RWContext *rw,
start_sb = 0;
for (i = 0; start_sb < sb_rows && i < AV1_MAX_TILE_ROWS; i++) {
current->tile_start_row_sb[i] = start_sb;
max_height = FFMIN(sb_rows - start_sb, max_tile_height_sb);
ns(max_height, height_in_sbs_minus_1[i], 1, i);
size_sb = current->height_in_sbs_minus_1[i] + 1;