URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
typedef struct RangeCoder
|
typedef struct RangeCoder
|
{
|
{
|
unsigned char one_state[256];
|
unsigned char one_state[256];
|
} RangeCoder;
|
} RangeCoder;
|
static inline void put_rac(RangeCoder *c, unsigned char* const state)
|
static inline void put_rac(RangeCoder *c, unsigned char* const state)
|
{
|
{
|
*state= c->one_state[*state];
|
*state= c->one_state[*state];
|
}
|
}
|
typedef struct PlaneContext{
|
typedef struct PlaneContext{
|
unsigned (*state)[32];
|
unsigned (*state)[32];
|
} PlaneContext;
|
} PlaneContext;
|
static inline void put_symbol(RangeCoder *c, unsigned char *state)
|
static inline void put_symbol(RangeCoder *c, unsigned char *state)
|
{
|
{
|
int i;
|
int i;
|
const int e;
|
const int e;
|
put_rac(c, state);
|
put_rac(c, state);
|
for(i=e-1; i>=0; i--)
|
for(i=e-1; i>=0; i--)
|
put_rac(c, state+22+i);
|
put_rac(c, state+22+i);
|
}
|
}
|
int encode_line(void)
|
int encode_line(void)
|
{
|
{
|
PlaneContext * const p;
|
PlaneContext * const p;
|
RangeCoder * const c;
|
RangeCoder * const c;
|
int a;
|
int a;
|
put_symbol(c, p->state[a]);
|
put_symbol(c, p->state[a]);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.