From 9f573264ea8f1175156c71d0524c29058946f232 Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Tue, 22 Nov 2022 02:36:23 -0600 Subject: [PATCH] LibVideo/VP9: Add a FIXME to keep render_and_frame_size_different The flag should be used to determine whether the pixel aspect ratio should be updated when frame/render sizes change in the bitstream. --- Userland/Libraries/LibVideo/VP9/Parser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Userland/Libraries/LibVideo/VP9/Parser.cpp b/Userland/Libraries/LibVideo/VP9/Parser.cpp index a8a574ed7c..fdd1dee990 100644 --- a/Userland/Libraries/LibVideo/VP9/Parser.cpp +++ b/Userland/Libraries/LibVideo/VP9/Parser.cpp @@ -309,6 +309,13 @@ DecoderErrorOr> Parser::parse_frame_size() DecoderErrorOr> Parser::parse_render_size(Gfx::Size frame_size) { + // FIXME: This function should save this bit as a value in the FrameContext. The bit can be + // used in files where the pixel aspect ratio changes between samples in the video. + // If the bit is set, the pixel aspect ratio should be recalculated, whereas if only + // the frame size has changed and the render size is unadjusted, then the pixel aspect + // ratio should be retained and the new render size determined based on that. + // See the Firefox source code here: + // https://searchfox.org/mozilla-central/source/dom/media/platforms/wrappers/MediaChangeMonitor.cpp#268-276 if (!TRY_READ(m_bit_stream->read_bit())) return frame_size; return Gfx::Size { TRY_READ(m_bit_stream->read_f16()) + 1, TRY_READ(m_bit_stream->read_f16()) + 1 };