FreeArc/Sections External compressor

From HaskellWiki
Jump to navigation Jump to search

config file arc.ini ...

Sections [External compressor]

These sections are used to describe the compression algorithms and preprocessing using external programs, such as PAQ and CCM. Examples of these sections:

[External compressor:precomp] 
mem = 2 
packcmd = precomp -o$$arcpackedfile$$.tmp $$arcdatafile$$.tmp 
unpackcmd = precomp -o$$arcdatafile$$.tmp -r $$arcpackedfile$$.tmp 
[External compressor:jpg] 
mem = 10 
packcmd = packjpg $$arcdatafile$$.jpg 
unpackcmd = packjpg $$arcdatafile$$.pjg 
datafile = $$arcdatafile$$.jpg 
packedfile = $$arcdatafile$$.pjg 

The title of the section after ':' sets new algorithm name. packcmd and unpackcmd describe the commands for packing and unpacking, respectively. packedfile and datafile - the names of packed and unpacked files, respectively, which are used by both commands; default is $$arcpackedfile$$.tmp and $$arcdatafile$$.tmp. cmem and dmem describe the amount of memory used in packing and unpacking (if they are the same, you can set both sizes using mem).

You can describe several versions / variations of one program, if they have the same call format:

[External compressor:ccm123,ccmx123,ccm125,ccmx125] 
mem = 276 
packcmd = {compressor} c 4 $$arcdatafile$$.tmp $$arcpackedfile$$.tmp 
unpackcmd = {compressor} d $$arcpackedfile$$.tmp $$arcdatafile$$.tmp

In this line {compressor} in the description replaced by the compression method name, that is equivalent to following description:

[External compressor:ccm123] 
mem = 276 
packcmd = ccm123 c 4 $$arcdatafile$$.tmp $$arcpackedfile$$.tmp 
unpackcmd = ccm123 d $$arcpackedfile$$.tmp $$arcdatafile$$.tmp 
  
[External compressor:ccmx123] 
mem = 276 
packcmd = ccmx123 c 4 $$arcdatafile$$.tmp $$arcpackedfile$$.tmp 
unpackcmd = ccmx123 d $$arcpackedfile$$.tmp $$arcdatafile$$.tmp 
… 

When using compressors, whose packed data format varies from version to version (as the CCM), it's recommended to rename executables according to version number (ccm123.exe, ccmx125.exe…) and describe them in arc.ini in the same way as above. Then add in the section [Compression methods] alias on the latest version of:

[Compression methods] 
ccm = ccm125 
ccmx = ccmx125 

Example of the above algorithms to determine a new method of compression in arc.ini:

[Compression methods] 
super = precomp+ccm/$jpg=jpg 

Now use the option -m=super and voila!

In file arc.ini in the program package you can find other examples describing external compressors and using them to improve compression modes -m#p/-max.