Repository navigation
Conversation
This was referenced Oct 7, 2026
This was referenced Oct 8, 2026
This was referenced Oct 8, 2026
A PNG whose header bit depth is 16 decoded through a handle created with attribute 1 now writes 16-bit rows instead of throwing: each row is 8 bytes per pixel, the samples are little-endian R16G16B16A16 (B16G16R16A16 for the B8G8R8A8 pixel format), and an image without alpha is filled with alpha_value in both bytes of the 16-bit value. PNGs of 8 bits or less keep 8-bit output with either attribute. Decoder::Png gains Decode16 on stb's 16-bit loader, and the guest test covers grayscale, RGB, RGBA, padded pitch, buffer checks and 8-bit files through the 16-bit handle. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
MGXAe
force-pushed
the
arena/40a13e68-anyps5
branch
from
October 8, 2026 03:25
bdd4fe1 to
b59853b
Compare
Collaborator
|
Which title decodes a 16-bit PNG through a handle created with |
Contributor
Author
|
There is no known title reaching this path on main. The throw was leftover debt from PR #175 rather than a blocker identified from a game log, and the 16-bit output layout in my PR was inferred rather than confirmed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
scePngDecDecodehas accepted theattribute = 1(16-bit) create attribute, but threw16-bit output is not implementedfor any 16-bit PNG. This implements that path.core/Decoder/Png:Decode16()returns a full-precision RGBA16 image throughstbi_load_16_from_memory(std::nullopton the same failures asDecode).core/libs/prx/libScePngDec: when the header bit depth is 16 and the handle attribute is 1, the decode writes 16-bit output - 8 bytes per pixel, each channel a little-endianuint16_t, withpixel_format 1giving B,G,R,A. A source without alpha (tRNS counts as alpha) fills all four channels, withalpha_valuerepeated into both bytes; the return value remains(width << 16) | height, andimage_pitch/image_mem_sizeare validated against the 8-byte stride. A PNG of 8 bits or less keeps decoding to 8-bit output with either attribute, so the output stride still followsPngDecImageInfo.bit_depth.throw std::runtime_error("scePngDecDecode: 16-bit output is not implemented")and its test assertion are removed; no other path changes.No reference implements 16-bit output (shadPS4 rejects the attribute, OpenOrbis/ProsperoLight/Kyty define only the create-time attribute), so the little-endian RGBA16 guest layout follows the existing 8-bit output path and the SharpProspero attribute description, and is recorded in
docs/dev/TechnicalDebt.md.Tested
decoder_png_testsandguest_png_decbuilt from the exact changed sources withg++ -std=c++20(Linux x86-64) and run: 16-bit gray, RGB and RGBA fixtures, alpha fill, both pixel formats, pitch padding,INVALID_PARAM/INVALID_SIZE/INVALID_ADDR/DECODE_ERRORpaths, and 8-bit RGB and palette+tRNS images through the same 16-bit-capable handle.ctest(the sandbox has no submodules initialized and the JPEG dependencies are unavailable), and console hardware; CI runs the complete suite.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)