MCPcopy Create free account
hub / github.com/IENT/YUView / parse

Method parse

YUViewLib/src/parser/AV1/tile_info.cpp:57–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55using namespace reader;
56
57void tile_info::parse(reader::SubByteReaderLogging & reader,
58 std::shared_ptr<sequence_header_obu> seqHeader,
59 unsigned MiCols,
60 unsigned MiRows)
61{
62 SubByteReaderLoggingSubLevel subLevel(reader, "tile_info()");
63
64 this->sbCols = seqHeader->use_128x128_superblock ? ((MiCols + 31) >> 5) : ((MiCols + 15) >> 4);
65 this->sbRows = seqHeader->use_128x128_superblock ? ((MiRows + 31) >> 5) : ((MiRows + 15) >> 4);
66 this->sbShift = seqHeader->use_128x128_superblock ? 5 : 4;
67 auto sbSize = this->sbShift + 2;
68 this->maxTileWidthSb = MAX_TILE_WIDTH >> sbSize;
69 this->maxTileAreaSb = MAX_TILE_AREA >> (2 * sbSize);
70 this->minLog2TileCols = tile_log2(this->maxTileWidthSb, sbCols);
71 this->maxLog2TileCols = tile_log2(1, std::min(this->sbCols, MAX_TILE_COLS));
72 this->maxLog2TileRows = tile_log2(1, std::min(this->sbRows, MAX_TILE_ROWS));
73 this->minLog2Tiles =
74 std::max(this->minLog2TileCols, tile_log2(this->maxTileAreaSb, sbRows * sbCols));
75
76 this->uniform_tile_spacing_flag = reader.readFlag("uniform_tile_spacing_flag");
77 if (this->uniform_tile_spacing_flag)
78 {
79 this->TileColsLog2 = this->minLog2TileCols;
80 while (this->TileColsLog2 < this->maxLog2TileCols)
81 {
82 this->increment_tile_cols_log2 = reader.readFlag("increment_tile_cols_log2");
83 if (this->increment_tile_cols_log2)
84 this->TileColsLog2++;
85 else
86 break;
87 }
88 this->tileWidthSb = (sbCols + (1 << TileColsLog2) - 1) >> TileColsLog2;
89 this->TileCols = 0;
90 for (unsigned startSb = 0; startSb < sbCols; startSb += tileWidthSb)
91 {
92 this->MiColStarts.push_back(startSb << sbShift);
93 this->TileCols++;
94 }
95 this->MiColStarts.push_back(MiCols);
96
97 this->minLog2TileRows = std::max(this->minLog2Tiles - this->TileColsLog2, 0u);
98 this->TileRowsLog2 = this->minLog2TileRows;
99 while (this->TileRowsLog2 < this->maxLog2TileRows)
100 {
101 if (reader.readFlag("increment_tile_rows_log2"))
102 this->TileRowsLog2++;
103 else
104 break;
105 }
106 this->tileHeightSb = (this->sbRows + (1 << this->TileRowsLog2) - 1) >> this->TileRowsLog2;
107 this->TileRows = 0;
108 for (unsigned startSb = 0; startSb < sbRows; startSb += this->tileHeightSb)
109 {
110 this->MiRowStarts.push_back(startSb << sbShift);
111 this->TileRows++;
112 }
113 this->MiRowStarts.push_back(MiRows);
114 }

Callers

nothing calls this directly

Calls 4

tile_log2Function · 0.85
readFlagMethod · 0.80
logCalculatedValueMethod · 0.80
readNSMethod · 0.45

Tested by

no test coverage detected