Results 1 to 3 of 3

Thread: Compression of array of chars

  1. #1
    Member
    Join Date
    May 2012
    Location
    Hong kong
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Compression of array of chars

    Hi All,

    For my job's project I'm looking for efficient LOSSLESS compression algorithm .
    So what I have and what I need:

    data array containing chars ( numbers from 30 to 122) .A lot of patterns! Array's size is constant (and big, about 12800000 chars).
    Memory usage is not very important.

    Need something fast and efficient. Better if only one run over the array.
    Now I use something very simple,like:
    1.Run over the array.
    2.If char returns more than 3 times, write to new array 0(as flag) X (char) N (number of times it returns)
    3 if 2 or less, just write char's value.

    It work fine, but I need to improve it (better compression and speed)

    I'll be glad to get your suggestions!

    Thanks a lot,

    Garry

  2. #2
    Programmer Bulat Ziganshin's Avatar
    Join Date
    Mar 2007
    Location
    Uzbekistan
    Posts
    4,497
    Thanks
    733
    Thanked 659 Times in 354 Posts
    bsclib, ppmd, zlib, lz4, lzma. i suggest you to try with external programs first in order to decide what library is best for you in terms of speed/compression ratio

  3. #3
    Expert
    Matt Mahoney's Avatar
    Join Date
    May 2008
    Location
    Melbourne, Florida, USA
    Posts
    3,255
    Thanks
    306
    Thanked 778 Times in 485 Posts
    And also libzpaq. Test with zpaq -m3 and -m4 first. These are the mid and max (level 2 and 3) in libzpaq.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •