60 |
* You can use it to check if the host XviD library API is the same as the one |
* You can use it to check if the host XviD library API is the same as the one |
61 |
* you used to build you client program. If versions mismatch, then it is |
* you used to build you client program. If versions mismatch, then it is |
62 |
* highly possible that your application will segfault because the host XviD |
* highly possible that your application will segfault because the host XviD |
63 |
* library and your application use structure fields in different ways. |
* library and your application use different structures. |
64 |
* |
* |
65 |
*/ |
*/ |
66 |
|
|
73 |
|
|
74 |
|
|
75 |
/** |
/** |
76 |
* \defgroup error_grp Error codes used by XviD API entry points. |
* \defgroup error_grp Error codes returned by XviD API entry points. |
77 |
* @{ |
* @{ |
78 |
*/ |
*/ |
79 |
|
|
85 |
* this point of the code. Clean all instances you |
* this point of the code. Clean all instances you |
86 |
* already created and exit the program cleanly. |
* already created and exit the program cleanly. |
87 |
* <li>xvid_encore or xvid_decore : something was wrong and en/decoding |
* <li>xvid_encore or xvid_decore : something was wrong and en/decoding |
88 |
* operation has not been completed |
* operation was not completed sucessfully. |
89 |
* sucessfully. At your option, you can |
* you can stop the en/decoding process or just |
90 |
* stop the en/decoding process or just ignore |
* ignore and go on. |
|
* and go on. |
|
91 |
* <li>xvid_stop : you can safely ignore it if you call this function at the |
* <li>xvid_stop : you can safely ignore it if you call this function at the |
92 |
* end of your program. |
* end of your program. |
93 |
* </ul> |
* </ul> |
101 |
|
|
102 |
#define XVID_ERR_MEMORY 1 /**< Operation failed. |
#define XVID_ERR_MEMORY 1 /**< Operation failed. |
103 |
* |
* |
104 |
* No memory was available on the host system, this is probably time to kill |
* Insufficent memory was available on the host system. |
|
* some unuseful programs (WinSpyWare, KDE, GNOME</trollinside>) in order to |
|
|
* use XviD. |
|
105 |
*/ |
*/ |
106 |
|
|
107 |
#define XVID_ERR_FORMAT 2 /**< Operation failed. |
#define XVID_ERR_FORMAT 2 /**< Operation failed. |
108 |
* |
* |
109 |
* The format of the parameters, input stream were wrong. |
* The format of the parameters or input stream were incorrect. |
110 |
*/ |
*/ |
111 |
|
|
112 |
/** @} */ |
/** @} */ |
122 |
* @{ |
* @{ |
123 |
*/ |
*/ |
124 |
|
|
125 |
#define XVID_CSP_RGB24 0 /**< Input/output frame uses the RGB24 colorspace format */ |
#define XVID_CSP_RGB24 0 /**< 24-bit RGB colorspace (b,g,r packed) */ |
126 |
#define XVID_CSP_YV12 1 /**< Input/output frame uses the YV12 colorspace format */ |
#define XVID_CSP_YV12 1 /**< YV12 colorspace (y,v,u planar) */ |
127 |
#define XVID_CSP_YUY2 2 /**< Input/output frame uses the YUV2 colorspace format */ |
#define XVID_CSP_YUY2 2 /**< YUY2 colorspace (y,u,y,v packed) */ |
128 |
#define XVID_CSP_UYVY 3 /**< Input/output frame uses the UYVY colorspace format */ |
#define XVID_CSP_UYVY 3 /**< UYVY colorspace (u,y,v,y packed) */ |
129 |
#define XVID_CSP_I420 4 /**< Input/output frame uses the I420 colorspace format */ |
#define XVID_CSP_I420 4 /**< I420 colorsapce (y,u,v planar) */ |
130 |
#define XVID_CSP_RGB555 10 /**< Input/output frame uses the RGB555 colorspace format */ |
#define XVID_CSP_RGB555 10 /**< 16-bit RGB555 colorspace */ |
131 |
#define XVID_CSP_RGB565 11 /**< Input/output frame uses the RGB565 colorspace format */ |
#define XVID_CSP_RGB565 11 /**< 16-bit RGB565 colorspace */ |
132 |
#define XVID_CSP_USER 12 /**< Input/output frame uses the USER colorspace format |
#define XVID_CSP_USER 12 /**< user colorspace format, where the image buffer points |
133 |
* |
* to a DEC_PICTURE (y,u,v planar) structure. |
134 |
* XviD will not perform any colorspace conversion. The |
* |
135 |
* output will be the native MPEG4 YV12 colorspace. Up to |
* For encoding, image is read from the DEC_PICTURE |
136 |
* the client application to convert it to a usable format. */ |
* parameter values. For decoding, the DEC_PICTURE |
137 |
|
* parameters are set, pointing to the internal XviD |
138 |
|
* image buffer. */ |
139 |
#define XVID_CSP_EXTERN 1004 /**< Special colorspace used for slice rendering |
#define XVID_CSP_EXTERN 1004 /**< Special colorspace used for slice rendering |
140 |
* |
* |
141 |
* The application provides an external buffer to XviD. |
* The application provides an external buffer to XviD. |
143 |
* buffer, no need to specify this is a speed boost feature. |
* buffer, no need to specify this is a speed boost feature. |
144 |
* This feature is only used by mplayer at the moment, refer |
* This feature is only used by mplayer at the moment, refer |
145 |
* to mplayer code to see how it can be used. */ |
* to mplayer code to see how it can be used. */ |
146 |
#define XVID_CSP_YVYU 1002 /**< Input/output frame uses the YVYU colorspace format */ |
#define XVID_CSP_YVYU 1002 /**< YVYU colorspace (y,v,y,u packed) */ |
147 |
#define XVID_CSP_RGB32 1000 /**< Input/output frame uses the RGB32 colorspace format */ |
#define XVID_CSP_RGB32 1000 /**< 32-bit RGB colorspace (b,g,r,a packed) */ |
148 |
#define XVID_CSP_NULL 9999 /**< Input/output frame uses the NULL colorspace format */ |
#define XVID_CSP_NULL 9999 /**< NULL colorspace; no conversion is performed */ |
149 |
|
|
150 |
#define XVID_CSP_VFLIP 0x80000000 /**< Flips input/output frames */ |
#define XVID_CSP_VFLIP 0x80000000 /**< (flag) Flip frame vertically during conversion */ |
151 |
|
|
152 |
/** @} */ |
/** @} */ |
153 |
|
|
187 |
#define XVID_CPU_SSE 0x00000004 /**< use/has SSE (pentium3) instruction set */ |
#define XVID_CPU_SSE 0x00000004 /**< use/has SSE (pentium3) instruction set */ |
188 |
#define XVID_CPU_SSE2 0x00000008 /**< use/has SSE2 (pentium4) instruction set */ |
#define XVID_CPU_SSE2 0x00000008 /**< use/has SSE2 (pentium4) instruction set */ |
189 |
#define XVID_CPU_3DNOW 0x00000010 /**< use/has 3dNOW (k6-2) instruction set */ |
#define XVID_CPU_3DNOW 0x00000010 /**< use/has 3dNOW (k6-2) instruction set */ |
190 |
#define XVID_CPU_3DNOWEXT 0x00000020 /**< use/has 3dNOW-ext (???) instruction set */ |
#define XVID_CPU_3DNOWEXT 0x00000020 /**< use/has 3dNOW-ext (athlon) instruction set */ |
191 |
#define XVID_CPU_TSC 0x00000040 /**< has TimeStampCounter instruction */ |
#define XVID_CPU_TSC 0x00000040 /**< has TimeStampCounter instruction */ |
192 |
|
|
193 |
/** @} */ |
/** @} */ |
247 |
* library |
* library |
248 |
*/ |
*/ |
249 |
int core_build; /**< [out] |
int core_build; /**< [out] |
250 |
* \todo Still unused at the moment, what do we |
* \todo Unused. |
|
* do with that ? |
|
251 |
*/ |
*/ |
252 |
} |
} |
253 |
XVID_INIT_PARAM; |
XVID_INIT_PARAM; |
290 |
* \defgroup decoder_grp Decoder related functions and structures. |
* \defgroup decoder_grp Decoder related functions and structures. |
291 |
* |
* |
292 |
* This part describes all the structures/functions from XviD's API needed for |
* This part describes all the structures/functions from XviD's API needed for |
293 |
* decoding a MPEG4 compliant stream. |
* decoding a MPEG4 compliant streams. |
294 |
* @{ |
* @{ |
295 |
*/ |
*/ |
296 |
|
|
365 |
#define XVID_DEC_CREATE 1 /**< Creates a decoder instance |
#define XVID_DEC_CREATE 1 /**< Creates a decoder instance |
366 |
* |
* |
367 |
* This operation constant is used by a client application in order to create |
* This operation constant is used by a client application in order to create |
368 |
* a decoder instance. All instances are independant from each other, so |
* a decoder instance. Decoder instances are independant from each other, and |
369 |
* client application can use safely various threads, each decoding a |
* can be safely threaded. |
|
* different MPEG4 bitstream. |
|
370 |
*/ |
*/ |
371 |
|
|
372 |
#define XVID_DEC_DESTROY 2 /**< Destroys a decoder instance |
#define XVID_DEC_DESTROY 2 /**< Destroys a decoder instance |
391 |
* This is the XviD's decoder entry point. The possible operations are |
* This is the XviD's decoder entry point. The possible operations are |
392 |
* described in the \ref decops_grp section. |
* described in the \ref decops_grp section. |
393 |
* |
* |
394 |
* \param handle Todo |
* \param handle Decoder instance handle. |
395 |
* \param opt Todo |
* \param opt Decoder option constant |
396 |
* \param param1 Todo |
* \param param1 Used to pass a XVID_DEC_PARAM or XVID_DEC_FRAME structure |
397 |
* \param param2 Todo |
* \param param2 Reserved for future use. |
398 |
*/ |
*/ |
399 |
|
|
400 |
int xvid_decore(void *handle, |
int xvid_decore(void *handle, |
440 |
* |
* |
441 |
* informs xvid to perform an adaptative quantization using a Luminance |
* informs xvid to perform an adaptative quantization using a Luminance |
442 |
* masking algorithm */ |
* masking algorithm */ |
443 |
#define XVID_LUMIMASKING 0x00000100/**< Lumiomasking flag |
#define XVID_LUMIMASKING 0x00000100/**< Lumimasking flag |
444 |
* |
* |
445 |
* \deprecated Please do not use this flag anymore */ |
* \deprecated This flag is no longer used. */ |
446 |
#define XVID_LATEINTRA 0x00000200/**< Unknown |
#define XVID_LATEINTRA 0x00000200/**< Unknown |
447 |
* |
* |
448 |
* ??? */ |
* \deprecated This flag is no longer used. */ |
449 |
#define XVID_INTERLACING 0x00000400/**< MPEG4 interlacing mode. |
#define XVID_INTERLACING 0x00000400/**< MPEG4 interlacing mode. |
450 |
* |
* |
451 |
* Switches MPEG4 interlacing mode */ |
* Enables interlacing encoding mode */ |
452 |
#define XVID_TOPFIELDFIRST 0x00000800/**< |
#define XVID_TOPFIELDFIRST 0x00000800/**< Unknown |
453 |
* |
* |
454 |
* */ |
* \deprecated This flag is no longer used. */ |
455 |
#define XVID_ALTERNATESCAN 0x00001000/**< |
#define XVID_ALTERNATESCAN 0x00001000/**< |
456 |
* |
* |
457 |
* */ |
* \deprecated This flag is no longer used. */ |
458 |
#define XVID_HINTEDME_GET 0x00002000/**< Gets Motion vector data from ME system. |
#define XVID_HINTEDME_GET 0x00002000/**< Gets Motion vector data from ME system. |
459 |
* |
* |
460 |
* informs xvid to return Motion Estimation vectors from the ME encoder |
* informs xvid to return Motion Estimation vectors from the ME encoder |
487 |
* |
* |
488 |
* This flags forces XviD to discard chroma data, this is not mpeg4 greyscale |
* This flags forces XviD to discard chroma data, this is not mpeg4 greyscale |
489 |
* mode, it simply drops chroma MBs using cbp == 0 for these blocks */ |
* mode, it simply drops chroma MBs using cbp == 0 for these blocks */ |
490 |
#define XVID_GRAYSCALE XVID_GREYSCALE /**< XVID_GREYSCALE alia for US speakerss |
#define XVID_GRAYSCALE XVID_GREYSCALE /**< XVID_GREYSCALE alias |
491 |
* |
* |
492 |
* Same as above */ |
* United States locale support. */ |
493 |
|
|
494 |
/** @} */ |
/** @} */ |
495 |
|
|
681 |
* Frame quantizer : |
* Frame quantizer : |
682 |
* <ul> |
* <ul> |
683 |
* <li> 0 (zero) : Then the rate controler chooses the right quantizer |
* <li> 0 (zero) : Then the rate controler chooses the right quantizer |
684 |
* for you. Tipically used in ABR encoding or first pass of a VBR |
* for you. Typically used in ABR encoding, or first pass of a VBR |
685 |
* encoding session. |
* encoding session. |
686 |
* <li> != 0 : Then you force the encoder to use this specific |
* <li> != 0 : Then you force the encoder to use this specific |
687 |
* quantizer value. It is clamped in the interval |
* quantizer value. It is clamped in the interval |
724 |
* Header bytes in the resulting MPEG4 stream */ |
* Header bytes in the resulting MPEG4 stream */ |
725 |
int kblks; /**< [out] |
int kblks; /**< [out] |
726 |
* |
* |
727 |
* Number of MacroBlocks coded as Intra blocks */ |
* Number of intra macro blocks */ |
728 |
int mblks; /**< [out] |
int mblks; /**< [out] |
729 |
* |
* |
730 |
* Number of MacroBlocks coded as Inter blocks */ |
* Number of inter macro blocks */ |
731 |
int ublks; /**< [out] |
int ublks; /**< [out] |
732 |
* |
* |
733 |
* Number of MacroBlocks coded as skipped blocks */ |
* Number of skipped macro blocks */ |
734 |
} |
} |
735 |
XVID_ENC_STATS; |
XVID_ENC_STATS; |
736 |
|
|
756 |
#define XVID_ENC_CREATE 1 /**< Creates a decoder instance |
#define XVID_ENC_CREATE 1 /**< Creates a decoder instance |
757 |
* |
* |
758 |
* This operation constant is used by a client application in order to create |
* This operation constant is used by a client application in order to create |
759 |
* an encoder instance. All instances are independant from each other, so |
* an encoder instance. Encoder instances are independant from each other. |
|
* client application can use safely various threads, each encoding a |
|
|
* different set of frames. |
|
760 |
*/ |
*/ |
761 |
|
|
762 |
#define XVID_ENC_DESTROY 2 /**< Destroys a encoder instance |
#define XVID_ENC_DESTROY 2 /**< Destroys a encoder instance |
780 |
* This is the XviD's encoder entry point. The possible operations are |
* This is the XviD's encoder entry point. The possible operations are |
781 |
* described in the \ref encops_grp section. |
* described in the \ref encops_grp section. |
782 |
* |
* |
783 |
* \param handle Todo |
* \param handle Encoder instance handle |
784 |
* \param opt Todo |
* \param opt Encoder option constant |
785 |
* \param param1 Todo |
* \param param1 Used to pass XVID_ENC_PARAM or XVID_ENC_FRAME structures. |
786 |
* \param param2 Todo |
* \param param2 Optionally used to pass the XVID_ENC_STATS structure. |
787 |
*/ |
*/ |
788 |
int xvid_encore(void *handle, |
int xvid_encore(void *handle, |
789 |
int opt, |
int opt, |