mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +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
Notes:
sideshowbarker
2024-07-17 03:52:50 +09:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/SerenityOS/serenity/commit/b1c7bbc4ba Pull-request: https://github.com/SerenityOS/serenity/pull/16238
2 changed files with 7 additions and 8 deletions
|
@ -845,6 +845,13 @@ DecoderErrorOr<u8> Parser::update_mv_prob(u8 prob)
|
||||||
return 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)
|
DecoderErrorOr<void> Parser::decode_tiles(FrameContext& frame_context)
|
||||||
{
|
{
|
||||||
auto log2_dimensions = frame_context.log2_of_tile_counts;
|
auto log2_dimensions = frame_context.log2_of_tile_counts;
|
||||||
|
@ -888,13 +895,6 @@ DecoderErrorOr<void> Parser::decode_tiles(FrameContext& frame_context)
|
||||||
return {};
|
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)
|
DecoderErrorOr<void> Parser::decode_tile(TileContext& tile_context)
|
||||||
{
|
{
|
||||||
for (auto row = tile_context.rows_start; row < tile_context.rows_end; row += 8) {
|
for (auto row = tile_context.rows_start; row < tile_context.rows_end; row += 8) {
|
||||||
|
|
|
@ -92,7 +92,6 @@ private:
|
||||||
|
|
||||||
/* (6.4) Decode Tiles Syntax */
|
/* (6.4) Decode Tiles Syntax */
|
||||||
DecoderErrorOr<void> decode_tiles(FrameContext&);
|
DecoderErrorOr<void> decode_tiles(FrameContext&);
|
||||||
u32 get_tile_offset(u32 tile_num, u32 mis, u32 tile_size_log2);
|
|
||||||
DecoderErrorOr<void> decode_tile(TileContext&);
|
DecoderErrorOr<void> decode_tile(TileContext&);
|
||||||
void clear_left_context(TileContext&);
|
void clear_left_context(TileContext&);
|
||||||
DecoderErrorOr<void> decode_partition(TileContext&, u32 row, u32 column, BlockSubsize subsize);
|
DecoderErrorOr<void> decode_partition(TileContext&, u32 row, u32 column, BlockSubsize subsize);
|
||||||
|
|
Loading…
Reference in a new issue