Validate the configuration and resource information as
sceVideodecCreateDecoder does, map the configuration the same way and
report the memory and frame buffer requirements that
sceVideodec2QueryDecoderMemoryInfo gives for it.
Videodec2 opens FFmpeg with apply_cropping = 0, so the frame it reports is
the coded picture and its crop fields describe the cropping rectangle. The
coded size was derived from the frame size and the crop, which counted the
crop a second time when it added up to a multiple of 16: a picture cropped
four units at the top and four at the bottom was reported 16 rows taller
than the coded picture, and every picture was then refused for a frame
buffer that was sized for the coded picture. The frame size is the coded
size, so the crop only fills the crop offsets.
The fixture's sequence parameter set is also decoded with a crop of four
units at the top and four at the bottom now, which covers the case in the
guest test.
libSceVideodec's five exports were stubs that threw. Decoder creation,
decoding, flushing, resetting and deleting are implemented with the
structure layouts of shadPS4's PS4 library, and the decode runs through
libSceVideodec2, which decodes H.264 with FFmpeg. The picture is copied
into the caller's frame buffer with the pitch aligned to 64 and the coded
height, the chroma after the luma rows, and the picture information holds
the timestamps and the crop offsets.
A guest test decodes the H.264 fixture through the library and checks the
pictures against the reference hashes.