Files
AnyPS5/docs/dev/debt/libScePngDec.md
T

2.4 KiB

libScePngDec technical debt

Functional

  • libScePngDec: the supplied module confirms the work-memory size formula, 16-byte handle alignment, the first 24 bytes of its context, and Create/QueryMemorySize validation order. The host now exposes these values but still allocates decoder working storage on the host instead of using the guest work region.
  • scePngDecDecode: the original's accepted pixel format 132 remains unsupported and throws. The input bit-depth limit and 16-to-8-bit conversion follow Prosper's PS5 3.20 module analysis, and the large-dimension image-info requirement and its validation order follow Prosper's PS5 3.20 module analysis, not console measurements here. The supplied 13.42 module accepts row filter type 7 and leaves the rows decoded before an error when the IDAT data ends early; here both decode nothing and return 0x80690012. Decoder scratch-memory behavior is not matched to the supplied module.
  • scePngDecDecodeWithInputControl (libScePngDec) - parameter offsets and validation order are from firmware 11.00's libScePngDec.sprx disassembly, not measured on a console: the input callback is at 0x00, its argument at 0x08, the output buffer at 0x10, its size at 0x18, operation at 0x1c (0x10 parses the header, 0x20 decodes), pixel format at 0x1e, alpha at 0x20, a reserved halfword at 0x22 that must be zero, and the pitch at 0x24. Operation 0x10 keeps the stream on the handle and stops once the IHDR, tRNS or IDAT chunk header is known; operation 0x20 continues that stream and decodes the buffered bytes through the direct decode path. The host pulls 16-byte blocks for the header and 1 KiB blocks for the body, so callback call counts and the byte at which each callback runs differ from the console's streaming; decoding without a prior parse, pixel format 132, and a concurrent call on a busy handle throws. Malformed data returns 0x80690010 and a negative callback result is propagated, where the console has further 0x80690011 and 0x80690020 parse failures that are not reproduced.