[cvs] / xvidcore / src / xvid.h Repository:
ViewVC logotype

Diff of /xvidcore/src/xvid.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21, Thu Oct 24 10:56:07 2002 UTC revision 1.23, Sat Nov 16 23:38:16 2002 UTC
# Line 3  Line 3 
3   *  XVID MPEG-4 VIDEO CODEC   *  XVID MPEG-4 VIDEO CODEC
4   *  - XviD Main header file -   *  - XviD Main header file -
5   *   *
6   *  This program is an implementation of a part of one or more MPEG-4   *  This file is part of XviD, a free MPEG-4 video encoder/decoder
  *  Video tools as specified in ISO/IEC 14496-2 standard.  Those intending  
  *  to use this software module in hardware or software products are  
  *  advised that its use may infringe existing patents or copyrights, and  
  *  any such use would be at such party's own risk.  The original  
  *  developer of this software module and his/her company, and subsequent  
  *  editors and their companies, will have no liability for use of this  
  *  software or modifications or derivatives thereof.  
7   *   *
8   *  This program is free software ; you can redistribute it and/or modify   *  XviD is free software; you can redistribute it and/or modify it
9   *  it under the terms of the GNU General Public License as published by   *  under the terms of the GNU General Public License as published by
10   *  the Free Software Foundation ; either version 2 of the License, or   *  the Free Software Foundation ; either version 2 of the License, or
11   *  (at your option) any later version.   *  (at your option) any later version.
12   *   *
# Line 26  Line 19 
19   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22     *  Under section 8 of the GNU General Public License, the copyright
23     *  holders of XVID explicitly forbid distribution in the following
24     *  countries:
25     *
26     *    - Japan
27     *    - United States of America
28     *
29     *  Linking XviD statically or dynamically with other modules is making a
30     *  combined work based on XviD.  Thus, the terms and conditions of the
31     *  GNU General Public License cover the whole combination.
32     *
33     *  As a special exception, the copyright holders of XviD give you
34     *  permission to link XviD with independent modules that communicate with
35     *  XviD solely through the VFW1.1 and DShow interfaces, regardless of the
36     *  license terms of these independent modules, and to copy and distribute
37     *  the resulting combined work under terms of your choice, provided that
38     *  every copy of the combined work is accompanied by a complete copy of
39     *  the source code of XviD (the version of XviD used to produce the
40     *  combined work), being distributed under the terms of the GNU General
41     *  Public License plus this exception.  An independent module is a module
42     *  which is not derived from or based on XviD.
43     *
44     *  Note that people who make modified versions of XviD are not obligated
45     *  to grant this special exception for their modified versions; it is
46     *  their choice whether to do so.  The GNU General Public License gives
47     *  permission to release a modified version without this exception; this
48     *  exception also makes it possible to release a modified version which
49     *  carries forward this exception.
50     *
51   * $Id$   * $Id$
52   *   *
53   *****************************************************************************/   *****************************************************************************/
# Line 60  Line 82 
82   * 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
83   * 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
84   * highly possible that your application will segfault because the host XviD   * highly possible that your application will segfault because the host XviD
85   * library and your application use structure fields in different ways.   * library and your application use different structures.
86   *   *
87   */   */
88    
# Line 73  Line 95 
95    
96    
97  /**  /**
98   * \defgroup error_grp Error codes used by XviD API entry points.   * \defgroup error_grp Error codes returned by XviD API entry points.
99   * @{   * @{
100   */   */
101    
# Line 85  Line 107 
107   *                              this point of the code. Clean all instances you   *                              this point of the code. Clean all instances you
108   *                              already created and exit the program cleanly.   *                              already created and exit the program cleanly.
109   * <li>xvid_encore or xvid_decore : something was wrong and en/decoding   * <li>xvid_encore or xvid_decore : something was wrong and en/decoding
110   *                                  operation has not been completed   *                                  operation was not completed sucessfully.
111   *                                 sucessfully. At your option, you can   *                                  you can stop the en/decoding process or just
112   *                                 stop the en/decoding process or just ignore   *                                                                      ignore and go on.
  *                                 and go on.  
