Debian Codegraph @

converter/other/fiasco/doc/fiasco_c_options_new.3

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