fix(ngs2): decode ATRAC9 across streamed waveform blocks #1300
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1300"
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 TibixDev on 2026-10-07T22:44:53Z.
What
Decode ATRAC9 waveforms across partial input buffers. Preserve sample and skip counts, assemble split superframes, and let callbacks refill, pause, or reset the stream. Closed ATRAC9 streams with missing samples throw.
Integrated with merged #1038 on
66b8abd8. Both codecs useAPPEND(0x2) through the same dispatch. PCM keeps its existing append validation, starvation, and early-close behavior. ATRAC9 appends compressed bytes without replacing the waveform metadata. No duplicateONLY_DATAflag remains.Tested
Fedora 44 Release: all seven NGS2 tests pass. Tests cover PCM streaming and ATRAC9 partitions, pitch, skip, repeats, refill callbacks, pause, reset, starvation, and truncation. All 255 byte splits of a superframe match complete decoding, with sample counts, byte counts, and final input pointers checked. An append without waveform metadata is rejected.
MinGW compiles the changed decoder/render/control sources and the ATRAC9 and PCM stream tests. Windows runtime CI is pending. Public source references and unverified console behavior remain in
TechnicalDebt.md.Checklist
main; merged #1038 integrated.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T03:26:11Z.
#1038 also defines flag
0x2: it calls itAPPENDand streams PCM through it, while this calls itONLY_DATAfor ATRAC9 and throws for PCM. The two conflict inNgs2Types.hpp,Ngs2Internal.hpp,Render.cppandVoice.cpp. Once #1038 lands, please rebase onto it and make the two readings one path.Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T06:45:51Z.
Integrated with merged #1038 and rebased on
66b8abd8.Both codecs now use the upstream
APPEND(0x2) flag and the same append dispatch. PCM keeps #1038's validation and early-close behavior. ATRAC9 appends compressed bytes while keeping the original waveform duration and skip count. The duplicateONLY_DATAconstant is gone.All seven Linux Release NGS2 tests pass, including the PCM stream tests. The ATRAC9 tests also check all 255 byte splits of a superframe, ignored continuation metadata, counters, final pointers, and rejection of an append without a waveform. Existing pitch, refill, pause, reset, starvation, truncation, and repeat checks pass. MinGW compiles the changed sources and both codec tests; Windows runtime CI is pending.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T22:56:26Z.
Rebased onto current
main(only conflict: the NGS2 lines indocs/dev/TechnicalDebt.md, kept both sides). Built and ran the full ctest on the rebased head: all NGS2 tests pass, includingngs2_atrac9, and the new tests fail without the change. Merging once CI is green on the new head.