PDA

View Full Version : ROFZ Compressor


sajmon83
22-11-2026, 09:30
ROFZ – LZ compressor with texture / audio / raw-data models

ROFZ is a lossless compressor for repacking games: optimal-parsing LZ77 + range coder with a per-block literal mixer, plus its own models for the data LZ codes badly. It finds that data anywhere in the stream, by header or by content:

BC1–BC7 / DXT textures – DDS, IWI, VTF headers, and BC1/3/4/5 without any header. Textures are chained, and a texture can be coded against an earlier one that shares its blocks.
PCM audio (WAV / AIFF, 8/16/24-bit, float, PS2 SS2) – cascade of sign-LMS predictors.
ADPCM audio – IMA / MS / Xbox ADPCM (WAV, also sound banks with header stubs), PlayStation SPU ADPCM (VAG, SS2 / ADS, WAC, header-less), CD-XA (PS1 sectors), Nintendo DSP-ADPCM (BCSTM / BFSTM / BWAV), CRI ADX – the codec's decoder runs alongside the model.
Raw multi-channel data – uncompressed images, vertex / animation arrays (adaptive linear predictor + context mixing).
x86 filter, multithreaded compression and decompression, stdin/stdout for FreeArc.

Std-only, Windows x64, two builds: rofz_avx2.exe (AVX2 CPUs) and rofz_sse2.exe (any x86-64 CPU). Both write the same streams and each decodes the other's; streams also decode identically with any thread count.

Neural-network models (CPU only, integer arithmetic; trained offline on samples of 75 games other than Memoriapolis, so as not to skew the results)

Online mixing networks – the literal mixer, the BC pixel-index mixer and the raw-data model combine their context predictions with a single-layer logistic network that learns while coding (identically in encoder and decoder).
Pre-trained start states – the literal mixer and the raw-data model (weights, context cells, bias, APM) start from states learned on game data instead of even odds (~580 KB of tables in the exe), so small blocks and block starts code smaller.
Literal parameter network – a one-layer softmax network over 22 cheap statistics of a block (order-0/1 and position-context entropies, share of zeros, record-stride hints) proposes the two most promising literal-context settings for the encoder's test-coding (trained on 600 blocks from 75 game samples).
Texture classifier – a logistic regression (one neuron) over 18 statistics of a texture candidate predicts whether the texture model will beat LZ; rejected candidates skip the trial coding (faster compression).
The gains are small (0.02–0.1%) but free for the decoder. -nn turns all trained models off.


Levels

-l1 … -l4: fast-decoding model sets, fixed per level: 1–2 fast models, 3 + the literal mixer where it saves ≥ 0.5%, 4 + the mixed texture models; only the fast variants of the models (full models from -l5). Every level codes smaller and decodes slower than the one before. Default: -l4. -ds N keeps a decoding speed on any level (off by default since 0.18.0).
-l5 … -l8: full models, smallest output. -l5 compresses fastest, -l8 smallest.
-m = memory budget (% of RAM), -t = threads, -ds = decompression speed to keep (MB/s, any level).


Benchmark
Ryzen 7 5800X3D (8C/16T), 64 GB RAM, NVMe SSD, Windows 11. Command line, one run after another on an idle PC, all 16 threads; every output was decompressed and compared byte for byte with the input. MB/s refer to the compressor's input.

Settings

LOLZ ULTRA (DiskSpan's LOLZ_ULTRA alias): lolz -dtb1 -d263 -mtt1 -mt16 -mc1023, decoded with CLS-LOLZ_D_x64
TARZ 1.0.3 at its best (LOLZ-ULTRA-like settings): tarz c -t16 -d256 -mtt1 -tt16 -mc1023 -ow4096 -fb256, tarz d -t16
ROFZ 0.18.1: rofz c -lN -m85%, rofz d (defaults otherwise)


Inputs and precompression

Per-type sets: 46 files of up to 16 MB cut from game data samples (files of one kind put together): PCM audio, IMA / MS ADPCM audio and a sound bank, console audio (PS1 CD-XA, PS2 VAG / SS2 / ADS / WAC, Nintendo DSP-ADPCM, CRI ADX, Xbox ADPCM) and PS3 textures, BC1–BC7 / DXT textures (DDS, VTF, IWI, XBM and header-less), raw images (BMP / TGA / RAW / TIF), text, Unity / CR2W / Source structures, executables, meshes, animations, BSP maps, PAK / VPK archives. No precompression – the same file for every compressor.
Memoriapolis (Unity 2022.3, 7 832 files, 7 267 959 185 B): files in Arc order (by extension, then path); the LZ4 / LZ4HC blocks of the 4 713 UnityFS archives restored to raw data, only blocks that recompress bit for bit) → 9 119 658 087 B; then srep 4.90g-wip -hash- -m3f -a0/0 → 5 355 251 639 B, the input of every run. The whole-game results are still those of rofz 0.17.0; they will be measured again later.


PCM audio (WAV / AIFF; uncompressed samples): 67 108 864 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 39 127 417 58.30% - 50.4 s 1.33 1.62 s 42
TARZ (best) 40 183 818 59.88% +2.70% 191.2 s 0.35 2.70 s 25
rofz -l1 30 875 027 46.01% -21.09% 4.2 s 16.10 0.75 s 90
rofz -l2 30 875 004 46.01% -21.09% 4.4 s 15.20 0.76 s 88
rofz -l3 30 874 960 46.01% -21.09% 4.5 s 15.02 0.76 s 88
rofz -l4 30 874 907 46.01% -21.09% 4.5 s 14.94 0.73 s 92
rofz -l5 30 874 907 46.01% -21.09% 4.5 s 14.99 0.77 s 87
rofz -l6 30 874 327 46.01% -21.09% 7.6 s 8.85 0.74 s 91
rofz -l7 30 874 320 46.01% -21.09% 7.6 s 8.84 0.76 s 88
rofz -l8 30 874 332 46.01% -21.09% 7.6 s 8.82 0.74 s 91

