Skip to content

Commit 5975b74

Browse files
committed
decode: Fix MiCol/RowStarts units
The spec says: pMiColStarts is a pointer to an array of TileCols number of unsigned integers that corresponds to MiColStarts defined in section 6.8.14 of the [AV1 Specification] And the unit of MiColStarts is MI(mode info). So is pMiRowStarts.
1 parent aa22319 commit 5975b74

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

vk_video_decoder/libs/NvVideoParser/src/VulkanAV1Decoder.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ bool VulkanAV1Decoder::DecodeTileInfo()
11941194

11951195
tile_width_sb = (sb_cols + (1 << log2_tile_cols) - 1) >> log2_tile_cols;
11961196
for (uint32_t off = 0, i = 0; off < sb_cols; off += tile_width_sb)
1197-
pic_data->MiColStarts[i++] = off;
1197+
pic_data->MiColStarts[i++] = off << sb_shift;
11981198

11991199
pic_data->tileInfo.TileCols = (sb_cols + tile_width_sb - 1) / tile_width_sb;
12001200

@@ -1208,7 +1208,7 @@ bool VulkanAV1Decoder::DecodeTileInfo()
12081208

12091209
tile_height_sb = (sb_rows + (1 << log2_tile_rows) - 1) >> log2_tile_rows;
12101210
for (uint32_t off = 0, i = 0; off < sb_rows; off += tile_height_sb)
1211-
pic_data->MiRowStarts[i++] = off;
1211+
pic_data->MiRowStarts[i++] = off << sb_shift;
12121212

12131213
pic_data->tileInfo.TileRows = (sb_rows + tile_height_sb - 1) / tile_height_sb;
12141214

@@ -1226,16 +1226,16 @@ bool VulkanAV1Decoder::DecodeTileInfo()
12261226
// Derivce superblock column / row start positions
12271227
uint32_t i, start_sb;
12281228
for (i = 0, start_sb = 0; start_sb < sb_cols; i++) {
1229-
pic_data->MiColStarts[i] = start_sb;
1229+
pic_data->MiColStarts[i] = start_sb << sb_shift;
12301230
start_sb += tile_width_sb;
12311231
}
1232-
pic_data->MiColStarts[i] = sb_cols;
1232+
pic_data->MiColStarts[i] = mi_cols;
12331233

12341234
for (i = 0, start_sb = 0; start_sb < sb_rows; i++) {
1235-
pic_data->MiRowStarts[i] = start_sb;
1235+
pic_data->MiRowStarts[i] = start_sb << sb_shift;
12361236
start_sb += tile_height_sb;
12371237
}
1238-
pic_data->MiRowStarts[i] = sb_rows;
1238+
pic_data->MiRowStarts[i] = mi_rows;
12391239
} else {
12401240
uint32_t i, widest_tile_sb, start_sb, size_sb, max_width, max_height;
12411241
widest_tile_sb = 0;

0 commit comments

Comments
 (0)