diff options
Diffstat (limited to 'converter/other/fiasco/codec/tiling.c')
-rw-r--r-- | converter/other/fiasco/codec/tiling.c | 70 |
1 files changed, 32 insertions, 38 deletions
diff --git a/converter/other/fiasco/codec/tiling.c b/converter/other/fiasco/codec/tiling.c index 83eb8b29..89fe3111 100644 --- a/converter/other/fiasco/codec/tiling.c +++ b/converter/other/fiasco/codec/tiling.c @@ -29,22 +29,7 @@ #include "wfalib.h" #include "tiling.h" -/***************************************************************************** - prototypes - -*****************************************************************************/ - -static int -cmpdecvar (const void *value1, const void *value2); -static int -cmpincvar (const void *value1, const void *value2); - -/***************************************************************************** - - public code - -*****************************************************************************/ typedef struct var_list { @@ -52,6 +37,38 @@ typedef struct var_list real_t variance; /* variance of tile */ } var_list_t; +#ifndef LITERAL_FN_DEF_MATCH +static qsort_comparison_fn cmpincvar; +#endif + +static int +cmpincvar(const void * const value1, + const void * const value2) { +/*---------------------------------------------------------------------------- + Sorts by increasing variances (quicksort sorting function) +-----------------------------------------------------------------------------*/ + return + ((var_list_t *) value1)->variance - ((var_list_t *) value2)->variance; +} + + + +#ifndef LITERAL_FN_DEF_MATCH +static qsort_comparison_fn cmpdecvar; +#endif + +static int +cmpdecvar(const void * const value1, + const void * const value2) { +/*---------------------------------------------------------------------------- + Sorts by decreasing variances (quicksort sorting function). +-----------------------------------------------------------------------------*/ + return + ((var_list_t *) value2)->variance - ((var_list_t *) value1)->variance; +} + + + tiling_t * alloc_tiling (fiasco_tiling_e method, unsigned tiling_exponent, unsigned image_level) @@ -214,26 +231,3 @@ perform_tiling (const image_t *image, tiling_t *tiling) } } -/***************************************************************************** - - private code - -*****************************************************************************/ - -static int -cmpincvar (const void *value1, const void *value2) -/* - * Sorts by increasing variances (quicksort sorting function). - */ -{ - return ((var_list_t *) value1)->variance - ((var_list_t *) value2)->variance; -} - -static int -cmpdecvar (const void *value1, const void *value2) -/* - * Sorts by decreasing variances (quicksort sorting function). - */ -{ - return ((var_list_t *) value2)->variance - ((var_list_t *) value1)->variance; -} |