Вы находитесь на странице: 1из 7

PreComp utility Current version: Precomp v0.4, lprepaq v1.

3, paq8o8pre v2
(21.03.2009)
Download - Changes - Results - FAQ - Contact
Wat is Precomp!
Precomp is a command line precompressor. You can use it to achieve better compression
on some filetpes !wor"s on files that are compressed with #$ib or the Deflate
compression method% and on &'F files(. Precomp tries to decompress the streams in those
files% and if the can be decompressed and )re)-compressed so that the are bit-to-bit-
identical to the original stream% the decompressed stream can be used instead of the
compressed one.
*he result is a .pcf file !PCF + PreCompressedFile( that contains more decompressed
data than the original file. ,ote that this file is lar"er than the original file% but if ou
compress it with a compression method stronger than Deflate% the compression is better
than before !or use lprepa- to get it precompressed and compressed in one step(.
Wat is Precomp Com#ort!
Precomp Comfort is a variation of Precomp. 't supports drag and drop of single files and
uses an ',' file for the parameters.
't is included in the .'P file. Precomp.e/e is the original version% Precomf.e/e is the
Comfort version.
Wat is lprepaq!
lprepa- combines lpa-0 b 1att 1ahone and Precomp. 't first precompresses the input
file% then compresses it using the powerful PAQ compression method. lprepa- is a
complete compressor2decompressor% so use this if ou 3ust want to compress our files.
Wat is prepaq!
prepa- v4 !a"a pa-5o5pre v4( b 6an 7ndrus combines pa-5o5 b 1att 1ahone and
Precomp. 't first precompresses the input file% then compresses it using the powerful PAQ
compression method. 6ust li"e lprepa-% prepa- is a complete compressor2decompressor%
but is it much slower than lprepa- and compression is better.
$ilet%pes
8ere is a list of filetpes that can eventuall achieve better compression with Precomp
and how ou can chec" if the can.
,ote that this list is not complete% and that other filetpes can contain Deflate or #$ib
streams% too% but ou should use the slow mode parameter !-slow( for them.
PDF Adobe9s PDF files often use #$ib compression to compress their documents.
Chec": )FlateDecode) appears in the file.
6P& Precomp uses pac"6P& b 1atthias ;tirner to lossless compress 6P&
images.
16P<& 16P<& is a video format that consists of 6P& images without huffman
tables. Precomp inserts them so that pac"6P& is able to compress the images.
.'P26AR 1ost .'P files use Deflate for compression. 6AR files basicall are .'P
files with an additional manifest for use with 6ava.
P,& P,& uses Deflate to compress its filtered image data.
&'F *he &'F format uses $.= to compress its image data.
&. &.ip files use Deflate for compression.
>.4 b.ip4 is a format often used in $inu/ environments.
;=F 1acromedia9s ;hoc"wave Flash files can use #$ib compression since
?ersion 0.
Chec": First three btes of file are C=; !instead of F=; for uncompressed files(.
1'1< >ase0@ *his encoding is used to attach binar files to e-mails.
;?&. *hese files contain ;?& files compressed with &.ip.
7D* 7pen7ffice Document files consist of #ipped A1$ data.
;'; !slow mode onl( *hese files contain informations about software installation
on ;mbian 7; for mobile phones. *he use #$ib compression.
BD1 !slow mode onl( *his is a file format for BD geometr used b RhinoBD
that contains #$ib streams.
#eno !slow mode onl( .eno is a file format used b the german =i"ipedia D?D.
&o'nloa(
Precomp !and Precomp Comfort( vC.@: precomp.#ip !BD4 E>(
lprepa- vF.B !including source(: lprepa-.#ip !4GD E>(
Note: Perhaps ou9ll be as"ed for 1;?CR5C.D$$. Download it here.
prepa- v4 !a"a pa-5o5pre v4% including source(: pa-5o5pre.#ip !BFF E>(
)l( versions
Precomp is not bac"wards compatible. 'f ou want to recompress some PCF file made
with a different version of Precomp% ou9ll have to download it here:
Precomp vC.B Precomp vC.BF Precomp vC.B4 Precomp vC.BB Precomp vC.B@
Precomp vC.BG Precomp vC.B0 Precomp vC.BH Precomp vC.B5
*o' to use it
Easiest way (lprepaq):
)lprepa- G inputIfilename outputIfilename) to compress a file.
)lprepa- d inputIfilename outputIfilename) to decompress a file.
G selects DD 1> memor. 7ptions range from C !0 1>( to D !FGBD 1>(.
'n general% option , uses B J BK4
,
1>.
Easy way (Precomp Comfort):
Drag and drop a file on precomf.e/e to precompress the file into a .pcf file with the same
name.
*o get bac" the original file% do the same with the .pcf file.
Using the command line: (Precomp)
)precomp inputIfilename) to precompress a file into a .pcf file with the same name
)precomp -rpcfIfilename) to restore the original file !-d is still valid% too(
Errorlevels
For batch 3obs% ou9ll find these errorlevels useful that are returned:
+rror
level
&escription
C ,o error
F ?arious errors !f.e. file access errors(
4 ,othing could be decompressed !PCF output is the same e/cept PCF header(
B Dis" full
@ *emporar file disappeared
G Parameter error: 'gnore position too big
0 Parameter error: 'dentical bte si#e too big
H Parameter error: Recursion level too big
5 Parameter error: Recursion level set more than once
D Parameter error: 1inimal identical bte si#e set more than once
FC Parameter error: Don9t use a space after -o
FF Parameter error: 1ore than one output file
F4 Parameter error: 1ore than one input file
Additional switches: (Precomp / Precomp Comfort)
-oLfilenameM:
;pecifies the output file name. For precompression% default is the original file name with
e/tension .pcf% for )decompression)% it is the original file name. 'f the output file e/ists%
ou will be as"ed if ou want to overwrite it. ,evertheless% ou can specif a different
output file name with this option.
-c and -m: !Comfort: CompressionI$evels% 1emorI$evels(
After precompressing a file with Precomp% it tells ou how to use these both parameters
to speed up the precompression the ne/t time ou precompress tis #ile. *hese are the
compression level and memor settings which are tried on this file. 'f ou would use this
on a different file% it could be that Precomp misses some compressed parts of it.
-t: !Comfort: CompressionI*pes(
<nables or disables detecting of certain compression tpes. For command-line use% there
are two variants:
tJ enables certain tpes and disables the others% while t- disables certain tpes and
enables the others.
Nsing -t-3 for e/ample disables 6P<& recompression and leaves all other tpes as before%
using -tJpf enables onl PDF and &'F precompression% disabling everthing else.
-l: !Comfort: 1a/imalIRecursionI$evel(
;ets the ma/imal recursion level. ;everal streams can contain additional streams inside%
for e/ample .'P or 1'1< >ase0@ streams. *his switch specifies the ma/imal )depth)
where Precomp will loo" for streams. ;etting this to C disables recursion% the default is FC
which should be enough for most filetpes.
-f: !Comfort: FastI1ode(
Fast mode to speed up Precomp. *his uses the first found compression for all streams
instead of tring all 5F combinations when not sure. *his will wor" fine on files that use
onl a few compression methods% but will result in worse compression for files with
man compression methods used. &ood candidates are PDF and .'P26AR2&. files. >ad
candidates are archives containing man files.
'n non-fast mode% there is a message when onl one level combination is used. *his
means that fast mode will do absolutel the same on this file% but faster.
-slow: !Comfort: ;lowI1ode(
;low mode will slow down Precomp much. 't loo"s for raw #$ib headers% and recogni#es
more file formats li"e ;'; and ;=F or special formats used onl for one single program.
8owever% the #$ib header consists of onl 4 btes% so there can be man false-detected
streams that aren9t #$ib streams but are handled li"e them% which results in a slower and
more instable behaviour.
;low mode can be combined with fast mode% but it could happen that a false-detected
stream is the first stream and prevents further real streams to be detected% so combine
them with caution. Nse this mode if ou have files that use #$ib compression but are not
supported !;';% ;=F% game ';7 files...(.
-brute: !Comfort: >ruteI1ode(
>rute mode will slow down Precomp ver% muc. 't assumes that there could be #$ib
streams without headers everwhere. *his even recogni#es most e/otic file formats that
don9t include #$ib headers but will ta"e ver much time !more than a minute even for
filesi#es around FC E>(. 'f ou should have data that has to be processed with this mode%
better tr to add #$ib headers on our own.
>rute mode can be combined with fast mode% but disables slow mode.
-pdfbmpLJ-M: !Comfort: PDFI>1PI1ode(
*his precedes PDF images with a >1P header to improve compression and speed%
especiall for PAQ.
-progonlLJ-M: !Comfort: 6P&IprogressiveIonl(
Recompresses progressive 6P&s onl. Again% this is especiall useful for PAQ which
usuall has a better 6P& compression than pac"6P&% but lac"s progressive 6P& support.
-m3pegLJ-M: !Comfort: 16P<&Irecompression(
<nables 16P<& recompression b inserting huffman tables into the 6P& data.
-v: !Comfort: ?erbose(
?erbose !debug( mode to gain additional information about detected streams and
recompression success2failure. 'f ou want a file with these informations% forward the
output to it% li"e this: )precomp -v inputIfilename O verbose.t/t).
-i: !Comfort: 'gnoreIPositions(
'n verbose mode% ou can see the position of streams in the file. =ith this parameter% ou
can ignore certain streams.
-s: !Comfort: 1inimalI;i#e(
=ith this parameter% ou can choose the minimal si#e of a stream that will be processed.
*he default is @ btes. ;etting it to higher values !around GC-4CC btes( sometimes
improves recompression% especiall in slow or brute mode.
,esults
;ome results to demonstrate the capabilities of Precomp can be found at the Results page.
$uture 'or-
1ultiple file and director support
PDF: Ascii5GDecode support
Precomp &N'
$./
tried to compress a file precompressed with Precomp and it didn!t get smaller"
*here can be two reasons for this: 7ne is that perhaps Precomp can9t find an compressed
streams in the file or the are too small to ma"e an difference. *he other is that the
compressor ou used after precompression is worse than Deflate !or ou didn9t use an(.
s the so#rce code for Precomp availa$le%
,ot et% because it is ver mess at the moment% but it will be.
Are there any &nown $#gs%
*here are some bugs that lead to crashes on ver special corrupt files% but these are ver
unusual. ,evertheless% Precomp is far from being complete% so if ou find a bug% send me
a bug report.
have fo#nd a $#g" 'ow to report it%
;end a mail to )schnaader A* gm/.de)% preferabl with )LPrecompM) in sub3ect !ou can
also use this lin"( with a description of the bug and if ou want !and if it is less than FC
1>(% the file ou wanted to precompress2restore.
(hat is the difference $etween #sing Precomp or )#ltivalent for P*+ files%
*he main difference is that PDF files compressed with 1ultivalent can9t be restored bit-
to-bit-identical because 1ultivalent is a loss compression method !although it is doesn9t
lose the PDF content(. ;o if ou 3ust want to compress PDF files and to have fast access
to them later on% use 1ultivalent. 'f ou want to get them smaller than 1ultivalent !even
in compact mode( does% or want to be sure the file is bit-to-bit-identical with the original
PDF% use Precomp. You can also use Precomp on PDF files compressed with 1ultivalent.
,he precompression for PN-. -+ and /P files is $ad. altho#gh ver$ose mode says they
can $e decompressed completely"
*he decompression of those files is well-defined% but there are man was to recompress
them. <speciall #$ib can be tuned with deflate*une!(% which is not supported b
Precomp because there are simpl too much variations to tr. '9m wor"ing on this% but at
the moment ' can9t sa if ' will succeed.
>ecause of the eas decompression% there will be a parameter for loss compression in
future versions. *his won9t restore files bit-to-bit identical% but the file content will sta
the same.
Contact
Nse this lin" to send comments% criticism% bug reports% etc.
Cre(its
*han"s for support% help and comments:
;tephan >usch !;-uee#e Chart Author(
=erner >ergmans !1a/imum Compression >enchmar" Author(
1atthias ;tirner !Pac"6P&(
Rade" $is"a !>lac" Fo/ Compression >enchmar" Author(
1ar" Adler !#$ib(
1att 1ahone !PAQ(
1alcolm *alor !=inRE(
;imon >erger !helped to fi/ man bugs(
*he whole <,C7D<.RN forum

Вам также может понравиться