mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-20 09:49:03 +02:00
The PSP's AVC decoder follows the H.264 output process (Annex C), measured in the new pspautotests video/mp4/avchold on streams that differ only in their headers, and video/mpeg/decodeend. With HRD parameters and picture timing SEI, a picture comes out dpb_output_delay after its access unit; Sony's movies have a one frame delay. Without, it is bumped out of a buffer three frames deep, whatever the stream declares. sceMpegAvcDecodeStop hands back what's left, and streams with more than three reference frames are refused with 0x80628002. We handed each picture back as soon as it was decoded. MGS Peace Walker's movie player only checks for the end of a movie while its clock is short of the movie's length, so its last picture landed right on that limit and the game hung on a black screen after the cutscene. ffmpeg still decodes the pixels, in display order; each access unit is tagged with its index so frames can be matched back, and ffmpeg's H.264 parser supplies the picture timing. A call can now hand back several pictures, as consecutive 0x2C byte descriptors the way mpeg.prx's sceMpegAvcDecodeStop reads them, each in a frame buffer slot of its own (reallocated when a savestate brings a block too small for that). Not followed: with B-frames and no picture timing, the PSP can complete several pictures in one call; here they come out one a call. All of the game movies checked have picture timing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>