feat(libSceVideodec2): output 10-bit pictures as low-bit 16-bit words #6709
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6709"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-16T06:07:32Z.
What
Mortalfin (PPSA99141) stops as soon as it plays an HEVC Main10 video (#6640):
A 10-bit picture is now written in the layout below instead of throwing:
framePitchInBytes× the picture height;framePitchin samples,framePitchInBytesin bytes: twice the width, aligned to 256 as for 8-bit;QueryDecoderMemoryInfosizes a frame of an HEVC or VP9 profile 2 configuration with two bytes per sample.Evidence. On #6640 @MarcZX100 asked for hardware or independent consumer evidence for the pitch fields, the alignment and the memory contract, not only the sample packing. EVO-PLAYER-PS5 decodes and presents 1080p HEVC Main10 on hardware through
sceVideodec2("a 1080p 10-bit file decodes and presents correctly today (198 frames verified)",docs/evo-pro/on-demand-decoder-handoff.md). Its decoder (projects/evoplayer/media/src/evo_vdec_native.c,ro_harvest):pitch_bytes >= pitch * 2, sopitchis in samples andpitch_bytesin bytes;pitch_bytes× the height and borrows the buffer as it is, so Y and UV are contiguous at one byte pitch;64.06≈ 65535 / 1023).Its hardware logs give the memory contract (same file):
frame=logged (rounded to 16 KiB)3840 × 1088 × 1.5= 6,266,880 bytes)The 1080p size also settles the pitch. A 1920-sample row is 3840 bytes, not 2 × 2048: a 4096-byte pitch would need 6,684,672 bytes, more than the console allocates. That is EVO's own expectation too ("expected 1920/3840" in its first-frame log). At 4K the console allocates 16 KiB more than the formula gives. I don't know where that comes from, so the debt entry records it. A buffer of this PR's size still holds the frame.
Unverified (in the debt entry):
frameFormatstays 0. EVO, SharpProspero and the other public consumers I found don't read it.Mortalfin's four decoders match EVO's resident layout (AVC, a 4K HEVC decoder, and 1080p HEVC decoders), so its Main10 decoder is most likely an HEVC profile 2 configuration that this PR sizes.
Overlap. #6414 changes
ChromaOffsetto align the height. This PR adds a sample-size parameter to the same function, so whichever merges second takes both:PitchBytes(width, sampleBytes) * AlignUp(height, HeightAlignment).Tested
guest_videodec2(core/libs/tests/GuestVideodec2.cpp), Linux, GCC, Release. The existing Main10 fixture (64x40, samples 0 to 1023) used to be expected to throw. It now checks:framePitch128,framePitchInBytes256,frameFormat0;ffmpeg -pix_fmt yuv420p10leoutput of the same stream, rearranged into this layout.main5d9dcc42dwith only the test applied:1920x1088 frame size differs for profile 2. Green with the change.python3 tools/check_conventions.py --base upstream/main: passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T06:49:11Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/tests/GuestVideodec2.cppImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T09:48:57Z.
Checked against EVO-PLAYER-PS5's hardware evidence (pitch units, UV placement, 1080p Main10 allocation), the 10-bit copy and the throw paths for other formats/depths, and the debt entry. The only conflict was the adjacent line in
docs/dev/debt/libSceVideodec2.md(the flush entry from #7118); I rebased and resolved it, kept your commit, and re-ran the Videodec2 and library tests (41/41 pass). Merged.