Commit Graph
9 Commits
Author SHA1 Message Date
Adrià c1c91acdbc Merge pull request #12723 from XairRrR/fix-libscevideodec-deep-pictures
fix(libSceVideodec): throw for decoded pictures deeper than 8 bits
2026-10-30 05:51:41 +01:00
XairRrR 2a8693ed5c test(libSceVideodec): cover a 10-bit picture returned by sceVideodecFlush
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
2026-10-29 06:29:35 +01:00
XairRrR d322c22b2a fix(libSceVideodec): throw for decoded pictures deeper than 8 bits
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
2026-10-29 06:06:41 +01:00
Omar Elmahy 7587941644 test(libSceVideodec): cover null and struct size validation in delete and reset decoder 2026-10-28 23:32:13 +00:00
AZLisme 7843323dc2 fix(videodec): read owned metadata for internal callers 2026-10-27 06:16:45 +08:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Rookie b6dc6a5d4d feat(libSceVideodec): implement sceVideodecQueryResourceInfo
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.
2026-10-22 14:32:24 +01:00
Slick Daddy 51c6b38978 fix(libSceVideodec): take the coded picture size the decoder reports
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.
2026-10-21 01:13:00 +03:00
Slick Daddy abf83aa4a8 feat(libSceVideodec): implement the video decoder on top of libSceVideodec2
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.
2026-10-20 00:17:11 +03:00