| 1 |
/* |
| 2 |
* misc.h |
| 3 |
* |
| 4 |
* Written by: Stefan Frank |
| 5 |
* Ullrich Hafner |
| 6 |
* |
| 7 |
* This file is part of FIASCO (Fractal Image And Sequence COdec) |
| 8 |
* Copyright (C) 1994-2000 Ullrich Hafner |
| 9 |
*/ |
| 10 |
|
| 11 |
/* |
| 12 |
* $Date: 2000/06/14 20:49:37 $ |
| 13 |
* $Author: hafner $ |
| 14 |
* $Revision: 5.1 $ |
| 15 |
* $State: Exp $ |
| 16 |
*/ |
| 17 |
|
| 18 |
#ifndef _MISC_H |
| 19 |
#define _MISC_H |
| 20 |
|
| 21 |
#include "config.h" |
| 22 |
|
| 23 |
#if TIME_WITH_SYS_TIME |
| 24 |
# include <sys/time.h> |
| 25 |
# include <time.h> |
| 26 |
#else /* not TIME_WITH_SYS_TIME */ |
| 27 |
# if HAVE_SYS_TIME_H |
| 28 |
# include <sys/time.h> |
| 29 |
# else /* not HAVE_SYS_TIME_H */ |
| 30 |
# include <time.h> |
| 31 |
# endif /* not HAVE_SYS_TIME_H */ |
| 32 |
#endif /* not TIME_WITH_SYS_TIME */ |
| 33 |
|
| 34 |
#include <stdio.h> |
| 35 |
#include "types.h" |
| 36 |
#include "bit-io.h" |
| 37 |
|
| 38 |
enum action_e {START, STOP}; |
| 39 |
|
| 40 |
void * |
| 41 |
Calloc (size_t n, size_t size); |
| 42 |
void |
| 43 |
Free (void *memory); |
| 44 |
unsigned |
| 45 |
prg_timer (clock_t *ptimer, enum action_e action); |
| 46 |
int |
| 47 |
read_int(FILE *infile); |
| 48 |
real_t |
| 49 |
read_real(FILE *infile); |
| 50 |
unsigned |
| 51 |
read_rice_code (unsigned rice_k, bitfile_t *input); |
| 52 |
void |
| 53 |
write_rice_code (unsigned value, unsigned rice_k, bitfile_t *output); |
| 54 |
void |
| 55 |
write_bin_code (unsigned value, unsigned maxval, bitfile_t *output); |
| 56 |
unsigned |
| 57 |
bits_bin_code (unsigned value, unsigned maxval); |
| 58 |
unsigned |
| 59 |
bits_rice_code (unsigned value, unsigned rice_k); |
| 60 |
unsigned |
| 61 |
read_bin_code (unsigned maxval, bitfile_t *input); |
| 62 |
unsigned * |
| 63 |
init_clipping (void); |
| 64 |
real_t |
| 65 |
variance (const word_t *pixels, unsigned x0, unsigned y0, |
| 66 |
unsigned width, unsigned height, unsigned cols); |
| 67 |
|
| 68 |
#ifndef HAVE_MEMMOVE |
| 69 |
void * |
| 70 |
memmove(void *dest, const void *src, size_t n); |
| 71 |
#endif /* not HAVE_MEMMOVE */ |
| 72 |
|
| 73 |
double |
| 74 |
Log2 (double x); |
| 75 |
#ifndef HAVE_STRCASECMP |
| 76 |
bool_t |
| 77 |
strcaseeq (const char *s1, const char *s2); |
| 78 |
#else /* HAVE_STRCASECMP */ |
| 79 |
int |
| 80 |
strcasecmp (const char *s1, const char *s2); |
| 81 |
#define strcaseeq(s1, s2) (strcasecmp ((s1), (s2)) == 0) |
| 82 |
#endif /* HAVE_STRCASECMP */ |
| 83 |
|
| 84 |
int |
| 85 |
sort_asc_word (const void *value1, const void *value2); |
| 86 |
int |
| 87 |
sort_desc_word (const void *value1, const void *value2); |
| 88 |
int |
| 89 |
sort_asc_pair (const void *value1, const void *value2); |
| 90 |
int |
| 91 |
sort_desc_pair (const void *value1, const void *value2); |
| 92 |
|
| 93 |
#endif /* not _MISC_H */ |
| 94 |
|