mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +00:00
LibVideo/VP9: Make get_tile_offset static and remove magic numbers
This can use the new utility functions for converting units now.
This commit is contained in:
parent
f5ea6c89df
commit
b1c7bbc4ba
2 changed files with 7 additions and 8 deletions
|
@ -845,6 +845,13 @@ DecoderErrorOr<u8> Parser::update_mv_prob(u8 prob)
|
|||
return prob;
|
||||
}
|
||||
|
||||
static u32 get_tile_offset(u32 tile_start, u32 frame_size_in_blocks, u32 tile_size_log2)
|
||||
{
|
||||
u32 superblocks = blocks_ceiled_to_superblocks(frame_size_in_blocks);
|
||||
u32 offset = superblocks_to_blocks((tile_start * superblocks) >> tile_size_log2);
|
||||
return min(offset, frame_size_in_blocks);
|
||||
}
|
||||
|
||||
DecoderErrorOr<void> Parser::decode_tiles(FrameContext& frame_context)
|
||||
{
|
||||
auto log2_dimensions = frame_context.log2_of_tile_counts;
|
||||
|
@ -888,13 +895,6 @@ DecoderErrorOr<void> Parser::decode_tiles(FrameContext& frame_context)
|
|||
return {};
|
||||
}
|
||||
|
||||
u32 Parser::get_tile_offset(u32 tile_num, u32 mis, u32 tile_size_log2)
|
||||
{
|
||||
u32 super_blocks = (mis + 7) >> 3u;
|
||||
u32 offset = ((tile_num * super_blocks) >> tile_size_log2) << 3u;
|
||||
return min(offset, mis);
|
||||
}
|
||||
|
||||
DecoderErrorOr<void> Parser::decode_tile(TileContext& tile_context)
|
||||
{
|
||||
for (auto row = tile_context.rows_start; row < tile_context.rows_end; row += 8) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue