Compression of ASCII strings in C

前端 未结 6 1566
梦如初夏
梦如初夏 2021-01-02 03:55

I have some C code that stores ASCII strings in memory as a four byte length followed by the string. The string lengths are in the range 10-250 bytes.

To reduce occ

6条回答
  •  無奈伤痛
    2021-01-02 04:53

    Why use a 4 byte length when strings are 10-250 bytes long, use a 1 byte length that will save you 3 bytes per string alone.

    Is the data textual only ie 0-9 A-z or some sub set?? if so re-encode it to use that subset and save a few bits per character.

    Now have a look at http://gnosis.cx/publish/programming/compression_primer.html in the Huffman encoding section and lempel-zev section.

    That should get you started.

提交回复
热议问题