Skip to content

feat(ajm): decode Opus mapping family 255 with several channels - #5517

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
ps54all:feat/libsceajm-opus-family255-multistream
Oct 14, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
ps54all:feat/libsceajm-opus-family255-multistream

Conversation

@ps54all

@ps54all ps54all commented Oct 13, 2026

Copy link
Copy Markdown

Depends on #5075: this branch is built on its head 485f638a5; only the last commit belongs to this PR.

What

#5075 accepts Opus mapping family 255 for one channel. Metal Gear Solid 4 initializes its intro movie's decoder with 4, 48000, 255 (12 bytes, nothing after the family), so the stream count and channel mapping that family 255 needs (RFC 7845 §5.1.1) are not in the initialization words.

  • A family 255 instance with more than one channel now opens its decoder on the first packet.
  • That multistream packet's self-delimited streams are counted (RFC 6716 appendix B, codes 0-3 with padding). Each stream's TOC stereo flag marks it as coupled (coupled streams come first in a multistream packet), and the channels map in order. FFmpeg then gets a family 255 OpusHead with that layout.
  • A packet whose streams do not add up to the channel count throws. Other families above 1 still throw.
  • The debt entry records that the layout is inferred, not read from the console.

Tested

Windows 11, RTX 3080, WinLibs GCC 15.2.0 r7, Release.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: fix(ajm): accept Opus mapping family 255 for a mono stream #5075
  • Unblocks: PPSA18194
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code); the runs are on my machine.

🤖 Generated with Claude Code

SandstromPL and others added 2 commits October 13, 2026 16:14
Co-authored-by: poonasor <12569806+poonasor@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
@oneandonlydean oneandonlydean self-assigned this Oct 14, 2026
@oneandonlydean
oneandonlydean merged commit 9bec202 into boykopovar:main Oct 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants