#ifndef _DEFINE_H #define _DEFINE_H #define pel_t float #define FALSE 0 #define TRUE 1 #define OFF 0 #define ON 1 #define _QCIF_ 0 #define _CIF_ 1 #define _Y_ 0 #define _U_ 1 #define _V_ 2 #define _R_ 0 #define _G_ 1 #define _B_ 2 #define _DX_ 0 #define _DY_ 1 /* various sizes */ #define _DCT_SIZE_ 8 #define _BLOCK_SIZE_ 8 #define _MB_SIZE_ 16 #define _GOB_WIDTH_ 11 #define _NUM_MB_ 33 #define _NUM_CIF_GOB_ 12 #define _NUM_QCIF_GOB_ 5 #define _NUM_PIC_PROP_ 6 #define _NUM_MB_PROP_ 3 /* options */ #define MOTIONEST_FULL 0 #define MOTIONEST_HVMIN 1 #define QUANT_BASIC 0 #define QUANT_THRESH 1 /* motion est */ #define MOT_EST_LO_RANGE (-15) #define MOT_EST_HI_RANGE 15 #define MOT_EST_RANGE (MOT_EST_HI_RANGE - MOT_EST_LO_RANGE) /* used for MTYPE */ #define INTRA 0 #define INTER 1 #define INTRA_MQUANT 1 #define INTER_TCOEFF 2 #define INTER_MQUANT_TCOEFF 3 #define INTER_MC_MVD 4 #define INTER_MC_MVD_TCOEFF 5 #define INTER_MC_MQUANT_MVD_TCOEFF 6 #define INTER_MC_FIL_MVD 7 #define INTER_MC_FIL_MVD_TCOEFF 8 #define INTER_MC_FIL_MQUANT_MVD_TCOEFF 9 /* used for transmission buffer */ #define BUFFER_DATA_WIDTH 492 #define BUFFER_PARITY_WIDTH 18 #define BUFFER_FRAME_WIDTH (1+1+BUFFER_DATA_WIDTH+BUFFER_PARITY_WIDTH) /* references to the VLC tables */ #define MBA_CODE 0 #define MTYPE_CODE 1 #define MVD_CODE 2 #define CBP_CODE 3 #define TCOEFF_CODE 4 /* PIC properties */ #define SPLIT_SCREEN 0 #define DOC_CAM 1 #define FREEZE_PIC 2 #define FORMAT 3 #define STILL_IMAGE 4 #define SPARE 5 /* MB properties */ #define MODE 0 #define MC_PRESENT 1 #define FIL_PRESENT 2 /* entropy encoding */ #define EOB 27 #define ESCAPE 28 #define MBA_STUFFING_IND 34 #define GOB_START_CODE_IND 35 #define MBA_STUFFING_LEN 11 /* other useful defines */ #define INTRA_DC_QSTEPSIZE 8 /* used within huffman tree for entropy decoding */ typedef class node{ public: node(void); unsigned char info[2]; struct node *left,*right;//left=1, right=0 }*nodep; /* VLC and FLC tables and values for entropy encoding/decoding */ extern const char PIC_STARTCODE[21]; extern const char MBA[35][17]; extern const char MTYPE[10][11]; extern const char MVD[32][12]; extern const char CBP[63][10]; extern const char TCOEFF[28][15][15]; extern const char BUFFER_S[9]; /* various constants */ class dimensions_t{ public: void init(int format); int width[3],height[3]; }; extern const int order[64][2]; /* holds order to send tcoeffs */ extern class dimensions_t DIM; /* global functions */ extern long abs(long i); extern int sign(int i); extern pel_t clip(pel_t num,int min,int max); #endif /* DEFINE_H */