1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:57:46 +00:00

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
parent 30189186e9
commit 074f771b59
8 changed files with 244 additions and 70 deletions

View file

@ -10,7 +10,7 @@
extern "C" int LLVMFuzzerTestOneInput(u8 const* data, size_t size)
{
Video::VP9::Decoder vp9_decoder;
if (auto decode_error = vp9_decoder.decode({ data, size }); decode_error.is_error())
if (auto decode_error = vp9_decoder.receive_sample({ data, size }); decode_error.is_error())
return -1;
return 0;
}