ADPCM audio (IMA / MS ADPCM WAV, a sound bank): 40 372 544 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 26 204 819 64.91% - 35.3 s 1.14 1.02 s 40
TARZ (best) 26 118 840 64.69% -0.33% 174.8 s 0.23 1.25 s 32
rofz -l1 23 965 640 59.36% -8.54% 6.4 s 6.35 0.48 s 84
rofz -l2 23 954 877 59.33% -8.59% 6.9 s 5.87 0.48 s 84
rofz -l3 23 938 172 59.29% -8.65% 8.2 s 4.92 0.50 s 81
rofz -l4 23 924 204 59.26% -8.70% 9.0 s 4.50 0.50 s 81
rofz -l5 22 970 203 56.90% -12.34% 8.0 s 5.07 0.99 s 41
rofz -l6 22 919 769 56.77% -12.54% 10.1 s 3.99 1.07 s 38
rofz -l7 22 919 266 56.77% -12.54% 10.5 s 3.86 1.06 s 38
rofz -l8 22 918 738 56.77% -12.54% 11.5 s 3.50 1.04 s 39

console audio and textures (PS1 CD-XA, PS2 VAG / SS2 / ADS / WAC, Nintendo DSP-ADPCM, CRI ADX, Xbox ADPCM, PS3 textures): 104 242 992 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 60 565 348 58.10% - 80.6 s 1.29 2.30 s 45
TARZ (best) 59 907 663 57.47% -1.09% 194.5 s 0.54 3.38 s 31
rofz -l1 59 224 009 56.81% -2.21% 14.0 s 7.45 1.44 s 72
rofz -l2 59 017 649 56.62% -2.56% 17.2 s 6.04 1.45 s 72
rofz -l3 58 745 160 56.35% -3.01% 21.3 s 4.90 1.81 s 58
rofz -l4 58 502 725 56.12% -3.41% 23.4 s 4.46 2.09 s 50
rofz -l5 57 910 829 55.55% -4.38% 24.6 s 4.24 3.22 s 32
rofz -l6 55 329 654 53.08% -8.64% 32.7 s 3.18 3.48 s 30
rofz -l7 55 325 784 53.07% -8.65% 36.5 s 2.86 3.42 s 30
rofz -l8 55 324 441 53.07% -8.65% 42.6 s 2.45 3.40 s 31

textures (DDS / BC1-BC7 / VTF / IWI / XBM): 150 994 944 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 65 330 035 43.27% - 156.3 s 0.97 3.64 s 41
TARZ (best) 65 011 249 43.06% -0.49% 285.7 s 0.53 6.87 s 22
rofz -l1 65 073 479 43.10% -0.39% 27.3 s 5.54 3.03 s 50
rofz -l2 64 703 941 42.85% -0.96% 35.5 s 4.26 2.94 s 51
rofz -l3 64 277 087 42.57% -1.61% 49.5 s 3.05 3.32 s 45
rofz -l4 61 720 287 40.88% -5.53% 53.5 s 2.82 5.23 s 29
rofz -l5 61 425 183 40.68% -5.98% 52.0 s 2.90 6.25 s 24
rofz -l6 61 256 329 40.57% -6.24% 74.2 s 2.04 6.58 s 23
rofz -l7 61 193 745 40.53% -6.33% 89.0 s 1.70 6.55 s 23
rofz -l8 61 165 158 40.51% -6.38% 103.4 s 1.46 6.65 s 23

raw images (BMP / TGA / RAW / TIF): 83 886 080 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 21 323 178 25.42% - 78.9 s 1.06 1.60 s 52
TARZ (best) 20 755 681 24.74% -2.66% 437.9 s 0.19 2.56 s 33
rofz -l1 21 190 058 25.26% -0.62% 15.3 s 5.49 0.93 s 90
rofz -l2 21 159 023 25.22% -0.77% 16.8 s 5.00 0.90 s 94
rofz -l3 20 537 604 24.48% -3.68% 22.5 s 3.73 1.44 s 58
rofz -l4 20 500 695 24.44% -3.86% 25.6 s 3.28 1.41 s 60
rofz -l5 19 944 470 23.78% -6.47% 35.6 s 2.36 3.43 s 24
rofz -l6 19 733 680 23.52% -7.45% 45.6 s 1.84 3.48 s 24
rofz -l7 19 700 741 23.49% -7.61% 55.5 s 1.51 3.47 s 24
rofz -l8 19 676 059 23.46% -7.72% 73.8 s 1.14 3.43 s 24

text, structures, executables, meshes, maps: 266 556 789 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 95 836 113 35.95% - 267.1 s 1.00 3.27 s 82
TARZ (best) 95 749 915 35.92% -0.09% 1301.8 s 0.20 4.68 s 57
rofz -l1 103 234 022 38.73% +7.72% 36.9 s 7.22 2.23 s 119
rofz -l2 102 172 015 38.33% +6.61% 58.7 s 4.54 2.37 s 113
rofz -l3 99 774 966 37.43% +4.11% 110.2 s 2.42 5.01 s 53
rofz -l4 99 244 592 37.23% +3.56% 142.2 s 1.87 4.93 s 54
rofz -l5 99 190 908 37.21% +3.50% 143.2 s 1.86 5.37 s 50
rofz -l6 93 830 156 35.20% -2.09% 217.8 s 1.22 6.63 s 40
rofz -l7 93 270 573 34.99% -2.68% 303.0 s 0.88 7.18 s 37
rofz -l8 93 054 209 34.91% -2.90% 460.7 s 0.58 7.36 s 36

Memoriapolis, whole game (rofz 0.17.0: not measured again yet): 5 355 251 639 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s RAM to decompress
LOLZ ULTRA 1 758 818 797 32.84% - 1615.1 s 3.32 12.00 s 446 5 698 MB
TARZ (best) 1 772 775 068 33.10% +0.79% 5779.4 s 0.93 20.30 s 264 2 784 MB
rofz -l1 1 858 615 328 34.71% +5.67% 564.5 s 9.49 24.68 s 217 4 103 MB
rofz -l4 1 801 250 333 33.64% +2.41% 1302.6 s 4.11 27.01 s 198 4 081 MB
rofz -l5 1 763 133 782 32.92% +0.25% 1442.6 s 3.71 54.31 s 99 6 377 MB
rofz -l8 1 739 267 961 32.48% -1.11% 3545.8 s 1.51 82.51 s 65 8 847 MB

Per set (output bytes)
set LOLZ ULTRA TARZ (best) rofz -l1 rofz -l2 rofz -l3 rofz -l4 rofz -l5 rofz -l6 rofz -l7 rofz -l8
lit/text 1 939 745 1 920 604 2 276 931 2 241 877 2 203 430 2 200 847 2 200 847 1 872 491 1 872 269 1 872 050
lit/text_utf16 782 807 768 166 896 111 857 508 818 020 800 900 800 900 735 400 734 994 734 821
lit/struct_unity 4 622 416 4 613 608 4 849 278 4 751 920 4 658 957 4 608 528 4 620 495 4 555 619 4 530 982 4 518 108
lit/struct_cr2w 12 435 801 12 466 536 12 642 307 12 590 111 12 477 591 12 484 180 12 484 099 12 418 834 12 408 367 12 401 991
lit/struct_misc 1 646 195 1 642 642 2 567 578 2 442 974 2 329 771 2 309 090 2 300 616 1 667 094 1 650 638 1 646 317
lit/struct_source 12 877 500 12 860 749 12 995 671 12 980 473 12 680 523 12 642 857 12 642 857 12 473 329 12 368 150 12 345 867
lit/exe64 4 402 081 4 000 834 4 348 670 4 301 596 4 173 919 4 142 244 4 128 059 4 012 930 3 995 288 3 985 884
lit/exe32 9 230 031 9 100 271 11 300 627 11 260 205 11 148 412 11 188 555 11 187 425 9 053 196 9 050 002 9 048 305
lit/exe_net 3 619 668 3 589 282 3 814 151 3 774 163 3 668 818 3 646 090 3 646 090 3 540 346 3 576 593 3 533 296
lit/mesh 7 019 892 7 061 608 8 106 947 8 067 894 7 940 565 7 929 739 7 929 739 7 020 295 6 980 130 6 977 864
lit/anim 5 093 373 5 523 928 5 654 300 5 594 216 5 291 816 5 162 390 5 162 291 4 854 950 4 847 439 4 838 677
lit/map_bsp 2 044 624 2 073 579 2 928 667 2 813 764 2 620 778 2 529 597 2 452 433 2 413 875 2 111 453 2 029 725
lit/terrain_nav 5 181 137 5 001 339 5 356 031 5 261 473 5 057 718 5 010 374 5 010 374 4 955 239 4 924 901 4 901 003
lit/font 3 279 030 3 265 130 3 540 980 3 427 181 3 241 392 3 141 029 3 136 103 3 007 693 2 980 914 2 990 163
lit/shader 294 593 285 262 317 858 304 786 292 592 288 823 288 823 287 478 287 627 284 382
lit/pack_pak 9 394 270 9 534 756 9 561 099 9 531 863 9 452 292 9 450 969 9 450 969 9 325 380 9 320 878 9 319 437
lit/pack_vpk 11 972 950 12 041 621 12 076 816 11 970 011 11 718 372 11 708 380 11 748 788 11 636 007 11 629 948 11 626 319
audio/audio_pcm16 12 621 005 12 980 497 9 861 454 9 861 446 9 861 423 9 861 372 9 861 372 9 861 152 9 861 146 9 861 159
audio/WAV16 9 020 554 9 567 334 7 420 903 7 420 896 7 420 880 7 420 881 7 420 881 7 420 741 7 420 741 7 420 741
audio/WAV24 8 424 908 8 093 706 6 171 528 6 171 526 6 171 519 6 171 516 6 171 516 6 171 357 6 171 356 6 171 356
audio/AIFF 9 060 950 9 542 281 7 421 142 7 421 136 7 421 138 7 421 138 7 421 138 7 421 077 7 421 077 7 421 076
raw/img_raw 4 244 729 4 129 180 4 295 927 4 268 429 4 119 632 4 084 231 4 086 545 3 921 622 3 899 825 3 885 489
raw/BMP 4 286 406 4 176 200 4 130 523 4 129 802 4 016 469 4 015 894 3 984 867 3 965 947 3 959 895 3 955 456
raw/TGA 4 283 867 4 175 178 4 130 618 4 129 888 4 016 559 4 015 908 3 984 905 3 965 922 3 960 127 3 955 617
raw/RAW 4 254 850 4 126 583 4 535 256 4 535 170 4 411 919 4 411 760 4 158 900 4 151 612 4 152 170 4 150 835
raw/TIF 4 253 326 4 148 540 4 097 734 4 095 734 3 973 025 3 972 902 3 729 253 3 728 577 3 728 724 3 728 662
tex/tex_bc1 8 534 089 8 451 644 9 032 672 9 026 626 8 990 478 8 346 299 8 231 756 8 227 145 8 224 702 8 223 744
tex/tex_bc3 4 775 742 4 778 892 5 178 828 5 178 744 5 177 432 4 595 549 4 555 641 4 555 264 4 555 223 4 555 101
tex/tex_bc45 4 987 145 4 979 232 5 364 905 5 257 555 5 154 513 5 073 620 5 069 256 5 096 973 5 069 638 5 055 240
tex/tex_bc7 11 390 057 11 140 226 11 120 445 11 022 302 10 992 170 10 981 013 10 981 013 10 926 940 10 919 074 10 917 999
tex/tex_bc6 12 295 850 12 353 859 9 167 635 9 167 635 9 167 633 9 167 632 9 167 632 9 167 579 9 167 579 9 167 577
tex/dds 1 265 829 1 200 701 1 354 339 1 325 613 1 301 761 1 173 263 1 133 598 1 133 595 1 133 595 1 133 595
tex/tex_vtf 4 831 058 4 865 011 5 227 342 5 174 285 5 108 334 4 850 371 4 861 782 4 855 202 4 854 746 4 854 030
tex/tex_xbm 9 254 180 9 334 486 10 023 631 9 951 827 9 807 968 9 479 965 9 427 292 9 302 192 9 292 371 9 288 565
tex/tex_iwi 7 996 085 7 907 198 8 603 682 8 599 354 8 576 798 8 052 575 7 997 213 7 991 439 7 976 817 7 969 307
adpcm/ADPCM_IMA 7 954 668 7 967 607 7 284 744 7 282 921 7 268 028 7 258 877 6 914 897 6 882 864 6 882 714 6 882 588
adpcm/ADPCM_MS 6 682 707 6 589 698 6 139 670 6 131 058 6 131 841 6 128 161 5 964 473 5 946 451 5 946 311 5 946 156
adpcm/ADPCM_bank 11 567 444 11 561 535 10 541 226 10 540 898 10 538 303 10 537 166 10 090 833 10 090 454 10 090 241 10 089 994
console/ps1_xa 11 773 597 11 812 741 10 684 429 10 684 429 10 684 427 10 684 428 10 533 375 10 533 364 10 533 364 10 533 364
console/ps2_vag 12 536 619 12 155 144 11 403 206 11 401 733 11 363 451 11 354 503 11 290 954 11 290 946 11 290 946 11 290 946
console/ps2_ss2 11 290 759 10 980 981 10 041 915 10 041 915 10 041 914 10 041 914 9 885 711 9 885 708 9 885 708 9 885 708
console/ps2_wac 1 412 180 1 428 831 1 303 807 1 306 636 1 301 568 1 300 473 1 280 083 1 276 599 1 275 986 1 275 651
console/nds_dsp 5 309 310 5 361 988 8 151 524 7 951 216 7 746 079 7 735 672 7 735 672 5 245 836 5 244 989 5 245 089
console/cri_adx 14 136 460 14 096 396 13 062 179 13 062 178 13 062 175 13 062 174 12 903 585 12 903 575 12 903 574 12 903 574
console/xbox_adpcm 1 010 957 1 016 245 976 695 976 694 976 693 976 693 955 045 955 046 955 046 955 046
console/ps3_tex 3 095 466 3 055 337 3 600 254 3 592 848 3 568 853 3 346 868 3 326 404 3 238 580 3 236 171 3 235 063

FreeArc / DiskSpan (arc.ini):
[External compressor:rofz]
header = 0
packcmd = "rofz_avx2.exe" c {options} - - <stdin> <stdout>
unpackcmd = "rofz_avx2.exe" d - - <stdin> <stdout>
(rofz_sse2.exe on a CPU without AVX2; an installer for any PC can ship rofz_sse2.exe.)
Use e.g. -mrofz:l4:m65% after your precompressors. Presets: rofz:l2:m45% (fast), rofz:l4:m65% (normal), rofz:l7:m85% (high), rofz:l8:m85% (ultra). In an installer only the unpackcmd is needed (d -t100p - - <stdin> <stdout>).

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).

0.18.0 (stream format v18; v17 streams decode)

new audio models: PlayStation SPU ADPCM (VAG, PS2 SS2 / ADS with interleave, Ubisoft WAC, header-less frames), CD-XA ADPCM sectors (RIFF CDXA and CD images), Nintendo DSP-ADPCM (BCSTM / BFSTM either byte order, BWAV), CRI ADX; Xbox ADPCM WAV through the IMA model; PS2 SS2 PCM with block interleave. Game samples at -l8 against 0.17.2: VAG −12%, SS2 / ADS −10%, WAC −9%, XA −8…−10%, DSP −5…−8%, ADX −5%, SS2 PCM −22%.
images and other 2D data on the fast levels: a weighted predictor after JPEG XL's – eight sub-predictors (JPEG XL's four with one of its parameter sets, the median, the gradient, two from the word coded before in the pixel) weighted by their recent errors; the words of a pixel coded on their own, as differences or as YCoCg-R; -l3 / -l4 also mix each residual bit from four contexts. 20 BMP photos (55.8 MB): -l1 −18.3%, -l4 −19.2% = 13.42 MB (JPEG XL lossless e7 / e9: 13.28 / 13.09 MB, decoding about 5× slower); per-type sets −1.4%, raw images −14…−18%. -l5 … -l8: the full raw data model takes contexts from the same predictor: BMP photos −3.8% (-l8 12.98 MB, below JPEG XL e9), per-type sets −0.2%, raw images −1.8…−2.8%. The eight sub-predictors run in AVX2 lanes (image decoding −14% of the time at -l1, −9% at -l4).
fixed model sets for -l1 … -l4, no decoding budget by default (-ds still works): 1–2 fast models, 3 + the literal mixer where it saves ≥ 0.5%, 4 + the mixed texture models; only fast model variants on 1–4. Per-type sets: -l1 −2.8%, -l4 −4.9% against 0.17's default -ds 200; decompression slower where textures and ADPCM keep their models.
the audio check reads the stream's block rows for block-interleaved PCM.
header-less textures: sprite atlases with large empty areas and a constant alpha half in most BC3 blocks are no longer taken for BC7 and cut into thousands of pieces (a 16384 × 16384 DXT5 atlas slice: −17% at -l8, 10% below LOLZ).
a region whose content appears again later is kept only when it also pays for those copies (LZ never copies from a region): Memoriapolis texture / mesh data −4.3%, structure data up to −6%, ADPCM −0.5…−1.5%.
large textures (over 12 MB) are cut into row bands of about 8 MB that are coded and decoded side by side (on -l6 … -l8 only the ones that pass whole): a 32 MB DXT5 atlas slice decodes 3.3× faster for +0.13–0.18%; the texture classifier codes its candidates and their LZ yardsticks side by side (Memoriapolis texture data: compression −22% of the time); about 30 dead development switches and their code removed (streams unchanged).
texture variants (-l1 … -l5): a BC2 / BC3 / BC5 texture coded against an earlier one of the same size may take either half of a block (alpha or colour) from the same place in it; references are also found by shared halves (another colour over the same alpha). UFC 3 (PS3) menu textures: -l4 −13%.
ADPCM without a header: sound banks that keep a table of WAV header stubs and the data elsewhere (KaktoR's 208 MB bank: -l8 131 051 752 B, −8.6% against 0.17.2 and −5.1% against BCM). The stubs give the format, the data is found as runs of valid blocks. Thanks to KaktoR for the sample and the report.
the printed RAM to decompress now counts the real models per thread (levels 5–8 needed up to 2× more than shown).
a folder as input or output gives a clear error instead of "access denied".

0.17.2 (stream format v17: 0.17.0 / 0.17.1 streams decode; streams with fast ADPCM need 0.17.2)

fast ADPCM model for -l1 … -l4: the codec's own quantizer gives the expected nibble, one adaptive context instead of the mixer – 2.5× faster to decode, 2.4–3.9% larger than the full model. The decoding budget takes it where it fits and moves it up to the full model where room is left. Pure ADPCM sets at -l4: −1.7% (IMA) / −3.6% (MS) against 0.17.1; other data codes as in 0.17.1.

0.17.1 (stream format v17: 0.17.0 streams decode; streams made with -nw need 0.17.1)

switches for the single models and the trained models.
default level 4 (was 3)
fix: audio from a WAV / ADPCM header that claims more data than follows it (a cut or broken file) ran on over the next data and coded it as audio. Textures and images found by their headers are now taken out of the audio, and the last 32 KB of every audio stream are coded by the audio model and by LZ; where LZ wins, a binary search in 64 KB steps finds where the stream turns into other data and the audio ends there (cut-WAV test files: −2.8% at -l4, −15.5% at -l7). Normal audio codes as before. Found while looking into KaktoR's report.

0.17.0 first release


Download: rofz-0.18.1-win64.7z (rofz_avx2.exe + rofz_sse2.exe + README)
SHA-256: a1211b26bbf90bbcfe5b3cebae52cfac4afc9fba46c04ec79a 3aeda4a5b79f5a (1 246 115 B)

Feedback and results on other games are welcome, especially where it loses. And 200MB of samples ;)

