diff --git a/Tests/LibVideo/CMakeLists.txt b/Tests/LibVideo/CMakeLists.txt index 4c14e2d7c9e..bd0ba699460 100644 --- a/Tests/LibVideo/CMakeLists.txt +++ b/Tests/LibVideo/CMakeLists.txt @@ -9,3 +9,4 @@ endforeach() install(FILES vp9_in_webm.webm DESTINATION usr/Tests/LibVideo) install(FILES vp9_4k.webm DESTINATION usr/Tests/LibVideo) install(FILES vp9_clamp_reference_mvs.webm DESTINATION usr/Tests/LibVideo) +install(FILES vp9_oob_blocks.webm DESTINATION usr/Tests/LibVideo) diff --git a/Tests/LibVideo/TestVP9Decode.cpp b/Tests/LibVideo/TestVP9Decode.cpp index e173f115df5..ac24e8b24eb 100644 --- a/Tests/LibVideo/TestVP9Decode.cpp +++ b/Tests/LibVideo/TestVP9Decode.cpp @@ -54,6 +54,11 @@ TEST_CASE(webm_in_vp9) decode_video("./vp9_in_webm.webm"sv, 25); } +TEST_CASE(vp9_oob_blocks) +{ + decode_video("./vp9_oob_blocks.webm"sv, 240); +} + BENCHMARK_CASE(vp9_4k) { decode_video("./vp9_4k.webm"sv, 2); diff --git a/Tests/LibVideo/vp9_oob_blocks.webm b/Tests/LibVideo/vp9_oob_blocks.webm new file mode 100644 index 00000000000..1c11ae17905 Binary files /dev/null and b/Tests/LibVideo/vp9_oob_blocks.webm differ diff --git a/Userland/Libraries/LibVideo/VP9/Context.h b/Userland/Libraries/LibVideo/VP9/Context.h index c543fb3d4f2..9c6b7e7b29b 100644 --- a/Userland/Libraries/LibVideo/VP9/Context.h +++ b/Userland/Libraries/LibVideo/VP9/Context.h @@ -105,16 +105,16 @@ public: // Calculates the output size for each plane in the frame. Gfx::Size decoded_size(bool uv) const { - // NOTE: According to the spec, this would be `y_size_to_uv_size(subsampling, blocks_to_pixels(blocks_size))`. - // We are deviating from that by creating smaller buffers to fit just the data we will store in an output - // frame or reference frame buffer. if (uv) { return { - y_size_to_uv_size(color_config.subsampling_y, size().width()), - y_size_to_uv_size(color_config.subsampling_y, size().height()), + y_size_to_uv_size(color_config.subsampling_y, blocks_to_pixels(columns())), + y_size_to_uv_size(color_config.subsampling_y, blocks_to_pixels(rows())), }; } - return size(); + return { + blocks_to_pixels(columns()), + blocks_to_pixels(rows()), + }; } Vector2D const& block_contexts() const { return m_block_contexts; }