Commit Graph
8 Commits
Author SHA1 Message Date
Bipin 8d878818b2 docs(opus): clarify failed encoder replacement outcomes in debt 2026-10-26 16:40:34 +05:30
Bipin acbab704c8 fix(core): retire the replaced opus encoder before the replacement
A create over a marked state now retires the encoder its instance id
names before any state write or allocation, so a replacement lost to a
host allocation failure or the libopus OPUS_ALLOC_FAIL branch cannot
strand an entry the state no longer names: Destroy and Terminate stay
consistent on every failure path. The debt notes record the
replacement rule as our choice with the console failed-replace
behaviour unmeasured and why the tests cannot force the failure
paths.
2026-10-26 16:06:06 +05:30
Bipin 8529647f01 fix(core): complete the silk layout and retire replaced encoders
The SILK setup writes rate/50 at +0xE4 next to +0x58 and the state test
asserts it, and a create over a marked state replaces the entry its
instance id names so the surviving Destroy frees the codec and the
following Terminate runs clean. EncodeFloat reports the reservation
that cannot fit with a throw at the checks where the console module
dies after the marker and frame 0, with the 8 MiB bound recorded as our
host stack model, and the tests cover the negative frame and the bound
setup.
2026-10-26 15:33:03 +05:30
Bipin e1a28b400b fix(core): adopt the measured opus encoder module protocol
Encode and EncodeFloat run the decrypted-module measurements: the null
state +0x01, null samples +0x02 before the state marker, a markerless
state +0x16/+0x15, null data +0x04 before the frame check, maxDataBytes
0 +0x05 and frame sizes outside the accepted durations +0x03, while a
negative maxDataBytes reaches the backend as it reaches AJM on the
console. Create zero-fills the state and writes the measured word and
bitrate tables, Destroy clears the 0x17B2 marker leaving the other
bytes, the encoder registry keys on the instance id at +0x00, and
EncodeFloat aborts for a stack reservation that cannot fit, matching
the console process death. The tests byte-check the measured layout
with the per-rate bitrates and the new check orders behind both
libraries' Api.hpp, and the debt notes carry the module runs with the
remaining AJM gaps.
2026-10-26 15:12:27 +05:30
Bipin 04ab37b35d fix(core): apply the measured opus encoder console behaviour
Create, CreateEx, Destroy, GetSize and Initialize follow the firmware
13.42 export measurements reported on the pull request: bases 0x813F0000
and 0x81770000, the pointer validated first (+0x01), then sample rate
(+0x10/+0x0F), channels (+0x0D/+0x0C) and application (+0x11/+0x10), the
required caller application 2051 for CELT and 2048 for SILK, the 0x17B2
state marker at +0xCC/+0xE8 behind Destroy (+0x16/+0x15) and fixed
728/752-byte GetSize values; a successful create zero-fills the console
state size. The internal encoder keeps the restricted celt and silk
applications whose packet identity the tests compare, float included.

The tests declare entry points through the libraries' Api.hpp instead of
local prototypes, cast states to the opaque encoder types, drop the silk
ctl/cancel/priority/timeout and live-encoder Terminate throw pins and
compare both float sections against opus_encode_float. Ctl,
Encode*WithPriority and the silk cancel and timeout entry points keep
their throwing stubs, and the debt notes carry the measurement with the
remaining gaps.
2026-10-26 08:41:34 +05:30
Bipin 981e36205c feat(core): implement the Opus encoder libraries
- libSceOpusCeltEnc and libSceOpusSilkEnc forward Initialize, Terminate,
  GetSize, Create, CreateEx, Encode, EncodeFloat and Destroy to bundled
  libopus with OPUS_APPLICATION_RESTRICTED_CELT and OPUS_APPLICATION_RESTRICTED_SILK
- state pointers are host registry keys; nothing is written into guest memory,
  Create without CreateEx binds an internal context id, and a live CreateEx
  encoder makes Terminate throw
- validation mirrors the recovered libSceOpusCeltDec order: channels before
  sample rate before application, offsets 0/1/2/3/6/7/8/9/13
- Ctl and the priority, timeout, batch and cancel exports still throw and are
  documented in libSceOpusCeltEnc.md and libSceOpusSilkEnc.md
- new guest_opus_celt_enc and guest_opus_silk_enc tests require bit-exact
  packets against a raw libopus encoder with the same restricted application,
  celt-mode or silk-only TOC values, an alternating sine decoded through
  opus_decode, and the negative error paths
2026-10-25 11:47:55 +05:30
boykopovar 223cc1c456 fix(opuscelt): restore encoder and control signatures 2026-10-21 21:48:14 +03:00
akkadbakkad89andDevin 7ccf4da486 fix(prx): align declarations to the PS5 3.20 export inventory and add debt notes
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 12:25:10 +00:00