tok_proto.h 2.23 KB
int tok_num_max_block = 6;

#define TOK_MAX_STREAMS (16)

short tok_num_streams = 0;

Tok_Context tok_contexts[TOK_MAX_STREAMS];

Tok_Context *tok_cur_context = NULL;

short tok_buf1[TOK_BUF_SIZE];
short tok_buf2[TOK_BUF_SIZE];

short *cur_tok_buf = tok_buf1;
short *prev_tok_buf = tok_buf2;

short tok_index[TOK_BUF_SIZE];
short tok_lev[TOK_BUF_SIZE];

int tok_n;

short tok_iqmat_default[64] = {
     8, 16, 19, 22, 26, 27, 29, 34,
    16, 16, 22, 24, 27, 29, 34, 37,
    19, 22, 26, 27, 29, 34, 34, 38,
    22, 22, 26, 27, 29, 34, 37, 40,
    22, 26, 27, 29, 32, 35, 40, 48,
    26, 27, 29, 32, 35, 40, 48, 58,
    26, 27, 29, 34, 38, 46, 56, 69,
    27, 29, 35, 38, 46, 56, 69, 83};

short tok_niqmat_default[64] = {
    16, 16, 16, 16, 16, 16, 16, 16,
    16, 16, 16, 16, 16, 16, 16, 16,
    16, 16, 16, 16, 16, 16, 16, 16,
    16, 16, 16, 16, 16, 16, 16, 16,
    16, 16, 16, 16, 16, 16, 16, 16,
    16, 16, 16, 16, 16, 16, 16, 16,
    16, 16, 16, 16, 16, 16, 16, 16,
    16, 16, 16, 16, 16, 16, 16, 16};

short *tok_iqmat;
short *tok_niqmat;

PIC tok_cur_pic,
    tok_cur_raster,
    tok_ref_for_pic,
    tok_ref_bak_pic,
    tok_bidir_next_pic;

int tok_luma_size;
int tok_line_size;

#define XSIZE	(352)
#define YSIZE	(240)
#define LUMSIZE (XSIZE*YSIZE)
#define PICSIZE (XSIZE*YSIZE*3/2)

unsigned char  pic1[PICSIZE],
               pic2[PICSIZE],
               pic3[PICSIZE],
               pic4[PICSIZE],
               pic5[PICSIZE];

int tok_tref_cur;
int tok_ptype_cur;

short tok_mbnum;
short mb_x, mb_y;
short *tok_stream_ptr;
short *tok_stream_end;

int backup_page = 0;

#define MB_DATA_SIZE (6*64)

short vzero[8] = {0,0,0,0,0,0,0,0};

/*
MacroBlock *mb_ptr = (MacroBlock *) (vmpegMainDataStart+MBOFFSET);
*/

MacroBlock mb;

int mvfx, mvfy;
int mvbx, mvby;
int mbtype;

int quant;

int  tok_parse_seq_hdr( void );
void tok_alloc_pics( void );
void tok_save_context( void );
int tok_prepare_next_page( void );
void tok_get_context( void );
void tok_save_context( void );
int tok_process_page( void );
void tok_zero_mb( MacroBlock * );
void vand( short *, int , short *, int );
void vshift( short *, int , short *, int );
void vstore( short *, int , short *);
void tok_get_mb( MacroBlock * );
void tok_dec_mb( MacroBlock * );
int tok_get_mbh( MacroBlock * );