mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:37:44 +00:00
LibVideo: Allow the VP9 decoder to decode ultra high resolution video
Previously, some integer overflows and truncations were causing parsing errors for 4K videos, with those fixed it can fully decode 8K video. This adds a test to ensure that 4K video will continue to be decoded. Note: There seems to be unexpectedly high memory usage while decoding them, causing 8K video to require more than a gigabyte of RAM. (!!!)
This commit is contained in:
parent
f894e8be62
commit
41cb705b47
6 changed files with 21 additions and 9 deletions
|
@ -979,8 +979,8 @@ DecoderErrorOr<void> Parser::decode_block(u32 row, u32 col, BlockSubsize subsize
|
|||
// write out of bounds. This check seems consistent with libvpx.
|
||||
// See here:
|
||||
// https://github.com/webmproject/libvpx/blob/705bf9de8c96cfe5301451f1d7e5c90a41c64e5f/vp9/decoder/vp9_decodeframe.c#L917
|
||||
auto maximum_block_y = min(num_8x8_blocks_high_lookup[subsize], m_mi_rows - row);
|
||||
auto maximum_block_x = min(num_8x8_blocks_wide_lookup[subsize], m_mi_cols - col);
|
||||
auto maximum_block_y = min<u32>(num_8x8_blocks_high_lookup[subsize], m_mi_rows - row);
|
||||
auto maximum_block_x = min<u32>(num_8x8_blocks_wide_lookup[subsize], m_mi_cols - col);
|
||||
|
||||
for (size_t y = 0; y < maximum_block_y; y++) {
|
||||
for (size_t x = 0; x < maximum_block_x; x++) {
|
||||
|
@ -1337,7 +1337,7 @@ DecoderErrorOr<i32> Parser::read_mv_component(u8 component)
|
|||
return (mv_sign ? -1 : 1) * static_cast<i32>(mag);
|
||||
}
|
||||
|
||||
Gfx::Point<size_t> Parser::get_decoded_point_for_plane(u8 column, u8 row, u8 plane)
|
||||
Gfx::Point<size_t> Parser::get_decoded_point_for_plane(u32 column, u32 row, u8 plane)
|
||||
{
|
||||
if (plane == 0)
|
||||
return { column * 8, row * 8 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue