Commit Graph
10 Commits
Author SHA1 Message Date
Adrià 142f7555aa Merge pull request #6051 from Ondra97/codex/fix-ajm-live-instance-handles
fix(ajm): preserve live decoder handles across ID wrap
2026-10-17 06:10:21 +02:00
xXPBSXxandClaude Sonnet 5.5 4dc23f9c14 docs(debt): list the unimplemented AJM codec 23 of PPSA21480
Broken Sword - Shadow of the Templars: Reforged stops at AJM decoding codec 23, which is not one of the codec ids known in Ajm.cpp (MP3 0, ATRAC9 1, M4AAC 2, Opus 24).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 05:45:41 +02:00
Dean 9bec202332 Merge pull request #5517 from ps54all/feat/libsceajm-opus-family255-multistream
feat(ajm): decode Opus mapping family 255 with several channels
2026-10-15 10:48:06 +13:00
Ondra97 e60dd9d5a7 fix(ajm): preserve live decoder handles across ID wrap 2026-10-14 22:45:37 +02:00
Adrià FranchandClaude 3faeae816b docs(debt): mark the ratio ramp semantics as assumed
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-14 14:46:30 +02:00
pushkarreddyy 4c58702fd0 feat(libSceAjm): support ratio ramp in sceAjmBatchJobSetResampleParametersEx 2026-10-14 14:46:23 +02:00
DavidandClaude Fable 5.1 7cc6baf118 feat(libSceAjm.native): implement the M4AAC decoder
Ghost of Yotei (PPSA26344, v1.008, eboot 0x2e1cfc) creates an M4AAC
instance (codec 2) and calls sceAjmBatchJobControl with flags
0x200000006000 (RESET | INITIALIZE | SIDEBAND_GAPLESS_DECODE), 8 bytes of
gapless decode plus 8 bytes of M4AAC initialize parameters and an 8-byte
result (#884); INITIALIZE for M4AAC threw on main.

- INITIALIZE (control and sceAjmBatchJobInitialize) reads the 8-byte
  {config type (1 ADTS, 2 raw), sampling frequency index} block of
  shadPS4 ajm_aac.h at 443f0224; an invalid type or a raw index above 11
  returns the invalid parameter result. Raw input is configured from the
  instance channels (0 is stereo) as in shadPS4 ajm_aac.cpp.
- RUN decodes ADTS frames (length from the header) and raw access units
  (the whole input, as fdk-aac's raw transport) with FFmpeg's AAC decoder
  into the instance's S16, S32 or float PCM, with the framework's gapless,
  resampling, stream, format and multiple-frames sidebands.
- Without ENABLE_NONDELAY_OUTPUT the first two frames after
  initialization or reset produce no output, as in shadPS4. A decoder
  error returns CODEC_ERROR | FATAL. The codec info is {heaac, reserved};
  the format reports the last frame's bitrate with fdk-aac's formula.
- Throws for what the sources do not settle: ADTS resynchronization,
  profiles other than AAC LC, several raw data blocks per frame, channel
  configurations other than 1, 2 and 6, more channels than the instance,
  HE-AAC without ENABLE_SBR_DECODE, raw input with RUN_MULTIPLE_FRAMES or
  several access units, a frame longer than the reserved room, and
  unknown codec flags.

guest_ajm decodes an embedded 5-frame stereo ADTS fixture (two chirps,
encoded by FFmpeg 6.1.1's aac encoder at 64 kbit/s) frame by frame, in
one multiple-frames run, as float, as raw access units and with gapless
trimming, and checks sample counts, format, codec info, the delay frames,
RESET, partial input, missing room and the correlation of each channel
with its input chirp at the 1024-sample encoder delay; plus the
INITIALIZE validation results and the refusals.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 13:32:37 +02:00
ps54allandClaude Opus 5.5 911e6c83ba feat(ajm): decode Opus mapping family 255 with several channels
A family 255 instance with more than one channel carries no stream count
or mapping in its initialization words, so its decoder now opens on the
first packet: the multistream packet's self-delimited streams are counted
(RFC 6716 appendix B), each stream's TOC stereo flag marks it as coupled,
and the channels map in order. A packet whose streams do not make the
channel count throws.

Metal Gear Solid 4 Master Collection (PPSA18194) initializes a 4-channel
family 255 decoder for its intro movie.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 00:03:21 +02:00
485f638a53 fix(ajm): accept Opus mapping family 255 for a mono stream
Co-authored-by: poonasor <12569806+poonasor@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 16:14:43 +05:30
Adrià FranchandClaude 342a8c4590 docs(debt): move library entries to one file per library
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-12 20:38:29 +02:00