nx_deflate_enc.nx
buildroot/runtime/nx_deflate_enc.nx
about
nx_deflate_enc.nx -- SOVEREIGN DEFLATE (RFC 1951) COMPRESSOR: LZ77 + FIXED Huffman (BTYPE=01). Pure integer,
no zlib. The COUNTERPART to nx_deflate.nx (which only inflates). Turns our uncompressed PNGs (590KB/frame
raw) into real compressed ones so renders ship full-resolution. LZ77 hashes 3 bytes -> most-recent position
(single candidate, extends fully -> zero/near-repeat runs after PNG filtering compress well = RLE-class +
literal-repeat). Bit packing per spec: data elements LSB-first, Huffman codes MSB-first (bit-reversed).
Verified round-trip against nx_deflate's inflate. license_tier: ORIGINAL
dependencies 1 imports · 4 importers
imports: nx_syscalls.nx
imported by: nx_apng.nxnx_deflate_enc_gate.nxnx_png.nxnx_sovgit_obj.nx
structs
| none |
consts
| 8 | const DFE_MAGIC_1025: i64 = 1025 |
| 9 | const DFE_MAGIC_1537: i64 = 1537 |
| 10 | const DFE_MAGIC_2049: i64 = 2049 |
| 11 | const DFE_MAGIC_3073: i64 = 3073 |
| 12 | const DFE_MAGIC_4097: i64 = 4097 |
| 13 | const DFE_MAGIC_6145: i64 = 6145 |
| 14 | const DFE_MAGIC_8193: i64 = 8193 |
| 15 | const DFE_MAGIC_12289: i64 = 12289 |
| 16 | const DFE_MAGIC_16385: i64 = 16385 |
| 17 | const DFE_MAGIC_24577: i64 = 24577 |
| 19 | const DFE_HSIZE: i64 = 32768 |
| 20 | const DFE_WINDOW: i64 = 32768 |
| 21 | const DFE_MINMATCH: i64 = 3 |
| 22 | const DFE_MAXMATCH: i64 = 258 |
functions
| 25 | func dfe_bits(out: *u8, st: *i64, val: i64, n: i64) -> i64 |
| 37 | func dfe_rev(code: i64, n: i64) -> i64 |
| 44 | func dfe_sym(out: *u8, st: *i64, s: i64) -> i64 |
| 51 | func dfe_hash(src: *u8, p: i64) -> i64 called by 1: dfe_deflate |
| 54 | func dfe_matchlen(src: *u8, a: i64, b: i64, slen: i64) -> i64 called by 1: dfe_deflate |
| 68 | func dfe_deflate(src: *u8, slen: i64, out: *u8, head: *i64, lbase: *i64, lext: *i64, dbase: *i64, dext: *i64) -> i64 |
| 116 | func dfe_fill_tables(lbase: *i64, lext: *i64, dbase: *i64, dext: *i64) -> i64 called by 1: dfe_compress |
| 141 | func dfe_compress(src: *u8, slen: i64, out: *u8) -> i64 |