GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2016-03-23 22:51:30

Juju
Member
Registered: 2015-10-01
Posts: 45

Bitbashing and Lempel–Ziv–Welch Compression

Time for something a bit bigger...

.gml file in plaintext
Dropbox mirror of .gml file

Expandscr_juju_bits_write_start( buffer )
scr_juju_bits_write( buffer, value, bits )
scr_juju_bits_write_end( buffer )

scr_juju_bits_read_start ( buffer )
scr_juju_bits_read( buffer, bits )
scr_juju_bits_read_end( buffer )

scr_juju_bits_peek( buffer, offset, bits )

scr_juju_bits_lzw_encode( buffer, bits )
scr_juju_bits_lzw_decode( buffer, bits )

LZW is used in GIF encoding, amongst other things. Whilst newer compression techniques have largely supplanted LZW, it's still used because of its flexibility. English text can typically be reduced to around half its size. These scripts work best in YYC. A 1mb file can be encoded in about a second, decoding is slower and takes about 1.5 seconds.

Last edited by Juju (2016-03-24 18:03:41)

Offline

#2 2016-03-24 03:30:54

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: Bitbashing and Lempel–Ziv–Welch Compression

This looks very, very interesting but ... um ... incomplete? I see some bit bashing but none of the scripts you listed (or perhaps a couple of them with slightly different names).


Abusing forum power since 1986.

Offline

#3 2016-03-24 06:23:30

Juju
Member
Registered: 2015-10-01
Posts: 45

Re: Bitbashing and Lempel–Ziv–Welch Compression

Oh balls, uploaded (and copy-pasted) the wrong file. Take two!

Offline

Board footer

Powered by FluxBB