KaktoR
22-11-2026, 10:17
adpcm sample
all settings left on default

rofz
Compressed 1 file, 208,780,556 => 156,157,676 bytes. Ratio 74.80%
Compression time: cpu 0.13 sec/real 37.72 sec = 0%. Speed 5.54 mB/s
All OK

tarz
Compressed 1 file, 208,780,556 => 149,665,201 bytes. Ratio 71.69%
Compression time: cpu 0.47 sec/real 374.98 sec = 0%. Speed 0.56 mB/s
All OK

sajmon83
22-11-2026, 11:51
Thanks! Levels 1–4 (the default) keep decompression at ~200 MB/s, and the ADPCM model decodes at only ~6 MB/s per thread, so on those levels ADPCM is left to LZ. For ADPCM-heavy data use -l5…-l8 or -ds 0. 0.17.1 also fixes WAV/ADPCM headers that claim more data than the file holds.
I am working on a lighter version of the ADPCM model for -l1 … -l4

0.17.1 (stream format v17: 0.17.0 streams decode; streams made with -nw need 0.17.1)
switches for the single models and the trained models.
default level 4 (was 3)
fix: audio from a WAV / ADPCM header that claims more data than follows it (a cut or broken file) ran on over the next data and coded it as audio. Textures and images found by their headers are now taken out of the audio, and the last 32 KB of every audio stream are coded by the audio model and by LZ; where LZ wins, a binary search in 64 KB steps finds where the stream turns into other data and the audio ends there (cut-WAV test files: −2.8% at -l4, −15.5% at -l7). Normal audio codes as before.

KaktoR
22-11-2026, 12:11
0.17.1 also fixes WAV/ADPCM headers that claim more data than the file holds.

Maybe that's the case here aswell :D

rofz -l8
Compressed 1 file, 208,780,556 => 143,341,931 bytes. Ratio 68.66%
Compression time: cpu 0.38 sec/real 194.37 sec = 0%. Speed 1.07 mB/s
All OK

tarz -t12
Compressed 1 file, 208,780,556 => 149,781,274 bytes. Ratio 71.74%
Compression time: cpu 0.30 sec/real 106.64 sec = 0%. Speed 1.96 mB/s
All OK

bzip3
Compressed 1 file, 208,780,556 => 137,015,001 bytes. Ratio 65.63%
Compression time: cpu 0.11 sec/real 24.74 sec = 0%. Speed 8.44 mB/s
All OK

bcm
Compressed 1 file, 208,780,556 => 137,432,665 bytes. Ratio 65.83%
Compression time: cpu 0.19 sec/real 10.06 sec = 2%. Speed 20.75 mB/s
All OK

sajmon83
22-11-2026, 12:24
lol, there’s no -l9 in rofz :P

KaktoR
22-11-2026, 12:28
Sorry, it was l8. Typo.

sajmon83
22-11-2026, 12:32
KaktoR, send me a sample of the files via private message or attach them here. That will make things easier, and I'll be able to work on the ADPCM model – I can see there's still some room for it! :D

