Compression of ASCII strings in C

前端 未结 6 1588
梦如初夏
梦如初夏 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:49

    I am not sure that the zlib or LZW compression approaches will work well in the case of individually compressing short strings of less than 250 bytes. Both typically require creating a fairly sizable dictionary before significant compression gains are seen.

    Perhaps simple Huffman coding with a fixed encoding tree, or one shared between all instances of the strings? Also, have you seen the ZSCII encoding used to compress short strings on memory constrained microcomputers in the 80s?

    link text

提交回复
热议问题