9 |
// global |
// global |
10 |
// ========================================== |
// ========================================== |
11 |
|
|
12 |
// API Version: 2.0 |
// API Version: 2.1 |
13 |
#define API_VERSION ((2 << 16) | (0)) |
#define API_VERSION ((2 << 16) | (1)) |
14 |
|
|
15 |
// cpu features |
// cpu features |
16 |
#define XVID_CPU_MMX 0x00000001 |
#define XVID_CPU_MMX 0x00000001 |
104 |
#define XVID_HALFPEL 0x00000040 /* use halfpel interpolation */ |
#define XVID_HALFPEL 0x00000040 /* use halfpel interpolation */ |
105 |
#define XVID_ADAPTIVEQUANT 0x00000080 |
#define XVID_ADAPTIVEQUANT 0x00000080 |
106 |
#define XVID_LUMIMASKING 0x00000100 |
#define XVID_LUMIMASKING 0x00000100 |
107 |
|
#define XVID_LATEINTRA 0x00000200 |
108 |
|
|
109 |
#define XVID_INTER4V 0x00000800 |
#define XVID_INTERLACING 0x00000400 /* enable interlaced encoding */ |
110 |
|
#define XVID_TOPFIELDFIRST 0x00000800 /* set top-field-first flag (cosmetic only) */ |
111 |
#define XVID_ME_ZERO 0x00001000 |
#define XVID_ALTERNATESCAN 0x00001000 /* ?? sets alternate vertical scan flag */ |
112 |
#define XVID_ME_LOGARITHMIC 0x00002000 |
|
113 |
#define XVID_ME_FULLSEARCH 0x00004000 |
#define XVID_HINTEDME_GET 0x00002000 /* receive mv hint data from core (1st pass) */ |
114 |
#define XVID_ME_PMVFAST 0x00008000 |
#define XVID_HINTEDME_SET 0x00004000 /* send mv hint data to core (2nd pass) */ |
115 |
|
|
116 |
|
#define XVID_INTER4V 0x00008000 |
117 |
|
|
118 |
|
#define XVID_ME_ZERO 0x00010000 |
119 |
|
#define XVID_ME_LOGARITHMIC 0x00020000 |
120 |
|
#define XVID_ME_FULLSEARCH 0x00040000 |
121 |
|
#define XVID_ME_PMVFAST 0x00080000 |
122 |
|
#define XVID_ME_EPZS 0x00100000 |
123 |
|
|
124 |
#define PMV_HALFPELDIAMOND16 0x00010000 |
#define PMV_HALFPELDIAMOND16 0x00010000 |
125 |
#define PMV_HALFPELREFINE16 0x00020000 |
#define PMV_HALFPELREFINE16 0x00020000 |
128 |
#define PMV_QUICKSTOP16 0x00100000 /* like early, but without any more refinement */ |
#define PMV_QUICKSTOP16 0x00100000 /* like early, but without any more refinement */ |
129 |
#define PMV_UNRESTRICTED16 0x00200000 /* unrestricted ME, not implemented */ |
#define PMV_UNRESTRICTED16 0x00200000 /* unrestricted ME, not implemented */ |
130 |
#define PMV_OVERLAPPING16 0x00400000 /* overlapping ME, not implemented */ |
#define PMV_OVERLAPPING16 0x00400000 /* overlapping ME, not implemented */ |
131 |
|
#define PMV_USESQUARES16 0x00800000 |
132 |
|
|
133 |
#define PMV_HALFPELDIAMOND8 0x01000000 |
#define PMV_HALFPELDIAMOND8 0x01000000 |
134 |
#define PMV_HALFPELREFINE8 0x02000000 |
#define PMV_HALFPELREFINE8 0x02000000 |
137 |
#define PMV_QUICKSTOP8 0x10000000 /* like early, but without any more refinement */ |
#define PMV_QUICKSTOP8 0x10000000 /* like early, but without any more refinement */ |
138 |
#define PMV_UNRESTRICTED8 0x20000000 /* unrestricted ME, not implemented */ |
#define PMV_UNRESTRICTED8 0x20000000 /* unrestricted ME, not implemented */ |
139 |
#define PMV_OVERLAPPING8 0x40000000 /* overlapping ME, not implemented */ |
#define PMV_OVERLAPPING8 0x40000000 /* overlapping ME, not implemented */ |
140 |
|
#define PMV_USESQUARES8 0x80000000 |
141 |
|
|
142 |
|
|
143 |
typedef struct |
typedef struct |
144 |
{ |
{ |
145 |
int width, height; |
int width, height; |
146 |
int fincr, fbase; // frame increment, fbase. each frame = "fincr/fbase" seconds |
int fincr, fbase; // frame increment, fbase. each frame = "fincr/fbase" seconds |
147 |
int bitrate; // the bitrate of the target encoded stream, in bits/second |
int rc_bitrate; // the bitrate of the target encoded stream, in bits/second |
148 |
int rc_buffersize; // the rate control buffersize / max. allowed deviation |
int rc_reaction_delay_factor; // how fast the rate control reacts - lower values are faster |
149 |
|
int rc_averaging_period; // as above |
150 |
|
int rc_buffer; // as above |
151 |
int max_quantizer; // the upper limit of the quantizer |
int max_quantizer; // the upper limit of the quantizer |
152 |
int min_quantizer; // the lower limit of the quantizer |
int min_quantizer; // the lower limit of the quantizer |
153 |
int max_key_interval; // the maximum interval between key frames |
int max_key_interval; // the maximum interval between key frames |
154 |
|
#ifdef BFRAMES |
155 |
|
int max_bframes; // max sequential bframes (0=disable bframes) |
156 |
|
int bquant_ratio; // bframe quantizer multipier (percentage). |
157 |
|
// used only when bquant < 1 |
158 |
|
// eg. 200 = x2 multiplier |
159 |
|
// quant = ((past_quant + future_quant) * bquant_ratio)/200 |
160 |
|
#endif |
161 |
void * handle; // [out] encoder instance handle |
void * handle; // [out] encoder instance handle |
162 |
|
|
163 |
} XVID_ENC_PARAM; |
} XVID_ENC_PARAM; |
165 |
|
|
166 |
typedef struct |
typedef struct |
167 |
{ |
{ |
168 |
|
int x; |
169 |
|
int y; |
170 |
|
} VECTOR; |
171 |
|
|
172 |
|
typedef struct |
173 |
|
{ |
174 |
|
int mode; // macroblock mode |
175 |
|
VECTOR mvs[4]; |
176 |
|
} MVBLOCKHINT; |
177 |
|
|
178 |
|
typedef struct |
179 |
|
{ |
180 |
|
int intra; // frame intra choice |
181 |
|
int fcode; // frame fcode |
182 |
|
MVBLOCKHINT * block; // caller-allocated array of block hints (mb_width * mb_height) |
183 |
|
} MVFRAMEHINT; |
184 |
|
|
185 |
|
typedef struct |
186 |
|
{ |
187 |
|
int rawhints; // if set, use MVFRAMEHINT, else use compressed buffer |
188 |
|
|
189 |
|
MVFRAMEHINT mvhint; |
190 |
|
void * hintstream; // compressed hint buffer |
191 |
|
int hintlength; // length of buffer (bytes) |
192 |
|
} HINTINFO; |
193 |
|
|
194 |
|
typedef struct |
195 |
|
{ |
196 |
int general; // [in] general options |
int general; // [in] general options |
197 |
int motion; // [in] ME options |
int motion; // [in] ME options |
198 |
void * bitstream; // [in] bitstream ptr |
void * bitstream; // [in] bitstream ptr |
206 |
int quant; // [in] frame quantizer (vbr) |
int quant; // [in] frame quantizer (vbr) |
207 |
int intra; // [in] force intra frame (vbr only) |
int intra; // [in] force intra frame (vbr only) |
208 |
// [out] intra state |
// [out] intra state |
209 |
|
HINTINFO hint; // [in/out] mv hint information |
210 |
|
|
211 |
|
#ifdef BFRAMES |
212 |
|
int bquant; // [in] bframe quantizer |
213 |
|
int input_consumed; // [out] |
214 |
|
#endif |
215 |
|
|
216 |
} XVID_ENC_FRAME; |
} XVID_ENC_FRAME; |
217 |
|
|
218 |
|
|