1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:57:35 +00:00

LibVideo/VP9: Use unit conversion functions in BlockContext

This should make things in there seem a little less magical :^)
This commit is contained in:
Zaggy1024 2022-11-28 05:10:39 -06:00 committed by Andreas Kling
parent 1fe22f2141
commit 720fc5a853
2 changed files with 16 additions and 4 deletions

View file

@ -60,6 +60,18 @@ inline Gfx::Size<u8> block_size_to_sub_blocks(BlockSubsize size)
return Gfx::Size<u8>(num_4x4_blocks_wide_lookup[size], num_4x4_blocks_high_lookup[size]);
}
template<Integral T>
inline T blocks_to_superblocks(T blocks)
{
return blocks >> 3;
}
template<Integral T>
inline T superblocks_to_blocks(T superblocks)
{
return superblocks << 3;
}
template<Integral T>
inline T blocks_to_sub_blocks(T blocks)
{