mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 00:22:57 -05:00
FFmpeg resamples narrowband SILK (TOC configurations 0-3) from 8 kHz and holds back 24 samples of the first narrowband packet after the decoder starts or after a packet of another bandwidth: a 20 ms packet decodes to 936 samples and the next wider packet to 984. sceOpusDecDecode required exactly the packet's duration and threw, so ProsperoRadio aborted on a narrowband Opus station. The decoder now keeps FFmpeg's output in a queue and returns exactly the packet's duration, as libopus does: the first narrowband packet starts with 24 samples of silence and the held-back samples follow in the next calls. The new test decodes three libopus 6 kb/s narrowband packets and a wideband packet after them; it aborts on main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1.4 KiB
1.4 KiB
libSceOpusDec technical debt
Functional
- libSceOpusDec uses FFmpeg for 48000 Hz mono/stereo signed-16 decoding. The six signatures, 640-byte opaque state allocation and byte-count return follow public PS5 decoder research and ProsperoRadio. Console PCM equivalence and error codes are unverified. Other sample rates, packet loss concealment, invalid inputs and termination with live decoders throw. Context identifiers and host decoder state are private registries; the firmware's opaque state layout and error recovery are unknown.
- sceOpusDecDecode (libSceOpusDec) returns exactly the packet's duration, as libopus does. FFmpeg resamples narrowband SILK from 8 kHz and holds back 24 samples of the first narrowband packet after the decoder starts or after a packet of another bandwidth, releasing them with the next packet that is not narrowband. The decoder keeps FFmpeg's output in order and pads the start with silence, so such a packet begins with 24 samples (0.5 ms) of silence and the output after it is 24 samples late; libopus has no such gap