summary refs log tree commit diff
path: root/pnmtofiasco.html
blob: 7caf46377bb419aeaaf5ee99c4f909bae332c1c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pnmtofiasco User Manual</title></head>
<body>
<h1>pnmtofiasco</h1>
Updated: 12 July 2000
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>

pnmtofiasco - Convert PNM file to FIASCO compressed file

<h2 id="synopsis">SYNOPSIS</h2>

<b>pnmtofiasco</b>
[<i>option</i>]...
[<i>filename</i>]...

<h2 id="description">DESCRIPTION</h2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<b>pnmtofiasco</b> compresses the named pbm, pgm, or ppm image files,
or Standard Input if no file is named, and produces a FIASCO file on
Standard Output.

<h2 id="options">OPTIONS</h2>

<p>In addition to the options common to all programs based on libnetpbm
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions">
Common Options</a>), <b>pnmtofiasco</b> recognizes the following
command line options:

<p>All option names may be abbreviated; for example, --optimize may be
written --optim or --opt. For most options a one letter short option
is provided.  Mandatory or optional arguments to long options are
mandatory or optional for short options, too.  Both short and long
options are case sensitive.

<h3 id="basicopts">Basic Options</h3>

<dl compact>
<dt><b>-i</b> <i>name</i>, <b>--input-name=</b><i>name</i>

<dd>Compress the named images, not Standard Input.  If <i>name</i> is
<b>-</b>, read Standard Input.  <i>name</i> has to be either an image
filename or a template of the form:

<pre>
prefix[start-end{+,-}step]suffix<br>
</pre>

<p>Templates are useful when compressing video streams: e.g., if you
specify the template <b>img0[12-01-2].pgm</b>, then <b>pnmtofiasco</b>
compresses the images img012.pgm, img010.pgm, ..., img002.pgm.

<p>If <i>name</i> is a relative path, <b>pnmtofiasco </b> searches for
the image files in the current directory and in the (colon-separated)
list of directories given by the environment variable
<b>FIASCO_IMAGES</b>.

<dt><b>-o</b> <i>output-file</i>, <b>--output-name=</b><i>name</i>

<dd>Write FIASCO output to the named file, not to Standard Output.

<p>If <i>name</i> is a relative path and the environment variable
<b>FIASCO_DATA</b> is a (colon-separated) list of directories, then
<b>pnmtofiasco</b> writes the output file to the first (writable)
directory of this list. Otherwise, <b>pnmtofiasco</b> write it to the
current directory.

<dt><b>-q</b> <i>N</i>, <b>--quality=</b><i>N</i>

<dd>Set quality of compression to <i>N</i>.  Quality is 1 (worst) to
100 (best); default is 20.

<dt><b>-v</b>, <b>--version</b>

<dd>Print <b>pnmtofiasco</b> version number, then exit.

<dt><b>-V</b> <i>N</i>, <b>--verbose </b><i>N</i>

<dd>Set level of verbosity to <i>N</i>.  Level is 0 (no output at
all), 1 (show progress meter), or 2 (show detailed compression
statistics); default is 1.

<dt><b>-B</b> <i>N</i>, <b>--progress-meter </b><i>N</i>

<dd>Set type of progress-meter to <i>N</i>.  The following types are
available; default is 1:

<dl>
<dt><b>0</b>
<dd>no progress meter

<dt><b>1</b>
<dd>RPM style progress bar using 50 hash marks

<dt><b>2</b>

<dd>percentage meter

</dl>

<dt><b>-f</b> <i>name</i>, <b>--config=</b><i>name</i>

<dd>Load parameter file <i>name </i> to initialize the options of
<b>pnmtofiasco</b>.  See file <b>system.fiascorc</b> for an example of
the syntax. Options of <b>pnmtofiasco</b> are set by any of the
following methods (in the specified order):

<ol>
<li>Global resource file <b>/etc/system.fiascorc</b>
<li>$HOME/.fiascorc
<li>command line
<li>--config=<i>name</i>
</ol>

<dt><b>-h</b>, <b>--info</b>

<dd>Print brief help, then exit.

<dt><b>-H</b>, <b>--help</b>

<dd>Print detailed help, then exit.

</dl>

<h3 id="advancedopts">Options for Advanced Users</h3>

<dl>
<dt><b>-b</b> <i>name</i>, <b>--basis-name=</b><i>name</i>

<dd>Preload compression basis <i>name</i> into FIASCO.  The basis
<i>name</i> provides the initial compression dictionary.  Either use
one of the files "small.fco", "medium.fco", or
"large.fco" that come with <b>pnmtofiasco </b> or create a
new ASCII basis file.

<dt><b>-z</b> <i>N</i>, <b>--optimize=</b><i>N</i> 

<dd>Set optimization level to <i>N</i>.  Level is 0 (fastest) to 3
(slowest); default is 1.  Be warned, the encoding time dramatically
increased when <i>N</i>=<b>2</b> or <i>N</i>=<b>3</b> while the
compression performance only slightly improves.

<dt><b>-P</b>, <b>--prediction</b>

<dd>Use additional predictive coding.  If this optimization is enabled
then the image is compressed in two steps.  In the first step, a coarse
approximation of the image is computed using large unichrome
blocks.  Finally, the delta image is computed and the prediction error
is approximated using the standard FIASCO algorithm.

<dt><b>-D</b> <i>N</i>, <b>--dictionary-size=</b><i>N</i>

<dd>Set size of dictionary that is used when coding the luminance band
to <i>N</i>; default is 10000, i.e., the dictionary is not restricted.

<dt><b>-C</b> <i>N</i>, <b>--chroma-dictionary=</b><i>N</i>

<dd>Set size of dictionary that is used when coding chroma bands to
<i>N</i>; default is 40.

<dt><b>-Q</b> <i>N</i>, <b>--chroma-qfactor=</b><i>N</i>

<dd>Reduce the quality of chroma band compression <i>N</i>-times with
respect to the user defined quality <i>q</i> of the luminance band
compression (<b>--quality</b>=<i>q</i>); default is 2.

<dt><b>-t</b> <i>N</i>, <b>--tiling-exponent=</b><i>N</i>

<dd>Subdivide the image into 2^<i>N</i> tiles prior coding; default is
4, i.e. the image is subdivided into 16 tiles. The processing order of
the individual tiles is defined by the option
<b>--tiling-method=</b><i>name</i>.

<dt><b>-T</b> <i>name</i>, <b>--tiling-method=</b><i>name</i>

<dd>Order the individual image tiles (the image is subdivided into;
see option <b>--tiling-exponent=</b><i>N</i>) by method <i>name</i>;
default is <b>desc-variance</b>.

<dl>
<dt><b>desc-variance</b>
<dd>Tiles with small variances are processed first.

<dt><b>asc-variance</b>
<dd>Tiles with large variances are processed first.

<dt><b>desc-spiral</b>
<dd>Tiles are process in spiral order starting in the middle. 

<dt><b>asc-spiral</b>
<dd>Tiles are process in spiral order starting at the border.

</dl>

<dt><b>--rpf-mantissa=</b><i>N</i>

<dd>Use <i>N</i> mantissa bits for quantized coefficients.

<dt><b>--dc-rpf-mantissa=</b><i>N</i>
<dd>Use <i>N</i> mantissa bits for quantized DC coefficients.

<dt><b>--rpf-range=</b><i>N</i>

<dd>Coefficients outside the quantization interval
[-<i>N</i>,+<i>N</i>] are set to zero.

<dt><b>--dc-rpf-range=</b><i>N</i>

<dd>DC coefficients outside the quantization interval
[-<i>N</i>,+<i>N</i>] are set to zero.

</dl>

<h3 id="videoopts">Additional Options for Video Compression</h3>

<dl>
<dt><b>-s</b> <i>N</i>, <b>--smooth=</b><i>N</i>

<dd>Smooth decompressed reference frames along the partitioning
borders by the given amount <i>N</i>.  <i>N</i> is 0 (no smoothing) to
100; default is 70.  This factor is stored in the FIASCO file.

<dt><b>-m</b> <i>N</i>, <b>--min-level=</b><i>N</i>

<dd>Start prediction (motion compensated prediction or additional
prediction) on block level <i>N</i>; default is level 6.  I.e., motion
compensation is applied to all image blocks of at least 8x8 pixels
(binary tree level <i>N</i>=6), 16x8 (<i>N</i>=7), 16x16 (<i>N</i>=8),
etc.

<dt><b>-M</b> <i>N</i>, <b>--max-level=</b><i>N</i>

<dd>Stop prediction (motion compensated prediction or additional
prediction) on block level <i>N</i>; default is level 10.  I.e.,
motion compensation is applied to all image blocks of at most 16x16
pixels (<i>N</i>=8), 32x16 (<i>N</i>=9), 32x32 (<i>N</i>=10), etc.

<dt><b>-2</b>, <b>--half-pixel</b>

<dd>Use half pixel precise motion compensation.

<dt><b>-F</b> <i>N</i>, <b>--fps=</b><i>N</i>

