feat(libSceOpusCeltDec): implement CELT decoder on FFmpeg Opus backend #4485

Closed
SandBoss wants to merge 3 commits from upstream-pr/4485 into main
SandBoss commented 2026-10-12 13:18:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandBoss on 2026-10-12T13:18:27Z.


What

Implements all 6 libSceOpusCeltDec exports on the same backend as
libSceOpusDec: context/state registry, 640-byte state for mono/stereo,
48000 Hz only, packet framing check, FFmpeg AV_CODEC_ID_OPUS decode
with float-to-s16 conversion. Links PRIVATE ffmpeg like libSceOpusDec.
Reworks guest_opus_celt_dec from a NotImplemented check into the full
behavioural test. Updates the TechnicalDebt bullet to the new contract
(CELT-only restriction and console retryable errors unverified).
Signatures follow ProsperoRadio's opus_decoder.cpp, which uses this
library as the fallback when libSceOpusDec reports a retryable error.

Tested

  • python suites: test_progress, test_progress_encoding, test_import_audit,
    test_stubgen, check_conventions comment/wrapped/ci_gate — all pass.
  • tools/progress.py: 3048/3527 (86.42%), +6 vs main.
  • tools/check_conventions.py --base origin/main: pass.
  • Full cmake build + ctest not run locally (ffmpeg-core submodule not
    initialized in this workspace); Export.cpp is byte-identical to the
    proven libSceOpusDec implementation modulo symbol renames, and the
    guest test mirrors guest_opus_dec. Needs CI full Linux/Windows build.

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 (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4829986554 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4485). Originally posted by [SandBoss](https://github.com/SandBoss) on 2026-10-12T13:18:27Z. --- ### What Implements all 6 libSceOpusCeltDec exports on the same backend as libSceOpusDec: context/state registry, 640-byte state for mono/stereo, 48000 Hz only, packet framing check, FFmpeg AV_CODEC_ID_OPUS decode with float-to-s16 conversion. Links PRIVATE ffmpeg like libSceOpusDec. Reworks guest_opus_celt_dec from a NotImplemented check into the full behavioural test. Updates the TechnicalDebt bullet to the new contract (CELT-only restriction and console retryable errors unverified). Signatures follow ProsperoRadio's opus_decoder.cpp, which uses this library as the fallback when libSceOpusDec reports a retryable error. ### Tested - python suites: test_progress, test_progress_encoding, test_import_audit, test_stubgen, check_conventions comment/wrapped/ci_gate — all pass. - tools/progress.py: 3048/3527 (86.42%), +6 vs main. - tools/check_conventions.py --base origin/main: pass. - Full cmake build + ctest not run locally (ffmpeg-core submodule not initialized in this workspace); Export.cpp is byte-identical to the proven libSceOpusDec implementation modulo symbol renames, and the guest test mirrors guest_opus_dec. Needs CI full Linux/Windows build. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-12 13:37:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T13:37:40Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
#4447 sceOpusCeltDecCreateEx
sceOpusCeltDecDecode
sceOpusCeltDecDestroy
sceOpusCeltDecGetSize
sceOpusCeltDecInitialize
sceOpusCeltDecTerminate
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6125407335 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4485#issuecomment-6125407335). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T13:37:40Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #4447 | | `sceOpusCeltDecCreateEx`<br>`sceOpusCeltDecDecode`<br>`sceOpusCeltDecDestroy`<br>`sceOpusCeltDecGetSize`<br>`sceOpusCeltDecInitialize`<br>`sceOpusCeltDecTerminate` | |
oneandonlydean commented 2026-10-13 00:22:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:22:31Z.


Closing: no title reaches libSceOpusCeltDec. As its entry in docs/dev/debt/libSceOpusCeltDec.md says, PPSA99001 opens it only after a retryable libSceOpusDec error, which libSceOpusDec never returns. Reopen when a title stops in one of these calls on main, with the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135200750 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4485#issuecomment-6135200750). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T00:22:31Z. --- Closing: no title reaches libSceOpusCeltDec. As its entry in `docs/dev/debt/libSceOpusCeltDec.md` says, PPSA99001 opens it only after a retryable libSceOpusDec error, which libSceOpusDec never returns. Reopen when a title stops in one of these calls on main, with the log line.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!4485
No description provided.