1 
2 /*
3  *  $Header: /cvsroot/faces/faces/compface/vars.h,v 1.1.1.1 2002/04/15 20:20:48 richburridge Exp $
4  *
5  *  Compface - 48x48x1 image compression and decompression
6  *
7  *  Copyright (c) 1990-2002 James Ashton - Sydney University
8  *
9  *  Permission is given to distribute these sources, as long as the
10  *  copyright messages are not removed, and no monies are exchanged.
11  *
12  *  No responsibility is taken for any errors on inaccuracies inherent
13  *  either to the comments or the code of this program, but if reported
14  *  to me, then an attempt will be made to fix them.
15  */
16 
17 #ifndef _COMPFACE_VARS_H_
18 #define _COMPFACE_VARS_H_
19 
20 BigInt B;
21 
22 /* Internal face representation - 1 char per pixel is faster */
23 char F[PIXELS];
24 
25 /* data.h was established by sampling over 1000 faces and icons */
26 Guesses G =
27 #include "data.h"
28 ;
29 
30 int status;
31 
32 jmp_buf comp_env;
33 
34 /* At the bottom of the octree 2x2 elements are considered black if any
35  * pixel is black.  The probabilities below give the distribution of the
36  * 16 possible 2x2 patterns.  All white is not really a possibility and
37  * has a probability range of zero.  Again, experimentally derived data.
38  */
39 Prob freqs[16] = {
40     { 0,   0}, {38,   0}, {38,  38}, {13, 152},
41     {38,  76}, {13, 165}, {13, 178}, { 6, 230},
42     {38, 114}, {13, 191}, {13, 204}, { 6, 236},
43     {13, 217}, { 6, 242}, { 5, 248}, { 3, 253}
44 };
45 
46 char HexDigits[] = "0123456789ABCDEF";
47 
48 /* A stack of probability values */
49 Prob *ProbBuf[PIXELS * 2];
50 int NumProbs = 0;
51 
52 Prob levels[4][3] = {
53     {{  1, 255}, {251, 0}, {  4, 251}},   /* Top of tree almost always grey */
54     {{  1, 255}, {200, 0}, { 55, 200}},
55     {{ 33, 223}, {159, 0}, { 64, 159}},
56     {{131,   0}, {  0, 0}, {125, 131}}    /* Grey disallowed at bottom */
57 };
58 
59 #endif /* _COMPFACE_VARS_H_ */
60