[svn] / branches / dshow / dshow / src / xvid.h Repository:
ViewVC logotype

Annotation of /branches/dshow/dshow/src/xvid.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (view) (download)

1 : Isibaar 6 #ifndef _XVID_H_
2 :     #define _XVID_H_
3 :    
4 :     #ifdef __cplusplus
5 :     extern "C" {
6 :     #endif
7 :    
8 :     // ==========================================
9 :     // global
10 :     // ==========================================
11 :    
12 :     // API Version: 2.0
13 :     #define API_VERSION ((2 << 16) | (0))
14 :    
15 :     // cpu features
16 :     #define XVID_CPU_MMX 0x00000001
17 :     #define XVID_CPU_MMXEXT 0x00000002
18 :     #define XVID_CPU_SSE 0x00000004
19 :     #define XVID_CPU_SSE2 0x00000008
20 :     #define XVID_CPU_3DNOW 0x00000010
21 :     #define XVID_CPU_3DNOWEXT 0x00000020
22 :     #define XVID_CPU_TSC 0x00000040
23 :     #define XVID_CPU_FORCE 0x80000000
24 :    
25 :     // colorspaces
26 :     #define XVID_CSP_RGB24 0
27 :     #define XVID_CSP_YV12 1
28 :     #define XVID_CSP_YUY2 2
29 :     #define XVID_CSP_UYVY 3
30 :     #define XVID_CSP_I420 4
31 :     #define XVID_CSP_RGB555 10
32 :     #define XVID_CSP_RGB565 11
33 :     #define XVID_CSP_USER 12
34 :     #define XVID_CSP_YVYU 1002
35 :     #define XVID_CSP_RGB32 1000
36 :     #define XVID_CSP_NULL 9999
37 :    
38 :     #define XVID_CSP_VFLIP 0x80000000 // flip mask
39 :    
40 :     // error
41 :     #define XVID_ERR_FAIL -1
42 :     #define XVID_ERR_OK 0
43 :     #define XVID_ERR_MEMORY 1
44 :     #define XVID_ERR_FORMAT 2
45 :    
46 :     typedef struct
47 :     {
48 :     int cpu_flags;
49 :     int api_version;
50 :     int core_build;
51 :     } XVID_INIT_PARAM;
52 :    
53 :     int xvid_init(void *handle, int opt,
54 :     void *param1, void *param2);
55 :    
56 :    
57 :     // ==========================================
58 :     // decoder
59 :     // ==========================================
60 :    
61 :     #define XVID_QUICK_DECODE 0x00000010 /* increases decoding speed but reduces quality */
62 :    
63 :     typedef struct
64 :     {
65 :     int width;
66 :     int height;
67 :     void *handle;
68 :     } XVID_DEC_PARAM;
69 :    
70 :    
71 :     typedef struct
72 :     {
73 :     int general;
74 :     void * bitstream;
75 :     int length;
76 :    
77 :     void * image;
78 :     int stride;
79 :     int colorspace;
80 :     } XVID_DEC_FRAME;
81 :    
82 :    
83 :     // decoder options
84 :     #define XVID_DEC_DECODE 0
85 :     #define XVID_DEC_CREATE 1
86 :     #define XVID_DEC_DESTROY 2
87 :    
88 :     int xvid_decore(void * handle,
89 :     int opt,
90 :     void * param1,
91 :     void * param2);
92 :    
93 :    
94 :     // ==========================================
95 :     // encoder
96 :     // ==========================================
97 :    
98 :     /* Do not rely on the VALUES of these constants, they may be changed at any time */
99 :     #define XVID_VALID_FLAGS 0x80000000
100 :    
101 :     #define XVID_CUSTOM_QMATRIX 0x00000004 /* use custom quant matrix */
102 :     #define XVID_H263QUANT 0x00000010
103 :     #define XVID_MPEGQUANT 0x00000020
104 :     #define XVID_HALFPEL 0x00000040 /* use halfpel interpolation */
105 :     #define XVID_ADAPTIVEQUANT 0x00000080
106 :     #define XVID_LUMIMASKING 0x00000100
107 :    
108 :     #define XVID_INTER4V 0x00000800
109 :    
110 :     #define XVID_ME_ZERO 0x00001000
111 :     #define XVID_ME_LOGARITHMIC 0x00002000
112 :     #define XVID_ME_FULLSEARCH 0x00004000
113 :     #define XVID_ME_PMVFAST 0x00008000
114 :    
115 :     #define PMV_HALFPELDIAMOND16 0x00010000
116 :     #define PMV_HALFPELREFINE16 0x00020000
117 :     #define PMV_EXTSEARCH16 0x00040000 /* extend PMV by more searches */
118 :     #define PMV_EARLYSTOP16 0x00080000
119 :     #define PMV_QUICKSTOP16 0x00100000 /* like early, but without any more refinement */
120 :     #define PMV_UNRESTRICTED16 0x00200000 /* unrestricted ME, not implemented */
121 :     #define PMV_OVERLAPPING16 0x00400000 /* overlapping ME, not implemented */
122 :    
123 :     #define PMV_HALFPELDIAMOND8 0x01000000
124 :     #define PMV_HALFPELREFINE8 0x02000000
125 :     #define PMV_EXTSEARCH8 0x04000000 /* extend PMV by more searches */
126 :     #define PMV_EARLYSTOP8 0x08000000
127 :     #define PMV_QUICKSTOP8 0x10000000 /* like early, but without any more refinement */
128 :     #define PMV_UNRESTRICTED8 0x20000000 /* unrestricted ME, not implemented */
129 :     #define PMV_OVERLAPPING8 0x40000000 /* overlapping ME, not implemented */
130 :    
131 :     typedef struct
132 :     {
133 :     int width, height;
134 :     int fincr, fbase; // frame increment, fbase. each frame = "fincr/fbase" seconds
135 :     int bitrate; // the bitrate of the target encoded stream, in bits/second
136 :     int rc_buffersize; // the rate control buffersize / max. allowed deviation
137 :     int max_quantizer; // the upper limit of the quantizer
138 :     int min_quantizer; // the lower limit of the quantizer
139 :     int max_key_interval; // the maximum interval between key frames
140 :    
141 :     void * handle; // [out] encoder instance handle
142 :    
143 :     } XVID_ENC_PARAM;
144 :    
145 :    
146 :     typedef struct
147 :     {
148 :     int general; // [in] general options
149 :     int motion; // [in] ME options
150 :     void * bitstream; // [in] bitstream ptr
151 :     int length; // [out] bitstream length (bytes)
152 :    
153 :     void * image; // [in] image ptr
154 :     int colorspace; // [in] source colorspace
155 :    
156 :     unsigned char *quant_intra_matrix; // [in] custom intra qmatrix
157 :     unsigned char *quant_inter_matrix; // [in] custom inter qmatrix
158 :     int quant; // [in] frame quantizer (vbr)
159 :     int intra; // [in] force intra frame (vbr only)
160 :     // [out] intra state
161 :     } XVID_ENC_FRAME;
162 :    
163 :    
164 :     typedef struct
165 :     {
166 :     int quant; // [out] frame quantizer
167 :     int hlength; // [out] header length (bytes)
168 :     int kblks, mblks, ublks; // [out]
169 :    
170 :     } XVID_ENC_STATS;
171 :    
172 :    
173 :     #define XVID_ENC_ENCODE 0
174 :     #define XVID_ENC_CREATE 1
175 :     #define XVID_ENC_DESTROY 2
176 :    
177 :     int xvid_encore(void * handle,
178 :     int opt,
179 :     void * param1,
180 :     void * param2);
181 :    
182 :    
183 :     #ifdef __cplusplus
184 :     }
185 :     #endif
186 :    
187 :     #endif /* _XVID_H_ */

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4