feat(ajm): implement sceAjmDecMp3ParseFrame #578
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/578"
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 DotDebian on 2026-10-04T23:24:53Z.
What
Implements
sceAjmDecMp3ParseFramein libSceAjm.native. It was a throwing stub with no parameters.(const uint8_t* stream, uint32_t stream_size, int parse_ofl, AjmDecMp3ParseFrame* frame), the 40-byte result layout and the rate tables follow shadPS4's reimplementation of the PS4 library (src/core/libraries/ajm/ajm_mp3.cpp,ParseMp3Header). The header fields themselves are the MPEG audio frame header (ISO/IEC 11172-3, 13818-3).SCE_AJM_ERROR_INVALID_PARAMETERfor a null pointer, fewer than 4 bytes, a broken sync word, the reserved version, the reserved sample rate index, and bitrate indexes 0 and 15.parse_ofl != 0throws. shadPS4 reads only the Fraunhofer block and leaves Xing/Info and VBRI as TODO, so the full lookup could not be established.Both limits are recorded in TechnicalDebt (unknown function info, functional). Not confirmed on a PS5 title.
Tested
Windows 11, MinGW-w64 GCC 15.2.0,
ctest: 213/213 pass.guest_ajmis extended withTestMp3ParseFrame: the six frames of the existing MP3 fixture (96 bytes, mono, 1152 samples, 32 kbps, 48 kHz, matching what the decoder test consumes), MPEG-1, MPEG-2 and MPEG-2.5 headers with and without padding and CRC, and each invalid-parameter case. Onmainthe test aborts in the stub.No title was run.
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
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T23:44:08Z.
Thanks. The name recomputes to eDFeTyi+G3Y, and the signature, the 40-byte result, both rate tables, the error order and the frame size formulas are the same as shadPS4's
ParseMp3Header. The Layer III values match the MPEG spec (144 or 72 times bitrate over sample rate plus padding, 1152 or 576 samples, channel mode 3 as mono), and I recomputed every row of the new test, including the padded 418 and 53 byte frames.On the TechnicalDebt line: shadPS4 says those tables were reversed from the AJM library itself, so the MPEG-2.5 limit at 64 kbps and the unchecked layer come from Sony's code rather than from a guess. If you like, the line could say that; it's fine as it is.
Throwing for
parse_oflis the right call while only the Fraunhofer path is known.guest_ajmpasses here, and on main the test doesn't compile without the new struct. PPSA21564 doesn't import this function. CI is green; ready to merge from my side.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T23:46:03Z.
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.
main)docs/dev/TechnicalDebt.mdL74