EDIT
And perhaps your samples are not being detected as ADPCM (VAG/PS-ADPCM, DSP, Xbox ADPCM, or a sound bank).
My samples (IMA and MS ADPCM in RIFF WAV, files of one kind put together; Ryzen 7 5800X3D, 16 threads, every output decompressed and compared):
IMA ADPCM WAV (11 767 582 B) | MS ADPCM WAV (11 827 746 B)
compressor size ratio comp decomp | size ratio comp decomp
bcm 2.03 (default) 7 999 145 67.98% 0.84 s 0.83 s | 6 485 638 54.83% 0.78 s 0.72 s
bzip3 -j 16 8 001 713 68.00% 1.15 s 1.13 s | 6 489 847 54.87% 1.05 s 0.97 s
rofz 0.17.2 -l4 7 779 664 66.11% 6.46 s 0.21 s | 6 556 774 55.44% 8.10 s 0.19 s
rofz 0.17.2 -l8 7 061 197 60.01% 7.29 s 0.28 s | 6 048 704 51.14% 9.86 s 0.27 s
rofz 0.17.2 -l8 -na 7 589 486 64.49% - - | 6 330 231 53.52% - -
On IMA / MS ADPCM WAV, -l8 is 11.7% / 6.7% smaller than BCM, and even without the audio model (-na, plain LZ) still 5.1% / 2.4% smaller. On your file BWT wins over -l8 by 4.4%, so it is most likely an ADPCM format rofz does not detect yet.
Or perhaps it’s a bug from 0.17.0 related to the WAV / ADPCM header.

KaktoR
22-11-2026, 13:01
I will send you the sample via PM.

However it turns out on other samples rofz performs better than all other, so I guess it's just one of the few samples.

sajmon83
22-11-2026, 13:32
I will send you the sample via PM.

However it turns out on other samples rofz performs better than all other, so I guess it's just one of the few samples.

A very unusual sample case, and a very useful one. It will be fixed in the next version. That’s why I need these samples—I’m not able to gather everything on my own! :)

kj911
23-11-2026, 04:17
Can we expect a version compatible with SSE4.1/AVX and Windows 7? Regarding the extraction process (just the decompressor), would an XP-compatible release be possible? (TARZ runs on older CPUs, and the CLS filter works even on XP—though it is slow when running on a single thread.)

sajmon83
23-11-2026, 08:09
Yes for SSE4.x/AVX: the format doesn't depend on the CPU (the models are integer-only, the AVX2 paths have scalar twins), so a build for x86-64-v2 (SSE4.2/POPCNT, Nehalem/Bulldozer and newer) gives byte-identical streams and decodes archives made by the AVX2 build.
XP: not realistic. Rust has no standard library for XP, and the decompressor needs large memory.

Masquerade
23-11-2026, 08:16
Very good, will watch this one with great interest.

kj911
23-11-2026, 10:34
So, can we expect a Win7-compatible build in the near future? (Perhaps even one that supports CPUs from before the Core series?) In truth, regardless of the CPU, there is only one factor that limits the capabilities of a given compressor: the available memory. Since the days of XP64/Vista, this is no longer capped at 2 or 4 GB and even Win8 and later versions don't offer any further advantage in this regard. (Aside from games and bloated web browsers, there’s practically no benefit to newer Windows versions; nothing justifies them. One thing is certain: I will never install Win11.)

How does the memory requirement for decompression compare to that of the classic LZ family?

For instance, if I use something like "lolz:dt:d128m:mtt0:ldmf1:mt1...", it theoretically requires around 200 MB per thread at least when constrained via CLS. How does ROFZ compare under similar parameters? (If left unrestricted, LOLZ could consume 2 GB potentially per thread regardless of the dictionary size.)

