mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-05 13:20:11 +00:00
ResetDecoder, SetDecodeInput, SyncDecode, GetDecodeOutput, FlushDecodeOutput, SyncDecodeWptr, TrySyncDecode and TrySyncDecodeWptr follow shadPS4's vdeccore.cpp. CreateDecoder starts a decode thread of the decoder's own that takes packet, flush and reset commands in order and decodes with the FFmpeg context it opens, and DeleteDecoder stops and joins it and frees what is still queued. GetDecodeOutput converts a picture to NV12 and copies it, as shadPS4's CopyNV12Data does, to the caller's frame buffer, else the next mapped slot, else a fallback buffer the decoder owns, writes the hardware picture info at the end of the frame buffer and fills the output info as shadPS4 does. The six exports that are stubs in shadPS4 stay unknown. The tests decode the H.264 fixture into slots, a caller buffer and the fallback, compare the visible picture with libSceVideodec2's decode of it, and cover every argument error, the empty queue, an invalid pts, flush, reset, try-sync, the write-pointer forwards and a delete with queued input.
2.6 KiB
2.6 KiB
libSceVdecCore technical debt
Unknown function info
- sceVdecCoreAnalyzeStream, sceVdecCoreFinalizeComputeResource, sceVdecCoreInitializeComputeResource, sceVdecCoreSetDecodeOutputSw, sceVdecCoreSyncDecodeOutputSw and sceVdecCoreTrySyncDecodeOutputSw (libSceVdecCore) - names and NIDs are present in the PS5 3.20 export inventory, but no credible prototypes were found. The declarations have no parameters solely to resolve known imports; this is not an ABI claim and callers must not call them until signatures are verified
Functional
- sceVdecCoreQueryInstanceSize, sceVdecCoreQueryFrameBufferInfo, sceVdecCoreQueryComputeResourceInfo, sceVdecCoreCreateDecoder, sceVdecCoreDeleteDecoder and sceVdecCoreMapMemoryBlock (libSceVdecCore) - console behaviour is unmeasured. The signatures, error codes, 1920x1080 and 16-frame defaults and slot cutting follow shadPS4's
vdeccore.cpp, and the sizes are shadPS4's constants, not console values: instance 0x40000, compute 0x10000, and a frame buffer of NV12 plus 0x1000 rounded to 64 KiB. CreateDecoder opens an FFmpeg H.264 or HEVC context and starts the decoder's decode thread, which DeleteDecoder stops and joins; the memory info and compute queue are ignored, and a handle CreateDecoder did not return, or a codec that is unavailable or fails to open, throws - sceVdecCoreResetDecoder, sceVdecCoreSetDecodeInput, sceVdecCoreSyncDecode, sceVdecCoreGetDecodeOutput, sceVdecCoreFlushDecodeOutput, sceVdecCoreSyncDecodeWptr, sceVdecCoreTrySyncDecode and sceVdecCoreTrySyncDecodeWptr (libSceVdecCore) - console behaviour is unmeasured; they follow shadPS4's
vdeccore.cpp. Decoding is FFmpeg software decoding on a host thread. GetDecodeOutput's pitch is the width rounded to 64 while CreateDecoder's frame buffer size uses the horizontal alignment (256 by default), as in shadPS4. Without a caller frame buffer or mapped slot a picture goes to host memory the decoder owns, and the empty-queue fields are shadPS4's. Unlike shadPS4, a picture larger than its frame buffer throws and the NV12 copy goes row by row