diff options
author | Zaggy1024 <zaggy1024@gmail.com> | 2022-11-28 05:10:39 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-11-30 08:28:30 +0100 |
commit | 720fc5a853dc768b1d2956f95eadf96761082830 (patch) | |
tree | f9ec0dd770a05e4ff38dfc8963d98ca773f2ee22 /Userland/Libraries/LibVideo/VP9/Utilities.h | |
parent | 1fe22f21410509c680700bfe66a83d3021a94804 (diff) | |
download | serenity-720fc5a853dc768b1d2956f95eadf96761082830.zip |
LibVideo/VP9: Use unit conversion functions in BlockContext
This should make things in there seem a little less magical :^)
Diffstat (limited to 'Userland/Libraries/LibVideo/VP9/Utilities.h')
-rw-r--r-- | Userland/Libraries/LibVideo/VP9/Utilities.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibVideo/VP9/Utilities.h b/Userland/Libraries/LibVideo/VP9/Utilities.h index 1fd3f891a6..516256285b 100644 --- a/Userland/Libraries/LibVideo/VP9/Utilities.h +++ b/Userland/Libraries/LibVideo/VP9/Utilities.h @@ -61,6 +61,18 @@ inline Gfx::Size<u8> block_size_to_sub_blocks(BlockSubsize 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) { return blocks << 1; |