Regarding Rust: There’s this thing called Rust9x (https://github.com/rust9x/rust/releases). If you’re clever enough, you could even compile the EXE for Win95! :D

sajmon83
23-11-2026, 12:24
Thanks for the Rust9x link, it's an interesting project, but I won't go that way. ROFZ is aimed at current CPUs and current methods: AVX2, many threads, context mixing and small neural networks (the literal parameter model, the texture classifier, pre-trained model states), and that's where the development goes. On a pre-Core CPU it would be far too heavy anyway. So an old single- or dual-core machine would take ages. So there's no Win7 or legacy-CPU build planned for now.

On memory for decompression, two parts:
- the segment: the decoder keeps the whole segment in RAM (by default up to 3 GB; that's also how far back matches can reach, like a dictionary). With "d -m" it gets a memory limit, and a segment that doesn't fit goes to a temporary file mapped into memory, so it still decompresses, just slower.
- the models, per decoding thread. From my sample runs (64 MB samples of game data, 16 threads):
-l1 … -l4: about 4–11 MB per thread (60–170 MB in total on 16 threads)
-l5 … -l8: mostly 5–45 MB per thread; raw image/structure data with the full model needs more, up to about 160 MB per thread in the worst case I measured. Fewer threads (-t) means proportionally less model memory.
So under limits similar to LOLZ, ROFZ stays below that on every level. The compressor prints the expected RAM for decompression after each run.

sajmon83
23-11-2026, 14:32
Changes

0.18.0 (stream format v18; v17 streams decode)

new audio models: PlayStation SPU ADPCM (VAG, PS2 SS2 / ADS with interleave, Ubisoft WAC, header-less frames), CD-XA ADPCM sectors (RIFF CDXA and CD images), Nintendo DSP-ADPCM (BCSTM / BFSTM either byte order, BWAV), CRI ADX; Xbox ADPCM WAV through the IMA model; PS2 SS2 PCM with block interleave. Game samples at -l8 against 0.17.2: VAG −12%, SS2 / ADS −10%, WAC −9%, XA −8…−10%, DSP −5…−8%, ADX −5%, SS2 PCM −22%.
images and other 2D data on the fast levels: a weighted predictor after JPEG XL's – eight sub-predictors (JPEG XL's four with one of its parameter sets, the median, the gradient, two from the word coded before in the pixel) weighted by their recent errors; the words of a pixel coded on their own, as differences or as YCoCg-R; -l3 / -l4 also mix each residual bit from four contexts. 20 BMP photos (55.8 MB): -l1 −18.3%, -l4 −19.2% = 13.42 MB (JPEG XL lossless e7 / e9: 13.28 / 13.09 MB, decoding about 5× slower); per-type sets −1.4%, raw images −14…−18%. -l5 … -l8: the full raw data model takes contexts from the same predictor: BMP photos −3.8% (-l8 12.98 MB, below JPEG XL e9), per-type sets −0.2%, raw images −1.8…−2.8%. The eight sub-predictors run in AVX2 lanes (image decoding −14% of the time at -l1, −9% at -l4).
fixed model sets for -l1 … -l4, no decoding budget by default (-ds still works): 1–2 fast models, 3 + the literal mixer where it saves ≥ 0.5%, 4 + the mixed texture models; only fast model variants on 1–4. Per-type sets: -l1 −2.8%, -l4 −4.9% against 0.17's default -ds 200; decompression slower where textures and ADPCM keep their models.
the audio check reads the stream's block rows for block-interleaved PCM.
header-less textures: sprite atlases with large empty areas and a constant alpha half in most BC3 blocks are no longer taken for BC7 and cut into thousands of pieces (a 16384 × 16384 DXT5 atlas slice: −17% at -l8, 10% below LOLZ).
a region whose content appears again later is kept only when it also pays for those copies (LZ never copies from a region): Memoriapolis texture / mesh data −4.3%, structure data up to −6%, ADPCM −0.5…−1.5%.
large textures (over 12 MB) are cut into row bands of about 8 MB that are coded and decoded side by side (on -l6 … -l8 only the ones that pass whole): a 32 MB DXT5 atlas slice decodes 3.3× faster for +0.13–0.18%; the texture classifier codes its candidates and their LZ yardsticks side by side (Memoriapolis texture data: compression −22% of the time); about 30 dead development switches and their code removed (streams unchanged).
texture variants (-l1 … -l5): a BC2 / BC3 / BC5 texture coded against an earlier one of the same size may take either half of a block (alpha or colour) from the same place in it; references are also found by shared halves (another colour over the same alpha). UFC 3 (PS3) menu textures: -l4 −13%.
ADPCM without a header: sound banks that keep a table of WAV header stubs and the data elsewhere (KaktoR's 208 MB bank: -l8 131 051 752 B, −8.6% against 0.17.2 and −5.1% against BCM). The stubs give the format, the data is found as runs of valid blocks. Thanks to KaktoR for the sample and the report.
the printed RAM to decompress now counts the real models per thread (levels 5–8 needed up to 2× more than shown).
a folder as input or output gives a clear error instead of "access denied".


PCM audio (WAV / AIFF; uncompressed samples): 67 108 864 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 39 127 417 58.30% - 50.4 s 1.33 1.62 s 42
TARZ (best) 40 183 818 59.88% +2.70% 191.2 s 0.35 2.70 s 25
rofz -l1 30 841 176 45.96% -21.18% 4.5 s 14.91 0.83 s 81
rofz -l2 30 841 153 45.96% -21.18% 4.7 s 14.34 0.81 s 82
rofz -l3 30 841 109 45.96% -21.18% 4.8 s 14.00 0.81 s 83
rofz -l4 30 841 056 45.96% -21.18% 4.8 s 14.00 0.81 s 83
rofz -l5 30 841 056 45.96% -21.18% 4.8 s 13.94 0.78 s 86
rofz -l6 30 839 955 45.96% -21.18% 7.0 s 9.55 0.82 s 82
rofz -l7 30 840 239 45.96% -21.18% 7.1 s 9.43 0.84 s 80
rofz -l8 30 840 254 45.96% -21.18% 7.1 s 9.45 0.80 s 84

ADPCM audio (IMA / MS ADPCM WAV, a sound bank): 40 372 544 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 26 204 819 64.91% - 35.3 s 1.14 1.02 s 40
TARZ (best) 26 118 840 64.69% -0.33% 174.8 s 0.23 1.25 s 32
rofz -l1 23 958 945 59.34% -8.57% 9.2 s 4.37 0.97 s 42
rofz -l2 23 948 182 59.32% -8.61% 9.7 s 4.15 0.88 s 46
rofz -l3 23 931 477 59.28% -8.68% 11.1 s 3.62 0.90 s 45
rofz -l4 23 917 509 59.24% -8.73% 11.9 s 3.40 0.91 s 45
rofz -l5 22 963 036 56.88% -12.37% 11.5 s 3.51 1.94 s 21
rofz -l6 22 911 886 56.75% -12.57% 13.6 s 2.96 1.95 s 21
rofz -l7 22 911 089 56.75% -12.57% 14.3 s 2.82 1.98 s 20
rofz -l8 22 910 458 56.75% -12.57% 15.8 s 2.55 1.96 s 21

console audio and textures (PS1 CD-XA, PS2 VAG / SS2 / ADS / WAC, Nintendo DSP-ADPCM, CRI ADX, Xbox ADPCM, PS3 textures): 104 242 992 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 60 565 348 58.10% - 80.6 s 1.29 2.30 s 45
TARZ (best) 59 907 663 57.47% -1.09% 194.5 s 0.54 3.38 s 31
rofz -l1 59 215 131 56.80% -2.23% 21.8 s 4.77 2.59 s 40
rofz -l2 59 008 629 56.61% -2.57% 25.1 s 4.15 2.57 s 41
rofz -l3 58 734 825 56.34% -3.02% 28.6 s 3.65 2.93 s 36
rofz -l4 58 495 658 56.11% -3.42% 31.7 s 3.29 3.22 s 32
rofz -l5 57 907 304 55.55% -4.39% 33.4 s 3.12 5.17 s 20
rofz -l6 55 364 109 53.11% -8.59% 40.5 s 2.57 5.43 s 19
rofz -l7 55 355 277 53.10% -8.60% 45.0 s 2.32 5.64 s 18
rofz -l8 55 352 746 53.10% -8.61% 53.6 s 1.95 5.70 s 18

textures (DDS / BC1-BC7 / VTF / IWI / XBM): 150 994 944 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 65 330 035 43.27% - 156.3 s 0.97 3.64 s 41
TARZ (best) 65 011 249 43.06% -0.49% 285.7 s 0.53 6.87 s 22
rofz -l1 65 231 996 43.20% -0.15% 35.3 s 4.28 4.93 s 31
rofz -l2 64 817 586 42.93% -0.78% 42.8 s 3.53 4.83 s 31
rofz -l3 64 330 841 42.60% -1.53% 58.5 s 2.58 5.26 s 29
rofz -l4 61 822 494 40.94% -5.37% 60.1 s 2.51 7.24 s 21
rofz -l5 61 531 207 40.75% -5.81% 58.2 s 2.59 8.29 s 18
rofz -l6 61 083 986 40.45% -6.50% 86.0 s 1.76 8.64 s 17
rofz -l7 61 022 788 40.41% -6.59% 104.2 s 1.45 8.88 s 17
rofz -l8 60 996 789 40.40% -6.63% 128.9 s 1.17 8.82 s 17

raw images (BMP / TGA / RAW / TIF): 83 886 080 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 21 323 178 25.42% - 78.9 s 1.06 1.60 s 52
TARZ (best) 20 755 681 24.74% -2.66% 437.9 s 0.19 2.56 s 33
rofz -l1 21 190 058 25.26% -0.62% 16.6 s 5.05 0.88 s 95
rofz -l2 21 159 023 25.22% -0.77% 18.6 s 4.52 0.86 s 97
rofz -l3 20 537 604 24.48% -3.68% 23.4 s 3.59 1.41 s 59
rofz -l4 20 500 695 24.44% -3.86% 26.2 s 3.20 1.44 s 58
rofz -l5 19 944 470 23.78% -6.47% 34.3 s 2.45 3.41 s 25
rofz -l6 19 744 251 23.54% -7.40% 45.8 s 1.83 3.58 s 23
rofz -l7 19 713 816 23.50% -7.55% 62.9 s 1.33 3.56 s 24
rofz -l8 19 682 941 23.46% -7.69% 85.3 s 0.98 3.50 s 24

text, structures, executables, meshes, maps: 266 556 789 B input
compressor output (B) ratio vs LOLZ compression MB/s decompression MB/s
LOLZ ULTRA 95 836 113 35.95% - 267.1 s 1.00 3.27 s 82
TARZ (best) 95 749 915 35.92% -0.09% 1301.8 s 0.20 4.68 s 57
rofz -l1 103 234 022 38.73% +7.72% 43.4 s 6.14 2.28 s 117
rofz -l2 102 172 015 38.33% +6.61% 65.4 s 4.08 2.41 s 110
rofz -l3 99 774 966 37.43% +4.11% 113.3 s 2.35 5.06 s 53
rofz -l4 99 244 592 37.23% +3.56% 146.2 s 1.82 4.96 s 54
rofz -l5 99 190 908 37.21% +3.50% 146.6 s 1.82 5.43 s 49
rofz -l6 93 885 501 35.22% -2.04% 274.1 s 0.97 8.85 s 30
rofz -l7 93 312 314 35.01% -2.63% 399.0 s 0.67 9.08 s 29
rofz -l8 93 085 577 34.92% -2.87% 647.3 s 0.41 9.18 s 29

FitGirl
23-11-2026, 17:15
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

FitGirl
23-11-2026, 17:41
Also, about AVX2 requirement. This heavily stops the tool from adoption. You train models for old-gen consoles, but doesn't allow PC which could easily run those games on emulators from installing games compressed with ROFZ. Actually, I don't know a single popular compressor which would not work w/o AVX2. You might ask your AI to port the sourcebase to C and compile it there w/o AVX2 req and see how it performs.

sajmon83
24-11-2026, 08:16
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
ROFZ codes BC textures with a context-mixing model, not with LZ. The decoder runs the same model as the encoder for every byte, so one thread decodes texture data at a few MB/s, while an LZ decoder like LOLZ mostly copies matches. I’m working on changing this approach.

Your result is the part I would like to look into. My guess is that most of the textures were not recognised (console tiling, no headers) and went to LZ or to the wrong model. A 100–200 MB cut of the .decompressed file (before srep) would help even more.

Also, about AVX2 requirement. This heavily stops the tool from adoption. You train models for old-gen consoles, but doesn't allow PC which could easily run those games on emulators from installing games compressed with ROFZ. Actually, I don't know a single popular compressor which would not work w/o AVX2. You might ask your AI to port the sourcebase to C and compile it there w/o AVX2 req and see how it performs.

Fair point. The arithmetic is integer-only and every AVX2 path has a plain fallback, so no C port is needed.
build compression decompression
(AVX2) 100% 100%
(SSE4.2) +13% +7%
(SSE2, any) +19% +14%
The next package will have both: rofz.exe (AVX2) and rofz_x64.exe (any x86-64 CPU).

FitGirl
24-11-2026, 08:36
Good news about two versions.
I've also PMed you with a link to the sample.

Joe Forster/STA
24-11-2026, 11:27
The next package will have both: rofz.exe (AVX2) and rofz_x64.exe (any x86-64 CPU).

That would be a bit confusing as both executables are for the x64 platform. I suggest naming the non-AVX2 version rofz_noavx2.exe or - according to the actual CPU requirements - rofz_avx[1].exe, rofz_sse.exe or something like that.

sajmon83
24-11-2026, 16:40
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:

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. No point in messing around with a "monkey stream" :P

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.

kj911
25-11-2026, 07:36
Thanks from newer EXE's. I need fine tuning from Rust compiler. Not working from Win7!

Masquerade
25-11-2026, 09:28
Not to derail the topic, but I thought it may be useful to tag on this tidbit regarding BC# and BCPack
https://encode.su/threads/3562-BCPack-texture-compression-%E2%80%93-details?p=68573&viewfull=1#post68573