Download Latest Version staciccomp-src.zip (41.0 kB)
Email in envelope

Get an email when there's a new version of staticcomp

Home / src
Name Modified Size InfoDownloads / Week
Parent folder
staciccomp-src.zip 2012-05-17 41.0 kB
Totals: 1 Item   41.0 kB 0
Staticcomp - program using library libsc for data compression
================================================================================

About:
Staticcomp is a file archiver based on Burrows-Wheeler transform.

Author:
Tomas Benek, prvni_b_ben@centrum.cz

Usage:
Posible parameters:
staticcomp [-c  -g<1-6> -b<1-6>] <filename>      - compression
staticcomp [-d] <filename>                       - decompression

Parameters description:
-h              - Shows help.
-g<1-6>         - Method of GST stage. Used only for compression and it is required.
-b<1-6>         - Size of loaded data block for BWT stage. Used only for compression and it is not required.
-c              - Compression of chosen file. After this filename suffix .sc is appended.
-d              - Decompression of chosen file. 

Sizes of block for parameter -b:
1 - 1 kB
2 - 10 kB
3 - 100 kB
4 - 500 kB, default value
5 - 2000 kB
6 - 10000 kB

GST methods for parameter -g:
1 - MTF
2 - MTF-1
3 - MTF-2
4 - Timestamp(0)
5 - IFC
6 - WFC

Examples of running program:
Compression of file "input" with default block size and method MTF:
staticcomp -c -g1 INPUT
Compression of file "input" with block size 100 kB and method WFC:
staticcomp -c -g6 -b3 INPUT
Decompression of file "input.sc":
staticcomp -d INPUT.sc


Working with filenames:
When compressing file suffix .sc is appended after filename (e.g. input => input.sc).
When decompressing file, there are two possibilities:
File contains suffix .sc, which is deleted (e.g. input.sc => input).
File doesn't contain suffix .sc, suffix .out is appended (e.g. input => input.out).                    

Format of compressed file header:
*************************************************
*  2*(unsigned char)      "SC"                *** 
*************************************************
* (Unsigned char)         GST Method(1-6)     ***
*************************************************
Compressed file starts with two-char string "SC" followed by one-char number indicating which
GST method was used for compression.

Format of compressed block of data:
*************************************************
* (Unsigned int)     block size               *** 
*************************************************
* (Unsigned int)    index of original string  ***
*************************************************
*                     DATA                    ***
*************************************************
First size of saved data block is saved, then goes index of original string for backward transform
and after it there are compressed data.

Program state and error codes:
Nazev       Hodnota  Popis
EOK         0        OK
EFREAD      1        Cannot open input file
EFWRITE     2        Cannot open output file
EMEMORY     3        Memory allocation error
ECLWRONG    4        Wrong commandline parameters
EBADGST     5        Wrong GST method
EBADFORMAT  6        Wrong file format, probably file is not compressed by staticcomp
EUNKNOWN    7        Unknown error

Files list:
aritm.cpp        - Arithmetic coder
aritm.hpp        
bwt.cpp          - Burrows-Wheeler transform
bwt.hpp          
fc.cpp           - WFC and IFC tranform
fc.hpp          
gst.cpp          - GST tranform, choses method according to parameter
gst.hpp     
libsc.cpp        - Libsc library file for file compression/decompression
libsc.hpp   
main.cpp         - Main function of program
main.hpp    
mtf.cpp          - MTF transform
mtf.hpp          
realloc.cpp      - Functions for memory reallocation for strings
realloc.hpp     
rle.cpp          - RLE 
rle.hpp        
timestamp.cpp    - Timestamp(0) transform
timestamp.hpp    
Makefile         - Makefile for program compliation
Source: Readme, updated 2013-08-23