Add clean-room BCPack decoder (BC1/BC3/BC4/BC5) to TtpfReader #7
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/breadbbbb--rpf9-explorer!7
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/7/head"
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?
@sombraSoft on GitHub · 2026-11-22 02:54 UTC · original
feat/ttpf-bcpack-decoder→main· +1836 −31 · 7 files · 1 commits · merged 2026-11-22 09:48 UTCSummary
Adds a clean-room C# Xbox Series DirectStorage BCPack decoder for BC1, BC3, BC4, and BC5 (
DSTORAGE_BCPACK_MODEcodecs1, 3, 4, 5) and integrates it intoTtpfReaderwhile keeping BCPack textures strictly read-only.Core/BcpackTables.cs&Core/BcpackDecoder.cs:L = 1 << 24home-state verification) and block rebuilders for BC1, BC3, BC4, and BC5.microsoft/silicon-ransMDU tables); codec-level constants only, zero game assets.allowProvisional: false) is the default: chunks referencing unconfirmed/provisional built-in history entries throwBcpackProvisionalException(NotSupportedException), corrupt bitstreams throwInvalidDataException, and unsupported codecs (BC2,BC6H,BC7) throwNotSupportedExceptionnaming the codec.Core/TtpfReader.cs:DecodeChunkand includes them inReadIndexmip availability andLegacyTopOnlyName.allowProvisionaloverloads onCreateDds,DecodeTexturePixels, andDecodeTexturePreview(default overloads remain strictallowProvisional: false).Limitation(e.g.BC7,BC6H) instead of a generic BCPack message.SupportsNativeReplacement = falseand marks read-only inPreviewNotewhenever any used chunk is BCPack-compressed.Core/Rds5TextureWriter.cs:!n.UsesBcpackso pure-zlib replacements never fail if a small unaffected neighbor uses a provisional BCPack chunk.Core/ArchiveReader.cs,README.md,README.txt:Verification
NVIDIA GeForce RTX 3060 Ti(driver621.24),.NET 10.0.401SDK (.NET 8/.NET 10targets).dotnet build Core/RpfPreview.Core.csproj -c Releasedotnet build App/RpfPreview.App.csproj -c Releasedotnet build Tools/IndexBuilder/IndexBuilder.csproj -c Releasetools/rpf9dump(TreatWarningsAsErrors=true)8 passed, 0 failed: all 160 probability tables, 12/16-lane rANS round-trips, multi-fragment flushes, corrupt/truncated/bounds negative controls, BC2/BC6H/BC7 rejection, strict vs provisional BC1/BC3/BC4/BC5 history behavior, end-to-end synthetic RDS5/ETPF634TtpfReader/DdsTextureReadertests, andRds5TextureWriterreplacement with a provisional BCPack smallest neighbor.357,115descriptors,103,170BC1/BC3/BC4/BC5 chunks):TtpfReader.Inspect(1.81s):742BC7,10BC6H;0layout or format skips)SupportsNativeReplacement: 78,629 (0BCPack textures marked replaceable)14.37 GiBdecoded in76.07s, 0 structural/other errors):allowProvisional: false): 101,440 chunks (98.32%) — covering 354,991 / 356,363 exported textures (99.41%of all catalog entries).1,296BC1,27BC3,77BC4,330BC5) across 1,372 textures (1,329decode withallowProvisional: true;43touch unfitted BC4 history and remain refused).ItsNotRexed/Leonidatools/bcpack.pyon 565 chunks (120BC1 + all35BC3 + all77BC4 + all333BC5):490byte-exact decoded payloads +75identical unfitted BC4 rejections)