ltgcgo / incubator

🥚 Where ideas come to life.
Creative Commons Attribution Share Alike 4.0 International
0 stars 0 forks source link

Brandy Breeze - Bzip respin #7

Open PoneyClairDeLune opened 2 months ago

PoneyClairDeLune commented 2 months ago

Brandy Breeze: 🍾 General-purpose compression algorithm.

Built on top of RLE, BWT, MTF(?) and LZ77/LZSS. Aims at offering a balance between Brotli's speed and XZ's efficiency.

Because bzip3 (.bz3) is already used as a name by others, the extension would probably be .brz. The stream format would be backwards compatible with bzip2, but either cannot compress or decompress the other.

General design:

  1. Run-length encode. (?)
  2. Burrows-Wheeler transform.
  3. Move-to-front transform. (?)
  4. Run-length encode. (?)
  5. LZ77/LZSS encode. If with LZSS, store 1-bit flags in KORG-like little-endian fashion.
PoneyClairDeLune commented 2 months ago

Current working draft: https://github.com/PoneyClairDeLune/brandy-breeze-js

PoneyClairDeLune commented 2 months ago
.magic:16                       = 'BZ' signature/magic number
.version:8                      = 'r' for Brandy Breeze
.hundred_k_blocksize:8          = '1'..'9' block-size 100 kB-900 kB (uncompressed)

.compressed_magic:32            = 'BZrd' for Brandy Breeze chunk data packet
.crc:32                         = checksum for this block (BE)
.size:24                        = size of this block (VLV 21-bit, BE)
.origPtr:24                     = start pointer into BWT for before untransform (VLV 21-bit, BE)

.eos_magic:32                   = 'BZre' for Brandy Breeze end of stream
.crc:32                         = checksum for whole stream

(Unfinished)