LibVideo: Add VideoFrame class for decoded video frames

The class is virtual and has one subclass, SubsampledYUVFrame, which
is used by the VP9 decoder to return a single frame. The
output_to_bitmap(Bitmap&) function can be used to set pixels on an
existing bitmap of the correct size to the RGB values that
should be displayed. The to_bitmap() function will allocate a new bitmap
and fill it using output_to_bitmap.

This new class also implements bilinear scaling of the subsampled U and
V planes so that subsampled videos' colors will appear smoother.
This commit is contained in:
Zaggy1024 2022-10-08 18:36:57 -05:00 committed by Andreas Kling
commit 074f771b59
Notes: sideshowbarker 2024-07-17 06:54:15 +09:00
8 changed files with 244 additions and 70 deletions

View file

@ -29,7 +29,7 @@ static void decode_video(StringView path, size_t expected_frame_count)
continue;
for (frame_index = 0; frame_index < block.frames().size(); frame_index++) {
MUST(vp9_decoder.decode(block.frames()[frame_index]));
MUST(vp9_decoder.receive_sample(block.frames()[frame_index]));
frame_count++;
}
}