<dd>Set number of frames per second to <i>N</i>.  This value is stored
in the FIASCO output file and is used in the decoder <a
href="fiascotopnm.html">fiascotopnm</a> to control the framerate.

<dt><b>-p</b> <i>type</i>, <b>--pattern=</b><i>type</i>

<dd>Defines the type of inter frame compression which should be
applied to individual frames of a video stream.  <i>type</i> is a
sequence of characters; default is "IPPPPPPPPP".  Element
<b>N</b> defines the type of predicting which should be used for frame
<b>N</b>; the frame type pattern is periodically extended.  Valid
characters are:

<dl>
<dt><b>I</b>
<dd>intra frame, i.e., no motion compensated prediction is used at
all.

<dt><b>P</b>
<dd>predicted frame, i.e., a previously encoded frame is used for
prediction (forward prediction).

<dt><b>B</b>
<dd>bidirectional predicted frame, i.e., not only a previously shown
frame but also a frame of the future is used for prediction (forward,
backward or interpolated prediction).

</dl>

<dt><b>--cross-B-search</b>

<dd>Instead of using exhaustive search the "Cross-B-Search"
algorithm is used to find the best interpolated prediction of
B-frames.

<dt><b>--B-as-past-ref</b>

<dd>Also use previously encoded B-frames when prediction the current
frame. If this option is not set, only I- and P-frames are used to
predict the current frame.

</dl>


<h2 id="examples">EXAMPLES</h2>

<p>Compress the still image "foo.ppm" to the FIASCO file
"foo.wfa" using the default options:

<pre>
        pnmtofiasco &lt; foo.ppm &gt;foo.wfa
</pre>

<p>Compress the video frames "foo0*.ppm" to the FIASCO file
"video.wfa" using half pixel precise motion compensation at
a frame rate of 15 frames per second.  Intra frame 1 is used to
predict P-frame 4, frames 1 and 4 are used to predict B-frames 2 and
3, and so on.  Frame 10 is again an intra-frame.

<pre>
        pnmtofiasco -2 -p "IBBPBBPBB" -fps 15 -o video.wfa foo0*.ppm
</pre>

<h2 id="files">FILES</h2>

<dl compact>
<dt><b>/etc/system.fiascorc</b>

<dd>The systemwide initialization file.

<dt>$HOME<b>/.fiascorc</b>

<dd>The personal initialization file.

</dl>

<h2 id="environment">ENVIRONMENT</h2>


<dl compact>

<dt><b>FIASCO_IMAGES</b>

<dd>Search path for image files.  Default is "./".

<dt><b>FIASCO_DATA</b>

<dd>Search and save path for FIASCO files.  Default is "./".

</dl>

<h2 id="seealso">SEE ALSO</h2>

<b><a href="fiascotopnm.html">fiascotopnm</a></b>,
<b><a href="pnmtojpeg.html">pnmtojpeg</a></b>,
<b><a href="pnmtojbig.html">pnmtojbig</a></b>,
<b><a href="pamtogif.html">pamtogif</a></b>,
<b><a href="pnm.html">pnm</a></b>

<p>Ullrich Hafner, Juergen Albert, Stefan Frank, and Michael Unger.
<b>Weighted Finite Automata for Video Compression</b>, IEEE Journal on
Selected Areas In Communications, January 1998

<p>Ullrich Hafner. <b>Low Bit-Rate Image and Video Coding with
Weighted Finite Automata</b>, Ph.D. thesis, Mensch &amp; Buch Verlag,
ISBN 3-89820-002-7, October 1999.

<p>FIASCO: An Open-Source Fractal Image and Sequence Codec, Linux Journal,
January 2001.

<h2 id="author">AUTHOR</h2>

Ullrich Hafner &lt;<a href="mailto:hafner@bigfoot.de">hafner@bigfoot.de</a>&gt;

<hr>
<h2 id="index">Table Of Contents</h2>
<ul>
<li><a href="#synopsis">SYNOPSIS</a>
<li><a href="#description">DESCRIPTION</a>
<li><a href="#options">OPTIONS</a>
  <ul>
  <li><a href="#basicopts">Basic Options</a>
  <li><a href="#advancedopts">Options for Advanced Users</a>
  <li><a href="#videoopts">Additional Options for Video Compression</a>
  </ul>
<li><a href="#examples">EXAMPLES</a>
<li><a href="#files">FILES</a>
<li><a href="#environment">ENVIRONMENT</a>
<li><a href="#seealso">SEE ALSO</a>
<li><a href="#author">AUTHOR</a>
</ul>
</body>
</html>