Debian Codegraph @

converter/other/fiasco/doc/fiasco_options_new.3

raw
1 .\" $Id: fiasco_options_new.3,v 1.2 2000/06/25 16:38:06 hafner Exp $
2 .TH fiasco 3 "April, 2000" "FIASCO" "Fractal Image And Sequence COdec"
3
4 .SH NAME
5 .B fiasco_options_new, fiasco_options_set_magnification,
6 .B fiasco_options_delete, fiasco_options_set_progress_meter,
7 .B fiasco_options_set_smoothing, fiasco_options_set_tiling,
8 .B fiasco_options_set_4_2_0_format, fiasco_options_set_basisfile,
9 .B fiasco_options_set_chroma_quality, fiasco_options_set_optimizations,
10 .B fiasco_options_set_prediction, fiasco_options_set_video_param,
11 .B fiasco_options_set_quantization, fiasco_options_set_frame_pattern
12 \- define additional options of FIASCO coder and decoder
13
14 .SH SYNOPSIS
15 .B #include <fiasco.h>
16 .sp
17 .BI "fiasco_options_t *"
18 .fi
19 .BI "fiasco_options_new"
20 .fi
21 .BI " (void);"
22 .sp
23 .BI "void"
24 .fi
25 .BI "fiasco_options_delete"
26 .fi
27 .BI " (fiasco_options_t * "options );
28 .sp
29 .BI "int"
30 .fi
31 .BI "fiasco_options_set_4_2_0_format"
32 .fi
33 .BI " (fiasco_options_t * "options ,
34 .fi
35 .BI " int "format );
36 .sp
37 .BI "int"
38 .fi
39 .BI "fiasco_options_set_basisfile"
40 .fi
41 .BI " (fiasco_options_t * "options ,
42 .fi
43 .BI " const char * "filename );
44 .sp
45 .BI "int"
46 .fi
47 .BI "fiasco_options_set_chroma_quality"
48 .fi
49 .BI " (fiasco_options_t * "options ,
50 .fi
51 .BI " float "quality_factor ,
52 .fi
53 .BI " unsigned "dictionary_size );
54 .sp
55 .BI "int"
56 .fi
57 .BI "fiasco_options_set_frame_pattern"
58 .fi
59 .BI " (fiasco_options_t * "options ,
60 .fi
61 .BI " const char * "pattern );
62 .sp
63 .BI "int"
64 .fi
65 .BI "fiasco_options_set_magnification"
66 .fi
67 .BI " (fiasco_options_t * "options ,
68 .fi
69 .BI " int "level );
70 .sp
71 .BI "int"
72 .fi
73 .BI "fiasco_options_set_optimizations"
74 .fi
75 .BI " (fiasco_options_t * "options ,
76 .fi
77 .BI " unsigned "min_block_level ,
78 .fi
79 .BI " unsigned "max_block_level ,
80 .fi
81 .BI " unsigned "max_elements ,
82 .fi
83 .BI " unsigned "dictionary_size ,
84 .fi
85 .BI " unsigned "optimization_level );
86 .sp
87 .BI "int"
88 .fi
89 .BI "fiasco_options_set_quantization"
90 .fi
91 .BI " (fiasco_options_t * "options ,
92 .fi
93 .BI " unsigned "mantissa ,
94 .fi
95 .BI " fiasco_rpf_range_e "range ,
96 .fi
97 .BI " unsigned "dc_mantissa ,
98 .fi
99 .BI " fiasco_rpf_range_e "dc_range );
100 .sp
101 .BI "int"
102 .fi
103 .BI "fiasco_options_set_prediction"
104 .fi
105 .BI " (fiasco_options_t * "options ,
106 .fi
107 .BI " int "intra_prediction ,
108 .fi
109 .BI " unsigned "min_block_level ,
110 .fi
111 .BI " unsigned "max_block_level );
112 .sp
113 .BI "int"
114 .fi
115 .BI "fiasco_options_set_progress_meter"
116 .fi
117 .BI " (fiasco_options_t * "options ,
118 .fi
119 .BI " fiasco_progress_e "type );
120 .sp
121 .BI "int"
122 .fi
123 .BI "fiasco_options_set_smoothing"
124 .fi
125 .BI " (fiasco_options_t * "options ,
126 .fi
127 .BI " unsigned "smoothing );
128 .sp
129 .BI "int"
130 .fi
131 .BI "fiasco_options_set_tiling"
132 .fi
133 .BI " (fiasco_options_t * "options ,
134 .fi
135 .BI " fiasco_tiling_e "method ,
136 .fi
137 .BI " unsigned "exponent );
138 .sp
139 .BI "int"
140 .fi
141 .BI "fiasco_options_set_video_param"
142 .fi
143 .BI " (fiasco_options_t * "options ,
144 .fi
145 .BI " unsigned "frames_per_second ,
146 .fi
147 .BI " int "half_pixel_prediction ,
148 .fi
149 .BI " int "cross_B_search ,
150 .fi
151 .BI " int "B_as_past_ref );
152 .fi
153
154 .SH DESCRIPTION
155 The \fBfiasco_options_new()\fP function allocates and initializes a
156 FIASCO options object which is used to control additional compression and
157 decompression parameters.
158
159 Conversely, the function \fBfiasco_options_delete()\fP discards the
160 given FIASCO options object.
161
162 Several member functions are available to modify the default behavior
163 of the FIASCO coder and decoder.
164
165 \fBfiasco_options_set_smoothing()\fP sets the
166 \fIsmoothing\fP-percentage along partitioning borders when the image
167 is regenerated; default is 70. This option is used both by the decoder
168 and encoder. You should use the \fIsmoothing\fP value specified in the
169 FIASCO file when you are decoding video frames.
170
171 \fBfiasco_options_set_magnification()\fP sets the \fImagnification\fP
172 of the regenerated image; default is 0, i.e., the image geometry is
173 not changed. This option is used by the decoder only.
174
175 \fBfiasco_options_set_4_2_0_format()\fP defines whether the decoder
176 should use the default 4:4:4 format or the 4:2:0 format. The latter
177 one significantly reduces the decoding time at the cost of some
178 additional blocking artefacts. This option is used by the decoder only.
179
180 \fBfiasco_options_set_frame_pattern()\fP sets the type of inter frame
181 compression which should be applied to individual frames of a video
182 stream; default is "IPPPPPPPPP".
183
184 \fBfiasco_options_set_tiling()\fP sets \fImethod\fP and \fIexponent\fP
185 of the image tiling algorithm which runs as initial step of the
186 encoder; by default the image is subdivided into 16 tiles which
187 are sorted by decreasing variance.
188
189 \fBfiasco_options_set_basisfile()\fP sets the \fIfilename\fP of
190 the FIASCO initial basis (codebook of dictionary vectors); default is
191 "small.fco".
192
193 \fBfiasco_options_set_chroma_quality()\fP sets the quality used when
194 coding the chroma channels of a color image to the term "\fIquality\fP
195 of luminance / \fIquality_factor\fP"; default is 2. Moreover, the size
196 of the codebook is limited by \fIdictionary_size\fP; default is 40
197 elements.
198
199 \fBfiasco_options_set_optimizations()\fP toggles various coding
200 optimizations. E.g., the size of the dictionary (default is 10000),
201 the subset of dictionary elements to use for an individual
202 approximation (default is 5), the size of the image blocks to consider
203 (4x4, ..., 64x64), and some additional low level
204 optimizations (default level is 1).
205
206 \fBfiasco_options_set_prediction()\fP enables an additional intra
207 block prediction by using a DC component approximation. By giving
208 levels \fImin_block_level\fP and \fImax_block_level\fP the prediction
209 can be limited to a small range of blocks only. By default, this
210 method is disabled.
211
212 \fBfiasco_options_set_video_param()\fP defines the framerate (default
213 is 25) and toggles whether to use half pixel precise motion
214 compensated prediction (disabled by default), whether to determine
215 motion vectors of interpolated prediction with the Cross-B-Search
216 algorithm (disabled by default), and whether to allow B frames to be
217 used for B frame predicion (disabled by default).
218
219 \fBfiasco_options_set_quantization()\fP defines the quantization
220 parameters of the approximation coefficients. By default the range of
221 DC coefficients is [-1,+1] using a mantissa of 5 bits (and one sign
222 bit). By default, all other coefficients are quantized with 3 mantissa
223 bits in the interval [-1.5,+1.5].
224
225 \fBfiasco_options_set_progress_meter()\fP sets the type of progress
226 meter to be used during coding. By default, an RPM style progress bar
227 using 50 hash marks (####) is used.
228
229 .SH ARGUMENTS
230 .TP
231 options
232 This object encapsulates the various coding and decoding parameters.
233
234 .TP
235 smoothing
236 This percentage (range is 0 - i.e., no smoothing - to 100) defines how
237 much the regenerated image is smoothed along the partitioning borders.
238
239 .TP
240 level
241 This value gives the magnification of the decoded image with respect
242 to the original size. Positive values increase and negative values
243 decrease the width and height of the image by a factor of
244 2^abs(\fIlevel\fP).
245
246 .TP
247 format
248 If \fIformat\fP is 0 then the 4:4:4 color image format is used, i.e.,
249 the chroma channel are of the same size as the luminance. Otherwise,
250 the 4:2:0 format is used. Then, width and height of each chroma
251 channel is only one half of the width and height of the luminance.
252
253 .TP
254 method
255 Defines the algorithm which should be used to sort the image tiles
256 which are generated in the initial coding step. If \fImethod\fP is
257 \fBFIASCO_VARIANCE_ASC\fP then the tiles are sorted by variance - the
258 first tile has the lowest variance. Conversely, when using
259 \fBFIASCO_VARIANCE_DSC\fP the first tile has the largest variance. If
260 \fImethod\fP is \fBFIASCO_SPIRAL_ASC\fP then the tiles are sorted like
261 a spiral starting in the middle of the image. Conversely, when using
262 \fBFIASCO_SPIRAL_DSC\fP the tiles are sorted like a spiral starting in
263 the upper left corner.
264
265 .TP
266 exponent
267 This value sets the number of image tiles - which are generated in the
268 initial step of the encoder - to 2^\fIexponent\fP.
269
270 .TP
271 pattern
272 This string defines the sequence of frame types. Character \fIn\fP of
273 the string defines the type of frame \fIn\fP (\fIpattern\fP is
274 periodically extended). Three different frame types are available
275 (case insensitive): choose 'i' for intra-frames (no inter frame
276 prediction is used), 'p' for predicted frames (a frame of the
277 past is used for prediction), or 'b' for bi-directional predicted
278 frames (both a frame of the past and the future is used for
279 prediction).
280
281 .TP
282 filename
283 The initial basis (codebook) of the coder is loaded from this
284 (ASCII) file. Files that already come with FIASCO are "small.fco" (3 elements),
285 "medium.fco" (132 elements), and "large.fco" (219 elements).
286
287 .TP
288 quality_factor
289 When coding chroma channels (Cb and Cr band) the approximation quality
290 is determined by the term `quality of Y component' / \fIquality_factor\fP.
291
292 .TP
293 dictionary_size
294 FIASCO uses a dictionary (codebook) of variable size to approximate
295 individual image blocks. The size of the codebook can be limited by
296 \fIdictionary_size\fP to reduce the coding time, however, at the cost
297 of decreasing quality.
298
299 .TP
300 min_block_level
301 During coding only those image blocks are considered for approximation
302 (or prediction) which binary tree level is larger than
303 \fImin_block_level\fP (minimum value is 3). (Since FIASCO internally
304 works with binary trees, the size of an image block is determined by
305 the \fIlevel\fP of the corresponding binary tree). Refer to following
306 table to convert these values:
307
308 .ce
309 level | width | height
310 .fi
311 ------+-------+--------
312 .fi
313 0 | 1 | 1
314 .fi
315 1 | 1 | 2
316 .fi
317 2 | 2 | 2
318 .fi
319 3 | 2 | 4
320 .fi
321 4 | 4 | 4
322 .fi
323 5 | 4 | 8
324 .fi
325 6 | 8 | 8
326 .fi
327 7 | 8 | 16
328 .fi
329 ------+-------+--------
330 .fi
331 The larger this value is the faster the coder runs but the worse the
332 image quality will be.
333
334 .TP
335 max_block_level
336 During coding only those image blocks are considered for approximation
337 (or prediction) which binary tree level is smaller than
338 \fImax_block_level\fP. The smaller this value is the faster the coder
339 runs but the worse the image quality will be.
340
341 .TP
342 max_elements
343 This value defines how many dictionary elements can be
344 used to approximate an individual image block. The smaller this positive
345 value (range is 1 to 5) is the faster the coder runs but the worse the
346 image quality will be.
347
348 .TP
349 optimization_level
350 Additional low level optimizations are available by setting
351 \fIoptimization_level\fP to one of the following values:
352 .fi
353 0 standard approximation method
354 .fi
355 1 slightly increases the approximation quality, running time is
356 twice as high as with the standard method
357 .fi
358 2 hardly increases the approximation quality of method 1, running time
359 is twice as high as with method 1 (this method just remains for
360 completeness)
361 .fi
362
363 .TP
364 intra_prediction
365 If \fIintra_prediction\fP is set to a non-zero value then an
366 additional block prediction of intra-frames is enabled. For some
367 images, the image quality is slightly improved, however, at the cost of
368 a significantly increased running time of the coder.
369
370 .TP
371 frames_per_second
372 This value defines the frame rate, i.e., how many frames per second
373 should be displayed. This value has no effect during coding, it is just
374 passed to the FIASCO output file where it is read and used by the
375 decoder.
376
377 .TP
378 half_pixel_prediction
379 A non-zero value enables half pixel precise motion compensated
380 prediction.
381
382 .TP
383 cross_B_search
384 A non-zero value enables the fast Cross-B-Search algorithm to determine
385 the motion vectors of an interpolated prediction. Otherwise,
386 exhaustive search (in the given search range) is used.
387
388 .TP
389 B_as_past_ref
390 A non-zero value allows not only I- and P-frames but also B-frames to be
391 used for a forward or bi-directional predicion.
392
393 .TP
394 mantissa, range
395 Approximation coefficients are quantized to a small number of
396 values (in fixed point format) in the interval [-\fIrange\fP,
397 +\fIrange\fP]. The number of \fImantissa\fP bits defines the accuracy of
398 quantization.
399
400 .TP
401 dc_mantissa, dc_range
402 Approximation coefficients of the DC component are quantized in a
403 different way: the number of mantissa bits is given by
404 \fIdc_mantissa\fP whereas the quantization interval is given by
405 [-\fIdc_range\fP, +\fBdc_range\fP].
406
407 .TP
408 type
409 This value sets the \fItype\fP of progress meter which should be used
410 during coding. The following types are available:
411 .fi
412 \fBFIASCO_PROGRESS_NONE\fP: no output at all
413 .fi
414 \fBFIASCO_PROGRESS_BAR\fP: print hash marks (###)
415 \fBFIASCO_PROGRESS_PERCENT\fP: percentage meter (50%)
416
417 .SH RETURN VALUES
418 The function \fBfiasco_decoder_new()\fP returns a pointer to the newly
419 allocated option object. If an error has been caught, a NULL pointer
420 is returned.
421
422 All set functions return 1 on success and 0 if an error has been
423 caught.
424
425 In case of an error, use the function fiasco_get_error_message(3) to
426 get a string with the last error message of FIASCO.
427
428 .SH "SEE ALSO"
429 .br
430 .BR fiasco_decoder "(3), " fiasco_coder (3)
431
432 Ullrich Hafner, Juergen Albert, Stefan Frank, and Michael Unger.
433 \fBWeighted Finite Automata for Video Compression\fP, IEEE Journal on
434 Selected Areas In Communications, January 1998
435 .br
436 Ullrich Hafner. \fBLow Bit-Rate Image and Video Coding with Weighted
437 Finite Automata\fP, Ph.D. thesis, Mensch & Buch Verlag, ISBN
438 3-89820-002-7, October 1999.
439
440 .SH AUTHOR
441 Ullrich Hafner