1 typedef struct RangeCoder
2 {
3     unsigned char one_state[256];
4 } RangeCoder;
put_rac(RangeCoder * c,unsigned char * const state)5 static inline void put_rac(RangeCoder *c, unsigned char* const state)
6 {
7   *state= c->one_state[*state];
8 }
9 typedef struct PlaneContext{
10     unsigned (*state)[32];
11 } PlaneContext;
put_symbol(RangeCoder * c,unsigned char * state)12 static inline void put_symbol(RangeCoder *c, unsigned char *state)
13 {
14     int i;
15     const int e;
16     put_rac(c, state);
17     for(i=e-1; i>=0; i--)
18       put_rac(c, state+22+i);
19 }
encode_line(void)20 int encode_line(void)
21 {
22     PlaneContext * const p;
23     RangeCoder * const c;
24     int a;
25     put_symbol(c, p->state[a]);
26 }
27