Results 1 to 5 of 5

Thread: Faster bmp.cfg for zpaq

  1. #1
    Member Karhunen's Avatar
    Join Date
    Dec 2011
    Location
    USA
    Posts
    91
    Thanks
    2
    Thanked 1 Time in 1 Post

    Faster bmp.cfg for zpaq

    I removed some models from the comp section in bmp_j4.cfg, and attach the file here for your consideration. My goal was faster compression for "hi color" images
    i.e. 24-bit bitmaps that have 64k or fewer colors. Speed is about 2x faster on my Win32 machine sacrificing about 20% greater file size. Roughly filesize ends up
    between the lpaq and paq8 compressors.
    Since I barely understand the ZPAQL syntax I am sure there must be some redundacies left in the cfg file. Constructive comments welcome.
    Attached Files Attached Files

  2. The Following User Says Thank You to Karhunen For This Useful Post:

    Matt Mahoney (20th July 2015)

  3. #2
    Expert
    Matt Mahoney's Avatar
    Join Date
    May 2008
    Location
    Melbourne, Florida, USA
    Posts
    3,255
    Thanks
    306
    Thanked 778 Times in 485 Posts
    Thanks. Quick test with maxcomp/rafale.bmp. Compression times are on a 2.0 GHz T3200 (32 bit Windows) using zpaq -m1 ... -m5 and zpaqd.

    1,418,810 m1.zpaq 0.7s
    1,282,590 m2.zpaq 1.7s
    766,644 m3.zpaq 3.1s
    740,732 m4.zpaq 8.6s
    704,757 m5.zpaq 33.4s
    616,762 bmp_k0.zpaq 15.1s
    522,053 bmp_j4.zpaq 30.4s

  4. #3
    Member Karhunen's Avatar
    Join Date
    Dec 2011
    Location
    USA
    Posts
    91
    Thanks
    2
    Thanked 1 Time in 1 Post
    I bundled up some more experiments plus a test image that was rendered, and clearly public domain. Although I cannot explain how they work, the hierarchy of compression is
    bmp_k0.........bmp_k9.cfg, highest to lowest and therefore slowest to fastest. All of these are modifications of bmp_j4.cfg and are useful to me for less memory per thread and
    decompression times. Best performance seems to be on images with 8k <= x <= 256k colors in a 24 bit bmp file.
    Attached Files Attached Files

  5. #4
    Programmer Jan Ondrus's Avatar
    Join Date
    Sep 2008
    Location
    Rychnov nad Kněžnou, Czech Republic
    Posts
    278
    Thanks
    33
    Thanked 137 Times in 49 Posts
    Quote Originally Posted by Karhunen View Post
    Constructive comments welcome.
    Try shufflling these lines - each line prepares context for individual model with help of r1 to r18 variables prepared above:
    Code:
      d++
      a=r 3 b=r 4 a-=b b=r 2 a+=b hashd d++
      a=r 2 b=r 3 a-=b b=r 5 a+=b hashd d++
      a=r 2 a*= 2 b=r 12 a-=b hashd d++
      a=r 3 a*= 2 b=r 13 a-=b hashd d++
      a=r 4 a*= 2 b=r 16 a-=b hashd d++
      a=r 5 a*= 2 b=r 14 a-=b hashd d++
      a=r 9 b=r 18 a-=b b=r 5 a+=b hashd d++
      a=r 3 b=r 15 a-=b b=r 5 a+=b hashd d++
      a= 24 a*= 16 b=a a=r 8 a<<= 1 a&=b b=a a=r 6 a>>= 1 a|=b hashd d++
    
      b=r 11 a=r 9 a-=b b=r 2 a+=b hashd d++
      b=r 17 a=r 9 a-=b b=r 3 a+=b hashd d++
      a=r 2 hashd b=r 11 a=r 9 a-=b hashd d++
      a=r 9 hashd a=r 10 hashd d++
      a=r 3 hashd b=r 17 a=r 9 a-=b hashd d++
      b=r 2 a=r 3 a+=b a>>= 3 hashd a=r 9 a>>= 4 hashd a=r 10 a>>= 4 hashd d++
      a=r 6 hashd a=r 8 a>>= 4 hashd d++
      a=r 2 hashd a=r 9 hashd a=r 10 hashd d++
      a=r 3 hashd d++
      a=r 3 hashd a=r 9 hashd a=r 10 hashd d++
      a=r 2 hashd d++
      a=r 2 hashd a=r 9 hashd d++
      a=r 3 hashd a=r 9 hashd d++
    for example:

    line:
    Code:
      a=r 3 a*= 2 b=r 13 a-=b hashd d++
    means
    Take variable r3, multiply it by 2 and subtract r13 from it (r3*2-r13). Use result as part of context for that model.
    Last edited by Jan Ondrus; 28th July 2015 at 09:17. Reason: added example

  6. The Following User Says Thank You to Jan Ondrus For This Useful Post:

    Karhunen (30th July 2015)

  7. #5
    Member Karhunen's Avatar
    Join Date
    Dec 2011
    Location
    USA
    Posts
    91
    Thanks
    2
    Thanked 1 Time in 1 Post
    ( zpaq 3.00+ config file for generic files version 11 {B} )
    ( Karhunen changed some models from -m 6 comp and hcomp from mid.cfg )
    ( comp isse chain decreased for speed. n=21 to n=13 result. )
    ( Approximately ln($1+2)*15 + 2^($1+2) MiB per thread required )

    comp 7 6 0 0 13 (hh hm ph pm n) ( hh array -> 7 and hm -> 6 also reduced )
    0 icm $1+10
    1 cm $1+18 255
    2 isse $1+14 1
    3 isse 16 2
    4 isse $1+13 3
    5 isse $1+12 4
    6 sse $1+13 3 32 255
    7 match $1+16 $1+17
    8 mix 12 0 7 8 255
    9 mix 14 0 8 12 255
    10 mix2 14 8 9 16 255
    11 sse 14 1 64 255
    12 mix2 10 10 11 32 255

    hcomp
    c++ *c=a b=c a=0 (save in rotating buffer M)
    d= 1 hash *d=a
    b-- d++ hash *d=a
    b-- d++ hash *d=a
    b-- d++ hash *d=a
    b-- d++ hash *d=a
    b-- d++ hash b-- hash *d=a
    d++ a=*c a<<= 8 *d=a
    halt
    end

Similar Threads

  1. LzTurbo: The fastest now more faster
    By dnd in forum Data Compression
    Replies: 33
    Last Post: 24th September 2017, 18:09
  2. How to make umac even faster
    By calthax in forum Data Compression
    Replies: 2
    Last Post: 26th March 2015, 00:38
  3. Computing the BWTS faster
    By nburns in forum Data Compression
    Replies: 4
    Last Post: 20th July 2013, 20:17
  4. GCC 4.6 faster than previous GCC, faster than LLVM
    By willvarfar in forum The Off-Topic Lounge
    Replies: 2
    Last Post: 15th November 2010, 16:09
  5. Faster PAQ7/8
    By LovePimple in forum Forum Archive
    Replies: 6
    Last Post: 8th February 2007, 14:04

Posting Permissions

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