Quote:
Originally Posted by FitGirl
Thanks for the new toy to play with.
GTA6 Sample (textures pack, full of BC textures)
Typical compression chain:
222333440 ttdb_terrain_image_based.ttpf
473012275 ttdb_terrain_image_based.ttpf.decompressed
368614655 ttdb_terrain_image_based.ttpf.decompressed.srep (m3f)
186781464 ttdb_terrain_image_based.ttpf.decompressed.srep.lo lz_single_thread_compressed (dec 5 sec on 1 thread)
193881051 ttdb_terrain_image_based.ttpf.decompressed.srep.ro fz (dec in 14 sec with 16 threads)
rofz compessed with default -l8, no fine tuning
lolz compressed with MY default/mid-range settings, not max, nor mtt with blocks
dunno why rofz is so much slower on mt decomp than lolz on a single thread
made another run withour srep, size was just a 10-20 KBs smaller
|
Thanks for the GTA6 sample (ttdb_terrain_image_based.ttpf). I took it apart, so here is what is going on.
What is inside
The file is an RDS5/ETPF texture pack: 204 textures = 51 terrain tiles, each in 4 variants:
Code:
format count size notes
RGBA8 1024^2 51 213.9 MB masks, GPU-tiled
BC7 2048^2 51 213.9 MB BCPack payload
BC1 1024^2 51 35.7 MB BCPack payload, 6 mips
BC1 512^2 51 9.0 MB BCPack payload, 5 mips
The BC7 and BC1 data is not plain BC blocks. Block statistics look like random bytes (e.g. BC7 "mode" byte 0 in 10% of blocks, BC1 endpoint order 50/50). It is BCPack, the Xbox texture compression. Those 259 MB make up about 95% of the compressed output.
Why can't I add a texture model for it
A model would have to decode BCPack to BC blocks and, on unpacking, re-encode them to the
exact original BCPack stream. There is no public BCPack encoder (the ttpf-viewer on GitHub cannot even decode it), so this is not possible for now.
I’ll wait until someone manages to re-encode it.
Changes- 0.18.1 (stream format v18 as 0.18.0: either version decodes the other's streams)
- two builds in the package, rofz_avx2.exe and rofz_sse2.exe (for CPUs without AVX2), instead of rofz.exe; the same streams. Thanks to Joe Forster/STA for the naming idea.
- a summary at the end of compression: the data found by kind (streams, bytes, how much its model kept and how much LZ coded smaller) and what coded it (model, regions, bytes in and out, ratio, share of the output); the RAM line gives the models per thread and the data apart.
- a texture whose header claims more data than its file holds (a cut file) ends at the next file header (textures, audio, images, CR2W, Ogg, ZIP, PNG, UnityFS, FSB5, Wwise banks, tar): the files after it are found again (16 type sets put together: −1.4% at -l2; the PS3 texture set −0.25%).
- audio regions and texture bands are cut into pieces of a segment's share per thread, 2–8 MB (8 MB before; large inputs as before), cube maps and texture arrays into their images: on the 16 MB sets ADPCM and console audio decode 2.5–3× and code 1.7× faster for +0.02…+0.09%, BC6H sky boxes decode 2.6× faster for +0.07%.
- -l6 … -l8: blocks of a quarter of the segment, 4–32 MB (8–32 MB before; inputs of 32 MB and more as before): 16 MB files code 25% and decode 25% faster at -l8.
- the match finder compares 8 bytes at a time (the same matches and streams): repetitive data codes up to 39% faster at -l1.
- per-type sets against 0.18.0: size −0.04…+0.05% per level (single sets up to +1.2% at -l6 … -l8), compression −7…−25% of the time, decompression −20…−29% (-l1 80 MB/s instead of 57).
EDIT
Work on
v19 has started: a new, simpler stream format whose main goal is a huge speed-up of decompression –
-l1 should decode even faster as lolz at about the same ratio. So there won't be any updates for a while.