Browse Source

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.
Zaggy1024 2 years ago
parent
commit
9f573264ea
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Userland/Libraries/LibVideo/VP9/Parser.cpp

+ 7 - 0
Userland/Libraries/LibVideo/VP9/Parser.cpp

@@ -309,6 +309,13 @@ DecoderErrorOr<Gfx::Size<u32>> Parser::parse_frame_size()
 
 DecoderErrorOr<Gfx::Size<u32>> Parser::parse_render_size(Gfx::Size<u32> 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<u32> { TRY_READ(m_bit_stream->read_f16()) + 1, TRY_READ(m_bit_stream->read_f16()) + 1 };