mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
d3d12/video_enc: Fix AV1 tile_info() coding
Previously this used the {Min,Max}Tile{Rows,Cols} as returned by the
driver capabilities. Those parameters should be used to determine
implementation supported tile configurations for a specific resolution.
In the case of header coding, the {min,max}Log2Tile{Rows,Cols} should be
derived exactly as the AV1 spec defines it.
Signed-off-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: Sil Vilerino <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32762>
This commit is contained in:
parent
548b5e37ae
commit
b9e9cb4684
1 changed files with 10 additions and 6 deletions
|
|
@ -443,15 +443,19 @@ d3d12_video_bitstream_builder_av1::write_pic_data(d3d12_video_encoder_bitstream
|
|||
|
||||
// tile_info()
|
||||
{
|
||||
unsigned maxTileWidthSb = pPicHdr->tile_info.tile_support_caps.MaxTileWidth;
|
||||
unsigned maxTileAreaSb = pPicHdr->tile_info.tile_support_caps.MaxTileArea;
|
||||
unsigned sbSize = (pSeqHdr->use_128x128_superblock ? 5 : 4) /* sbShift */ + 2;
|
||||
unsigned maxTileWidthSb = 4096 /* MAX_TILE_WIDTH */ >> sbSize;
|
||||
unsigned maxTileAreaSb = 4096 * 2304 /* MAX_TILE_AREA */ >> (2 * sbSize);
|
||||
|
||||
unsigned minLog2TileCols = tile_log2(maxTileWidthSb, pPicHdr->tile_info.tile_support_caps.MinTileCols);
|
||||
unsigned maxLog2TileCols = tile_log2(1, pPicHdr->tile_info.tile_support_caps.MaxTileCols);
|
||||
unsigned minLog2TileCols = tile_log2(maxTileWidthSb, pPicHdr->frame_width_sb);
|
||||
unsigned maxLog2TileCols = tile_log2(1, std::min(pPicHdr->frame_width_sb, uint32_t(64) /* MAX_TILE_COLS */));
|
||||
unsigned log2TileCols = tile_log2(1, static_cast<unsigned>(pPicHdr->tile_info.tile_partition.ColCount));
|
||||
|
||||
unsigned minLog2TileRows = tile_log2(1, pPicHdr->tile_info.tile_support_caps.MinTileRows);
|
||||
unsigned maxLog2TileRows = tile_log2(1, pPicHdr->tile_info.tile_support_caps.MaxTileRows);
|
||||
unsigned maxLog2TileRows = tile_log2(1, std::min(pPicHdr->frame_height_sb, uint32_t(64) /* MAX_TILE_ROWS */));
|
||||
unsigned minLog2Tiles = std::max(minLog2TileCols,
|
||||
tile_log2(maxTileAreaSb,
|
||||
pPicHdr->frame_width_sb * pPicHdr->frame_height_sb));
|
||||
unsigned minLog2TileRows = minLog2Tiles < log2TileCols ? 0 : minLog2Tiles - log2TileCols;
|
||||
unsigned log2TileRows = tile_log2(1, static_cast<unsigned>(pPicHdr->tile_info.tile_partition.RowCount));
|
||||
|
||||
pBit->put_bits(1, pPicHdr->tile_info.uniform_tile_spacing_flag); // uniform_tile_spacing_flag
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue