--- global.h 2002/03/26 11:16:08 1.2 +++ global.h 2002/04/13 16:30:01 1.5 @@ -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,25 @@ #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 + + 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 @@ -47,6 +62,11 @@ int dquant; int cbp; + // bframe stuff + + VECTOR b_mvs[4]; + VECTOR b_pmvs[4]; + } MACROBLOCK; static __inline int8_t get_dc_scaler(int32_t quant, uint32_t lum) @@ -81,4 +101,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_ */