Product | PowerArc 1.1 from 10 Aug 2000 |
Description | High efficient Data Compression Library for use with Delphi, C++ or VB. |
Author | Copyright (c) 1998-2000, SoftLab Web: http://softlab.od.ua Email: support@softlab.od.ua |
Status | Shareware without source $30. Online registration is available. |
Limitation | work only in IDE |
SOFTLAB EVALUATION LICENSE AGREEMENT 1.GRANT OF LICENSE.
2. WARRANTY AND LIMITATION OF LIABILITY.
|
PowerArc is the high efficient Data Compression Library for use with Delphi, C++ or VB. The library supports some algorithms of compression, both widespread, and specialized. All algorithms are contain built in data integrity check and thread-safe (can be work in multithread application). In the following table briefly we shall describe them.
Method
|
Description
|
Rank | Some idea of this algorithm describe in article Peter Fenwick "Symbol Ranking Text Compression with Shannon Recodings". At small compression the very fast and effective implementation is possible. |
ZIP | standart pkware zip compression algorithm. |
BZIP | Modern algorithm of the compressions which have appeared rather recently. Is based on Burrows-Wheeler transform. Example of the archiver operating this algorithm is bzip2. |
PPM | The similar method was applied in the archiver HA (Harri Hirvola). Allows
to reach a maximum degree of compression at the expense of a heavy expense
of memory and lowering of speed of operation. Ideally approaches for compression
of the text information. More detail about this algorithm you can find in article Mark Nelson "Arithmetic Coding + Statistical Modeling = Data Compression" Dr. Dobb's Journal February, 1991 |
Each algorithm is realized as the separate DLL-unit and has the unitized interface:
const
PowerArcModuleSignature = 'AA6F3C60-37D7-11D4-B4BF-D80DBEC04C01';
type
TPowerArcModuleInfo = packed record
Signature: PChar; // must be eq to PowerArcModuleSignature
Name: PChar; // module name
Description: PChar; // full module description
Options: PChar; // options list delimited with #0
DefaultBPC: integer; // bit per char on calgary corpus *100
MaxBPC: integer;
case integer of // unique module ID
0: ( ModuleID: packed array[0..7] of Char );
1: ( ModuleIDW: packed array[0..1] of integer );
end;
PPowerArcModuleInfo = ^TPowerArcModuleInfo;
TReadFunc = function (Data: Pointer; var Buffer; Size: integer): integer; stdcall;
TWriteFunc = function (Data: Pointer; const Buffer; Size: integer): integer; stdcall;{ set default compression options }
procedure SetOptions(Opt: PChar); stdcall;
{ compress stream }
procedure Compress(Data: Pointer; Opt: PChar; ReadFunc: TReadFunc; WriteFunc: TWriteFunc); stdcall;
{ compress memory buffer }
procedure CompressMem(Data: Pointer; Opt: PChar; Mem: Pointer; MemSize: integer; WriteFunc: TWriteFunc); stdcall;
{ decompress stream }
function Decompress(Data: Pointer; ReadFunc: TReadFunc; WriteFunc: TWriteFunc): Boolean; stdcall;
{ get module information }
function GetPowerArcModuleInfo: PPowerArcModuleInfo; stdcall;
On the following to a graphics the comparative outcomes of operation of different algorithms on Calgary Text Corpus are exhibited (click on image for more detail).
The same outcomes are indicated in the following table (cases of best compression and best speed are selected):
Rank | ZIP | BZIP | PPM | ||||||||
Opt | bits char |
MByte sec |
Opt | bits char |
MByte sec |
Opt | bits char |
MByte sec |
Opt | bits char |
MByte sec |
1 | 3,818 |
1,337 |
1 | 3,027 |
0,507 |
1 | 2,301 |
0,187 |
2 2 | 2,560 |
0,301 |
2 | 3,780 | 1,271 | 2 | 2,914 | 0,464 | 2 | 2,211 | 0,187 | 3 3 | 2,148 | 0,250 |
3 | 3,635 | 1,292 | 3 | 2,817 | 0,371 | 3 | 2,171 | 0,183 | 4 4* | 1,976 | 0,214 |
4* | 3,523 | 1,246 | 4 | 2,716 | 0,345 | 4 | 2,134 | 0,180 | 6 5 | 1,921 | 0,181 |
5 | 3,394 | 1,218 | 5 | 2,637 | 0,252 | 5* | 2,131 | 0,179 | 8 6 | 1,906 | 0,158 |
6 | 3,321 | 1,167 | 6* | 2,600 | 0,179 | 6 | 2,119 | 0,177 | 16 7 | 1,902 | 0,131 |
7 | 3,266 | 1,020 | 7 | 2,592 | 0,155 | 7 | 2,105 | 0,178 | 32 8 | 1,900 | 0,121 |
8 | 3,263 | 0,909 | 8 | 2,583 | 0,121 | 8 | 2,090 | 0,175 | |||
9 | 2,581 | 0,093 | 9 | 2,090 | 0,175 |
For compare with existing archiver note that PKWARE PKZIP 2.5 this file set compress with 2.6 bits per char.
The next table describing options for each algorithm
Method
|
Valid Options
|
Rank | 1..8. set compression level |
ZIP | 1..9. set compression level |
BZIP | 1..9. set parameter "block size" as *100 Kbyte |
PPM | M O, where M is the memory limith in Mbyte and O is the prediction order (delimited with space) |
For more convenient operation you can use the stream interface (for more detail see PowerArc.pas)
type
TPowerArcCompressStream = class(TStream)
public
constructor Create(BaseStream: TStream; FArcIdx: integer;
const FArcOpt: string = '');
destructor Destroy; override;
end;TPowerArcDecompressStream = class(TStream)
public
constructor Create(BaseStream: TStream);
destructor Destroy; override;
end;
Copyright © 2000, SoftLab