The High 10 intra picture of testDeepPicture comes back from
sceVideodecDecode, so the bit-depth check at the sceVideodecFlush call
site was not exercised. testDeepReorderedPicture decodes a 70-byte 64x48
High 10 stream whose sequence parameters declare a reorder delay of one
picture: sceVideodecDecode holds the IDR back, and the flush that
returns it must throw.
AI-assisted: yes
sceVideodecDecode and sceVideodecFlush copy the picture libSceVideodec2
decodes as 8-bit NV12: one byte per sample and a pitch aligned from the
width in pixels. For a High 10 H.264 stream libSceVideodec2 writes two
bytes per sample and reports it in the picture header's bit depth, which
the copy ignored. A small 10-bit picture, whose rows fit the staging
buffer, was therefore returned as a valid 8-bit picture holding the
first half of each row's bytes, with success.
The picture header's bit depth is now checked, and a picture deeper than
8 bits throws, as the console's output for it is not known. The debt
file records it.
AI-assisted: yes
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.