--- global.h 2002/04/05 14:40:36 1.4 +++ global.h 2002/04/13 16:30:01 1.5 @@ -4,7 +4,7 @@ #include "xvid.h" #include "portab.h" -/* --- macroblock stuff --- */ +/* --- macroblock modes --- */ #define MODE_INTER 0 #define MODE_INTER_Q 1 @@ -14,6 +14,14 @@ #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 { uint32_t bufa; @@ -54,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) @@ -88,4 +101,13 @@ return dc_scaler; } + +// 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_ */