diff options
Diffstat (limited to 'converter/other/fiasco/input/basis.c')
-rw-r--r-- | converter/other/fiasco/input/basis.c | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/converter/other/fiasco/input/basis.c b/converter/other/fiasco/input/basis.c index e5ced0d0..4be7f4ed 100644 --- a/converter/other/fiasco/input/basis.c +++ b/converter/other/fiasco/input/basis.c @@ -1,7 +1,7 @@ /* - * basis.c: WFA initial basis files + * basis.c: WFA initial basis files * - * Written by: Ullrich Hafner + * Written by: Ullrich Hafner * * This file is part of FIASCO (Fractal Image And Sequence COdec) * Copyright (C) 1994-2000 Ullrich Hafner @@ -43,7 +43,7 @@ typedef struct /***************************************************************************** - prototypes + prototypes *****************************************************************************/ @@ -58,7 +58,7 @@ static basis_file_t const basis_files[] = { /***************************************************************************** - public code + public code *****************************************************************************/ @@ -70,69 +70,69 @@ get_linked_basis (const char *basis_name, wfa_t *wfa) * according to the stored data, otherwise print a warning message. * * Return value: - * true on success, false if basis is not available yet. + * true on success, false if basis is not available yet. * * Side effects: - * 'wfa' struct is filled on success. + * 'wfa' struct is filled on success. */ { - bool_t success = NO; /* indicates if basis is found */ - unsigned n; /* counter */ - basis_values_t bv; /* basis values */ + bool_t success = NO; /* indicates if basis is found */ + unsigned n; /* counter */ + basis_values_t bv; /* basis values */ for (n = 0; basis_files [n].filename != NULL; n++) - if (streq (basis_files [n].filename, basis_name)) /* basis is stored */ + if (streq (basis_files [n].filename, basis_name)) /* basis is stored */ { - unsigned state, edge; - - (*basis_files [n].function) (&bv); /* initialize local variables */ - /* - * Generate WFA - */ - wfa->basis_states = wfa->states = bv.states + 1; - wfa->domain_type[0] = USE_DOMAIN_MASK; - wfa->final_distribution[0] = 128; - append_edge (0, 0, 1.0, 0, wfa); - append_edge (0, 0, 1.0, 1, wfa); - for (state = 1; state < wfa->basis_states; state++) - { - wfa->final_distribution [state] = bv.final [state - 1]; - wfa->domain_type [state] = bv.use_domain [state - 1] - ? USE_DOMAIN_MASK - : AUXILIARY_MASK; - } - for (edge = 0; isedge (bv.transitions [edge][0]); edge++) - append_edge (bv.transitions [edge][0], bv.transitions [edge][1], - bv.transitions [edge][2], bv.transitions [edge][3], - wfa); - - success = YES; - break; + unsigned state, edge; + + (*basis_files [n].function) (&bv); /* initialize local variables */ + /* + * Generate WFA + */ + wfa->basis_states = wfa->states = bv.states + 1; + wfa->domain_type[0] = USE_DOMAIN_MASK; + wfa->final_distribution[0] = 128; + append_edge (0, 0, 1.0, 0, wfa); + append_edge (0, 0, 1.0, 1, wfa); + for (state = 1; state < wfa->basis_states; state++) + { + wfa->final_distribution [state] = bv.final [state - 1]; + wfa->domain_type [state] = bv.use_domain [state - 1] + ? USE_DOMAIN_MASK + : AUXILIARY_MASK; + } + for (edge = 0; isedge (bv.transitions [edge][0]); edge++) + append_edge (bv.transitions [edge][0], bv.transitions [edge][1], + bv.transitions [edge][2], bv.transitions [edge][3], + wfa); + + success = YES; + break; } if (!success) warning ("WFA initial basis '%s' isn't linked with the executable yet." - "\nLoading basis from disk instead.", basis_name); + "\nLoading basis from disk instead.", basis_name); return success; } /***************************************************************************** - private code + private code *****************************************************************************/ /***************************************************************************** - basis "small.wfa" + basis "small.wfa" *****************************************************************************/ -static unsigned states_small = 2; -static bool_t use_domain_small[] = {YES, YES}; -static real_t final_small[] = {64, 64}; -static real_t transitions_small[][4] = {{1, 2, 0.5, 0}, {1, 2, 0.5, 1}, - {1, 0, 0.5, 1}, {2, 1, 1.0, 0}, - {2, 1, 1.0, 1}, {-1, 0, 0, 0}}; +static unsigned states_small = 2; +static bool_t use_domain_small[] = {YES, YES}; +static real_t final_small[] = {64, 64}; +static real_t transitions_small[][4] = {{1, 2, 0.5, 0}, {1, 2, 0.5, 1}, + {1, 0, 0.5, 1}, {2, 1, 1.0, 0}, + {2, 1, 1.0, 1}, {-1, 0, 0, 0}}; static void small_init (basis_values_t *bv) { |