113   * <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
114   *                 end of your program.   *                 end of your program.
115   * </ul>   * </ul>
# Line 102  Line 123 
123    
124  #define XVID_ERR_MEMORY  1 /**< Operation failed.  #define XVID_ERR_MEMORY  1 /**< Operation failed.
125                              *                              *
126   * 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.  
127   */   */
128    
129  #define XVID_ERR_FORMAT  2 /**< Operation failed.  #define XVID_ERR_FORMAT  2 /**< Operation failed.
130                              *                              *
131   * The format of the parameters, input stream were wrong.   * The format of the parameters or input stream were incorrect.
132   */   */
133    
134  /** @} */  /** @} */
# Line 125  Line 144 
144   * @{   * @{
145   */   */
146    
147  #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) */
148  #define XVID_CSP_YV12   1  /**< Input/output frame uses the YV12 colorspace format */  #define XVID_CSP_YV12   1  /**< YV12 colorspace (y,v,u planar) */
149  #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) */
150  #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) */
151  #define XVID_CSP_I420   4  /**< Input/output frame uses the I420 colorspace format */  #define XVID_CSP_I420   4  /**< I420 colorsapce (y,u,v planar) */
152  #define XVID_CSP_RGB555 10 /**< Input/output frame uses the RGB555 colorspace format */  #define XVID_CSP_RGB555 10 /**< 16-bit RGB555 colorspace */
153  #define XVID_CSP_RGB565 11 /**< Input/output frame uses the RGB565 colorspace format */  #define XVID_CSP_RGB565 11 /**< 16-bit RGB565 colorspace */
154  #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
155                              *                              *   to a DEC_PICTURE (y,u,v planar) structure.
156                              * XviD will not perform any colorspace conversion. The                                                          *
157                              * output will be the native MPEG4 YV12 colorspace. Up to                                                          *   For encoding, image is read from the DEC_PICTURE
158                              * the client application to convert it to a usable format. */                                                          *   parameter values. For decoding, the DEC_PICTURE
159                                *   parameters are set, pointing to the internal XviD
160                                *   image buffer. */
161  #define XVID_CSP_EXTERN 1004 /**< Special colorspace used for slice rendering  #define XVID_CSP_EXTERN 1004 /**< Special colorspace used for slice rendering
162                                *                                *
163                                * The application provides an external buffer to XviD.                                * The application provides an external buffer to XviD.
# Line 144  Line 165 
165                                * buffer, no need to specify this is a speed boost feature.                                * buffer, no need to specify this is a speed boost feature.
166                                * This feature is only used by mplayer at the moment, refer                                * This feature is only used by mplayer at the moment, refer
167                                * to mplayer code to see how it can be used. */                                * to mplayer code to see how it can be used. */
168  #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) */
169  #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) */
170  #define XVID_CSP_NULL   9999 /**< Input/output frame uses the NULL colorspace format */  #define XVID_CSP_NULL   9999 /**< NULL colorspace; no conversion is performed */
171    
172  #define XVID_CSP_VFLIP  0x80000000 /**< Flips input/output frames */  #define XVID_CSP_VFLIP  0x80000000 /**< (flag) Flip frame vertically during conversion */
173    
174  /** @} */  /** @} */
175    
# Line 188  Line 209 
209  #define XVID_CPU_SSE      0x00000004 /**< use/has SSE (pentium3) instruction set */  #define XVID_CPU_SSE      0x00000004 /**< use/has SSE (pentium3) instruction set */
210  #define XVID_CPU_SSE2     0x00000008 /**< use/has SSE2 (pentium4) instruction set */  #define XVID_CPU_SSE2     0x00000008 /**< use/has SSE2 (pentium4) instruction set */
211  #define XVID_CPU_3DNOW    0x00000010 /**< use/has 3dNOW (k6-2) instruction set */  #define XVID_CPU_3DNOW    0x00000010 /**< use/has 3dNOW (k6-2) instruction set */
212  #define XVID_CPU_3DNOWEXT 0x00000020 /**< use/has 3dNOW-ext (???) instruction set */  #define XVID_CPU_3DNOWEXT 0x00000020 /**< use/has 3dNOW-ext (athlon) instruction set */
213  #define XVID_CPU_TSC      0x00000040 /**< has TimeStampCounter instruction */  #define XVID_CPU_TSC      0x00000040 /**< has TimeStampCounter instruction */
214    
215  /** @} */  /** @} */
# Line 248  Line 269 
269                                    * library                                    * library
270                                    */                                    */
271                  int core_build;  /**< [out]                  int core_build;  /**< [out]
272                                    * \todo Still unused at the moment, what do we                                    * \todo Unused.
                                   * do with that ?  
273                                    */                                    */
274          }          }
275          XVID_INIT_PARAM;          XVID_INIT_PARAM;
# Line 292  Line 312 
312   * \defgroup decoder_grp Decoder related functions and structures.   * \defgroup decoder_grp Decoder related functions and structures.
313   *   *
314   *  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
315   *  decoding a MPEG4 compliant stream.   *  decoding a MPEG4 compliant streams.
316   *  @{   *  @{
317   */   */
318    
# Line 367  Line 387 
387  #define XVID_DEC_CREATE         1 /**< Creates a decoder instance  #define XVID_DEC_CREATE         1 /**< Creates a decoder instance
388                                     *                                     *
389   * 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
390   * a decoder instance. All instances are independant from each other, so   * a decoder instance. Decoder instances are independant from each other, and
391   * client application can use safely various threads, each decoding a   * can be safely threaded.
  * different MPEG4 bitstream.  
392   */   */
393    
394  #define XVID_DEC_DESTROY        2 /**< Destroys a decoder instance  #define XVID_DEC_DESTROY        2 /**< Destroys a decoder instance
# Line 394  Line 413 
413   * This is the XviD's decoder entry point. The possible operations are   * This is the XviD's decoder entry point. The possible operations are
414   * described in the \ref decops_grp section.   * described in the \ref decops_grp section.
415   *   *
416   * \param handle Todo   * \param handle Decoder instance handle.
417   * \param opt Todo   * \param opt Decoder option constant
418   * \param param1 Todo   * \param param1 Used to pass a XVID_DEC_PARAM or XVID_DEC_FRAME structure
419   * \param param2 Todo   * \param param2 Reserved for future use.
420   */   */
421    
422          int xvid_decore(void *handle,          int xvid_decore(void *handle,
# Line 443  Line 462 
462                                                                                          *                                                                                          *
463  * informs  xvid  to perform  an  adaptative quantization using a Luminance  * informs  xvid  to perform  an  adaptative quantization using a Luminance
464  * masking algorithm */  * masking algorithm */
465  #define XVID_LUMIMASKING                0x00000100/**< Lumiomasking flag  #define XVID_LUMIMASKING                0x00000100/**< Lumimasking flag
466                                                                                          *                                                                                          *
467  * \deprecated Please do not use this flag anymore */                                                                                          * \deprecated This flag is no longer used. */
468  #define XVID_LATEINTRA                  0x00000200/**< Unknown  #define XVID_LATEINTRA                  0x00000200/**< Unknown
469                                                                                          *                                                                                          *
470  * ??? */                                                                                          * \deprecated This flag is no longer used. */
471  #define XVID_INTERLACING                0x00000400/**< MPEG4 interlacing mode.  #define XVID_INTERLACING                0x00000400/**< MPEG4 interlacing mode.
472                                                                                          *                                                                                          *
473  * Switches MPEG4 interlacing mode */                                                                                          * Enables interlacing encoding mode */
474  #define XVID_TOPFIELDFIRST              0x00000800/**<  #define XVID_TOPFIELDFIRST              0x00000800/**< Unknown
475                                                                                          *                                                                                          *
476  * */                                                                                          * \deprecated This flag is no longer used. */
477  #define XVID_ALTERNATESCAN              0x00001000/**<  #define XVID_ALTERNATESCAN              0x00001000/**<
478                                                                                          *                                                                                          *
479  * */                                                                                          * \deprecated This flag is no longer used. */
480  #define XVID_HINTEDME_GET               0x00002000/**< Gets Motion vector data from ME system.  #define XVID_HINTEDME_GET               0x00002000/**< Gets Motion vector data from ME system.
481                                                                                          *                                                                                          *
482  * informs  xvid to  return  Motion Estimation vectors from the ME encoder  * informs  xvid to  return  Motion Estimation vectors from the ME encoder
# Line 490  Line 509 
509                                                                                          *                                                                                          *
510  * 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
511  * mode, it simply drops chroma MBs using cbp == 0 for these blocks */  * mode, it simply drops chroma MBs using cbp == 0 for these blocks */
512  #define XVID_GRAYSCALE                  XVID_GREYSCALE /**< XVID_GREYSCALE alia for US speakerss  #define XVID_GRAYSCALE                  XVID_GREYSCALE /**< XVID_GREYSCALE alias
513                                                                                          *                                                                                          *
514  * Same as above */  * United States locale support. */
515    
516  /** @} */  /** @} */
517    
# Line 684  Line 703 
703                                                                                          * Frame quantizer :                                                                                          * Frame quantizer :
704                                                                                          * <ul>                                                                                          * <ul>
705                                                                                          * <li> 0 (zero) : Then the  rate controler chooses the right quantizer                                                                                          * <li> 0 (zero) : Then the  rate controler chooses the right quantizer
706                                                                                          *                 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
707                                                                                          *                 encoding session.                                                                                          *                 encoding session.
708                                                                                          * <li> !=  0  :  Then you  force  the  encoder  to use  this  specific                                                                                          * <li> !=  0  :  Then you  force  the  encoder  to use  this  specific
709                                                                                          *                  quantizer   value.     It   is   clamped    in   the   interval                                                                                          *                  quantizer   value.     It   is   clamped    in   the   interval
# Line 727  Line 746 
746                                                                    * Header bytes in the resulting MPEG4 stream */                                                                    * Header bytes in the resulting MPEG4 stream */
747                  int kblks;               /**< [out]                  int kblks;               /**< [out]
748                                                                    *                                                                    *
749                                                                    * Number of MacroBlocks coded as Intra blocks */                                                                    * Number of intra macro blocks  */
750                  int mblks;               /**< [out]                  int mblks;               /**< [out]
751                                                                    *                                                                    *
752                                                                    * Number of MacroBlocks coded as Inter blocks */                                                                    * Number of inter macro blocks */
753                  int ublks;               /**< [out]                  int ublks;               /**< [out]
754                                                                    *                                                                    *
755                                                                    * Number of MacroBlocks coded as skipped blocks */                                                                    * Number of skipped macro blocks */
756          }          }
757          XVID_ENC_STATS;          XVID_ENC_STATS;
758    
# Line 759  Line 778 
778  #define XVID_ENC_CREATE         1 /**< Creates a decoder instance  #define XVID_ENC_CREATE         1 /**< Creates a decoder instance
779                                     *                                     *
780   * 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
781   * 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.  
782   */   */
783    
784  #define XVID_ENC_DESTROY        2 /**< Destroys a encoder instance  #define XVID_ENC_DESTROY        2 /**< Destroys a encoder instance
# Line 785  Line 802 
802   * This is the XviD's encoder entry point. The possible operations are   * This is the XviD's encoder entry point. The possible operations are
803   * described in the \ref encops_grp section.   * described in the \ref encops_grp section.
804   *   *
805   * \param handle Todo   * \param handle Encoder instance handle
806   * \param opt Todo   * \param opt Encoder option constant
807   * \param param1 Todo   * \param param1 Used to pass XVID_ENC_PARAM or XVID_ENC_FRAME structures.
808   * \param param2 Todo   * \param param2 Optionally used to pass the XVID_ENC_STATS structure.
809   */   */
810          int xvid_encore(void *handle,          int xvid_encore(void *handle,
811                                          int opt,                                          int opt,

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.23

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