Repository navigation
feat(libSceVideodec2): decode HEVC and VP9 - #1931
Conversation
EVO-PLAYER (PPSA99039) creates resident AVC, HEVC and VP9 decoders at start-up, and stopped at "Videodec2: unsupported codec" on the HEVC one. Codec types 974921 (HEVC) and 2382845 (VP9) now open FFmpeg's HEVC and VP9 decoders. HEVC input goes through the same Annex B conversion as H.264 and VP9 frames are passed through; output stays 8-bit NV12, and a frame deeper than 8 bits throws. Picture info throws for HEVC and VP9, whose layouts differ from the AVC one. Assisted by Claude Code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DwFnKjMxmwGDWiuYYf1v4D
klosixgaming-arch
left a comment
There was a problem hiding this comment.
Reviewed against the repo's bar. This is a clean, well-scoped extension and I can approve it.
What holds up:
CodecIdcentralises the codec dispatch and throws on any unknown tag, so no silent fallback. Thecreatepath callsCodecId(config->codecType)before allocating, which rejects bad tags early rather than afterOpenCodec.- 10-bit guard is the right call:
av_pix_fmt_desc_get(...)->comp[0].depth > 8throwing instead of silently converting is exactly what the repo wants for unknown console output layouts, and it's debt-documented. GetPictureInfothrows for HEVC/VP9 pictures rather than writing the AVC layout — correct, and the debt entry names the real separate layouts.- Test coverage is real, not symbol-checks: 6-frame HEVC clip with B-frame display/decode ordering, an independent FFmpeg 9.0.2 reference hash comparison of every NV12 frame (12 distinct hashes), length-prefixed vs Annex-B for HEVC, Main10/Profile-2 create-plus-throw, and a negative control (
mainfails atunsupported codec). Good.
Notes (non-blocking):
- The VP9 branch writes into
decoder.annexBthen pointsunitat it, whereas H.264/HEVC go throughToAnnexB. ConfirmannexBisn't also holding an H.264 stream for a decoder that is both (it isn't — one codec per decoder) so the reuse is safe; just flagging the shared member. QueryDecoderMemoryInforeports the 8-bit size even for Main10/VP9-P2 decoders that then throw on decode. That's debt-documented and acceptable, but a title probing memory for a 10-bit buffer will get an undersized value — worth a sentence in the debt entry that the query also lies in that case (it currently only says the frame throws).
Written with AI assistance.
|
Thanks @klosixgaming-arch. On note 2: the debt entry already covers the query. It ends with "a decoder for HEVC Main10 or VP9 Profile 2 is created, but a frame deeper than 8 bits throws, since the console's 10-bit output layout is unknown, and |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
What
sceVideodec2CreateDecoderaccepted only H.264 (codecType == 1). EVO-PLAYER PPSA99039 v0.11.0 creates resident decoders at start-up for AVC, HEVC and VP9, and with its default build for HEVC Main10 and VP9 Profile 2 too. With #1916 and the PRs for its earlier stops, it stopped at the HEVC one:Videodec2CodecType(Interop/Video/Videodec2.cs:Avc = 1, Hevc = 974921, Vp9 = 2382845). EVO-PLAYER'smedia/include/sce/sce_videodec2.hgives the same values and recordssceVideodec2CreateDecoderaccepting them on hardware. Any other value still throwsunsupported codec.QueryDecoderMemoryInforeports the 8-bit frame size for those decoders.sceVideodec2GetPictureInfoandsceVideodec2GetAvcPictureInfothrow for HEVC and VP9 pictures instead of writing the AVC layout; SharpProspero gives them separateSceVideodec2HevcPictureInfoandSceVideodec2Vp9PictureInfolayouts.GetHevcPictureInfoandGetVp9PictureInfoare not exported. EVO calls none of these.Tested
guest_videodec2, extended:-pix_fmt nv12); all 12 hashes are distinct. The output reports the codec type, the size and the 256-byte pitch.GetPictureInfothrows for these pictures.Export.cppfrommain, the test fails atVideodec2: unsupported codec.guest_videodec2passes.guest_videodec2passes.mainf1451396plus feat(libkernel): implement sigaction #1916, feat(libSceNet): implement sceNetResolverStartNtoaMultipleRecordsEx #1838, feat(libkernel): implement getdents and getdirentries #1634, feat(videoout): implement sceVideoOutGetResolutionStatus #1714, feat(libkernel): implement the sigset functions #1641, feat(libkernel): implement msync #1857 and fix(relinker): keep Linux imports declared from host modules off guest exports #1529, Linux, RX 7600:RESIDENT AVC/HEVC/VP9/HEVC10 decoder up).sceAgcCreatePrimState: invalid context register offsets, which is unrelated to this change.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)🤖 Generated with Claude Code
https://claude.ai/code/session_01DwFnKjMxmwGDWiuYYf1v4D