--- trunk/xvidcore/src/global.h 2002/03/08 02:46:11 3 +++ trunk/xvidcore/src/global.h 2002/05/03 00:45:10 156 @@ -1,9 +1,10 @@ #ifndef _GLOBAL_H_ #define _GLOBAL_H_ +#include "xvid.h" #include "portab.h" -/* --- macroblock stuff --- */ +/* --- macroblock modes --- */ #define MODE_INTER 0 #define MODE_INTER_Q 1 @@ -13,11 +14,26 @@ #define MODE_STUFFING 7 #define MODE_NOT_CODED 16 +/* --- bframe specific --- */ + +#define MODE_DIRECT 0 +#define MODE_INTERPOLATE 1 +#define MODE_BACKWARD 2 +#define MODE_FORWARD 3 +#define MODE_DIRECT_NONE_MV 4 + + typedef struct { - int x; - int y; -} VECTOR; + uint32_t bufa; + uint32_t bufb; + uint32_t buf; + uint32_t pos; + uint32_t *tail; + uint32_t *start; + uint32_t length; +} +Bitstream; #define MBPRED_SIZE 15 @@ -36,12 +52,25 @@ int mode; int quant; // absolute quant + int field_dct; + int field_pred; + int field_for_top; + int field_for_bot; + // encoder specific VECTOR pmvs[4]; int dquant; int cbp; + // bframe stuff + + VECTOR b_mvs[4]; + VECTOR b_pmvs[4]; + + int mb_type; + int dbquant; + } MACROBLOCK; static __inline int8_t get_dc_scaler(int32_t quant, uint32_t lum) @@ -76,4 +105,13 @@ return dc_scaler; } -#endif /* _GLOBAL_H_ */ \ No newline at end of file + +// useful macros + +#define MIN(X, Y) ((X)<(Y)?(X):(Y)) +#define MAX(X, Y) ((X)>(Y)?(X):(Y)) +#define ABS(X) (((X)>0)?(X):-(X)) +#define SIGN(X) (((X)>0)?1:-1) + + +#endif /* _GLOBAL_H_ */