23 |
#define MODE_DIRECT_NONE_MV 4 |
#define MODE_DIRECT_NONE_MV 4 |
24 |
#define MODE_DIRECT_NO4V 5 |
#define MODE_DIRECT_NO4V 5 |
25 |
|
|
26 |
|
|
27 |
|
// vop coding types |
28 |
|
// intra, prediction, backward, sprite, not_coded |
29 |
|
#define I_VOP 0 |
30 |
|
#define P_VOP 1 |
31 |
|
#define B_VOP 2 |
32 |
|
#define S_VOP 3 |
33 |
|
#define N_VOP 4 |
34 |
|
|
35 |
|
/* convert mpeg-4 coding type i/p/b/s_VOP to XVID_TYPE_xxx */ |
36 |
|
static __inline int |
37 |
|
coding2type(int coding_type) |
38 |
|
{ |
39 |
|
return coding_type + 1; |
40 |
|
} |
41 |
|
|
42 |
|
/* convert XVID_TYPE_xxx to bitstream coding type i/p/b/s_VOP */ |
43 |
|
static __inline int |
44 |
|
type2coding(int xvid_type) |
45 |
|
{ |
46 |
|
return xvid_type - 1; |
47 |
|
} |
48 |
|
|
49 |
|
|
50 |
|
typedef struct |
51 |
|
{ |
52 |
|
int x; |
53 |
|
int y; |
54 |
|
} |
55 |
|
VECTOR; |
56 |
|
|
57 |
|
|
58 |
|
|
59 |
typedef struct |
typedef struct |
60 |
{ |
{ |
61 |
VECTOR duv[3]; |
VECTOR duv[3]; |
89 |
int j0s; |
int j0s; |
90 |
int i1s; |
int i1s; |
91 |
int j1s; |
int j1s; |
92 |
// int i2s; |
int i2s; |
93 |
// int j2s; |
int j2s; |
94 |
|
|
95 |
int i1ss; |
int i1ss; |
96 |
int j1ss; |
int j1ss; |
97 |
// int i2ss; |
int i2ss; |
98 |
// int j2ss; |
int j2ss; |
99 |
|
|
100 |
int alpha; |
int alpha; |
101 |
// int beta; |
int beta; |
102 |
int Ws; |
int Ws; |
103 |
// int Hs; |
int Hs; |
104 |
|
|
105 |
|
int dxF, dyF, dxG, dyG; |
106 |
|
int Fo, Go; |
107 |
|
int cFo, cGo; |
108 |
} |
} |
109 |
GMC_DATA; |
GMC_DATA; |
110 |
|
|
166 |
|
|
167 |
VECTOR b_mvs[4]; |
VECTOR b_mvs[4]; |
168 |
VECTOR b_qmvs[4]; |
VECTOR b_qmvs[4]; |
|
// VECTOR b_pmvs[1]; |
|
|
|
|
|
// bframe direct mode |
|
|
|
|
|
// VECTOR directmv[4]; |
|
|
// VECTOR deltamv; |
|
169 |
|
|
170 |
int mb_type; |
int mb_type; |
|
int dbquant; |
|
171 |
|
|
172 |
// stuff for block based ME (needed for Qpel ME) |
// stuff for block based ME (needed for Qpel ME) |
173 |
// backup of last integer ME vectors/sad |
// backup of last integer ME vectors/sad |
174 |
|
|
|
// VECTOR i_mv16; |
|
|
VECTOR i_mvs[4]; |
|
|
|
|
|
int32_t i_sad8[4]; // SAD values for inter4v-VECTORs |
|
|
// int32_t i_sad16; // SAD value for inter-VECTOR |
|
|
|
|
175 |
VECTOR amv; // average motion vectors from GMC |
VECTOR amv; // average motion vectors from GMC |
176 |
int32_t mcsel; |
int32_t mcsel; |
177 |
|
|
180 |
} |
} |
181 |
MACROBLOCK; |
MACROBLOCK; |
182 |
|
|
183 |
static __inline int8_t |
static __inline uint32_t |
184 |
get_dc_scaler(uint32_t quant, |
get_dc_scaler(uint32_t quant, |
185 |
uint32_t lum) |
uint32_t lum) |
186 |
{ |
{ |
210 |
#define SIGN(X) (((X)>0)?1:-1) |
#define SIGN(X) (((X)>0)?1:-1) |
211 |
#define CLIP(X,AMIN,AMAX) (((X)<(AMIN)) ? (AMIN) : ((X)>(AMAX)) ? (AMAX) : (X)) |
#define CLIP(X,AMIN,AMAX) (((X)<(AMIN)) ? (AMIN) : ((X)>(AMAX)) ? (AMAX) : (X)) |
212 |
#define DIV_DIV(a,b) (((a)>0) ? ((a)+((b)>>1))/(b) : ((a)-((b)>>1))/(b)) |
#define DIV_DIV(a,b) (((a)>0) ? ((a)+((b)>>1))/(b) : ((a)-((b)>>1))/(b)) |
213 |
|
#define SWAP(_T_,A,B) { _T_ tmp = A; A = B; B = tmp; } |
214 |
|
|
215 |
|
|
216 |
#endif /* _GLOBAL_H_ */ |
#endif /* _GLOBAL_H_ */ |